duy 2 年之前
父节点
当前提交
0c9e790c9b
共有 1 个文件被更改,包括 48 次插入37 次删除
  1. 48 37
      src/views/archives/tuning.vue

+ 48 - 37
src/views/archives/tuning.vue

@@ -470,35 +470,47 @@ const delModalClick = () => {
 }
 const splitLoad = ref(false)
 const tunModalClick = () => {
-    splitLoad.value = true
-    window?.$messageBox?.alert('请谨慎考虑是否要批量拆除已经案卷及卷内文件?', '拆除案卷', {
-        showCancelButton: true,
-        confirmButtonText: '确认拆卷',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: async (action, ctx, close) => {
-            if (action === 'confirm') {
-                console.log(1111);
+    const rows = tableCheckedKeys.value;
+   
+    let iscansplit= rows.filter((item)=>{
+        if(item?.isLock===1){
+            return item
+        }
+    })
+    if(iscansplit.length>0){
+        window.$message.warning('选择的案卷已被锁定,不允许拆卷')
+    }else{
+        splitLoad.value = true
+        window?.$messageBox?.alert('请谨慎考虑是否要批量拆除已经案卷及卷内文件?', '拆除案卷', {
+            showCancelButton: true,
+            confirmButtonText: '确认拆卷',
+            cancelButtonText: '取消',
+            type: 'warning',
+            callback: async (action, ctx, close) => {
+                if (action === 'confirm') {
+                    console.log(1111);
 
-                ctx.confirmButtonLoading = true;
+                    ctx.confirmButtonLoading = true;
 
-                let ids = ''
-                const rows = tableCheckedKeys.value;
-                ids = rowsToId(rows)
-                const {error, code, data, msg} = await tuningApi.splitArchive({
-                    ids: ids
-                })
-                ctx.confirmButtonLoading = true;
-                if (!error && code === 200) {
-                    window.$message?.success(msg)
-                    getTableData()
+                    let ids = ''
+                
+                    ids = rowsToId(rows)
+                    const {error, code, data, msg} = await tuningApi.splitArchive({
+                        ids: ids
+                    })
+                    ctx.confirmButtonLoading = true;
+                    if (!error && code === 200) {
+                        window.$message?.success(msg)
+                        getTableData()
+                    }
+                    // else {
+                    //     window.$message?.warning(msg)
+                    // }
                 }
-                // else {
-                //     window.$message?.warning(msg)
-                // }
             }
-        }
-    })
+        })
+    }
+    
 }
 //左右拖动,改变树形结构宽度
 const leftWidth = ref(382);
@@ -594,8 +606,10 @@ const intableSortClick = () => {
 //表格行被点击
 const tableFileShow = ref(false)
 const checkInid = ref('')
+const checkRow=ref({})
 const tableRowClick = ({row}) => {
     tableFileShow.value = true;
+    checkRow.value=row
     checkInid.value = row.id
     setInnertableColumn()
     getintableData()
@@ -644,16 +658,7 @@ const sortTableData = ref([])
 const sortTableLoading = ref(false)
 const sortType = ref()
 const getSortTableData = async() => {
-    // if (sortType.value === 1) {
-    //     sortTableData.value = tableCheckedKeys.value
-    //     sortSearchForm.value.total = sortTableData.value.length
-    // } else if (sortType.value === 2) {
-    //     sortTableData.value = intableCheckedKeys.value
-    //     sortSearchForm.value.total = intableCheckedKeys.value.length
-    // }
-
-    // sortSearchForm.value.current = 1
-
+   
     if(sortType.value === 1){
         sortTableLoading.value = true
         const {error, code, data} = await tuningApi.pageByArchive({
@@ -753,11 +758,17 @@ const batchEditClick = (type) => {
     setTableUploadColumn(type)
     uploadSaveLoading.value = false
     tableUploadData.value = rows
-    if(rows.length>0){
+    console.log(checkRow.value,'checkRow.value');
+    if(checkRow.value?.isLock!==1){
+        if(rows.length>0){
         showUploadModal.value = true
+        }else{
+            window.$message.warning('请先选择文件')
+        }
     }else{
-        window.$message.warning('请先选择文件')
+        window.$message.warning('该案卷已被锁定,不允许编辑卷内文件')
     }
+   
   
 }