master
hou 3 years ago
parent e788d96728
commit bc6b90259b

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

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

Loading…
Cancel
Save