瀏覽代碼

案卷查询相关调接口

duy 2 年之前
父節點
當前提交
767dfc41b5
共有 4 個文件被更改,包括 338 次插入227 次删除
  1. 36 0
      src/api/modules/archiveConfig/tuning.js
  2. 27 50
      src/views/archives/rolling.vue
  3. 271 175
      src/views/archives/tuning.vue
  4. 4 2
      src/views/file/records.vue

+ 36 - 0
src/api/modules/archiveConfig/tuning.js

@@ -0,0 +1,36 @@
+import {httpApi} from "../../request/httpApi";
+
+export default {
+  // 分页档案调整
+  async pageByArchive(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/page',
+        method: 'get',
+        params: form
+    }, msg)
+  },
+  //根据档案获取文件
+  async getarchiveFilePage(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveFile/page',
+            method: 'post',
+            params: form
+        }, msg);
+ },
+ //锁定案卷
+ async archivesautoLock(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/lock',
+        method: 'post',
+        params: form
+    }, msg);
+},
+//解锁案卷 /archivesauto/unlock
+async archivesautoUnLock(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/unlock',
+        method: 'post',
+        params: form
+    }, msg);
+},
+}

+ 27 - 50
src/views/archives/rolling.vue

@@ -52,6 +52,7 @@ import {useAppStore} from "~src/store";
 import HcTree from "~src/components/tree/hc-tree.vue"
 import ProjectTree from "./components/ProjectTree.vue"
 import projectScanningApi from "~api/other-file/projectScanning";
+import archiveFileApi from "~api/archiveFile/archiveFileAuto.js";
 import {getStoreValue, setStoreValue} from '~src/utils/storage'
 import {downloadBlob, getArrValue, deepClone} from "js-fast-way"
 //变量
@@ -60,6 +61,7 @@ const projectId = ref(useAppState.getProjectId);
 const contractId = ref(useAppState.getContractId);
 const projectInfo = ref(useAppState.getProjectInfo);
 const isCollapse = ref(useAppState.getCollapse)
+import tuningApi from "~api/archiveConfig/tuning.js";
 
 //监听
 watch(() => [
@@ -111,43 +113,32 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-     {key:'key1', name: '档号'},
-    {key:'key2', name: '案卷题名', width: 600},
-    {key:'key3', name: '保管期限'},
-    {key:'key4', name: '总页数'},
+     {key:'fileNumber', name: '档号'},
+    {key:'name', name: '案卷题名', width: 600},
+    {key:'storageTimeValue', name: '保管期限'},
+    {key:'pageN', name: '总页数'},
 
 ])
