From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 29 四月 2025 13:25:29 +0800
Subject: [PATCH] Merge branch 'dev' into dev_tides

---
 src/views/business/reportPreparation/index.vue |  106 +++++++++++++++++++++++++++++------------------------
 1 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index 9ca8094..785e9f1 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -22,11 +22,14 @@
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button size="mini" @click="refresh()">閲嶇疆</el-button>
           <el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button>
-          <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">鎵归噺涓嬭浇</el-button>
+          <el-button size="mini" @click="refresh()">閲嶇疆</el-button>
         </el-form-item>
       </el-form>
+    </div>
+    <div style="text-align: right;margin-bottom: 10px">
+      <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">鎵归噺涓嬭浇</el-button>
+      <el-button :loading="outExportLoading" size="mini" type="primary" @click="handleExport">鎶ヨ〃瀵煎嚭</el-button>
     </div>
     <div>
       <lims-table :tableData="valueTableData" :column="column" :page="page" :tableLoading="tableLoading"
@@ -85,7 +88,7 @@
           @click="fullscreen = true;"></i>
         <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;">
       </div>
-      <div v-if="issuedVisible" style="height: 80vh;">
+      <div v-if="issuedVisible" style="height: 70vh;">
         <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" />
       </div>
       <span slot="footer" class="dialog-footer">
@@ -110,7 +113,7 @@
           @click="fullscreen = true;"></i>
         <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;">
       </div>
-      <div v-if="approveVisible" style="height: 80vh;">
+      <div v-if="approveVisible" style="height: 70vh;">
         <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" />
       </div>
       <span slot="footer" class="dialog-footer">
@@ -184,8 +187,8 @@
           <el-button size="small" style="height: 38px" type="primary">闄勪欢涓婁紶</el-button>
         </el-upload>
       </div>
-      <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px"
-        key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table>
+      <lims-table :tableData="tableDataFile" :column="columnFile" height="600px"
+        key="tableDataFile" :tableLoading="tableLoadingFile"></lims-table>
     </el-dialog>
   </div>
 </template>
@@ -193,7 +196,6 @@
 <script>
 import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
 // import ShowInfo from "../do/b1-material-ins-order/showInfo.vue";
-import file from "@/utils/file";
 import {
   downAll,
   examineReport,
@@ -201,13 +203,15 @@
   ratifyReport,
   sendBackTask,
   upReportUrl,
-  writeReport
+  writeReport,
+  reportAllExport
 } from "@/api/business/insReport";
 import { mapGetters } from "vuex";
 import { selectUserCondition } from "@/api/business/inspectionTask";
 import limsTable from "@/components/Table/lims-table.vue";
