From bc44c8e3c9d85691ce3fa73ef1300a6fae46e365 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 18 三月 2025 19:07:08 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/views/business/reportPreparation/index.vue |  211 +++++++++++++++++++++++-----------------------------
 1 files changed, 92 insertions(+), 119 deletions(-)

diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index c5df9d9..fe5106a 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -1,4 +1,9 @@
 <style scoped>
+.reportPreparation {
+  width: 100%;
+  height: 100%;
+}
+
 .title {
   height: 60px;
   line-height: 60px;
@@ -15,7 +20,7 @@
   display: flex;
   align-items: center;
   height: 50px;
-  width: 230px;
+  width: 210px;
 }
 
 .search_label {
@@ -65,8 +70,8 @@
 </style>
 
 <template>
-  <div class="inspection_order">
-    <div style="width: 100%; height: 100%">
+  <div>
+    <div class="reportPreparation bg-1">
       <div>
         <el-row class="title">
           <el-col :span="12" style="padding-left: 20px; text-align: left"
@@ -196,6 +201,7 @@
                 :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
                 style="color: #3a7bfa"
                 @click="more = !more"
+                v-hasPermi="['bbusiness:reportPreparation:more']"
                 >{{ !more ? "鏇村" : "鏀惰捣" }}</el-button
               >
               <div class="search_thing" style="padding-left: 20px">
@@ -224,62 +230,31 @@
                       <el-dropdown-item
                         icon="el-icon-download"
                         command="batchDownload"
+                        v-hasPermi="['business:reportPreparation:batchDownload']"
                         >鎵归噺涓嬭浇</el-dropdown-item
                       >
                       <el-dropdown-item
                         icon="el-icon-upload"
                         command="batchUpload"
+                         v-hasPermi="['business:reportPreparation:batchUpload']"
                         >鎵归噺涓婁紶</el-dropdown-item
                       >
                       <el-dropdown-item
                         icon="el-icon-s-check"
                         command="oneClickApproval"
+                         v-hasPermi="['business:reportPreparation:oneClickApproval']"
                         >涓�閿鎵�</el-dropdown-item
                       >
                       <el-dropdown-item
                         icon="el-icon-setting"
                         command="approvalConfig"
+                         v-hasPermi="['business:reportPreparation:signatureConfiguration']"
                         >瀹℃壒绛惧悕閰嶇疆</el-dropdown-item
                       >
                     </el-dropdown-menu>
                   </el-dropdown>
                 </template>
-                <template>
-                  <el-button
-                    size="small"
-                    type="primary"
-                    @click="handleDowns"
-                    :loading="outLoading"
-                    style="margin-right: 6px"
-                    >鎵归噺涓嬭浇</el-button
-                  >
-                  <el-button
-                    size="small"
-                    type="primary"
-                    @click="openBatchUploadDia()"
-                    :loading="inLoading"
-                    >鎵归噺涓婁紶</el-button
-                  >
-                  <el-button
-                    size="small"
-                    type="primary"
-                    @click="oneClickApproval()"
-                    :loading="approvalLoading"
-                    >涓�閿鎵�</el-button
-                  >
-                  <el-button
-                    size="small"
-                    type="primary"
-                    @click="openApprovalConfig()"
-                    :loading="approvalConfigLoading"
-                    >瀹℃壒绛惧悕閰嶇疆</el-button
-                  >
-                </template>
               </div>
-              <!-- <div class="btns">
-              <el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">鎵归噺涓嬭浇</el-button>
-              <el-button size="small" type="primary" @click="openBatchUploadDia()" :loading="inLoading">鎵归噺涓婁紶</el-button>
-            </div> -->
             </div>
           </el-col>
         </el-row>
@@ -316,10 +291,12 @@
           </p>
         </div>
         <lims-table
+          :handleSelectionChange="handleSelectionChange"
+          isSelection
           :tableData="tableData"
           :column="column"
           :tableLoading="tableLoading"
-          :height="'calc(100vh - 270px)'"
+          :height="tableHeight+''"
           :page="page"
           @pagination="pagination"
         ></lims-table>
@@ -341,13 +318,6 @@
           style="cursor: pointer; font-size: 18px"
           @click="fullscreen = true"
         ></i>
-        <!-- <img
-          v-else
-          alt=""
-          src="../../../static/img/no-full.svg"
-          style="cursor: pointer"
-          @click="fullscreen = false"
-        /> -->
       </div>
       <div v-if="viewIssuedVisible" style="height: 80vh">
         <onlyoffice
@@ -371,13 +341,6 @@
           @click="fullscreen = true"
           v-if="!fullscreen"
         ></i>
-        <!-- <img
-          src="../../../static/img/no-full.svg"
-          alt=""
-          v-else
-          style="cursor: pointer"
-          @click="fullscreen = false"
-        /> -->
       </div>
       <Word
         style="height: 70vh"
@@ -406,13 +369,6 @@
           @click="fullscreen = true"
           v-if="!fullscreen"
         ></i>
-        <!-- <img
-          src="../../../static/img/no-full.svg"
-          alt=""
-          v-else
-          style="cursor: pointer"
-          @click="fullscreen = false"
-        /> -->
       </div>
       <div style="height: 75vh" v-if="issuedVisible">
         <onlyoffice
@@ -477,13 +433,6 @@
           @click="fullscreen = true"
           v-if="!fullscreen"
         ></i>
-        <!-- <img
-          src="../../../static/img/no-full.svg"
-          alt=""
-          v-else
-          style="cursor: pointer"
-          @click="fullscreen = false"
-        /> -->
       </div>
       <div style="height: 75vh" v-if="approveVisible">
         <onlyoffice
@@ -542,18 +491,6 @@
       top="5vh"
     >
       <div>
-        <!-- <el-upload
-            class="upload-demo"
-            :action="action"
-            :headers="headers"
-            :show-file-list="false"
-            accept=".doc,.docx"
-            :limit="1"
-            :before-upload="beforeUpload"
-            :on-success="handleSuccess"
-            ref="upload"
-            :on-error="onError">
-          </el-upload> -->
         <el-upload
           ref="upload"
           class="upload-demo custom-upload"
@@ -850,14 +787,20 @@
   downAll,
   getBatchApprovalProgress,
   getReportCountInfo,
-  downReport,
   upReportUrl,
   ratifyReport,
   writeReport,
   examineReport,
   downLoad,
   getReportInfo,
+  getURL,
+  batchApprovalReport,
+  downReport,
 } from "../../../api/business/reportPreparation";
