From 730473fedc3f7f345cf199a5cc1585e7a11c3786 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Sun, 7 Apr 2024 10:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A1=E6=B2=AB=E7=82=B9?= =?UTF-8?q?=E6=A3=80=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 2 +- src/mycomponents/form/customerFrom.vue | 27 ++- src/pages/foam/check.vue | 135 ++++++++--- src/pages/foam/input.vue | 126 +++++----- src/pages/plastics/check.vue | 321 +++++++++++++++++++++++-- src/pages/plastics/input.vue | 12 +- 6 files changed, 482 insertions(+), 141 deletions(-) diff --git a/src/api/request2.js b/src/api/request2.js index 3a63aff..1de769d 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -243,7 +243,7 @@ export function foamMaterialInputSubmit(params) { */ export function foamCheckSubmit(params) { return request({ - url: baseApi + "/system/captcha/captchaImage", + url: baseApi + "/MachineClass/Insert", method: "post", data: params, }); diff --git a/src/mycomponents/form/customerFrom.vue b/src/mycomponents/form/customerFrom.vue index 677faba..189e984 100644 --- a/src/mycomponents/form/customerFrom.vue +++ b/src/mycomponents/form/customerFrom.vue @@ -371,23 +371,24 @@ } this.formData.forEach(res => { - if (res.SelectName.includes("班")) { - var value = this.dataClassList.filter(item => item.name == res.SelectName) - if (value.length > 0) { - res.SelectValue = value[0].value - } else { - res.SelectValue = "" - } - } else { - var value = this.dataList.filter(item => item.name == res.SelectName) - if (value.length > 0) { - res.SelectValue = value[0].value + if(res.SelectName){ + if (res.SelectName.includes("班")) { + var value = this.dataClassList.filter(item => item.name == res.SelectName) + if (value.length > 0) { + res.SelectValue = value[0].value + } else { + res.SelectValue = "" + } } else { - res.SelectValue = res.SelectName + var value = this.dataList.filter(item => item.name == res.SelectName) + if (value.length > 0) { + res.SelectValue = value[0].value + } else { + res.SelectValue = res.SelectName + } } } }) - callBack(this.formData) } catch (error) { this.showHint("", error.message) diff --git a/src/pages/foam/check.vue b/src/pages/foam/check.vue index 9b7fafa..b094d91 100644 --- a/src/pages/foam/check.vue +++ b/src/pages/foam/check.vue @@ -2,28 +2,54 @@ - - + + - - + + - - + + + + + + 设备编号: + + + + + 设备名称 : {{deviceName}} + + + 点检日期 : {{dateTime}} + + + 点检人 : {{worker}} + + + @@ -38,7 +64,7 @@ - + @@ -76,6 +102,7 @@ return { dateTime: "", deviceCode: "", + deviceCheckCode:"", deviceName: "", worker: this.$store.state.user.name, dataList: [], @@ -202,9 +229,12 @@ computed: {}, onLoad() { + }, + mounted() { + this.$refs.inputDevice.focused = true }, onReady() { - this.openScanPopup(); + // this.openScanPopup(); }, methods: { getScanResult(result) { @@ -216,7 +246,6 @@ uni.hideLoading() this.deviceCode = result; console.log(result) - this.reset(); this.closeScanPopup(); var groupSelect = { Type: "4", @@ -227,19 +256,10 @@ // this.dataList = this.formData this.dataList = res.Result; this.dataList.push(groupSelect) - this.dataList.forEach(res=>{ - res.SelectName="" - res.SelectValue="" - if(res.putMachine){ - res.putMachine.forEach(item=>{ - item.SelectName="" - item.SelectValue="" - }) - } - - }) + this.deviceName=this.dataList[0].Name; this.dateTime = getCurrDateTime() + this.worker = this.$store.state.user.name }).catch(error => { uni.hideLoading() this.showMessage(error) @@ -256,6 +276,7 @@ }, submit() { if (this.deviceCode == "") { + this.deviceCheckCode="" this.$refs.comMessage.showMessage("提示", "请先扫描设备编号") return } @@ -269,34 +290,35 @@ } }) var commitData={ - LoginUserID:this.$store.state.user.id, - UserName:this.$store.state.user.name, + id:this.$store.state.user.id, createTime:getCurrDateTime(), groupName:groupName, groupValue:groupValue, dataList:data } - var param = commitData - console.log("提交", JSON.stringify(param)) - // foamCheckSubmit(param).then(res=>{ - // uni.hideLoading() - // this.showMessage("提交成功") - // this.clearData() - // }).catch(error=>{ - // uni.hideLoading() - // this.showMessage(error) - // }) - + console.log("提交", JSON.stringify(commitData)) + foamCheckSubmit(commitData).then(res=>{ + uni.hideLoading() + this.showMessage("提交成功") + this.clearData() + }).catch(error=>{ + uni.hideLoading() + this.showMessage(error) + }) }) }, clearData() { this.deviceCode = "" + this.deviceName=""; + this.dateTime =""; this.dateTime = "", - this.deviceCode = "", - this.deviceName = "", - this.reset(); - }, + this.deviceCode = "", + this.deviceName = "", + this.worker="" + this.dataList=[] + // this.reset(); + }, reset() { this.$refs.customerFrom.reset() }, @@ -307,9 +329,44 @@ closeScanPopup() { this.$refs.scanPopup.closeScanPopup(); }, + deviceClear(){ + this.deviceCode=""; + this.deviceCheckCode="" + }, showMessage(hint){ this.$refs.comMessage.showMessage("提示", hint) }, + onConfirmDevice(data){ + if(data==undefined||data==""){ + this.showMessage("请扫描设备编号") + return; + } + + uni.showLoading({ + title: "加载中", + mask: true + }) + getDeviceInfo(data).then(res => { + uni.hideLoading() + this.deviceCode = data; + this.deviceCheckCode = data; + console.log(data) + this.closeScanPopup(); + var groupSelect = { + Type: "4", + Content: "选择班组", + SelectName: "", + SelectValue: "", + } + this.dataList = res.Result; + this.dataList.push(groupSelect) + this.deviceName=this.dataList[0].Name; + this.dateTime = getCurrDateTime() + }).catch(error => { + uni.hideLoading() + this.showMessage(error) + }) + }, } } diff --git a/src/pages/foam/input.vue b/src/pages/foam/input.vue index e49c433..431baec 100644 --- a/src/pages/foam/input.vue +++ b/src/pages/foam/input.vue @@ -22,42 +22,50 @@ - - - + + + - + - + - + - - - + + + - + + - + - - - + + + - + + + + @@ -84,14 +92,14 @@ -