-import { delfile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
+import {delFile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
 export default {
+  name: 'ReportPreparation',
   components: { limsTable, onlyoffice },
   data() {
     return {
@@ -215,6 +219,7 @@
         queryStatus: null,
         code: null,
         typeSource: null,
+        orderType: null,
       },
       page: {
         current: 1,
@@ -239,6 +244,7 @@
       option: null,
       mutiList: [],
       outLoading: false,
+      outExportLoading: false,
       inLoading: false,
       addApproverDia: false, // 鎸囧畾瀹℃壒浜哄憳寮规
       approver: '', // 瀹℃壒浜哄憳
@@ -329,11 +335,6 @@
           ]
         }
       ],
-      pageFile: {
-        total: 0,
-        size: 10,
-        current: 1
-      },
       isCopper: null,
       tableLoading: false,
       valueTableData: [],
@@ -464,7 +465,7 @@
       return this.javaApi + '/insReport/upAll'
     },
     fileAction() {
-      return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified'
+      return this.javaApi + '/insOrderPlan/uploadFile'
     },
     fileAction1() {
       return this.javaApi + '/insReport/inReport'
@@ -524,19 +525,14 @@
     // 鏌ヨ闄勪欢鏌ョ湅鍒楄〃鍥炶皟
     getFileList() {
       this.tableLoadingFile = true
-      getFileList({ insOrderId: this.filesLookInfo.insOrderId }).then(res => {
+      getFileList({ insOrderId: this.filesLookInfo.insOrderId,current: -1, size: -1 }).then(res => {
         this.tableLoadingFile = false
         if (res.code === 200) {
           this.tableDataFile = res.data.records
-          this.pageFile.total = res.data.total
         }
       }).catch(err => {
         this.tableLoadingFile = false
       })
-    },
-    paginationFile(page) {
-      this.pageFile.size = page.limit
-      this.getFileList()
     },
     closeFilesLook() {
       this.filesDialogVisible = false
@@ -558,37 +554,33 @@
       downFile({
         id: row.id,
       }).then(res => {
-        if (res.code === 200) {
-          let url = '';
-          if (res.data.type == 1) {
-            url = this.javaApi + '/img/' + res.data.fileUrl
-            this.$download.saveAs(url, row.fileName);
-          } else {
-            url = this.javaApi + '/word/' + res.data.fileUrl
-            this.$download.saveAs(url, row.fileName);
-          }
-        }
+        this.$download.saveAs(res.data.fileUrl, row.fileName);
       }).catch(error => {
 
       })
     },
     // 鍒犻櫎闄勪欢鏂囦欢
     delete(row) {
-      this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
+      this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
       }).then(() => {
-        delfile({ id: row.id }).then(res => {
-          if (res.code === 500) {
-            return
-          }
+        this.tableLoadingFile = true
+        delFile({ id: row.id }).then(res => {
+          this.tableLoadingFile = false
           this.$message.success('鍒犻櫎鎴愬姛')
-          this.getList()
-        }).catch(e => {
-          this.$message.error('鍒犻櫎澶辫触')
+          this.getFileList()
+        }).catch(err => {
+          this.tableLoadingFile = false
+          console.log('err---', err);
         })
-      }).catch(() => { })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      })
     },
     // 鏌ョ湅浜т笟閾句俊鎭�
     openInfoDialog(row) {
@@ -606,7 +598,21 @@
       this.outLoading = true
       downAll({ ids: str }).then(res => {
         this.outLoading = false
-        this.$download.saveAs(this.javaApi + res.message, row.fileName);
+        this.$download.zip(res.data, '鎶ュ憡.zip');
+      }).catch(() => {
+        this.outLoading = false
+      })
+
+    },
+    // 鎶ヨ〃瀵煎嚭
+    handleExport() {
+      this.outExportLoading = true
+      reportAllExport({
+        ...this.entity
+      }).then(res => {
+        this.outExportLoading = false
+        const blob = new Blob([res], { type: 'application/octet-stream' });
+        this.$download.saveAs(blob, "鎶ュ憡鎶ヨ〃瀵煎嚭.xlsx");
       })
     },
     beforeUpload(file) {
@@ -621,6 +627,7 @@
     },
     fileBeforeUpload(file) {
       let flag = true
+      console.log('file----', file)
       if (file.size > 1024 * 1024 * 10) {
         this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
         this.$refs.upload.clearFiles()
@@ -672,7 +679,7 @@
         case 0:
           // 鍘熸潗鏂�
           this.$router.push({
-            path: "/materialOrder/customsInspection", query: {
+            path: "/materialOrder/customsInspectionView", query: {
               customsInspection: row,
               active: this.activeFace,
               currentId: row.insOrderId,
@@ -683,7 +690,7 @@
         case null:
           // 鎴愬搧
           this.$router.push({
-            path: "/productOrder/add", query: {
+            path: "/productOrder/addView", query: {
               examine: this.examine,
               active: this.activeFace,
               currentId: row.insOrderId
@@ -693,7 +700,7 @@
         case 1:
           // 閾滄潗
           this.$router.push({
-            path: "/materialOrder/copperOrder", query: {
+            path: "/materialOrder/CopperView", query: {
               active: this.activeFace,
               currentId: row.insOrderId
             }
@@ -746,6 +753,7 @@
     },
     // 鏌ョ湅鎶ュ憡
     viewIssued(row) {
+      console.log('this.javaApi', this.javaApi)
       this.currentInfo = row;
       let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS
       let fileType = "docx"
@@ -824,7 +832,7 @@
     },
     // 鑾峰彇浜哄憳鍒楄〃
     getAuthorizedPerson() {
-      selectUserCondition({ type: 0 }).then((res) => {
+      selectUserCondition({ type: 1 }).then((res) => {
         let data = [];
         res.data.forEach((a) => {
           data.push({
@@ -871,6 +879,8 @@
         this.refreshTable('page')
         this.currentInfo = null;
         this.approveVisible = false;
+      }).catch(() => {
+        this.loadingApprove = false;
       })
     },
     handle(row) {

--
Gitblit v1.9.3