|
@@ -41,7 +41,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
-import { getArrValue, isNullES } from 'js-fast-way'
|
|
|
+import { arrToId, getArrValue, isNullES } from 'js-fast-way'
|
|
|
import { getBizDictionary } from '~api/other'
|
|
|
import contractApi from '~api/project/contract'
|
|
|
import { NewDelMsg } from 'hc-vue3-ui'
|
|
@@ -176,7 +176,22 @@ const addUserClick = () => {
|
|
|
|
|
|
//全部删除
|
|
|
const allDelClick = () => {
|
|
|
-
|
|
|
+ const data = tableData.value
|
|
|
+ if (data.length <= 0) {
|
|
|
+ window?.$message?.warning('暂无用户数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ NewDelMsg({
|
|
|
+ text: '是否将所有用户移除出合同段?',
|
|
|
+ }, async (resolve) => {
|
|
|
+ const ids = arrToId(data)
|
|
|
+ const { code } = await contractApi.removeUsersByIds(ids)
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ if (code === 200) {
|
|
|
+ window?.$message?.success('删除成功')
|
|
|
+ getTableData().then()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//单独删除
|
|
@@ -185,11 +200,11 @@ const delRowClick = (row) => {
|
|
|
text: '是否将该用户移除出合同段?',
|
|
|
}, async (resolve) => {
|
|
|
const { code } = await contractApi.removeUsersByIds(row.id)
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
if (code === 200) {
|
|
|
window?.$message?.success('删除成功')
|
|
|
getTableData().then()
|
|
|
}
|
|
|
- resolve() //关闭弹窗的回调
|
|
|
})
|
|
|
}
|
|
|
</script>
|