|
|
@ -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 == '') {
|
|
|
|