Ver Fonte

删除节点工程用表

duy há 2 anos atrás
pai
commit
b9e4500feb
1 ficheiros alterados com 25 adições e 15 exclusões
  1. 25 15
      src/views/data-fill/division.vue

+ 25 - 15
src/views/data-fill/division.vue

@@ -993,24 +993,34 @@ const addingFormClick = () => {
     }
 }
 //删除当前节点用表
-const deltableexcel = (row) => {
-  console.log('删除',row);
-  window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        callback:async (action) => {
-            if (action === 'confirm') {
-               const {error, code} = await divisionApi.removeWbsTreeContract({
-                id: row.id
-            })
-            if (!error && code === 200) {
+const deltableexcel =async (row) => {
+     const {error, code,msg} = await divisionApi.removeWbsTreeContract({id: row.pkeyId,stats:0})
+     if (!error && code === 200) {
                 window?.$message?.success('删除成功')
                 window?.location?.reload()  //刷新页面
+     }else if( code === 300){
+          window?.$messageBox?.alert(msg+',请谨慎考虑后,确认是否需要删除?', '删除', {
+            showCancelButton: true,
+            confirmButtonText: '确认删除',
+            cancelButtonText: '取消',
+            callback:async (action) => {
+                if (action === 'confirm') {
+                const {error, code,msg} = await divisionApi.removeWbsTreeContract({
+                    id: row.pkeyId,
+                    stats:1
+                })
+                    if (!error && code === 200) {
+                        window?.$message?.success('删除成功')
+                        window?.location?.reload()  //刷新页面
+                    }else{
+                         window?.$message?.warning(msg)
+                    }
+                }
             }
-            }
-        }
-    })
+        })
+     }else{
+          window?.$message?.warning(msg)
+     }
 }
 //树配置
 const addingFormTreeRef = ref(null)