From 28533103f6bdb000825bc7999077f3fd92149804 Mon Sep 17 00:00:00 2001 From: hou <1601990943@qq.com> Date: Fri, 18 Feb 2022 14:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/raw/ingoods/dnReceipt/ImportDN.vue | 34 ++++++++++++++--- .../raw/ingoods/dnReceipt/dnReceiving.vue | 38 +++++++++++++++---- 2 files changed, 60 insertions(+), 12 deletions(-) diff --git a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue index eb9ea74..a05732d 100644 --- a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue +++ b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue @@ -130,6 +130,28 @@ export default class dnReceiptDom extends BasePage { // 需求数量 requestAmount: number = null; // 页面初始化 + async onReady() { + await this.queryLoction(); + } + async queryLoction() { + this.Location = []; + let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); + let content = { + loginName: session.loginName, + sendSpot: sendSpot, + factoryCode: session.factoryCode, + workArea: session.workareaCode, + }; + let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); + res.forEach((item: LocationDetail) => { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + this.Location.push(pickerName); + }); + this.wl = this.Location[0]; + } // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { console.log('condition>>>>>>>>>>>>>>>>>>.', condition); @@ -158,16 +180,16 @@ export default class dnReceiptDom extends BasePage { } //输入单号 查询数据 async query() { - this.empty() + this.empty(); if (!this.form.documentNo) { this.customToast(this.$t('message.Commission_tips1') as any); return; } await this.model.ImportQueryOrderInfo(this.form.documentNo); if (model.code == '1') { - if(this.model.orderInInfoList.length == 0){ - this.empty() - return + if (this.model.orderInInfoList.length == 0) { + this.empty(); + return; } uni.showToast({ icon: 'success', @@ -242,7 +264,9 @@ export default class dnReceiptDom extends BasePage { this.Location = []; // 查询时初始化仓库 this.Location = await this.initLocation(this.every); - + if (this.Location.length == 0) { + await this.queryLoction(); + } // 自动化流程改造测试 this.LocationChoice({ pickerName: this.Location.find(() => true), diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index dc48428..5b7c4df 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -131,6 +131,28 @@ export default class dnReceiptDom extends BasePage { // 需求数量 requestAmount: number = null; // 页面初始化 + async onReady() { + await this.queryLoction(); + } + async queryLoction() { + this.Location = []; + let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); + let content = { + loginName: session.loginName, + sendSpot: sendSpot, + factoryCode: session.factoryCode, + workArea: session.workareaCode, + }; + let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); + res.forEach((item: LocationDetail) => { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + this.Location.push(pickerName); + }); + this.wl = this.Location[0]; + } // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { console.log('condition>>>>>>>>>>>>>>>>>>.', condition); @@ -159,16 +181,16 @@ export default class dnReceiptDom extends BasePage { } //输入单号 查询数据 async query() { - this.empty() + this.empty(); if (!this.form.documentNo) { this.customToast(this.$t('message.Commission_tips1') as any); return; } await this.model.queryOrderInInfo(this.form.documentNo); if (model.code == '1') { - if(this.model.orderInInfoList.length == 0){ - this.empty() - return + if (this.model.orderInInfoList.length == 0) { + this.empty(); + return; } uni.showToast({ icon: 'success', @@ -179,7 +201,7 @@ export default class dnReceiptDom extends BasePage { this.material = JSON.parse(list); this.DNReceivingList = JSON.parse(list); this.DNReceivingList.forEach((item: any) => { - item.wllist = []; + item.wllist = []; }); this.poList = [...this.DNReceivingList]; //结构 let arr = this.removeDuplicates(this.poList, 'poNo'); @@ -243,7 +265,9 @@ export default class dnReceiptDom extends BasePage { this.Location = []; // 查询时初始化仓库 this.Location = await this.initLocation(this.every); - + if (this.Location.length == 0) { + await this.queryLoction(); + } // 自动化流程改造测试 this.LocationChoice({ pickerName: this.Location.find(() => true), @@ -375,7 +399,7 @@ export default class dnReceiptDom extends BasePage { return null; } await this.model.submitOrderInEnter(this.DNReceivingList); - if(this.model.SubmitCode == '1'){ + if (this.model.SubmitCode == '1') { this.resetForm(); } }