+
+import { getToken } from "@/utils/auth";
+
+import auth from "@/plugins/auth.js";
 
 export default {
   components: {
@@ -866,6 +809,7 @@
   },
   data() {
     return {
+      tableHeight: "",
       tagField: {
         isUpload: {
           select: [
@@ -1117,6 +1061,9 @@
               disabled: (row) => {
                 return row.isExamine != -9;
               },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:establishment");
+              },
             },
             {
               name: "涓嬭浇",
@@ -1124,15 +1071,17 @@
               clickFun: (row) => {
                 this.download(row);
               },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:download");
+              },
             },
             {
               name: "涓婁紶",
               type: "upload",
-              url: "/file/attachmentType/upload",
+              url: "/insReport/inReport",
               data: (row) => {
                 return {
                   id: row.id,
-                  type: 1,
                 };
               },
               uploadIdFun: (row) => {
@@ -1140,6 +1089,9 @@
               },
               disabled: (row) => {
                 return row.isExamine != -9;
+              },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:upload");
               },
             },
             {
@@ -1151,6 +1103,9 @@
               disabled: (row) => {
                 return row.isExamine != -9;
               },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:restore");
+              },
             },
             {
               name: "鎻愪氦",
@@ -1160,6 +1115,9 @@
               },
               disabled: (row) => {
                 return row.state != 0;
+              },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:submit");
               },
             },
             {
@@ -1172,6 +1130,9 @@
                 return (
                   row.state == null || row.state == 0 || row.isExamine == 1
                 );
+              },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:examine");
               },
             },
             {
@@ -1189,6 +1150,9 @@
                   row.isRatify == 1
                 );
               },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:approve");
+              },
             },
             {
               name: "鎾ゅ洖",
@@ -1198,6 +1162,9 @@
               },
               disabled: (row) => {
                 return row.state == 1;
+              },
+              showHide: () => {
+                return auth.hasPermi("business:reportPreparation:withdraw");
               },
             },
           ],
