From 6dd2ced16064bbd9a11fbef86897eb90efc62df1 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Wed, 3 Jul 2024 13:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4=E5=90=8E?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=AE=A1=E5=88=92=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manifest.json | 4 +-- src/pages/foam/upLink.vue | 47 +++++++++++++++++++++++------ src/pages/plastics/plasticsGood.vue | 42 ++++++++++++++++++++++---- 3 files changed, 76 insertions(+), 17 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index 97b1f16..810ea11 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "投入产出", "appid" : "__UNI__37328FF", "description" : "", - "versionName" : "1.0.3", - "versionCode" : 3, + "versionName" : "1.0.5", + "versionCode" : 5, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/src/pages/foam/upLink.vue b/src/pages/foam/upLink.vue index 2fda90b..f2fe4b2 100644 --- a/src/pages/foam/upLink.vue +++ b/src/pages/foam/upLink.vue @@ -152,14 +152,8 @@ } console.log("提交", JSON.stringify(param)) - upLickSubmit(param).then(res => { - uni.hideLoading() - uni.showToast({ - title: '提交成功', - }); - // this.showMessage("提交成功") - this.resetData() + this.setPlanNumber() }).catch(error => { uni.hideLoading() this.showMessage(error) @@ -170,10 +164,45 @@ }) }, - resetData() { + + setPlanNumber(){ + getUpLinkPlaneNumberList().then(res => { + uni.hideLoading() + uni.showToast({ + title: '提交成功', + }); + if (res.Result.length > 0) { + var list = []; + list = res.Result; + list.forEach(res => { + res.label = res.PLAN_NO; + res.value = res.SHIFT_CODE + }) + var item = list.filter(r=>r.label==this.planNumber) + if(item.length==0){ + this.resetData(true); + }else { + this.resetData(false) + } + } else { + this.resetData(true); + } + + }).catch(error => { + this.resetData(true); + uni.hideLoading() + this.showMessage(error) + }) + }, + + resetData(clearNumber) { + if(clearNumber){ + this.planNumber="" + }else { + this.$refs.inputScan.focused = true + } this.scanCode = "" this.scanCheckCode = "" - this.$refs.inputScan.focused = true }, clearCode() { this.scanCode = ""; diff --git a/src/pages/plastics/plasticsGood.vue b/src/pages/plastics/plasticsGood.vue index 42bfd2b..dadd4cd 100644 --- a/src/pages/plastics/plasticsGood.vue +++ b/src/pages/plastics/plasticsGood.vue @@ -154,27 +154,57 @@ } console.log("提交", JSON.stringify(param)) - upLickSubmit(param).then(res => { + this.setPlanNumber() + }).catch(error => { + uni.hideLoading() + this.showMessage(error) + }) + }, + + setPlanNumber(){ + getPlasticsGoodPlaneNumberList().then(res => { uni.hideLoading() uni.showToast({ title: '提交成功', }); - this.resetData() + if (res.Result.length > 0) { + var list = []; + list = res.Result; + list.forEach(res => { + res.label = res.PLAN_NO; + res.value = res.SHIFT_CODE + }) + var item = list.filter(r=>r.label==this.planNumber) + if(item.length==0){ + this.resetData(true); + }else { + this.resetData(false) + } + } else { + this.resetData(true); + } + }).catch(error => { + this.resetData(true); uni.hideLoading() this.showMessage(error) }) }, + showMessage(hint) { showConfirmMsg("提示", hint, false, callBack => { }) }, - resetData() { - this.scanCode ="" - this.scanCheckCode="" - this.$refs.inputScan.focused = true + resetData(clearNumber) { + if(clearNumber){ + this.planNumber="" + }else { + this.$refs.inputScan.focused = true + } + this.scanCode = "" + this.scanCheckCode = "" }, clearCode() { this.scanCode = "";