From 0ddb55d01d4eb218fc92d3ff79d973757183a725 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期三, 19 三月 2025 14:47:41 +0800
Subject: [PATCH] 修改检验任务报告处理问题

---
 src/views/business/inspectionTask/index.vue |   38 ++++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue
index b635be5..5cdde1c 100644
--- a/src/views/business/inspectionTask/index.vue
+++ b/src/views/business/inspectionTask/index.vue
@@ -76,7 +76,8 @@
                 <el-button link type="text" size="small">鏇村</el-button>
               </template>
               <div>
-                <el-button :disabled="scope.row.insState != 3" style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">涓嬭浇鎶ュ憡</el-button>
+                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
+                  (scope.row.userName && !scope.row.userName.includes(nickName)))" style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">涓嬭浇鎶ュ憡</el-button>
                 <el-upload ref='upload'
                            :action="javaApi + '/insReport/inReport'"
                            :before-upload="beforeUpload"
@@ -86,10 +87,13 @@
                            :show-file-list="false"
                            style="display: inline;margin: 0 6px"
                            accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
-                  <el-button :disabled="scope.row.insState != 3" size="small" type="text">涓婁紶</el-button>
+                  <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
+                  (scope.row.userName && !scope.row.userName.includes(nickName)))" size="small" type="text">涓婁紶</el-button>
                 </el-upload>
-                <el-button :disabled="scope.row.insState != 3" type="text" size="small" @click="handleRestore(scope.row)">杩樺師</el-button>
-                <el-button :disabled="scope.row.insState != 3" type="text" size="small" @click="handleIssued(scope.row)">鏌ョ湅鎶ュ憡</el-button>
+                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
+                  (scope.row.userName && !scope.row.userName.includes(nickName)))" type="text" size="small" @click="handleRestore(scope.row)">杩樺師</el-button>
+                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
+                  (scope.row.userName && !scope.row.userName.includes(nickName)))" type="text" size="small" @click="handleIssued(scope.row)">鏌ョ湅鎶ュ憡</el-button>
               </div>
             </el-popover>
           </div>
@@ -204,11 +208,28 @@
     <viewManHourDia ref="viewManHourDia"></viewManHourDia>
     <!--涓嶅悎鏍煎娴嬫煡鐪嬪脊妗�-->
     <un-pass-retest-result v-if="retestVisible" :retestInfo="retestInfo" :retestVisible="retestVisible" @closeRetestLook="closeRetestLook"></un-pass-retest-result>
+    <!--鎶ュ憡鏌ョ湅-->
+    <el-dialog title="鎶ュ憡鏌ョ湅" :visible.sync="issuedVisible" width="80vw" :modal-append-to-body="false"
+               :fullscreen="fullscreen">
+      <div class="full-screen">
+        <i class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen = true;"
+           v-if="!fullscreen"></i>
+        <img src="@/assets/images/no-full.svg" alt="" v-else style="cursor: pointer;" @click="fullscreen = false;">
+      </div>
+      <div style="height: 80vh;" v-if="issuedVisible">
+        <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" />
+      </div>
+    </el-dialog>
+    <el-dialog title="鏌ョ湅闄勪欢" :visible.sync="lookDialogVisible" width="800px" top="5vh" fullscreen>
+      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.tempUrlPdf" :currentFile="{}"
+                   style="max-height: 90vh;overflow-y: auto;" />
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { getYearAndMonthAndDays } from "@/utils/date";
+
 import EditInspectionItem from "./components/EditInspectionItem.vue";
 import limsTable from "@/components/Table/lims-table.vue";
 import viewManHourDia from "./components/viewManHourDia.vue"
@@ -228,9 +249,12 @@
 import { mapGetters } from "vuex";
 import {getRetestResult} from "@/api/business/rawMaterialOrder";
 import {upReportUrl} from "@/api/business/insReport";
+import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
 export default {
   name: 'InspectionTask',
   components: {
+    filePreview, onlyoffice,
     EditInspectionItem,
     limsTable,
     viewManHourDia,
@@ -242,6 +266,10 @@
   },
   data() {
     return {
+      issuedVisible: false,
+      fullscreen: false,
+      lookDialogVisible: false,
+      option: null,
       InspectionKey: 1,
       bindDialogVisible: false,
       bindAddDialogVisible: false,
@@ -646,6 +674,7 @@
     },
     // 鏌ョ湅鎶ュ憡
     handleIssued(row) {
+      console.log('================')
       // todo: 鏌ョ湅鎶ュ憡缁勪欢
       this.currentInfo = row;
       let fileName = row.url
@@ -962,6 +991,7 @@
       if (response.code == 200) {
         this.$refs.upload.clearFiles()
         this.$message.success("涓婁紶鎴愬姛");
+        this.refreshTable()
       } else {
         this.$message.error(response.message);
       }

--
Gitblit v1.9.3