Browse Source

feat(ledger): 添加内业台账导出功能

duy 1 month ago
parent
commit
0cb36b8fd3
2 changed files with 19 additions and 8 deletions
  1. 9 0
      src/api/modules/data-fill/query.js
  2. 10 8
      src/views/ledger/components/internal.vue

+ 9 - 0
src/api/modules/data-fill/query.js

@@ -189,4 +189,13 @@ export default {
             data: form,
         })
     },
+        //导出内业台账
+    async exportNeiye(form) {
+        return HcApi({
+            url: '/api/blade-business/neiYeController/export',
+            method: 'post',
+            data: form,
+            responseType: 'blob',
+        })
+    },
 }

+ 10 - 8
src/views/ledger/components/internal.vue

@@ -12,8 +12,8 @@
                             </div> -->
                             <div class="inline-block w-40">
                                 <el-select v-model="searchInternalForm.dateIsComplete" clearable placeholder="日期是否完整">
-                                    <el-option label="是" value="" />
-                                    <el-option label="否" value="" />
+                                    <el-option label="是" value="1" />
+                                    <el-option label="否" value="2" />
                                 </el-select>
                             </div>
                             <div class="ml-2 inline-block w-38">
@@ -24,7 +24,7 @@
                             </div>
                          
                             <div class="ml-2 inline-block w-38">
-                                <el-select v-model="searchInternalForm.dateIsComplete" clearable placeholder="节点显示">
+                                <el-select v-model="searchInternalForm.selectType" clearable placeholder="节点显示">
                                     <el-option label="按工序展示" :value="1" />
                                     <el-option label="按本节点显示" :value="2" />
                                 </el-select>
@@ -208,7 +208,8 @@ const InternalAssociation = ref([
 
 //搜索表单
 const searchInternalForm = ref({
-    taskStatus: null, isFile: null, reportNumber: null, isExperiment: null, 
+    taskStatus: null, isFile: null, reportNumber: null, isExperiment: null, selectType: null,
+
     current: 1, size: 20, total: 0,
 })
 
@@ -316,12 +317,13 @@ const tableInternalSelection = (rows) => {
 //下载
 const downloadLoading = ref(false)
 const batchDownload = async () => {
-    const rows = tableInternalKeys.value
-    console.log(rows, 'rows')
-    const ids = arrToId(rows)
+
     //批量下载
     downloadLoading.value = true
-    const { error, disposition, res } = await queryApi.batchDownloadFileToZip({ ids: ids })
+    const { error, disposition, res } = await queryApi.exportNeiye({
+         ...searchInternalForm.value,
+        projectId: projectId.value,
+    })
     //处理数据
     downloadLoading.value = false
     if (!error) {