|
|
|
|
@ -166,7 +166,12 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
pickerName.sendSpot = item.sendSpot;
|
|
|
|
|
this.Location.push(pickerName);
|
|
|
|
|
});
|
|
|
|
|
this.wl = this.Location[0];
|
|
|
|
|
this.Location.forEach((item, index) => {
|
|
|
|
|
if (item.label == '0011') {
|
|
|
|
|
this.wl = this.Location[index];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//this.wl = this.Location[0];
|
|
|
|
|
}
|
|
|
|
|
// 页面需要清空仓库,因此需要复用该方法
|
|
|
|
|
async initLocation(condition): Promise<LocationDetail[]> {
|
|
|
|
|
@ -278,20 +283,21 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
|
this.receiptAmount = '';
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
// 待放入新增中的公共对象
|
|
|
|
|
this.every = { ...e.pickerName };
|
|
|
|
|
//清空库位列表 避免库位重复添加
|
|
|
|
|
console.log('this.every', this.every);
|
|
|
|
|
this.Location = [];
|
|
|
|
|
//this.Location = [];
|
|
|
|
|
// 查询时初始化仓库
|
|
|
|
|
this.Location = await this.initLocation(this.every);
|
|
|
|
|
if (this.Location.length == 0) {
|
|
|
|
|
await this.queryLoction();
|
|
|
|
|
}
|
|
|
|
|
// this.Location = await this.initLocation(this.every);
|
|
|
|
|
// if (this.Location.length == 0) {
|
|
|
|
|
// await this.queryLoction();
|
|
|
|
|
// }
|
|
|
|
|
// 自动化流程改造测试
|
|
|
|
|
this.LocationChoice({
|
|
|
|
|
pickerName: this.Location.find(() => true),
|
|
|
|
|
});
|
|
|
|
|
// this.LocationChoice({
|
|
|
|
|
// pickerName: this.Location.find(() => true),
|
|
|
|
|
// });
|
|
|
|
|
this.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.poNo == this.every.poNo && item.materialCode == this.every.materialCode && item.poLine == this.every.poLine) {
|
|
|
|
|
this.everyIndex = index;
|
|
|
|
|
@ -362,6 +368,10 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.materialCode != this.every.materialCode) {
|
|
|
|
|
this.customToast(this.$t('message.isdeffrent') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
@ -432,13 +442,13 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
// 清空 add table
|
|
|
|
|
this.LocationList = [];
|
|
|
|
|
// 仓库
|
|
|
|
|
this.Location = [];
|
|
|
|
|
// this.Location = [];
|
|
|
|
|
this.poNo = '';
|
|
|
|
|
this.poList = [];
|
|
|
|
|
// 清空 当前选择的库位对象
|
|
|
|
|
this.wl = {
|
|
|
|
|
value: null,
|
|
|
|
|
};
|
|
|
|
|
// this.wl = {
|
|
|
|
|
// value: null,
|
|
|
|
|
// };
|
|
|
|
|
// 清空 物料对象
|
|
|
|
|
this.every = {};
|
|
|
|
|
// 清空 原始物料列表
|
|
|
|
|
@ -455,12 +465,12 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.Container = {};
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
this.LocationList = [];
|
|
|
|
|
this.Location = [];
|
|
|
|
|
//this.Location = [];
|
|
|
|
|
this.poNo = '';
|
|
|
|
|
this.poList = [];
|
|
|
|
|
this.wl = {
|
|
|
|
|
value: null,
|
|
|
|
|
};
|
|
|
|
|
// this.wl = {
|
|
|
|
|
// value: null,
|
|
|
|
|
// };
|
|
|
|
|
this.every = {};
|
|
|
|
|
this.materialList = [];
|
|
|
|
|
this.receiptAmount = null;
|
|
|
|
|
@ -476,11 +486,62 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
}, time);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
// checknumber(arr: any = {}) {
|
|
|
|
|
// var map = {},
|
|
|
|
|
// dest = [];
|
|
|
|
|
// for (var i = 0; i < arr.length; i++) {
|
|
|
|
|
// var ai = arr[i];
|
|
|
|
|
// if (!map[ai.id]) {
|
|
|
|
|
// dest.push({
|
|
|
|
|
// id: ai.id,
|
|
|
|
|
// name: ai.name,
|
|
|
|
|
// value: ai.value,
|
|
|
|
|
// });
|
|
|
|
|
// map[ai.id] = ai;
|
|
|
|
|
// } else {
|
|
|
|
|
// for (var j = 0; j < dest.length; j++) {
|
|
|
|
|
// var dj = dest[j];
|
|
|
|
|
// if (dj.id == ai.id) {
|
|
|
|
|
// dj.value = (parseFloat(dj.value) + parseFloat(ai.value)).toString();
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// console.log(dest);
|
|
|
|
|
// }
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
if (this.LocationList.length === 0) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips5') as any);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
//this.checknumber(this.LocationList);
|
|
|
|
|
let materialCodeListarr = [];
|
|
|
|
|
this.DNReceivingList.forEach((item) => {
|
|
|
|
|
if (parseFloat(item.receiptAmount) < parseFloat(item.requestAmount)) {
|
|
|
|
|
materialCodeListarr.push(item.materialCode);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (materialCodeListarr.length != 0) {
|
|
|
|
|
let materialCodeListString = materialCodeListarr.toString();
|
|
|
|
|
//this.customToast((materialCodeListString + this.$t('message.Notcompleted')) as any);
|
|
|
|
|
this.uni.showModal({
|
|
|
|
|
content: (materialCodeListString + this.$t('message.Notcompleted')) as any,
|
|
|
|
|
showCancel: false,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
//console.log('继续执行!')
|
|
|
|
|
this.realysubmit();
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
//console.log('继续执行!')
|
|
|
|
|
this.realysubmit();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async realysubmit() {
|
|
|
|
|
//console.log('继续执行!');
|
|
|
|
|
await this.model.submitOrderInEnter(this.DNReceivingList);
|
|
|
|
|
if (this.model.SubmitCode == '1') {
|
|
|
|
|
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
|
|
|
|
|
|