From 63343a3a32cd59a8ce7b8e15a68dd996e28f6ad9 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 08 十月 2024 08:59:37 +0800
Subject: [PATCH] 优化

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   75 ++++++++++++++++++++++++++++++++-----
 1 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 0729ec1..56dc04b 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -260,16 +260,17 @@
       <el-col :span="12" style="padding-left: 20px;text-align: left;" :class="{noShow:noBack}">妫�楠屽崟璇︽儏
       </el-col>
       <el-col :span="12" style="text-align: right;">
+        <el-button size="small" type="primary" @click="versionDialogVisible=true" v-if="state==1">妫�楠屾ā鏉垮垏鎹�</el-button>
         <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">鏍峰搧鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="taskVisible=true" v-show="!isLook">浠诲姟鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
           :loading="submitLoading">鎻愪氦</el-button>
         <!-- 澶嶆牳 -->
-        <el-button size="small" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
+        <el-button size="small" type="primary" @click="upInsReview(1,'缁х画璇曢獙')" :loading="reviewLoading"
           v-if="state>1&&!isLook">缁х画璇曢獙</el-button>
-        <el-button size="small" @click="upInsReview(0)" v-if="state>1&&!isLook" type="danger">鍐嶆璇曢獙</el-button>
-        <el-button size="small" @click="upInsReview(2)" v-if="state>1&&!isLook">缁撴潫璇曢獙</el-button>
-        <el-button size="small" @click="$emit('goback')" v-if="!noBack">杩斿洖</el-button>
+        <el-button size="small" @click="upInsReview(0,'鍐嶆璇曢獙')" v-if="state>1&&!isLook" type="danger">鍐嶆璇曢獙</el-button>
+        <el-button size="small" @click="upInsReview(2,'缁撴潫璇曢獙')" v-if="state>1&&!isLook">缁撴潫璇曢獙</el-button>
+        <el-button size="small" @click="handleBack" v-if="!noBack">杩斿洖</el-button>
       </el-col>
     </el-row>
     <div class="search" v-show="!isLook">
@@ -717,7 +718,7 @@
       }"
       v-if="state==1&&fileAdd"
       :on-success="handleSuccessUp" :show-file-list="false"
-        accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload"
+        accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :headers="headers" :on-change="beforeUpload"
         style="width: 80px !important;"
         :on-error="onError" ref='upload'>
         <el-button size="small" type="primary" v-if="state==1">闄勪欢涓婁紶</el-button></el-upload>
@@ -855,6 +856,13 @@
         <el-button type="primary" @click="submit0">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      title="鏂囦欢棰勮"
+      :visible.sync="lookFileVisible"
+      width="60%" fullscreen>
+      <filePreview v-if="lookFileVisible" :fileUrl="currentFile.url"
+      :currentFile="currentFile" style="max-height: 87vh;overflow-y: auto;"/>
+    </el-dialog>
   </div>
 </template>
 
@@ -865,16 +873,19 @@
   import excelFunction from '../../../util/excelFountion'
   import CircuitParameters1 from './circuit-parameters1.vue'
   import CircuitParameters2 from './circuit-parameters2.vue'
+  import filePreview from '../../tool/file-preview.vue'
   export default {
     props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1','noBack'],
     components: {
       ValueTable,
       Circuit,
       CircuitParameters1,
-      CircuitParameters2
+      CircuitParameters2,
+      filePreview
     },
     data() {
       return {
+        lookFileVisible:false,//棰勮鏂囦欢
         experimentDia:false,
         experimentInfo:{
           note:'',
@@ -944,6 +955,12 @@
             disabFun: (row, index) => {
 								return this.state!=1
 							}
+					},
+          {
+						id: '1',
+						font: '棰勮',
+						type: 'text',
+						method: 'lookFile',
 					}
           ],
           isPage: false,
@@ -1054,7 +1071,8 @@
         otherForm:{
           temperature:'',
           humidity:''
-        }
+        },
+        currentFile:{},//褰撳墠鏂囦欢
       }
     },
     // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
@@ -3105,8 +3123,13 @@
         })
       },
       // 澶嶆牳
-      upInsReview(e) {
-        if (e == 1||e==2) {
+      upInsReview(e,type) {
+        this.$confirm(`鏄惁${type}?`, "鎻愮ず", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        }).then(() => {
+          if (e == 1||e==2) {
           // 缁х画璇曢獙
           this.reviewLoading = true;
           this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
@@ -3128,6 +3151,7 @@
           // 鍐嶆璇曢獙
           this.reviewDia = true;
         }
+        })
       },
       handleReviewDia() {
         if (this.noReason) {
@@ -3169,7 +3193,16 @@
         }
       },
       handleSubmit(){
-        this.experimentDia = true
+        if (this.sonLaboratory === '鐢佃矾璇曢獙') {
+          this.experimentDia = true
+        } else {
+          if(this.insOrder.orderType=='C'){
+            this.verifyUser = this.insOrder.prepareUserId
+            this.submit()
+          }else{
+            this.addVerifyDia = true
+          }
+        }
       },
       submit() {
         if (this.verifyUser === null || this.verifyUser === '') {
@@ -3596,6 +3629,28 @@
         await this.handleChangeSample(this.currentSample)
         this.currentNum++
         this.tableLoading = false
+      },
+      lookFile(row){
+        this.currentFile = row;
+        if(row.type==1){
+          this.currentFile.url = this.javaApi+'/img/'+row.fileUrl
+        }else{
+          this.currentFile.url = this.javaApi+'/word/'+row.fileUrl
+        }
+        this.lookFileVisible = true
+      },
+      handleBack(){
+        if(this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐢佃矾璇曢獙')){
+          this.$confirm('璇风‘璁ゅ綋鍓嶆暟鎹槸鍚﹀叏閮ㄤ繚瀛橈紝鏄惁杩斿洖锛�', '鎻愮ず', {
+            confirmButtonText: '纭畾',
+            cancelButtonText: '鍙栨秷',
+            type: 'warning'
+          }).then(() => {
+            this.$emit('goback')
+          })
+        }else{
+          this.$emit('goback')
+        }
       }
     }
   }

--
Gitblit v1.9.3