库位问题

master
hou 3 years ago
parent cad91590e2
commit e9b9c2b531

@ -36,11 +36,11 @@
<view class="number">
<view class="number-left">
<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 class="number-right">
<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>
<!-- 库位 -->
@ -121,6 +121,9 @@ export default class dnReceiptDom extends BasePage {
wlCode: any = '';
//
async onLoad() {
await this.QueryLoc();
}
async QueryLoc() {
//
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = {
@ -140,7 +143,6 @@ export default class dnReceiptDom extends BasePage {
this.Location.push(pickerName);
});
this.wlCode = this.Location[0];
console.log('库位列表', this.Location);
}
//
async query() {
@ -160,13 +162,29 @@ export default class dnReceiptDom extends BasePage {
this.every = this.material[0];
}
// receiptAmount requestAmount
materialChoice(e: any) {
async materialChoice(e: any) {
this.material.forEach((item: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
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) {
@ -217,7 +235,7 @@ export default class dnReceiptDom extends BasePage {
}
async bill() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message._tips6') as any)
this.customToast(this.$t('message._tips6') as any);
return;
}
let person = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);

@ -36,11 +36,11 @@
<view class="number">
<view class="number-left">
<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 class="number-right">
<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>
<!-- 库位 -->
@ -94,7 +94,7 @@ import model from './model';
})
export default class dnReceiptDom extends BasePage {
model = model;
detailHeader = detailHeader
detailHeader = detailHeader;
form: any = {
documentNo: '',
};
@ -110,15 +110,15 @@ export default class dnReceiptDom extends BasePage {
Loc: any = [];
//
wlCode: any = '';
materialIndex:any = null
materialIndex: any = null;
//
async onReady() {
//
// let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
//let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
await this.QueryLoc()
await this.QueryLoc();
}
async QueryLoc(){
async QueryLoc() {
let content = {
loginName: session.loginName,
//sendSpot: sendSpot,
@ -143,28 +143,28 @@ export default class dnReceiptDom extends BasePage {
this.materialList = [];
this.Loc = [];
}
async close(){
async close() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
uni.showModal({
content:this.$t('message.closing') as any,
cancelText:this.$t('message.product_Cancel') as any,
confirmText:this.$t('message.workArea_Confirm') as any,
success:async (res) =>{
if(res.confirm){
await this.model.closeCode(this.form.documentNo)
if(this.model.code == '1'){
content: this.$t('message.closing') as any,
cancelText: this.$t('message.product_Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: async (res) => {
if (res.confirm) {
await this.model.closeCode(this.form.documentNo);
if (this.model.code == '1') {
this.customToast(this.$t('message.Warehouse_Tip9') as any);
this.empty()
this.form.documentNo == ''
this.empty();
this.form.documentNo == '';
}
}else if(res.cancel){
return
} else if (res.cancel) {
return;
}
}
})
},
});
}
//
async query() {
@ -187,15 +187,15 @@ export default class dnReceiptDom extends BasePage {
this.materialList.push(pickerName);
});
this.every = this.material[0];
this.materialIndex = 0
this.materialIndex = 0;
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.nowAmount = ''
this.material.forEach((item: any,index:any) => {
this.nowAmount = '';
this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
this.materialIndex = index
this.materialIndex = index;
return;
}
});
@ -219,11 +219,11 @@ export default class dnReceiptDom extends BasePage {
return;
}
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
this.list.forEach((item: any) => {
if(item.materialCode == this.every.materialCode){
num += parseFloat(item.nowAmount);
}
});
// this.list.forEach((item: any) => {
// if (item.materialCode == this.every.materialCode) {
// num += parseFloat(item.nowAmount);
// }
// });
if (num > parseFloat(this.every.orderAmount)) {
uni.showModal({
title: this.$t('message.Pi_tip') as any,
@ -241,8 +241,8 @@ export default class dnReceiptDom extends BasePage {
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount)
this.nowAmount = ''
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
} else if (res.cancel) {
return;
}
@ -250,38 +250,38 @@ export default class dnReceiptDom extends BasePage {
});
} else {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount)
this.nowAmount = ''
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
}
}
deleteItem(e: any) {
uni.showModal({
content:this.$t('message.product_Delete') as any,
cancelText:this.$t('message.Cancel') as any,
confirmText:this.$t('message.workArea_Confirm') as any,
success:(res) =>{
if(res.confirm){
this.list.splice(e.contentIndex,1)
let i:any
this.material.forEach((item:any,index:any) =>{
if(item.materialCode == e.lineData.materialCode){
i = index
content: this.$t('message.product_Delete') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
this.list.splice(e.contentIndex, 1);
let i: any;
this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.lineData.materialCode) {
i = index;
}
})
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount)
}else if(res.cancel){
return
});
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount);
} else if (res.cancel) {
return;
}
}
})
},
});
}
async onSubmit() {
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.empty();
await this.QueryLoc()
await this.query()
await this.QueryLoc();
await this.query();
}
async bill() {
if (this.form.documentNo == '') {

Loading…
Cancel
Save