Browse Source

删除节点修改

duy 2 năm trước cách đây
mục cha
commit
a765feb578
1 tập tin đã thay đổi với 5 bổ sung23 xóa
  1. 5 23
      src/views/data-fill/division.vue

+ 5 - 23
src/views/data-fill/division.vue

@@ -1009,7 +1009,7 @@ const addingFormClick = () => {
 //删除当前节点用表
 const deltableexcel =async (row) => {
     console.log(row,'row');
-    if(row['ancestors'].length>0||row['nodeType'].length>0){
+    if(row['ancestors'].length>0||row['nodeType']>0){
        window?.$message?.warning('该表不允许删除')
     }else if(row['pdfUrl'].length>0){
          window?.$messageBox?.alert('该表已填写数据'+',请谨慎考虑后,确认是否需要删除?', '删除', {
@@ -1034,33 +1034,15 @@ const deltableexcel =async (row) => {
     }
     else{
          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('该表已填写数据'+',请谨慎考虑后,确认是否需要删除?', '删除', {
-            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) {
+            if (!error && code === 200) {
                         window?.$message?.success('删除成功')
                         window?.location?.reload()  //刷新页面
-                    }else{
+            }else{
                          window?.$message?.warning(msg)
                     }
-                }
-            }
-        })
-     }else{
-          window?.$message?.warning(msg)
-     }
+     
     }
+   
 }
 //树配置
 const addingFormTreeRef = ref(null)