-const tableData = ref([
-    {
-        id: 1,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    }
-])
+const tableData = ref([])
 
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-
+    tableLoading.value = true
+    const { error, code, data } = await tuningApi.pageByArchive({
+        ...searchForm.value,
+        projectId: projectId.value,
+        contractId: contractId.value,
+        isArchive :0
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total'] || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
 //多选
@@ -204,25 +195,11 @@ const isStorageNode = ref(0)
 const isBuiltDrawing = ref(0)
 const nodeElTreeClick = ({node, data, keys, key}) => {
     console.log('点击',data);
-    // treeNodeInfo.value = node
-//    formInline.value=data
-
-//   if(data.children){
-//        childtreedata.value=data.children
-//   }else{
-//       childtreedata.value=[data]
-//   }
-
-
-    // //设置变量
-    // nodeIds.value = key || ''
-    // isStorageNode.value = data['isStorageNode'] || 0
-    // isBuiltDrawing.value = data['isBuiltDrawing'] || 0
-    // //设置搜索数据
-    // searchForm.value.current = 1;
-    // searchForm.value.nodeIds = key || ''
-    // setTableColumns()
-    // getTableData()
+    searchForm.value.total = 0
+    searchForm.value.current = 1
+    searchForm.value.size = 20
+    searchForm.value.nodeIds = data.id || '';
+    getTableData()
     //缓存展开的节点
     setStoreValue('scanningTreeExpandKeys', keys)
 }

+ 271 - 175
src/views/archives/tuning.vue

@@ -34,10 +34,16 @@
                         </el-button>
                     </HcTooltip>
                   <HcTooltip keys="archives_tuning_btn_lock">
-                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0">
+                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="lockarchives" :loading="lockLoad">
                         <HcIcon name="file-lock"/>
                         <span>档案锁定</span>
                     </el-button>
+                  </HcTooltip>
+                  <HcTooltip keys="archives_tuning_btn_unlock">
+                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="unlockarchives" :loading="unlockLoad">
+                        <HcIcon name="lock-unlock"/>
+                        <span>档案解锁</span>
+                    </el-button>
                   </HcTooltip>
                     <HcTooltip keys="archives_tuning_btn_remove">
                         <el-button hc-btn @click="movesClick" :disabled="tableCheckedKeys.length <= 0">
@@ -46,7 +52,7 @@
                         </el-button>
                     </HcTooltip>
                    <HcTooltip keys="archives_tuning_btn_edit">
-                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchEditClick">
+                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchEditClick(1)">
                             <HcIcon name="edit"/>
                             <span>编辑</span>
                         </el-button>
@@ -79,7 +85,7 @@
                             <template #table-column-header-num>
                                 <HcTooltip keys="archives_tuning_btn_sort">
                                     <span class="text-link text-lg" @click="tableSortClick">
-                                        <HcIcon name="arrow-up-down"/>
+                                        <HcIcon name="arrow-up-down"  :class="tableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'"/>
                                     </span>
                                 </HcTooltip>
                             </template>
@@ -89,31 +95,30 @@
                         <div class="header-box">
                             <div class="header">卷内文件</div>
                             <div>
-                                <HcIcon name="edit" @click="batchEditClick"  class="hc-icon-close"  :class="tableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'" style=" color:rgb(64, 149, 229);"/>
-                                <HcIcon name="delete-bin" @click="delModalClick" class="hc-icon-close text-hover" :class="tableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'"  style="margin-left:5px;margin-right:5px;color: rgb(189, 49, 36);"/>
+                                <HcIcon name="edit" @click="batchEditClick(2)"  class="hc-icon-close"  :class="intableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'" style=" color:rgb(64, 149, 229);"/>
+                                <HcIcon name="delete-bin" @click="delModalClick" class="hc-icon-close text-hover" :class="intableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'"  style="margin-left:5px;margin-right:5px;color: rgb(189, 49, 36);"/>
                                 <HcIcon name="close" @click="closetableFile" class="hc-icon-close text-hover" style=" color:rgb(64, 149, 229);"/>
                             </div>
 
                         </div>
                         <div class="hc-file-table-box">
                             <HcTable
-                            ref="tableFileRef"
+                             :loading="intableLoading"
+                             ref="tableFileRef"
                              :column="innertableColumn"
-                             :datas="tableData"
-                             :loading="tableFileLoading"
+                             :datas="intableData"
                              isCheck
-                             @selection-change="tableSelection"
-                             @row-click="tableFileRowClick"
-
+                             @selection-change="intableSelection"
                              >
                                  <template #table-column-header-num>
                                     <HcTooltip keys="archives_tuning_btn_sort">
-                                        <span class="text-link text-lg" @click="tableSortClick">
-                                            <HcIcon name="arrow-up-down"/>
+                                        <span class="text-link text-lg" @click="intableSortClick">
+                                            <HcIcon name="arrow-up-down" :class="intableCheckedKeys.length >0 ? 'text-hover' : 'text-disable'"/>
                                         </span>
                                     </HcTooltip>
                                 </template>
                             </HcTable>
+                            <HcPages :pages="insearchForm" @change="inpageChange"/>
                         </div>
                     </div>
                 </div>
@@ -193,49 +198,24 @@
         </HcDialog>
 
         <!--编辑案卷信息-->
-        <el-dialog v-model="showUploadModal" title="编辑文件信息" width="80vw" class="hc-modal-border hc-modal-table">
+        <el-dialog v-model="showUploadModal" :title="editTitle" width="80vw" class="hc-modal-border hc-modal-table">
             <HcTable ui="hc-form-table" :column="tableUploadColumn" :datas="tableUploadData" :loading="uploadSaveLoading">
                 <template #fileNumber="{row}">
                     <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileNumber')"/>
                 </template>
-                <template #fileName="{row}">
-                    <el-input v-model="row.fileName" :class="row['isFileName'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileName')"/>
+                <template #name="{row}">
+                    <el-input v-model="row.name" :class="row['isFileName'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileName')"/>
                 </template>
-                <template #fileTime="{row}">
+                <template #fileTime="{row}" v-if="editType === 2">
                     <el-date-picker v-model="row.fileTime" type="date" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :clearable="false"/>
                 </template>
-                <template #sheetType="{row}" v-if="isBuiltDrawing === 1">
-                    <el-select v-model="row.sheetType">
-                        <el-option v-for="item in sheetType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
-                    </el-select>
-                </template>
-                <template #sheetSource="{row}" v-if="isBuiltDrawing === 1">
-                    <el-select v-model="row.sheetSource">
-                        <el-option v-for="item in sheetSourceType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
-                    </el-select>
-                </template>
-                <template #drawingNo="{row}" v-if="isBuiltDrawing === 1">
-                    <el-input v-model="row.drawingNo"/>
-                </template>
-                <template #citeChangeNumber="{row}" v-if="isBuiltDrawing === 1">
-                    <el-input v-model="row.citeChangeNumber"/>
+                <template #filingUnit="{row}">
+                    <el-input v-model="row.filingUnit" type="textarea"/>
                 </template>
-                <template #isApproval="{row}">
-                    <el-select v-model="row.isApproval">
-                        <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
-                    </el-select>
-                </template>
-                <template #isNeedCertification="{row}">
-                    <el-select v-model="row.isNeedCertification">
-                        <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
-                    </el-select>
-                </template>
-                <template #dutyUser="{row}">
-                    <el-input v-model="row.dutyUser"/>
-                </template>
-                <template #action="{row,index}">
-                    <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)">删除</el-button>
+                <template #remark="{row}">
+                    <el-input v-model="row.remark" type="textarea"/>
                 </template>
+          
             </HcTable>
             <template #footer>
                 <div class="lr-dialog-footer">
@@ -246,7 +226,7 @@
                             <HcIcon name="close"/>
                             <span>取消</span>
                         </el-button>
-                        <el-button type="primary" hc-btn :disabled="uploadsLoading" :loading="uploadSaveLoading" @click="batchUploadSave">
+                        <el-button type="primary" hc-btn :disabled="uploadSaveLoading" :loading="uploadSaveLoading" @click="batchUploadSave">
                             <HcIcon name="save"/>
                             <span>保存</span>
                         </el-button>
@@ -260,13 +240,12 @@
 <script setup>
 import {ref, watch, onMounted} from "vue";
 import {useAppStore} from "~src/store";
-//import HcTree from "./components/hc-tree.vue"
 import HcTree from "~src/components/tree/hc-tree.vue"
-import ProjectTree from "./components/ProjectTree.vue"
 import {downloadBlob, getArrValue, deepClone} from "js-fast-way"
 import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
+import tuningApi from "~api/archiveConfig/tuning.js";
+import archiveFileApi from "~api/archiveFile/archiveFileAuto.js";
 
-import projectScanningApi from "~api/other-file/projectScanning";
 import {getStoreValue, setStoreValue} from '~src/utils/storage'
 
 //变量
@@ -288,6 +267,7 @@ watch(() => [
 onMounted(() => {
     // getClassIfyList()
     setTableColumns()
+  
 })
 
 //树加载
@@ -296,128 +276,134 @@ const treeNodeLoading = () => {
     treeLoading.value = false
 }
 
-//自动展开缓存
-const TreeAutoExpandKeys = ref(getStoreValue('scanningTreeExpandKeys') || [])
-
 //项目树被点击
-const treeNodeInfo = ref({})
-const treeDataInfo = ref({})
 const nodeIds = ref('')
 const isStorageNode = ref(0)
 // const isBuiltDrawing = ref(0)
 const nodeElTreeClick = ({node, data, keys, key}) => {
     console.log('点击',data);
-    setStoreValue('scanningTreeExpandKeys', keys)
+    searchForm.value.total = 0
+    searchForm.value.current = 1
+    searchForm.value.size = 20
+    searchForm.value.nodeIds = data.id || '';
+    getTableData()
 }
 //搜索表单
 const searchForm = ref({
-    contractId: null, type: null, approval: null, betweenTime: null,
+    contractId: null, type: null, approval: null, 
+    current: 1, size: 20, total: 0
+})
+const insearchForm = ref({
+    contractId: null, type: null, approval: null, 
     current: 1, size: 20, total: 0
 })
-
 //树相关的变量
 const primaryKeyId = ref('')
 
-//日期时间被选择
-const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr,query}) => {
-    betweenTime.value = arr
-    searchForm.value.betweenTime = query
-}
-
-//搜索
-const searchClick = () => {
-    searchForm.value.current = 1;
-    getTableData()
-}
-
 //分页被点击
 const pageChange = ({current, size}) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
 }
