duy преди 2 години
родител
ревизия
afb9ad680e
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      src/views/data-fill/division.vue

+ 6 - 2
src/views/data-fill/division.vue

@@ -999,12 +999,15 @@ const addingFormClick = () => {
 }
 //删除当前节点用表
 const deltableexcel =async (row) => {
-     const {error, code,msg} = await divisionApi.removeWbsTreeContract({id: row.pkeyId,stats:0})
+    if(row['ancestors'].length>0||row['nodeType'].length>0){
+       window?.$message?.warning('该表不允许删除')
+    }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(msg+',请谨慎考虑后,确认是否需要删除?', '删除', {
+          window?.$messageBox?.alert('该表已填写数据'+',请谨慎考虑后,确认是否需要删除?', '删除', {
             showCancelButton: true,
             confirmButtonText: '确认删除',
             cancelButtonText: '取消',
@@ -1026,6 +1029,7 @@ const deltableexcel =async (row) => {
      }else{
           window?.$message?.warning(msg)
      }
+    }
 }
 //树配置
 const addingFormTreeRef = ref(null)