From be98e17b6f4d7917d7187557889032cbc0a62068 Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期六, 06 四月 2024 17:49:39 +0800
Subject: [PATCH] 检验任务的缺漏代码

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   76 ++++++++++++++++++++++++-------------
 1 files changed, 49 insertions(+), 27 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 08cde83..80d266a 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -124,6 +124,7 @@
 			<el-col :span="12" style="text-align: right;">
 				<el-button size="small" type="primary" @click="sampleVisible=true">鏍峰搧鍒囨崲</el-button>
 				<el-button size="small" type="primary" @click="taskVisible=true">浠诲姟鍒囨崲</el-button>
+        <el-button size="small" type="primary" @click="submit" v-show="state==1" :loading="submitLoading">鎻愪氦</el-button>
         <!-- 澶嶆牳 -->
         <el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
 						v-show="state>1">閫氳繃</el-button>
@@ -266,6 +267,7 @@
 			return {
 				sampleVisible: false,
 				taskVisible: false,
+        submitLoading:false,
 				searchForm: {
 					sampleName: null,
 					state: null
@@ -362,6 +364,7 @@
 		methods: {
 			handleChangeSample(row, column, event) {
 				this.currentSample = row;
+				this.param = {}
 				this.currentSample.insProduct.forEach(a => {
 					this.param[a.id] = {
 						insValue: [],
@@ -447,26 +450,26 @@
 				this.tableList.forEach(a => {
 					let dels = []
 					let ids = []
-					a.template.forEach(b => {
-						if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽瓙椤�') {
-							let count = 0
-							for (let i in this.currentSample.insProduct) {
-								if (this.currentSample.insProduct[i].inspectionItemSubclass === b.v.v && this.currentSample
-									.insProduct[i].templateId === a.templateId) {
-									ids.push({
-										r: b.r,
-										id: this.currentSample.insProduct[i].id,
-										product: this.currentSample.insProduct[i]
-									})
-									break
-								}
-								count++
-							}
-							if (count === this.currentSample.insProduct.length) {
-								dels.push(b)
-							}
-						}
-					})
+          a.template.forEach(b => {
+          	if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽瓙椤�') {
+          		let count = 0
+          		for (let i in this.currentSample.insProduct) {
+          			if (this.currentSample.insProduct[i].inspectionItemSubclass === b.v.v && this.currentSample
+          				.insProduct[i].templateId === a.templateId) {
+          				ids.push({
+          					r: b.r,
+          					id: this.currentSample.insProduct[i].id,
+          					product: this.currentSample.insProduct[i]
+          				})
+          				break
+          			}
+          			count++
+          		}
+          		if (count === this.currentSample.insProduct.length) {
+          			dels.push(b)
+          		}
+          	}
+          })
 					dels.forEach(del => {
 						for (let b = 0; b < a.template.length; b++) {
 							if (a.template[b].r === del.r) {
@@ -589,11 +592,14 @@
 									this.param[a.id].insValue[i].u = insValue[i].u
 							}
 					}catch(e){}
-						try{
-							this.param[a.id].equipValue.v.v = a.insProductResult.equipValue
-						}catch(e){}
-						this.param[a.id].resValue.v.v = a.lastValue
-						this.param[a.id].insResult.v.v = a.insResult
+					try{
+						this.param[a.id].equipValue.v.v = a.insProductResult.equipValue
+					}catch(e){}
+					try{
+					  this.param[a.id].resValue.v.v = a.lastValue
+					  this.param[a.id].insResult.v.v = a.insResult
+					}catch(e){
+					}
 				})
 				this.handleExcelMethod()
 			},
@@ -822,7 +828,7 @@
             laboratory:this.sonLaboratory,
             tell:null
           }).then(res => {
-            if (res.code === 200 && res.data) {
+            if (res.code === 200) {
               this.$message.success("鎿嶄綔鎴愬姛")
               this.$emit('goback')
             }
@@ -845,7 +851,7 @@
             laboratory:this.sonLaboratory,
             tell:this.noReason
           }).then(res => {
-            if (res.code === 200 && res.data) {
+            if (res.code === 200) {
               this.$message.success("鎿嶄綔鎴愬姛")
               this.$emit('goback')
             }
@@ -858,6 +864,22 @@
           this.$message.error('鏈緭鍏ヤ笉閫氳繃鍘熷洜')
         }
       },
+      submit(){
+        this.submitLoading = true;
+        this.$axios.post(this.$api.insOrderPlan.submitPlan, {
+            orderId:this.orderId,
+            laboratory:this.sonLaboratory,
+        }).then(res => {
+          if (res.code === 200) {
+            this.$message.success("鎿嶄綔鎴愬姛")
+            this.$emit('goback')
+          }
+          this.submitLoading = false;
+        }).catch(error => {
+          console.error(error)
+          this.submitLoading = false;
+        })
+      }
   	}
 }
 </script>

--
Gitblit v1.9.3