From 22b45a79b2ceab7625e0fe248458c398cc26110d Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期一, 25 九月 2023 12:53:59 +0800
Subject: [PATCH] 	modified:   src/components/view/Processingproducts.vue 	modified:   src/components/view/rawInsDetail.vue 	modified:   src/components/view/sale.vue

---
 src/components/view/rawInsDetail.vue |   57 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue
index 5cfeb6c..4bda44d 100644
--- a/src/components/view/rawInsDetail.vue
+++ b/src/components/view/rawInsDetail.vue
@@ -102,7 +102,8 @@
 					<template slot-scope="scope">
 						<!-- <el-input v-if="detailId == null" v-model="scope.row.name" placeholder="璇疯緭鍏ラ」鐩悕绉�"></el-input> -->
 						<el-autocomplete v-if="detailId == null" class="inline-input" v-model="scope.row.name"
-							:fetch-suggestions="querySearch" placeholder="璇疯緭鍏ラ」鐩悕绉�" @select="handleSelect(scope.row)" @blur="handleSelect(scope.row)"></el-autocomplete>
+							:fetch-suggestions="querySearch" placeholder="璇疯緭鍏ラ」鐩悕绉�" @select="handleSelect(scope.row)"
+							@blur="handleSelect(scope.row)"></el-autocomplete>
 						<el-input v-else v-model="scope.row.rpName" disabled></el-input>
 					</template>
 				</el-table-column>
@@ -181,7 +182,7 @@
 				</el-table-column>
 				<el-table-column v-if="detailId !== null" label="鎿嶄綔" width="120">
 					<template>
-						<el-button type="text" size="small" @click.once="submitSave">涓婃姤</el-button>
+						<el-button type="text" size="small" @click="submitSave">涓婃姤</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
@@ -301,10 +302,10 @@
 				this.detailInfo.number = this.ifsInfo.number
 				this.detailInfo.specifications = this.ifsInfo.specifications
 				this.restaurants = JSON.parse(JSON.stringify(this.ifsInfo.rawInsProducts))
-				this.restaurants.forEach(item=>{
-					this.$set(item,"value",item.name)
+				this.restaurants.forEach(item => {
+					this.$set(item, "value", item.name)
 				})
-				console.log("restaurants",this.restaurants);
+				console.log("restaurants", this.restaurants);
 			})
 		},
 		querySearch(queryString, cb) {
@@ -319,13 +320,13 @@
 			};
 		},
 		handleSelect(row) {
-			let select=this.restaurants.filter(item=>{
-				return item.name===row.name
+			let select = this.restaurants.filter(item => {
+				return item.name === row.name
 			})[0]
-			if(select!=undefined){
-				this.$set(row,"internal",select.internal)
-				this.$set(row,"required",select.required)
-				this.$set(row,"unit",select.unit)
+			if (select != undefined) {
+				this.$set(row, "internal", select.internal)
+				this.$set(row, "required", select.required)
+				this.$set(row, "unit", select.unit)
 				//妫�楠屽��
 			}
 		},
@@ -385,12 +386,11 @@
 			console.log(this.projectTable);
 			if (this.projectTable.length > 0) {
 				let filterTable = this.projectTable.filter(item => {
-					return item.required === '' || item.internal === '' ||
-						item.required === null || item.internal === null || item.name === ''
+					return  item.name === null || item.name === ''
 				})
 				if (filterTable.length > 0) {
 					this.$message({
-						message: "椤圭洰鍚嶇О锛屾爣鍑嗗�煎拰鍐呮帶鍊间笉鑳戒负绌猴紒",
+						message: "椤圭洰鍚嶇О涓嶈兘涓虹┖锛�",
 						type: 'warning'
 					});
 					return
@@ -438,14 +438,39 @@
 				this.getDetailInfo(); //閲嶆柊鍒锋柊淇℃伅鏁版嵁
 			}
 		},
-		async submitSave() {
-			const res = await this.$axios.post(
+		 submitSave() {
+			let pro = this.projectTable.filter(item => {
+				return item.testState === 0;
+			})
+			if (pro.length > 0) {
+				this.$prompt('璇疯緭鍏ヤ笉鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�', {
+					confirmButtonText: '纭畾',
+					cancelButtonText: '鍙栨秷',
+					inputPattern: /^\d+$/,
+					inputErrorMessage: '璇疯緭鍏ユ纭暟瀛楁牸寮�'
+				}).then(({ value }) => {
+					this.$axios.post(
+						this.$api.url.updateRawInspectsById+`${this.detailId}`, {"number": value }
+					).then(res => {
+						this.$message.success("鎻愪氦鎴愬姛");
+						this.getDetailInfo();
+						this.goBack()
+					});
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '鍙栨秷杈撳叆'
+					});
+				});
+			}else{
+			 this.$axios.post(
 				this.$api.url.updateRawInspectsById + `${this.detailId}`
 			).then(res => {
 				this.$message.success("鎻愪氦鎴愬姛");
 				this.getDetailInfo();
 				this.goBack()
 			});
+			}
 		},
 		// 鑾峰彇璁惧鏍戝唴瀹�
 		getOptions() {

--
Gitblit v1.9.3