From 639073fd37ec8aaeed4334114da26051c83ae556 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 18 十月 2023 11:16:20 +0800
Subject: [PATCH] 1.模具点检  100%

---
 pages/mjgl/mjdj.vue |   54 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/pages/mjgl/mjdj.vue b/pages/mjgl/mjdj.vue
index 85550e6..864a1cd 100644
--- a/pages/mjgl/mjdj.vue
+++ b/pages/mjgl/mjdj.vue
@@ -159,7 +159,8 @@
 
 			<view class="footer" v-show='centerContent.length!==0'>
 				<u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
-					@click="submit" :disabled="resultValue===''" text="纭鎻愪氦">
+					:disabled="centerContent.filter(i=>i.isOK==='OK'||i.isOK==='NG').length!==centerContent.length"
+					@click="submit" text="纭鎻愪氦">
 				</u-button>
 			</view>
 
@@ -204,7 +205,6 @@
 				selectValue: '',
 				centerContent: [],
 				resultValue: ''
-
 			}
 		},
 		created() {
@@ -217,8 +217,8 @@
 			init() {
 				uni.stopPullDownRefresh();
 
-				this.getCheckScanMouldQrCodeData('001')
-				this.getCheckScanMouldTemp('001')
+				// this.getCheckScanMouldQrCodeData('001')
+				// this.getCheckScanMouldTemp('001')
 				// this.getSelectScanMouldQrCodeItem('001', '001')
 			},
 			async getCheckScanMouldQrCodeData(mouldcode) {
@@ -236,6 +236,10 @@
 					mouldcode: mouldcode
 				})
 				this.standardArr = res
+
+				this.centerContent = []
+				this.resultValue = ''
+				this.selectValue = ''
 			},
 			async getSelectScanMouldQrCodeItem(mouldcode, checktempcode) {
 				const {
@@ -285,7 +289,7 @@
 			selectClick(val) {
 				this.resultValue = ''
 				this.selectValue = val.name
-				this.getSelectScanMouldQrCodeItem('001', val.code)
+				this.getSelectScanMouldQrCodeItem(this.topContent[0].code, val.code)
 
 			},
 			bwClick(item, val) {
@@ -301,18 +305,40 @@
 			},
 			resultClick(val) {
 				this.resultValue = val
-
-				console.log(val)
-
-				// this.centerContent.forEach(i => {
-				// 	i.isOK = val
-				// })
-
-
 				this.$forceUpdate() //寮哄埗瑙嗗浘鏇存柊
 			},
-			submit() {
+			async submit() {
 
+				const children = []
+				this.centerContent.forEach((i, index) => {
+					children.push({
+						seq: index + 1,
+						itemcode: i.code,
+						cycle: '',
+						value: i.inputValue,
+						result: i.isOK
+					})
+				})
+
+				const data = {
+					code: this.topContent[0].code,
+					name: this.topContent[0].name,
+					standcode: this.selectValue,
+					result: this.resultValue,
+					children
+				}
+
+				// console.log(JSON.stringify(data))
+				this.isDisabledSubmitButton = true
+				const res = await MouldCheckSave('2050', data)
+				if (res.code === '200') {
+					uni.$u.toast('鎻愪氦鎴愬姛锛�')
+					this.isDisabledSubmitButton = false
+					this.topContent = []
+					this.selectValue = ''
+					this.centerContent = []
+					this.resultValue = ''
+				}
 			},
 		}
 	}

--
Gitblit v1.9.3