-
+//分页被点击
+const inpageChange = ({current, size}) => {
+    insearchForm.value.current = current
+    insearchForm.value.size = size
+    getintableData()
+}
 //表格数据
 const tableRef = ref(null)
 
 const tableColumn = ref([])
 //设置表头
 const setTableColumns = () => {
-    if (isBuiltDrawing.value === 1) {
-        tableColumn.value = [
+    tableColumn.value = [
             {key:'fileNumber', name: '档号'},
-            {key:'fileName', name: '案卷题名',width:500},
-            {key:'fileRetion', name: '保管期限'},
-            {key:'filePage', name: '总页数'},
+            {key:'name', name: '案卷题名',width:500},
+            {key:'storageTimeValue', name: '保管期限'},
+            {key:'pageN', name: '总页数'},
         ]
-
-
-    } else {
-        tableColumn.value = [
-             {key:'fileNumber', name: '档号', },
-            {key:'fileName', name: '案卷题名',width:600},
-            {key:'fileRetion', name: '保管期限'},
-            {key:'filePage', name: '总页数'},
-
-
-        ]
-    }
 }
-const tableData = ref([
-    {
-        id: 1,
-        fileNumber: 'xxxx-xxxx-xxx',
-        fileName: '30 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-        filePage: '3',
-        isCertificationValue: '未认证',
-        isApprovalValue: '待审批',
-        fileTime: '2022-12-12',
-        fileRetion: '永久',
-        dutyUser:'xxxx单位',
-         tips:'/'
-    },
-     {
-        id: 1,
-        fileNumber: 'xxxx-xxxx-xxx',
-        fileName: '30 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-        filePage: '3',
-        isCertificationValue: '未认证',
-        isApprovalValue: '待审批',
-        fileTime: '2022-12-12',
-        fileRetion: '永久',
-        dutyUser:'xxxx单位',
-        tips:'/'
-    },
-])
+const tableData = ref([])
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-
+    tableFileShow.value=false
+    tableLoading.value = true
+    const { error, code, data } = await tuningApi.pageByArchive({
+        ...searchForm.value,
+        projectId: projectId.value,
+        contractId: contractId.value,
+        isArchive :0
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total'] || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
 const innertableColumn = ref([])
+const intableData=ref([])
 //设置表头
 const setInnertableColumn = () => {
     innertableColumn.value = [
             {key:'fileNumber', name: '文件编号'},
-            {key:'fileName', name: '文件题名',width:500},
-
+            {key:'name', name: '文件题名',width:500},
             {key:'fileTime', name: '文件日期'},
             {key:'dutyUser', name: '责任者'},
-            {key:'filePage', name: '页数'},
+            {key:'pageN', name: '页数'},
         ]
 }
+const intableLoading=ref(false)
+//获取卷内文件
+const getintableData=async()=>{
+    intableLoading.value = true
+    const { error, code, data } = await tuningApi.getarchiveFilePage({
+        ...insearchForm.value,
+        nodeIds:searchForm.value.nodeIds,
+        archiveId:checkInid.value
+    })
+    intableLoading.value = false
+    if (!error && code === 200) {
+        intableData.value = getArrValue(data['records'])
+        insearchForm.value.total = data['total'] || 0
+    
+    } else {
+        intableData.value = []
+        insearchForm.value.total = data['total'] || 0
+ 
+    }
+}
 //多选
 const tableCheckedKeys = ref([]);
+const intableCheckedKeys = ref([]);
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
-
+const intableSelection = (rows) => {
+    intableCheckedKeys.value = rows
+}
 //删除
 const delModalClick = () => {
-    delMessage(() => {
+    // delMessage(() => {
 
+    // })
+    window?.$messageBox?.alert('请谨慎考虑是否要批量删除卷内文件?', '删除文件', {
+        showCancelButton: true,
+        confirmButtonText: '确认删除',
+        cancelButtonText: '取消',
+        type: 'warning',
+        callback: (action) => {
+            if (action === 'confirm') {
+                console.log(1111);
+                // cbk()
+            }
+        }
     })
 }
 const tunModalClick=()=>{
@@ -491,13 +477,30 @@ const movesModalClose = () => {
 const sortModal = ref(false)
 //显示
 const tableSortClick = () => {
-    sortModal.value = true
+    if(tableCheckedKeys.value.length>0){
+        sortModal.value = true
+        sortType.value=1
+        setsortTableColumn()
+        getSortTableData()
+    }
+}
+const intableSortClick = () => {
+    if(intableCheckedKeys.value.length>0){
+        sortModal.value = true
+        sortType.value=2
+        setsortTableColumn()
+        getSortTableData()
+    }
+    
 }
 //表格行被点击
 const tableFileShow = ref(false)
-const tableRowClick = () => {
+const checkInid=ref('')
+const tableRowClick = ({row}) => {
     tableFileShow.value = true;
+    checkInid.value=row.id
     setInnertableColumn()
+    getintableData()
 }
 //收起卷内文件
 const closetableFile = () => {
@@ -505,10 +508,7 @@ const closetableFile = () => {
 }
 //卷内文件点击
 
-const tableFileRowClick = () => {
-    showMeteInfo.value = true;
 
-}
 //搜索表单
 const sortSearchForm = ref({
     current: 1, size: 20, total: 0
@@ -520,29 +520,41 @@ const sortPageChange = ({current, size}) => {
     searchForm.value.size = size
     getSortTableData()
 }
-
+const setsortTableColumn = () => {
+ if(sortType.value===1){
+    sortTableColumn.value = [
+        {key:'fileNumber', name: '档号', width: 160},
+        {key:'name', name: '案卷名称'},
+        {key:'action', name: '排序', width: 90},
+    ]
+ }else if(sortType.value===2){
+    sortTableColumn.value = [
+        {key:'fileNumber', name: '文件编号', width: 160},
+        {key:'name', name: '文件名称'},
+        {key:'action', name: '排序', width: 90},
+    ]
+ }
+}
 //表格数据
 const sortTableColumn = ref([
-    {key:'key1', name: '档号', width: 160},
-    {key:'key2', name: '案卷名称'},
+    {key:'fileNumber', name: '档号', width: 160},
+    {key:'name', name: '案卷名称'},
     {key:'action', name: '排序', width: 90},
 ])
-const sortTableData = ref([
-    {
-        id: 1,
-        key1: 'xxxx-xxxx-xxx',
-        key2: '30 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-    },
-    {
-        id: 2,
-        key1: 'xxxx-xxxx-222',
-        key2: '40 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-    }
-])
+const sortTableData = ref([])
 
 const sortTableLoading = ref(false)
+const sortType=ref()
 const getSortTableData = () => {
-
+    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
 }
 
 //拖动完成
@@ -584,66 +596,150 @@ const sortModalClose = () => {
     sortModal.value = false
 }
 //编辑
-const tableUploadType = ref('add')
+
 const showUploadModal = ref(false)
 const isBuiltDrawing = ref(0)
+const editTitle=ref('')
+const editType=ref()
 //批量上传保存
 const uploadSaveLoading = ref(false)
 //批量编辑
 
 //批量编辑
-const batchEditClick = () => {
-    const rows = deepClone(tableCheckedKeys.value)
-    //判断是否满足条件
-    const result = rows.every(({status})=> {
-        return status !== 1 && status !== 2
-    })
+const batchEditClick = (type) => {
+    let rows=[]
+    if(type===1){
+        editTitle.value='编辑案卷信息'
+        editType.value=1
+        rows = deepClone(tableCheckedKeys.value)
+    }else{
+        editTitle.value='编辑文件信息'
+        editType.value=2
+        rows = deepClone(intableCheckedKeys.value)
+    }
     //判断状态
-    if (result) {
-        tableUploadType.value = 'edit'
-        setTableUploadColumn()
+        setTableUploadColumn(type)
         uploadSaveLoading.value = false
         tableUploadData.value = rows
         showUploadModal.value = true
-    } else {
-        window.$message?.warning('已上报或已审批的文件不能编辑')
-    }
+    
 }
 
 
 
 //设置文件表头
-const tableUploadColumn = ref([
-    {key:'fileNumber', name: '文件编号'},
-    {key:'fileName', name: '文件题名'},
-    {key:'fileTime', name: '文件日期'},
-    {key:'dutyUser', name: '立卷单位'},
-    {key:'tips', name: '备注'},
-
-])
-const setTableUploadColumn = () => {
-    if (isBuiltDrawing.value === 1) {
+const tableUploadColumn = ref([])
+const setTableUploadColumn = (type) => {
+    if (type === 1) {
         tableUploadColumn.value = [
-        {key:'fileNumber', name: '文件编号'},
-        {key:'fileName', name: '文件题名'},
-        {key:'fileTime', name: '文件日期'},
-        {key:'dutyUser', name: '立卷单位'},
-        {key:'tips', name: '备注'},
+        {key:'fileNumber', name: '档号'},
+        {key:'name', name: '案卷题名'},
+        {key:'filingUnit', name: '立卷单位'},
+        {key:'remark', name: '备注'},
         ]
     } else {
         tableUploadColumn.value = [
              {key:'fileNumber', name: '文件编号'},
-            {key:'fileName', name: '文件题名'},
+            {key:'name', name: '文件题名'},
             {key:'fileTime', name: '文件日期'},
-            {key:'dutyUser', name: '立卷单位'},
-            {key:'tips', name: '备注'},
+            {key:'filingUnit', name: '立卷单位'},
+            {key:'remark', name: '备注'},
         ]
     }
 }
 const tableUploadData = ref([])
+const batchUploadCancel=()=>{
 
+}
+//确认上传保存
+const batchUploadSaveApi = async (rows) => {
+    uploadSaveLoading.value = true
+    const {error, code} = await archiveFileApi.batchUploadSave({
+        list: rows
+    },false)
+    //判断状态
+    uploadSaveLoading.value = false
+    if (!error && code === 200) {
+        window.$message?.success('保存成功')
+        batchUploadCancel()
+        getTableData()
+    } else {
+        window.$message?.error('保存失败')
+    }
+}
+//批量新增编辑保存
+const batchUploadSave=async()=>{
+    const rows = tableUploadData.value
+    if (rows.length > 0) {
+        //验证表单数据
+        uploadSaveLoading.value = true
+        let isTableRows = false;
+
+        //判断数据
+        if (isTableRows) {
+            uploadSaveLoading.value = false
+            window.$message?.warning('请先完善表单信息')
+        } else {
+            console.log(rows,'rows');
+            if(editType.value===2){
+                      //数据处理
+                rows.forEach((element,index)=>{
+                    element.startDate = element.dates[0]
+                    element.endDate = element.dates[1]
+                    element.autoFileSort = index+1
+                })
+                await batchUploadSaveApi(rows)
+            }else{
+                await batchUploadSaveApi(rows)
+            }
+      
 
-
+            // if (tableUploadType.value === 'add') {
+            //     await batchUploadSaveApi(rows)
+            // } else {
+            //     await batchEditSaveApi(rows)
+            // }
+        }
+    } else {
+        window.$message?.warning('请先上传文件')
+    }
+}
+const lockLoad=ref(false)
+const unlockLoad=ref(false)
+//档案锁定
+const lockarchives=async()=>{
+    lockLoad.value = true
+    let ids=''
+    const rows = tableCheckedKeys.value;
+    ids= rowsToId(rows)
+    const { error, code, data,msg } = await tuningApi.archivesautoLock({
+       ids:ids
+    })
+    lockLoad.value = false
+    if (!error && code === 200) {
+        console.log(msg,'msg');
+        window.$message?.success(msg)
+        getTableData()
+    } else {
+        window.$message?.warning(msg)
+    }
+}
+const unlockarchives=async()=>{
+    unlockLoad.value = true
+    let ids=''
+    const rows = tableCheckedKeys.value;
+    ids= rowsToId(rows)
+    const { error, code, data,msg } = await tuningApi.archivesautoUnLock({
+       ids:ids
+    })
+    unlockLoad.value = false
+    if (!error && code === 200) {
+        window.$message?.success(msg)
+        getTableData()
+    } else {
+        window.$message?.warning(msg)
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 4 - 2
src/views/file/records.vue

@@ -419,7 +419,8 @@ const getTableData = async () => {
         ...searchForm.value,
         projectId: projectId.value,
         contractId: contractId.value,
-        isAutoFile:1
+        isAutoFile:1,
+        isArchive : 1
     })
     tableLoading.value = false
     if (!error && code === 200) {
@@ -823,7 +824,8 @@ const getSortTableData = async () => {
     const { error, code, data } = await archiveFileApi.getarchiveFilePage({
         ...sortSearchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
+        
     })
     sortTableLoading.value = false
     if (!error && code === 200) {