master
hou 3 years ago
parent e788d96728
commit bc6b90259b

@ -134,6 +134,7 @@ export default class dnReceiptDom extends BasePage {
newLocation: any = []; newLocation: any = [];
// //
LocationList: any = []; LocationList: any = [];
DNReceivingListIndex: any = null;
// //
wl: any = { wl: any = {
value: null, value: null,
@ -251,6 +252,20 @@ export default class dnReceiptDom extends BasePage {
materialChoice(e: any) { materialChoice(e: any) {
// //
this.every = { ...e.pickerName }; this.every = { ...e.pickerName };
if (this.DNReceivingListIndex == null) {
this.model.ImportDNReceivingList.push(this.every);
}
this.model.ImportDNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
this.DNReceivingListIndex = index;
}
});
this.model.ImportDNReceivingList.forEach((item: any, index: any) => {
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
this.model.ImportDNReceivingList.push(this.every);
this.DNReceivingListIndex = index + 1;
}
});
this.newLocation = []; this.newLocation = [];
this.newLocation = this.Location.filter((item: any) => item.sendSpot === this.every.sendSpot); this.newLocation = this.Location.filter((item: any) => item.sendSpot === this.every.sendSpot);
console.log('newLoction', this.newLocation); console.log('newLoction', this.newLocation);
@ -303,15 +318,27 @@ export default class dnReceiptDom extends BasePage {
wlCode: this.wl.label, wlCode: this.wl.label,
receiptAmount: this.receiptAmount, receiptAmount: this.receiptAmount,
}); });
this.model.ImportDNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList);
// //
this.receiptAmount = ''; this.receiptAmount = '';
//true //true
isTrue = true; isTrue = true;
this.business(); this.business();
} }
deleteItem(index: any) { deleteItem(indexItem: any) {
let Item: any = {};
this.model.ImportDNReceivingList.forEach((item: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
Item = item;
}
});
Item.wllist.forEach((item: any, index: any) => {
if (item.poLine == this.LocationList[indexItem].poLine || item.materialCode == this.LocationList[indexItem].materialCode || item.dnNo == this.LocationList[indexItem].dnNo) {
Item.wllist.splice(index, 1);
}
});
//splice //splice
this.LocationList.splice(index, 1); this.LocationList.splice(indexItem, 1);
this.business(); this.business();
// guoshuang // guoshuang
uni.showToast({ uni.showToast({
@ -351,7 +378,7 @@ export default class dnReceiptDom extends BasePage {
} }
// //
this.every.wllist = this.LocationList; this.every.wllist = this.LocationList;
await this.model.submitOrderInEnter([this.every]); await this.model.submitOrderInEnter(this.model.ImportDNReceivingList);
this.resetForm(); this.resetForm();
} }
async bill() { async bill() {

@ -36,6 +36,7 @@ export class ReceiptModule extends VuexModule {
code = ''; code = '';
DNdetailedList: any; DNdetailedList: any;
DNReceivingList: any = []; DNReceivingList: any = [];
ImportDNReceivingList: any = [];
/** /**
* *
*/ */

Loading…
Cancel
Save