@@ -1237,19 +1204,20 @@
   },
   computed: {
     headers() {
+      let token = getToken();
       return {
-        token: sessionStorage.getItem("token"),
+        authorization: token,
       };
     },
     action() {
-      return "";
+      return this.javaApi + "/insReport/upAll";
     },
   },
   created() {
     this.getAuthorizedPerson();
     this.handleResize();
     // 鐩戝惉绐楀彛澶у皬鏀瑰彉浜嬩欢
-    window.addEventListener("resize", this.handleResize);
+    window.addEventListener("resize", this.handleResize);  
   },
   beforeDestroy() {
     if (this.time != null) {
@@ -1269,6 +1237,11 @@
     this.entityCopy = this.HaveJson(this.entity);
     this.getList();
     this.getReportCountInfo();
+    this.getTableHeight();
+    window.addEventListener('resize', this.calculateTableHeight); // 鐩戝惉绐楀彛澶у皬鍙樺寲
+  },
+  beforeDestroy() {
+    window.removeEventListener('resize', this.calculateTableHeight); // 绉婚櫎鐩戝惉
   },
   watch: {
     batchUploadDia(newVal) {
@@ -1306,6 +1279,12 @@
     },
   },
   methods: {
+    // 鑾峰彇琛ㄦ牸楂樺害
+    getTableHeight() {
+      const windowHeight =   window.innerHeight; // 娴忚鍣ㄧ獥鍙i珮搴�
+      this.tableHeight = windowHeight - 60 - 80 - 46 - 50 - 32 - 44 -30 - 30;
+      console.log('this.tableHeight',this.tableHeight);
+    },
     // 杩斿洖鍒嗛〉鍊�
     pagination({ page, limit }) {
       this.page.current = page;
@@ -1331,7 +1310,7 @@
     },
     // 鎾ゅ洖 寮规
     withdraw(row) {
-      getLaboratoryByReportId(row.id).then((res) => {
+      getLaboratoryByReportId({ id: row.id }).then((res) => {
         this.laboratorys = res.data;
         this.reportId = row.id;
         this.withdrawDialogVisible = true;
@@ -1349,6 +1328,7 @@
       withdraw(data).then((res) => {
         if (res.code == 200) {
           this.$message.success("鎾ゅ洖鎴愬姛");
+          this.laboratory = [];
           this.withdrawDialogVisible = false;
           this.refresh();
         }
@@ -1399,6 +1379,7 @@
     getAuthorizedPerson() {
       getUserList()
         .then((res) => {
+          console.log('res',res);
           this.personList = res.data;
         })
         .catch((error) => {
@@ -1539,6 +1520,10 @@
     handleChange(arr) {
       this.mutiList = arr;
     },
+    handleSelectionChange(val) {
+      this.mutiList = val;
+      console.log(`output->val`, val);
+    },
     handleDowns() {
       if (this.mutiList.length == 0) {
         this.$message.error("璇烽�夋嫨鎶ュ憡");
@@ -1582,14 +1567,8 @@
       downAll({ ids: str }).then((res) => {
         this.outLoading = false;
         this.$message.success("瀵煎嚭鎴愬姛");
-        // const blob = new Blob([res],{ type: 'application/octet-stream' });
-        // const url = URL.createObjectURL(blob);
-        // const link = document.createElement('a');
-        // link.href = url;
-        // link.download = '鎶ュ憡.zip';
-        // link.click();
         const link = document.createElement("a");
-        link.href = this.javaApi + res.message;
+        link.href = this.javaApi + res.data;
         link.target = "_blank";
         document.body.appendChild(link);
         link.click();
@@ -1718,27 +1697,21 @@
       console.log(`output->row`, row);
     },
     download(row) {
-      getReportInfo({ id: row.id, type: 1,suffix:'.docx' }).then((response) => {
-        if (response.data && response.data.contentType) {
-          downLoad({ id: row.id, type: 1, code: row.code,suffix: '.docx' })
-            .then((res) => {
-              // 鑾峰彇鏂囦欢鍚�
-              const blob = new Blob([res], { type: response.data.contentType });
-              const url = URL.createObjectURL(blob);
-              let link = document.createElement("a");
-              link.href = url;
-              link.download = row.code;
-              document.body.appendChild(link);
-              link.click();
-              document.body.removeChild(link);
-              URL.revokeObjectURL(url);
-            })
-            .catch((error) => {
-              this.$message.error(error);
-            });
-        } else {
-          this.$message.error("鏈壘鍒版枃浠�");
-        }
+      downReport({ id: row.id, type: 0 }).then((res) => {
+          let rowUrl = row.urlS ? row.urlS : row.url;
+          let fileName =
+            rowUrl.indexOf("_") == -1
+              ? rowUrl.split("/")[2]
+              : rowUrl.split("_")[1];
+          console.log(fileName);
+          const blod = new Blob([res], { type: "application/octet-stream" });
+          const url = URL.createObjectURL(blod);
+          const link = document.createElement("a");
+          link.href = url;
+          link.target = "_blank";
+          link.download = fileName;
+          document.body.appendChild(link);
+          link.click();
       });
     },
     // 杩樺師鎿嶄綔
@@ -1749,7 +1722,7 @@
         type: "warning",
       })
         .then(() => {
-          upReportUrl({ id: row.id,type:1 }).then((res) => {
+          upReportUrl({ id: row.id, type: 1 }).then((res) => {
             if (res.code === 200) {
               this.$message.success("鎿嶄綔鎴愬姛");
               this.refreshTable("page");
@@ -1762,7 +1735,7 @@
       this.currentInfo = row;
       let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
       fileName = fileName.replace("/word/", "");
-      const userName = JSON.parse(localStorage.getItem("user")).name;
+      const userName = this.$store.state.user.name;
       this.option = {
         url: this.javaApi + "/word/" + fileName,
         isEdit: false,
@@ -1800,7 +1773,7 @@
       this.currentInfo = row;
       let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
       fileName = fileName.replace("/word/", "");
-      const userName = JSON.parse(localStorage.getItem("user")).name;
+      const userName = this.$store.state.user.name;
       this.option = {
         url: this.javaApi + "/word/" + fileName,
         isEdit: false,
@@ -1888,8 +1861,8 @@
       this.loadingApproveReason = true;
       examineReport({
         id: this.currentInfo.id,
-        isRatify: 0,
-        ratifyTell: this.reason,
+        isExamine: 0,
+        examineTell: this.reason,
       })
         .then((res) => {
           this.loadingApproveReason = false;

--
Gitblit v1.9.3