guoshuang 3 years ago
commit cad91590e2

@ -130,6 +130,28 @@ export default class dnReceiptDom extends BasePage {
// //
requestAmount: number = null; requestAmount: number = null;
// //
async onReady() {
await this.queryLoction();
}
async queryLoction() {
this.Location = [];
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = {
loginName: session.loginName,
sendSpot: sendSpot,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: LocationDetail) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.wl = this.Location[0];
}
// //
async initLocation(condition): Promise<LocationDetail[]> { async initLocation(condition): Promise<LocationDetail[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition); console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
@ -158,16 +180,16 @@ export default class dnReceiptDom extends BasePage {
} }
// //
async query() { async query() {
this.empty() this.empty();
if (!this.form.documentNo) { if (!this.form.documentNo) {
this.customToast(this.$t('message.Commission_tips1') as any); this.customToast(this.$t('message.Commission_tips1') as any);
return; return;
} }
await this.model.ImportQueryOrderInfo(this.form.documentNo); await this.model.ImportQueryOrderInfo(this.form.documentNo);
if (model.code == '1') { if (model.code == '1') {
if(this.model.orderInInfoList.length == 0){ if (this.model.orderInInfoList.length == 0) {
this.empty() this.empty();
return return;
} }
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
@ -242,7 +264,9 @@ export default class dnReceiptDom extends BasePage {
this.Location = []; this.Location = [];
// //
this.Location = await this.initLocation(this.every); this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
// //
this.LocationChoice({ this.LocationChoice({
pickerName: this.Location.find(() => true), pickerName: this.Location.find(() => true),

@ -131,6 +131,28 @@ export default class dnReceiptDom extends BasePage {
// //
requestAmount: number = null; requestAmount: number = null;
// //
async onReady() {
await this.queryLoction();
}
async queryLoction() {
this.Location = [];
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = {
loginName: session.loginName,
sendSpot: sendSpot,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: LocationDetail) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.wl = this.Location[0];
}
// //
async initLocation(condition): Promise<LocationDetail[]> { async initLocation(condition): Promise<LocationDetail[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition); console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
@ -159,16 +181,16 @@ export default class dnReceiptDom extends BasePage {
} }
// //
async query() { async query() {
this.empty() this.empty();
if (!this.form.documentNo) { if (!this.form.documentNo) {
this.customToast(this.$t('message.Commission_tips1') as any); this.customToast(this.$t('message.Commission_tips1') as any);
return; return;
} }
await this.model.queryOrderInInfo(this.form.documentNo); await this.model.queryOrderInInfo(this.form.documentNo);
if (model.code == '1') { if (model.code == '1') {
if(this.model.orderInInfoList.length == 0){ if (this.model.orderInInfoList.length == 0) {
this.empty() this.empty();
return return;
} }
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
@ -243,7 +265,9 @@ export default class dnReceiptDom extends BasePage {
this.Location = []; this.Location = [];
// //
this.Location = await this.initLocation(this.every); this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
// //
this.LocationChoice({ this.LocationChoice({
pickerName: this.Location.find(() => true), pickerName: this.Location.find(() => true),
@ -375,7 +399,7 @@ export default class dnReceiptDom extends BasePage {
return null; return null;
} }
await this.model.submitOrderInEnter(this.DNReceivingList); await this.model.submitOrderInEnter(this.DNReceivingList);
if(this.model.SubmitCode == '1'){ if (this.model.SubmitCode == '1') {
this.resetForm(); this.resetForm();
} }
} }

Loading…
Cancel
Save