From 859dacb2b86be0dd74aed57d26c7bdea07ced7c1 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 24 十月 2023 15:51:42 +0800
Subject: [PATCH] 1.模具上机 100%

---
 pages/mjgl/mjdj.vue |   60 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/pages/mjgl/mjdj.vue b/pages/mjgl/mjdj.vue
index 85550e6..a06d501 100644
--- a/pages/mjgl/mjdj.vue
+++ b/pages/mjgl/mjdj.vue
@@ -64,9 +64,13 @@
 
 
 
-							<view class="marginRight20 marginBottom10">
+							<view class="marginRight20 marginBottom10" v-if='standardArr.length>0'>
 								<u-button @click="show = true" type='primary' size="small" plain
 									shape='circle'>璇烽�夋嫨</u-button>
+							</view>
+
+							<view class="marginRight20 marginBottom10" v-if='standardArr.length===0'>
+								鏆傛棤鍏宠仈鏍囧噯,璇峰厛鍏宠仈
 							</view>
 
 						</view>
@@ -159,7 +163,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 +209,6 @@
 				selectValue: '',
 				centerContent: [],
 				resultValue: ''
-
 			}
 		},
 		created() {
@@ -217,8 +221,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 +240,10 @@
 					mouldcode: mouldcode
 				})
 				this.standardArr = res
+
+				this.centerContent = []
+				this.resultValue = ''
+				this.selectValue = ''
 			},
 			async getSelectScanMouldQrCodeItem(mouldcode, checktempcode) {
 				const {
@@ -285,7 +293,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 +309,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.standardArr.find(i => i.name === this.selectValue).code,
+					result: this.resultValue,
+					children
+				}
+
+				// console.log(JSON.stringify(data))
+				this.isDisabledSubmitButton = true
+				const res = await MouldCheckSave('2501', data)
+				if (res.code === '200') {
+					uni.$u.toast('鎻愪氦鎴愬姛锛�')
+					this.isDisabledSubmitButton = false
+					this.topContent = []
+					this.selectValue = ''
+					this.centerContent = []
+					this.resultValue = ''
+				}
 			},
 		}
 	}

--
Gitblit v1.9.3