|
|
|
@ -49,6 +49,7 @@
|
|
|
|
<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 v-model="every.receiptAmount" :placeholder="$t('message.po_PleaseInput')" :type="type" :border="border" class="input" disabled />
|
|
|
|
<u-input v-model="every.receiptAmount" :placeholder="$t('message.po_PleaseInput')" :type="type" :border="border" class="input" disabled />
|
|
|
|
|
|
|
|
<!-- <u-input v-model="allNum" :placeholder="$t('message.po_PleaseInput')" :type="type" :border="border" class="input" disabled /> -->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 库位 -->
|
|
|
|
<!-- 库位 -->
|
|
|
|
@ -108,13 +109,12 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
materialList: any = [];
|
|
|
|
materialList: any = [];
|
|
|
|
// 当前被选择中原材料
|
|
|
|
// 当前被选择中原材料
|
|
|
|
every: any = {};
|
|
|
|
every: any = {};
|
|
|
|
|
|
|
|
everyIndex: any = '';
|
|
|
|
value = '';
|
|
|
|
value = '';
|
|
|
|
headers = headers;
|
|
|
|
headers = headers;
|
|
|
|
type = 'text';
|
|
|
|
type = 'text';
|
|
|
|
//要提交的数据
|
|
|
|
//要提交的数据
|
|
|
|
DNReceivingList: any = [];
|
|
|
|
DNReceivingList: any = [];
|
|
|
|
//下标
|
|
|
|
|
|
|
|
DNReceivingListIndex: any = null;
|
|
|
|
|
|
|
|
border = true;
|
|
|
|
border = true;
|
|
|
|
//本次数量
|
|
|
|
//本次数量
|
|
|
|
receiptAmount: any = '';
|
|
|
|
receiptAmount: any = '';
|
|
|
|
@ -172,11 +172,16 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
title: this.$t('message.successful') as any,
|
|
|
|
title: this.$t('message.successful') as any,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log('orderInInfoList', this.model.orderInInfoList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let list: any = localStorage.getItem('list');
|
|
|
|
let list: any = localStorage.getItem('list');
|
|
|
|
localStorage.removeItem('list');
|
|
|
|
localStorage.removeItem('list');
|
|
|
|
this.material = JSON.parse(list);
|
|
|
|
this.material = JSON.parse(list);
|
|
|
|
this.poList = [...this.material]; //结构
|
|
|
|
this.DNReceivingList = JSON.parse(list);
|
|
|
|
|
|
|
|
this.DNReceivingList.forEach((item: any) => {
|
|
|
|
|
|
|
|
item.wllist = [];
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.poList = [...this.DNReceivingList]; //结构
|
|
|
|
let arr = this.removeDuplicates(this.poList, 'poNo');
|
|
|
|
let arr = this.removeDuplicates(this.poList, 'poNo');
|
|
|
|
// 组装下拉结构
|
|
|
|
// 组装下拉结构
|
|
|
|
arr.forEach((item: any) => {
|
|
|
|
arr.forEach((item: any) => {
|
|
|
|
@ -211,6 +216,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择采购单后触发的回调事件
|
|
|
|
//选择采购单后触发的回调事件
|
|
|
|
poListChoice(e: any) {
|
|
|
|
poListChoice(e: any) {
|
|
|
|
|
|
|
|
this.receiptAmount = '';
|
|
|
|
this.poNo = e.pickerName.value;
|
|
|
|
this.poNo = e.pickerName.value;
|
|
|
|
// 过滤重复物料
|
|
|
|
// 过滤重复物料
|
|
|
|
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
|
|
|
|
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
|
|
|
|
@ -229,9 +235,11 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
|
|
|
|
this.receiptAmount = '';
|
|
|
|
// 待放入新增中的公共对象
|
|
|
|
// 待放入新增中的公共对象
|
|
|
|
this.every = { ...e.pickerName };
|
|
|
|
this.every = { ...e.pickerName };
|
|
|
|
//清空库位列表 避免库位重复添加
|
|
|
|
//清空库位列表 避免库位重复添加
|
|
|
|
|
|
|
|
console.log('this.every', this.every);
|
|
|
|
this.Location = [];
|
|
|
|
this.Location = [];
|
|
|
|
// 查询时初始化仓库
|
|
|
|
// 查询时初始化仓库
|
|
|
|
this.Location = await this.initLocation(this.every);
|
|
|
|
this.Location = await this.initLocation(this.every);
|
|
|
|
@ -240,6 +248,13 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
this.LocationChoice({
|
|
|
|
this.LocationChoice({
|
|
|
|
pickerName: this.Location.find(() => true),
|
|
|
|
pickerName: this.Location.find(() => true),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
|
|
|
|
if (item.poNo == this.every.poNo && item.materialCode == this.every.materialCode && item.poLine == this.every.poLine) {
|
|
|
|
|
|
|
|
this.everyIndex = index;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.every = this.DNReceivingList[this.everyIndex];
|
|
|
|
|
|
|
|
console.log('this.every', this.every);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择库位后触发的回调事件
|
|
|
|
//选择库位后触发的回调事件
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
@ -247,7 +262,8 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//点击添加
|
|
|
|
//点击添加
|
|
|
|
Add() {
|
|
|
|
Add() {
|
|
|
|
const count = this.totalLocation(this.LocationList);
|
|
|
|
// const count = this.totalLocation(this.LocationList);
|
|
|
|
|
|
|
|
const count = parseFloat(this.every.requestAmount);
|
|
|
|
if (this.receiptAmount == '' || !this.wl.value) {
|
|
|
|
if (this.receiptAmount == '' || !this.wl.value) {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
@ -262,73 +278,66 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parseFloat(this.receiptAmount) > this.every.requestAmount || +this.receiptAmount + count > this.every.requestAmount) {
|
|
|
|
if (parseFloat(this.receiptAmount) > count || parseFloat(this.receiptAmount) + parseFloat(this.every.receiptAmount) > count) {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
title: this.$t('message.Commission_tips4') as any,
|
|
|
|
title: this.$t('message.Commission_tips4') as any,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.LocationList.push({
|
|
|
|
let isTrue = true;
|
|
|
|
...this.every,
|
|
|
|
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
|
|
|
|
wlCode: this.wl.label,
|
|
|
|
if (item.wlCode == this.wl.label && item.receiptAmount == this.receiptAmount) {
|
|
|
|
receiptAmount: this.receiptAmount,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.every.wllist = [];
|
|
|
|
|
|
|
|
if (this.DNReceivingList.length == 0) {
|
|
|
|
|
|
|
|
this.DNReceivingList.push(this.every);
|
|
|
|
|
|
|
|
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
let isTrue: any = false;
|
|
|
|
|
|
|
|
let wllistIsTrue: any = false;
|
|
|
|
|
|
|
|
this.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
|
|
|
|
if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
|
|
|
|
|
|
|
|
isTrue = true;
|
|
|
|
|
|
|
|
this.DNReceivingListIndex = index;
|
|
|
|
|
|
|
|
item.wllist.forEach((item: any) => {
|
|
|
|
|
|
|
|
if (item.poNo == this.LocationList.poNo || item.poLine == this.LocationList.poLine || item.materialCode == this.LocationList.materialCode || item.wlCode == this.LocationList.wlCode || item.receiptAmount == this.LocationList.receiptAmount) {
|
|
|
|
|
|
|
|
wllistIsTrue = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (isTrue == false) {
|
|
|
|
|
|
|
|
this.DNReceivingList.push(this.every);
|
|
|
|
|
|
|
|
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isTrue == true || wllistIsTrue == true) {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
icon: 'none',
|
|
|
|
title: this.$t('message.repeatedly') as any,
|
|
|
|
title: this.$t('message.repeatedly') as any,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return (isTrue = false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isTrue == true || wllistIsTrue == false) {
|
|
|
|
});
|
|
|
|
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
if (isTrue == true) {
|
|
|
|
}
|
|
|
|
this.LocationList.push({
|
|
|
|
isTrue = false;
|
|
|
|
...this.every,
|
|
|
|
wllistIsTrue = false;
|
|
|
|
receiptAmount: this.receiptAmount,
|
|
|
|
|
|
|
|
wlCode: this.wl.label,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.DNReceivingList[this.everyIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
|
|
|
let num: any = 0;
|
|
|
|
|
|
|
|
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
|
|
|
|
|
|
|
|
num += parseFloat(item.receiptAmount);
|
|
|
|
|
|
|
|
item.wllist = null;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.DNReceivingList[this.everyIndex].receiptAmount = num;
|
|
|
|
|
|
|
|
this.receiptAmount = '';
|
|
|
|
|
|
|
|
this.every = this.DNReceivingList[this.everyIndex];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.receiptAmount = '';
|
|
|
|
|
|
|
|
this.business();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deleteItem(e: any) {
|
|
|
|
deleteItem(e: any) {
|
|
|
|
console.log('data', e.lineData);
|
|
|
|
|
|
|
|
uni.showModal({
|
|
|
|
uni.showModal({
|
|
|
|
title: this.$t('message.delete') as any,
|
|
|
|
content: this.$t('message.product_Delete') as string,
|
|
|
|
cancelText: this.$t('message.Cancel') as any,
|
|
|
|
cancelText: this.$t('message.Cancel') as string,
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as any,
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as string,
|
|
|
|
success: (res) => {
|
|
|
|
success: (res) => {
|
|
|
|
if (res.confirm) {
|
|
|
|
if (res.confirm) {
|
|
|
|
this.DNReceivingList.forEach((item: any) => {
|
|
|
|
this.LocationList.splice(e.contentIndex, 1);
|
|
|
|
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
|
|
|
|
let externalIndex: number = 0;
|
|
|
|
item.wllist.forEach((item: any, index: any) => {
|
|
|
|
this.DNReceivingList.forEach((item: any, index: any) => {
|
|
|
|
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode || item.wlCode == e.lineData.wlCode || item.receiptAmount == e.lineData.receiptAmount) {
|
|
|
|
if (item.poNo == e.lineData.poNo && item.materialCode == e.lineData.materialCode && item.poLine == e.lineData.poLine) {
|
|
|
|
item.wllist.splice(index, 1);
|
|
|
|
externalIndex = index;
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.LocationList.splice(e.contentIndex, 1);
|
|
|
|
let inside: number = 0;
|
|
|
|
|
|
|
|
this.DNReceivingList[externalIndex].wllist.forEach((item: any, index: any) => {
|
|
|
|
|
|
|
|
if (item.receiptAmount == e.lineData.receiptAmount && item.wlCode == e.lineData.wlCode) {
|
|
|
|
|
|
|
|
inside = index;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.DNReceivingList[externalIndex].wllist.splice(inside, 1);
|
|
|
|
|
|
|
|
let num: number = 0;
|
|
|
|
|
|
|
|
this.DNReceivingList[externalIndex].wllist.forEach((item: any) => {
|
|
|
|
|
|
|
|
num += parseFloat(item.receiptAmount);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.DNReceivingList[externalIndex].receiptAmount = num;
|
|
|
|
} else if (res.cancel) {
|
|
|
|
} else if (res.cancel) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -354,7 +363,6 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
// this.material = [];
|
|
|
|
// this.material = [];
|
|
|
|
// 清空 去重后的物料列表
|
|
|
|
// 清空 去重后的物料列表
|
|
|
|
this.materialList = [];
|
|
|
|
this.materialList = [];
|
|
|
|
|
|
|
|
|
|
|
|
// 清空 当前累计数量
|
|
|
|
// 清空 当前累计数量
|
|
|
|
this.receiptAmount = null;
|
|
|
|
this.receiptAmount = null;
|
|
|
|
this.DNReceivingList = [];
|
|
|
|
this.DNReceivingList = [];
|
|
|
|
@ -368,12 +376,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let obj = {
|
|
|
|
await this.model.submitOrderInEnter(this.DNReceivingList);
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
|
|
|
list: this.DNReceivingList,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
await this.model.submitOrderInEnter(obj);
|
|
|
|
|
|
|
|
this.resetForm();
|
|
|
|
this.resetForm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async bill() {
|
|
|
|
async bill() {
|
|
|
|
@ -392,10 +395,6 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
await this.model.querydetaildlist(content);
|
|
|
|
await this.model.querydetaildlist(content);
|
|
|
|
this.toPage(this.page.raw.ingoods.dnReceipt.Local);
|
|
|
|
this.toPage(this.page.raw.ingoods.dnReceipt.Local);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//添加和删除操作的时候 计算累计收货数量
|
|
|
|
|
|
|
|
business() {
|
|
|
|
|
|
|
|
this.every.receiptAmount = this.totalLocation(this.LocationList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|