From 00b15962f9a8175a61197b6fb6e19d6014e75507 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 31 八月 2023 17:15:45 +0800
Subject: [PATCH] 	modified:   .env.development 	modified:   src/views/inspectionManagement/commissionInspection/index.vue

---
 src/views/inspectionManagement/commissionInspection/index.vue |   78 ++++++++++++++++++++++----------------
 1 files changed, 45 insertions(+), 33 deletions(-)

diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue
index b4bc55b..675620f 100644
--- a/src/views/inspectionManagement/commissionInspection/index.vue
+++ b/src/views/inspectionManagement/commissionInspection/index.vue
@@ -67,7 +67,7 @@
 							<el-table-column prop="entrusted" label="濮旀墭鍗曚綅" min-width="12%" />
 							<el-table-column prop="samples_number" label="鏍峰搧鏁伴噺" min-width="8%" />
 							<el-table-column prop="sample_name" label="鏍峰搧鍚嶇О" min-width="8%" />
-							<el-table-column prop="specifications_models" label="瑙勬牸鍨嬪彿" min-width="12%" />
+							<el-table-column prop="speName" label="瑙勬牸鍨嬪彿" min-width="12%" />
 							<el-table-column prop="inspectionTime" label="閫佹牱鏃堕棿" min-width="8%" />
 							<el-table-column prop="completionDeadline" label="瀹屾垚鏈熼檺" min-width="8%" />
 							<el-table-column prop="contacts" label="濮旀墭缂栧埗浜�" min-width="8%" />
@@ -163,7 +163,8 @@
 		selectViewUUID,
 		delLink,
 		chooseVersion,
-		lookProByVer
+		lookProByVer,
+		addInspect
 	} from '@/api/inspection/commisioninspection'
 	export default {
 		data() {
@@ -193,7 +194,7 @@
 					value: '1',
 					label: '閮ㄩ棬1'
 				}],
-				radioValue: 0,
+				radioValue: null,
 				commisionTable: [{
 					specifications_models: "GGXH-AAAAA",
 					inspectionTime: "2023-08-03",
@@ -209,15 +210,15 @@
 				}],
 				conditionsOptions: [{
 						label: '鍏ㄩ儴',
-						value: 0
+						value: null
 					},
 					{
 						label: '宸叉楠�',
-						value: 1
+						value: 0
 					},
 					{
 						label: '寰呮楠�',
-						value: 2
+						value: 1
 					}
 				],
 				currentPage: 1,
@@ -264,30 +265,33 @@
 			confirmBtn(formName) {
 				this.$refs[formName].validate((valid)=>{
 					if(valid){
-					// let dateArr = this.addInspectionForm.inspectionDate;
-					// //娣诲姞鎶ユ鍗�
-					// let val = this.checkData[0];
-					// let obj = {
-					// 	"endTime": dateArr[1],
-					// 	"experiment": "",
-					// 	"formTime": val.createTime,
-					// 	"id": val.id,
-					// 	"mcode": val.materialCoding,
-					// 	"name": val.materialName,
-					// 	"num": val.quantity,
-					// 	"specifications": val.specificationsModels,
-					// 	"startTime": dateArr[0],
-					// 	"supplier": val.supplierName,
-					// 	"type": val.type,
-					// 	"unit": val.unit,
-					// 	"version": this.addInspectionForm.version
-					// }
-					// // this.createReport(obj);
-					// this.addReportDialog = false;
-					// this.initNewSelection();
-					// this.showNewPage = true;
+					let dateArr = this.addInspectionForm.inspectionDate;
+					//娣诲姞鎶ユ鍗�
+					let val = this.checkData[0];
+					let obj = {
+						"endTime": dateArr[1],
+						"mcode":"mcode",
+						"formTime": val.inspectionTime,
+						"id": val.id,
+						"name": val.sample_name,
+						"num": val.samples_number,
+						"specifications": val.speName,
+						"startTime": dateArr[0],
+						"supplier": val.entrusted,
+						"type": 2,
+						"version": this.addInspectionForm.version
+					}
+					this.createReport(obj);
+					this.addReportDialog = false;
 					}
 				});
+			},
+			//鐢熸垚鎶ユ鍗曡姹�
+			async createReport(param) {
+				let res = await addInspect(param);
+				if(res.data==null)return
+				this.$message.success('鎶ユ鎴愬姛')
+				this.$router.push(`/experiment/Viewdetails/${res.data}`)
 			},
 			//鐢熸垚鎶ユ鍗曟寜閽�
 			addReportBtn() {
@@ -299,7 +303,7 @@
 					} else {
 						let mcode = this.checkData[0].entrust_coding;
 						let name = this.checkData[0].sample_name;
-						let specifications = this.checkData[0].specifications_models;
+						let specifications = this.checkData[0].speName;
 						let id = this.checkData[0].id;
 						this.getChooseVersionFun(mcode,name,specifications,id);
 						this.addReportDialog = true;
@@ -309,7 +313,7 @@
 			changeVersionFun(){
 				let mCode = this.checkData[0].entrust_coding;
 				let name = this.checkData[0].sample_name;
-				let specifications = this.checkData[0].specifications_models;
+				let specifications = this.checkData[0].speName;
 				let version = this.addInspectionForm.version;
 				let id = this.checkData[0].id;
 				this.getProByVersion(mCode,name,specifications,version,id);
@@ -333,7 +337,7 @@
 				var vm = this;
 				this.chooseVersion = [];
 				await chooseVersion({
-				mcode : mCode,
+				id : id,
 				name : name,
 				specifications : specifications
 				}).then((res)=>{
@@ -401,8 +405,6 @@
 			async radioclick() {
 				// 澶勭悊鐐瑰嚮radio鐨勬椂闂�
 				if (this.radioValue === 0) {
-					this.getCommisionList()
-				} else {
 					const res = await getCommisionList({
 						pageNo: this.currentPage,
 						pageSize: this.pageSize,
@@ -410,6 +412,16 @@
 					})
 					this.commisionTable = res.data.row
 					this.total = res.data.total
+				} else if(this.radioValue === 1) {
+					const res = await getCommisionList({
+						pageNo: this.currentPage,
+						pageSize: this.pageSize,
+						inspectionStatus: this.radioValue
+					})
+					this.commisionTable = res.data.row
+					this.total = res.data.total
+				}else{
+					this.getCommisionList();
 				}
 
 			},

--
Gitblit v1.9.3