diff --git a/src/pages/raw/commission/entrant/index.vue b/src/pages/raw/commission/entrant/index.vue index 99bbf22..c4e5368 100644 --- a/src/pages/raw/commission/entrant/index.vue +++ b/src/pages/raw/commission/entrant/index.vue @@ -36,11 +36,11 @@ {{ $t('message.CommissionedDemandData') }} - + {{ $t('message.Cumulative') }} - + @@ -121,6 +121,9 @@ export default class dnReceiptDom extends BasePage { wlCode: any = ''; //页面初始化 async onLoad() { + await this.QueryLoc(); + } + async QueryLoc() { //页面初始化 获取可选库位 let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); let content = { @@ -140,7 +143,6 @@ export default class dnReceiptDom extends BasePage { this.Location.push(pickerName); }); this.wlCode = this.Location[0]; - console.log('库位列表', this.Location); } //输入单号 查询数据 async query() { @@ -160,13 +162,29 @@ export default class dnReceiptDom extends BasePage { this.every = this.material[0]; } //选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount - materialChoice(e: any) { + async materialChoice(e: any) { this.material.forEach((item: any) => { if (item.materialCode == e.pickerName.value) { this.every = item; return; } }); + this.wlCode = {}; + this.Location = []; + this.model.LoctionList.forEach((item: any) => { + if (item.sendSpot == this.every.sendSpot) { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + this.Location.push(pickerName); + } + }); + if (this.Location.length != 0) { + this.wlCode = this.Location[0]; + } else { + await this.QueryLoc(); + } } //选择库位后触发的回调事件 LocationChoice(e: any) { @@ -217,7 +235,7 @@ export default class dnReceiptDom extends BasePage { } async bill() { if (this.form.documentNo == '') { - this.customToast(this.$t('message._tips6') as any) + this.customToast(this.$t('message._tips6') as any); return; } let person = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); diff --git a/src/pages/raw/commission/goOut/index.vue b/src/pages/raw/commission/goOut/index.vue index e5043db..cc1b5d3 100644 --- a/src/pages/raw/commission/goOut/index.vue +++ b/src/pages/raw/commission/goOut/index.vue @@ -36,11 +36,11 @@ {{ $t('message.CommissionedDemandData') }} - + {{ $t('message.Cumulative') }} - + @@ -94,7 +94,7 @@ import model from './model'; }) export default class dnReceiptDom extends BasePage { model = model; - detailHeader = detailHeader + detailHeader = detailHeader; form: any = { documentNo: '', }; @@ -110,15 +110,15 @@ export default class dnReceiptDom extends BasePage { Loc: any = []; //所选择的库位 wlCode: any = ''; - materialIndex:any = null + materialIndex: any = null; //页面初始化 async onReady() { //页面初始化 获取可选库位 // let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); //let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); - await this.QueryLoc() + await this.QueryLoc(); } - async QueryLoc(){ + async QueryLoc() { let content = { loginName: session.loginName, //sendSpot: sendSpot, @@ -143,28 +143,28 @@ export default class dnReceiptDom extends BasePage { this.materialList = []; this.Loc = []; } - async close(){ + async close() { if (this.form.documentNo == '') { this.customToast(this.$t('message.Commission_tips1') as any); return; } uni.showModal({ - content:this.$t('message.closing') as any, - cancelText:this.$t('message.product_Cancel') as any, - confirmText:this.$t('message.workArea_Confirm') as any, - success:async (res) =>{ - if(res.confirm){ - await this.model.closeCode(this.form.documentNo) - if(this.model.code == '1'){ + content: this.$t('message.closing') as any, + cancelText: this.$t('message.product_Cancel') as any, + confirmText: this.$t('message.workArea_Confirm') as any, + success: async (res) => { + if (res.confirm) { + await this.model.closeCode(this.form.documentNo); + if (this.model.code == '1') { this.customToast(this.$t('message.Warehouse_Tip9') as any); - this.empty() - this.form.documentNo == '' + this.empty(); + this.form.documentNo == ''; } - }else if(res.cancel){ - return + } else if (res.cancel) { + return; } - } - }) + }, + }); } //输入单号 查询数据 async query() { @@ -187,15 +187,15 @@ export default class dnReceiptDom extends BasePage { this.materialList.push(pickerName); }); this.every = this.material[0]; - this.materialIndex = 0 + this.materialIndex = 0; } //选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount materialChoice(e: any) { - this.nowAmount = '' - this.material.forEach((item: any,index:any) => { + this.nowAmount = ''; + this.material.forEach((item: any, index: any) => { if (item.materialCode == e.pickerName.value) { this.every = item; - this.materialIndex = index + this.materialIndex = index; return; } }); @@ -219,11 +219,11 @@ export default class dnReceiptDom extends BasePage { return; } let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount); - this.list.forEach((item: any) => { - if(item.materialCode == this.every.materialCode){ - num += parseFloat(item.nowAmount); - } - }); + // this.list.forEach((item: any) => { + // if (item.materialCode == this.every.materialCode) { + // num += parseFloat(item.nowAmount); + // } + // }); if (num > parseFloat(this.every.orderAmount)) { uni.showModal({ title: this.$t('message.Pi_tip') as any, @@ -241,8 +241,8 @@ export default class dnReceiptDom extends BasePage { nowAmount: this.nowAmount, }; this.list.push(arr); - this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount) - this.nowAmount = '' + this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount); + this.nowAmount = ''; } else if (res.cancel) { return; } @@ -250,38 +250,38 @@ export default class dnReceiptDom extends BasePage { }); } else { let arr = { - poNo: this.form.documentNo, - materialCode: this.every.materialCode, - loginName: this.session.loginName, - factoryCode: this.session.factoryCode, - wlCode: this.wlCode.label, - nowAmount: this.nowAmount, + poNo: this.form.documentNo, + materialCode: this.every.materialCode, + loginName: this.session.loginName, + factoryCode: this.session.factoryCode, + wlCode: this.wlCode.label, + nowAmount: this.nowAmount, }; this.list.push(arr); - this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount) - this.nowAmount = '' + this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount); + this.nowAmount = ''; } } deleteItem(e: any) { uni.showModal({ - content:this.$t('message.product_Delete') as any, - cancelText:this.$t('message.Cancel') as any, - confirmText:this.$t('message.workArea_Confirm') as any, - success:(res) =>{ - if(res.confirm){ - this.list.splice(e.contentIndex,1) - let i:any - this.material.forEach((item:any,index:any) =>{ - if(item.materialCode == e.lineData.materialCode){ - i = index + content: this.$t('message.product_Delete') as any, + cancelText: this.$t('message.Cancel') as any, + confirmText: this.$t('message.workArea_Confirm') as any, + success: (res) => { + if (res.confirm) { + this.list.splice(e.contentIndex, 1); + let i: any; + this.material.forEach((item: any, index: any) => { + if (item.materialCode == e.lineData.materialCode) { + i = index; } - }) - this.material[i].outAmount -= parseFloat(e.lineData.nowAmount) - }else if(res.cancel){ - return + }); + this.material[i].outAmount -= parseFloat(e.lineData.nowAmount); + } else if (res.cancel) { + return; } - } - }) + }, + }); } async onSubmit() { if (this.list == null || this.list.length == 0) { @@ -289,8 +289,8 @@ export default class dnReceiptDom extends BasePage { } await this.model.submitOutsourcing(this.list); await this.empty(); - await this.QueryLoc() - await this.query() + await this.QueryLoc(); + await this.query(); } async bill() { if (this.form.documentNo == '') {