库位问题

master
hou 3 years ago
parent cad91590e2
commit e9b9c2b531

@ -36,11 +36,11 @@
<view class="number"> <view class="number">
<view class="number-left"> <view class="number-left">
<view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view> <view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view>
<u-input v-model="every.poAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding:'0';" /> <u-input v-model="every.poAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'" />
</view> </view>
<view class="number-right"> <view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view> <view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input placeholder=" " v-model="every.receiptAmount" :type="type" :border="border" style="padding:'0';" class="input" disabled /> <u-input placeholder=" " v-model="every.receiptAmount" :type="type" :border="border" style="padding: '0'" class="input" disabled />
</view> </view>
</view> </view>
<!-- 库位 --> <!-- 库位 -->
@ -121,6 +121,9 @@ export default class dnReceiptDom extends BasePage {
wlCode: any = ''; wlCode: any = '';
// //
async onLoad() { async onLoad() {
await this.QueryLoc();
}
async QueryLoc() {
// //
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = { let content = {
@ -140,7 +143,6 @@ export default class dnReceiptDom extends BasePage {
this.Location.push(pickerName); this.Location.push(pickerName);
}); });
this.wlCode = this.Location[0]; this.wlCode = this.Location[0];
console.log('库位列表', this.Location);
} }
// //
async query() { async query() {
@ -160,13 +162,29 @@ export default class dnReceiptDom extends BasePage {
this.every = this.material[0]; this.every = this.material[0];
} }
// receiptAmount requestAmount // receiptAmount requestAmount
materialChoice(e: any) { async materialChoice(e: any) {
this.material.forEach((item: any) => { this.material.forEach((item: any) => {
if (item.materialCode == e.pickerName.value) { if (item.materialCode == e.pickerName.value) {
this.every = item; this.every = item;
return; return;
} }
}); });
this.wlCode = {};
this.Location = [];
this.model.LoctionList.forEach((item: any) => {
if (item.sendSpot == this.every.sendSpot) {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
}
});
if (this.Location.length != 0) {
this.wlCode = this.Location[0];
} else {
await this.QueryLoc();
}
} }
// //
LocationChoice(e: any) { LocationChoice(e: any) {
@ -217,7 +235,7 @@ export default class dnReceiptDom extends BasePage {
} }
async bill() { async bill() {
if (this.form.documentNo == '') { if (this.form.documentNo == '') {
this.customToast(this.$t('message._tips6') as any) this.customToast(this.$t('message._tips6') as any);
return; return;
} }
let person = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); let person = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);

@ -36,11 +36,11 @@
<view class="number"> <view class="number">
<view class="number-left"> <view class="number-left">
<view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view> <view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view>
<u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding:'0';"/> <u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'" />
</view> </view>
<view class="number-right"> <view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view> <view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input placeholder=" " v-model="every.outAmount" :type="type" :border="border" class="input" style="padding:'0';" disabled /> <u-input placeholder=" " v-model="every.outAmount" :type="type" :border="border" class="input" style="padding: '0'" disabled />
</view> </view>
</view> </view>
<!-- 库位 --> <!-- 库位 -->
@ -94,7 +94,7 @@ import model from './model';
}) })
export default class dnReceiptDom extends BasePage { export default class dnReceiptDom extends BasePage {
model = model; model = model;
detailHeader = detailHeader detailHeader = detailHeader;
form: any = { form: any = {
documentNo: '', documentNo: '',
}; };
@ -110,13 +110,13 @@ export default class dnReceiptDom extends BasePage {
Loc: any = []; Loc: any = [];
// //
wlCode: any = ''; wlCode: any = '';
materialIndex:any = null materialIndex: any = null;
// //
async onReady() { async onReady() {
// //
// 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);
await this.QueryLoc() await this.QueryLoc();
} }
async QueryLoc() { async QueryLoc() {
let content = { let content = {
@ -154,17 +154,17 @@ export default class dnReceiptDom extends BasePage {
confirmText: this.$t('message.workArea_Confirm') as any, confirmText: this.$t('message.workArea_Confirm') as any,
success: async (res) => { success: async (res) => {
if (res.confirm) { if (res.confirm) {
await this.model.closeCode(this.form.documentNo) await this.model.closeCode(this.form.documentNo);
if (this.model.code == '1') { if (this.model.code == '1') {
this.customToast(this.$t('message.Warehouse_Tip9') as any); this.customToast(this.$t('message.Warehouse_Tip9') as any);
this.empty() this.empty();
this.form.documentNo == '' this.form.documentNo == '';
} }
} else if (res.cancel) { } else if (res.cancel) {
return return;
} }
} },
}) });
} }
// //
async query() { async query() {
@ -187,15 +187,15 @@ export default class dnReceiptDom extends BasePage {
this.materialList.push(pickerName); this.materialList.push(pickerName);
}); });
this.every = this.material[0]; this.every = this.material[0];
this.materialIndex = 0 this.materialIndex = 0;
} }
// receiptAmount requestAmount // receiptAmount requestAmount
materialChoice(e: any) { materialChoice(e: any) {
this.nowAmount = '' this.nowAmount = '';
this.material.forEach((item: any, index: any) => { this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.pickerName.value) { if (item.materialCode == e.pickerName.value) {
this.every = item; this.every = item;
this.materialIndex = index this.materialIndex = index;
return; return;
} }
}); });
@ -219,11 +219,11 @@ export default class dnReceiptDom extends BasePage {
return; return;
} }
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount); let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
this.list.forEach((item: any) => { // this.list.forEach((item: any) => {
if(item.materialCode == this.every.materialCode){ // if (item.materialCode == this.every.materialCode) {
num += parseFloat(item.nowAmount); // num += parseFloat(item.nowAmount);
} // }
}); // });
if (num > parseFloat(this.every.orderAmount)) { if (num > parseFloat(this.every.orderAmount)) {
uni.showModal({ uni.showModal({
title: this.$t('message.Pi_tip') as any, title: this.$t('message.Pi_tip') as any,
@ -241,8 +241,8 @@ export default class dnReceiptDom extends BasePage {
nowAmount: this.nowAmount, nowAmount: this.nowAmount,
}; };
this.list.push(arr); this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount) this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '' this.nowAmount = '';
} else if (res.cancel) { } else if (res.cancel) {
return; return;
} }
@ -258,8 +258,8 @@ export default class dnReceiptDom extends BasePage {
nowAmount: this.nowAmount, nowAmount: this.nowAmount,
}; };
this.list.push(arr); this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount) this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '' this.nowAmount = '';
} }
} }
deleteItem(e: any) { deleteItem(e: any) {
@ -269,19 +269,19 @@ export default class dnReceiptDom extends BasePage {
confirmText: this.$t('message.workArea_Confirm') as any, confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.list.splice(e.contentIndex,1) this.list.splice(e.contentIndex, 1);
let i:any let i: any;
this.material.forEach((item: any, index: any) => { this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.lineData.materialCode) { if (item.materialCode == e.lineData.materialCode) {
i = index i = index;
} }
}) });
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount) this.material[i].outAmount -= parseFloat(e.lineData.nowAmount);
} else if (res.cancel) { } else if (res.cancel) {
return return;
} }
} },
}) });
} }
async onSubmit() { async onSubmit() {
if (this.list == null || this.list.length == 0) { if (this.list == null || this.list.length == 0) {
@ -289,8 +289,8 @@ export default class dnReceiptDom extends BasePage {
} }
await this.model.submitOutsourcing(this.list); await this.model.submitOutsourcing(this.list);
await this.empty(); await this.empty();
await this.QueryLoc() await this.QueryLoc();
await this.query() await this.query();
} }
async bill() { async bill() {
if (this.form.documentNo == '') { if (this.form.documentNo == '') {

Loading…
Cancel
Save