cosmoim-852 fix 委外入库逻辑调整

master
hou 3 years ago
parent ae0879f2f8
commit 534cc882e8

@ -398,28 +398,43 @@ export default class dnReceiptDom extends BasePage {
this.customToast(this.$t('message.Commission_tips5') as any);
return null;
}
await this.model.submitOrderInEnter(this.DNReceivingList);
if (this.model.SubmitCode == '1') {
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
uni.request({
url: ServeUrl.server.address + url.material.DNorderin.subcDnInfo,
method: 'POST',
data: {
dnNo: this.form.documentNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
},
success: (res: any) => {
console.log(res.data);
if (res.data.code != '0' && res.data.list != null) {
// this.empty();
this.resetForm();
} else if (res.data.code == '0' && res.data.list == null) {
this.empty();
this.form.documentNo = '';
}
},
});
let isTrue = true;
this.DNReceivingList.forEach((item: any) => {
if (item.wllist.length != 0) {
let num = 0;
item.wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});
if (num != parseFloat(item.requestAmount)) {
this.customToast(this.$t('message.Pi_tip15') as any);
return (isTrue = false);
}
}
});
if (isTrue) {
await this.model.submitOrderInEnter(this.DNReceivingList);
if (this.model.SubmitCode == '1') {
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
uni.request({
url: ServeUrl.server.address + url.material.DNorderin.subcDnInfo,
method: 'POST',
data: {
dnNo: this.form.documentNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
},
success: (res: any) => {
console.log(res.data);
if (res.data.code != '0' && res.data.list != null) {
// this.empty();
this.resetForm();
} else if (res.data.code == '0' && res.data.list == null) {
this.empty();
this.form.documentNo = '';
}
},
});
}
}
}
async bill() {

@ -109,12 +109,12 @@ export default class dnReceiptDom extends BasePage {
}
current = 0;
items = [this.$t('message.POPlan'), this.$t('message.WPMInformation')];
onClickItem(e: any) {
onClickItem(e: any): void {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
}
async Submit() {
async Submit(): Promise<void> {
if (!this.containerCode) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;

Loading…
Cancel
Save