guoshuang 3 years ago
commit cad91590e2

@ -130,6 +130,28 @@ export default class dnReceiptDom extends BasePage {
//
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[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
@ -158,16 +180,16 @@ export default class dnReceiptDom extends BasePage {
}
//
async query() {
this.empty()
this.empty();
if (!this.form.documentNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.ImportQueryOrderInfo(this.form.documentNo);
if (model.code == '1') {
if(this.model.orderInInfoList.length == 0){
this.empty()
return
if (this.model.orderInInfoList.length == 0) {
this.empty();
return;
}
uni.showToast({
icon: 'success',
@ -242,7 +264,9 @@ export default class dnReceiptDom extends BasePage {
this.Location = [];
//
this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
//
this.LocationChoice({
pickerName: this.Location.find(() => true),

@ -131,6 +131,28 @@ export default class dnReceiptDom extends BasePage {
//
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[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
@ -159,16 +181,16 @@ export default class dnReceiptDom extends BasePage {
}
//
async query() {
this.empty()
this.empty();
if (!this.form.documentNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.queryOrderInInfo(this.form.documentNo);
if (model.code == '1') {
if(this.model.orderInInfoList.length == 0){
this.empty()
return
if (this.model.orderInInfoList.length == 0) {
this.empty();
return;
}
uni.showToast({
icon: 'success',
@ -179,7 +201,7 @@ export default class dnReceiptDom extends BasePage {
this.material = JSON.parse(list);
this.DNReceivingList = JSON.parse(list);
this.DNReceivingList.forEach((item: any) => {
item.wllist = [];
item.wllist = [];
});
this.poList = [...this.DNReceivingList]; //
let arr = this.removeDuplicates(this.poList, 'poNo');
@ -243,7 +265,9 @@ export default class dnReceiptDom extends BasePage {
this.Location = [];
//
this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
//
this.LocationChoice({
pickerName: this.Location.find(() => true),
@ -375,7 +399,7 @@ export default class dnReceiptDom extends BasePage {
return null;
}
await this.model.submitOrderInEnter(this.DNReceivingList);
if(this.model.SubmitCode == '1'){
if (this.model.SubmitCode == '1') {
this.resetForm();
}
}

Loading…
Cancel
Save