|
|
|
@ -123,6 +123,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
every: any = {};
|
|
|
|
|
value = '';
|
|
|
|
|
type = 'text';
|
|
|
|
|
DNReceivingListIndex: any = null;
|
|
|
|
|
border = true;
|
|
|
|
|
//本次数量
|
|
|
|
|
receiptAmount: any = '';
|
|
|
|
@ -140,6 +141,8 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
requestAmount: number = null;
|
|
|
|
|
|
|
|
|
|
async onReady() {
|
|
|
|
|
this.model.DNReceivingList = [];
|
|
|
|
|
this.resetForm();
|
|
|
|
|
//this.initLocation();
|
|
|
|
|
}
|
|
|
|
|
// 页面初始化
|
|
|
|
@ -177,7 +180,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.queryOrderInInfo(this.form.documentNo);
|
|
|
|
|
await this.model.queryOrderInInfo(this.form.documentNo.trim());
|
|
|
|
|
if (model.code == '1') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
@ -248,6 +251,21 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
|
// 待放入新增中的公共对象
|
|
|
|
|
this.every = { ...e.pickerName };
|
|
|
|
|
if (this.DNReceivingListIndex == null) {
|
|
|
|
|
this.model.DNReceivingList.push(this.every);
|
|
|
|
|
}
|
|
|
|
|
this.model.DNReceivingList.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.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
|
|
|
|
|
this.model.DNReceivingList.push(this.every);
|
|
|
|
|
this.DNReceivingListIndex = index + 1;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
|
|
|
|
|
//清空库位列表 避免库位重复添加
|
|
|
|
|
this.Location = [];
|
|
|
|
|
// 查询时初始化仓库
|
|
|
|
@ -289,24 +307,37 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
// 判断已添加库位和新添加库位是否相同,不相同return
|
|
|
|
|
let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
|
|
|
|
|
|
|
|
|
|
if (isTrue) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message._tips5') as any,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (isTrue) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// title: this.$t('message._tips5') as any,
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
this.LocationList.push({
|
|
|
|
|
...this.every,
|
|
|
|
|
wlCode: this.wl.label,
|
|
|
|
|
receiptAmount: this.receiptAmount,
|
|
|
|
|
});
|
|
|
|
|
this.model.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList);
|
|
|
|
|
this.receiptAmount = '';
|
|
|
|
|
isTrue = true;
|
|
|
|
|
// this.addition();
|
|
|
|
|
this.business();
|
|
|
|
|
}
|
|
|
|
|
deleteItem(index: any) {
|
|
|
|
|
this.LocationList.splice(index, 1);
|
|
|
|
|
deleteItem(indexItem: any) {
|
|
|
|
|
let Item: any = {};
|
|
|
|
|
this.model.DNReceivingList.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);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.LocationList.splice(indexItem, 1);
|
|
|
|
|
this.business();
|
|
|
|
|
// guoshuang 删除成功提示
|
|
|
|
|
uni.showToast({
|
|
|
|
@ -346,11 +377,33 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
this.every.wllist = this.LocationList;
|
|
|
|
|
console.log('new this.every :::: ', this.every);
|
|
|
|
|
await this.model.submitOrderInEnter([this.every]);
|
|
|
|
|
await this.model.submitOrderInEnter(this.model.DNReceivingList);
|
|
|
|
|
this.resetForm();
|
|
|
|
|
}
|
|
|
|
|
addition() {
|
|
|
|
|
if (this.model.DNReceivingList.length != 0) {
|
|
|
|
|
let whether: any = false;
|
|
|
|
|
let nnum: any;
|
|
|
|
|
this.model.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.poLine == this.every.poLine || item.sendSpot == this.every.sendSpot || item.materialCode == this.every.materialCode) {
|
|
|
|
|
whether = true;
|
|
|
|
|
nnum = index;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log('nnum', nnum);
|
|
|
|
|
if (whether == true) {
|
|
|
|
|
this.model.DNReceivingList[nnum].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
} else {
|
|
|
|
|
this.every.wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
this.model.DNReceivingList.push(this.every);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.model.DNReceivingList.length == 0) {
|
|
|
|
|
this.model.DNReceivingList.push(this.every);
|
|
|
|
|
}
|
|
|
|
|
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
|
|
|
|
|
}
|
|
|
|
|
async bill() {
|
|
|
|
|
if (this.form.documentNo == '') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|