소스 검색

下载案卷目录

duy 2 달 전
부모
커밋
5f5d36bf5b
2개의 변경된 파일34개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 0
      src/api/modules/archiveConfig/tuning.js
  2. 25 1
      src/views/archives/manage/inspects.vue

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

@@ -154,4 +154,13 @@ async splitArchive(form, msg = true) {
             params: form,
         }, msg)
      },
+
+    async downloadArchiveAutoExcel(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-archive/archivesauto/downloadArchiveAutoExcel',
+            method: 'post',
+            params: form,
+            responseType: 'blob',
+        }, msg)
+    },
 }

+ 25 - 1
src/views/archives/manage/inspects.vue

@@ -4,6 +4,12 @@
             <HcTree :project-id="projectId" :contract-id="contractId" :auto-expand-keys="treeAutoExpandKeys" @node-tap="projectTreeClick" @node-loading="treeNodeLoading" @menu-tap="ElTreeMenuClick" />
         </template>
         <hc-new-card v-show="!isCarrySpotChecksDrawer" title="已形成的案卷">
+            <template #extra>
+                <el-button hc-btn :disabled="!searchForm.nodeIds" :loading="downLoading" type="primary" @click="downloadArchiveAutoExcelClick">
+                    <HcIcon name="download" />
+                    下载案卷目录
+                </el-button>
+            </template>
             <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }" @row-click="tableRowClick">
                 <template #name="{ row }">
                     <div class="text-link" :class="row.isReviewed === 1 ? 'text-green' : 'text-blue'">{{ row?.name }}</div>
@@ -169,13 +175,14 @@
 <script setup>
 import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { getArrValue, getObjValue } from 'js-fast-way'
+import { downloadBlob, getArrValue, getObjValue } from 'js-fast-way'
 import HcTree from '~src/components/tree/hc-tree.vue'
 import MetaTable from './components/meta-table.vue'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import tuningApi from '~api/archiveConfig/tuning.js'
 import archiveQueryApi from '~api/using/query.js'
 import inspectApi from '~api/transfer/inspects.js'
+import tuning from '../../../api/modules/archiveConfig/tuning'
 
 //变量
 const useAppState = useAppStore()
@@ -647,6 +654,23 @@ const getmetaInfo = async (fileId)=>{
         cscmetaDataTabledata.value = []
     }
 }
+//下载案卷目录
+const downLoading = ref(false)
+
+
+const downloadArchiveAutoExcelClick = async () => {
+  
+    downLoading.value = true
+    const { res, msg, headers } = await tuning.downloadArchiveAutoExcel(
+        { projectId: projectId.value, contractId: contractId.value, nodeId: searchForm.value.nodeIds },
+    )
+    downLoading.value = false
+    if (res) {
+        downloadBlob(res, headers['content-disposition'], 'application/zip')
+        window.$message.success('下载成功')
+    }
+
+}
 </script>
 
 <style lang="scss">