fix:优化库位获取逻辑、优化提交后表单重置逻辑;

master
zhoulei 4 years ago
parent 60af1f19fd
commit 31b98f80ba

@ -78,7 +78,6 @@ export default {
handler() { handler() {
this.selByValKey(); this.selByValKey();
}, },
deep: true,
}, },
}, },
mounted() { mounted() {

@ -134,8 +134,13 @@ export default class dnReceiptDom extends BasePage {
poNo: any = null; poNo: any = null;
// //
requestAmount: number = null; requestAmount: number = null;
//
async onReady() { async onReady() {
// this.initLocation();
}
//
//
async initLocation() {
// //
let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
@ -156,13 +161,15 @@ export default class dnReceiptDom extends BasePage {
} }
// //
async query() { async query() {
if (this.form.documentNo == '') { if (!this.form.documentNo) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips1') as any, title: this.$t('message.Commission_tips1') as any,
}); });
return; return;
} }
//
this.initLocation();
await this.model.queryOrderInInfo(this.form.documentNo); await this.model.queryOrderInInfo(this.form.documentNo);
let list: any = localStorage.getItem('list'); let list: any = localStorage.getItem('list');
localStorage.removeItem('list'); localStorage.removeItem('list');
@ -264,21 +271,29 @@ export default class dnReceiptDom extends BasePage {
} }
// //
resetForm() { resetForm() {
this.form.documentNo = '';
// add table // add table
this.LocationList = []; this.LocationList = [];
//
this.Location = [];
this.poNo = ''; this.poNo = '';
this.poList = [];
// //
this.wl = { this.wl = {
value: null, value: null,
}; };
// //
this.every = {}; this.every = {};
//
// this.material = [];
// //
this.materialList = []; this.materialList = [];
// //
this.receiptAmount = null; this.receiptAmount = null;
} }
async onSubmit() { async onSubmit() {
this.resetForm();
if (this.LocationList.length === 0) { if (this.LocationList.length === 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -287,6 +302,7 @@ export default class dnReceiptDom extends BasePage {
return null; return null;
} }
this.every.wllist = this.LocationList; this.every.wllist = this.LocationList;
console.log('new this.every :::: ', this.every);
await this.model.submitOrderInEnter([this.every]); await this.model.submitOrderInEnter([this.every]);
this.resetForm(); this.resetForm();
} }

Loading…
Cancel
Save