master
hou 3 years ago
parent 245525ee79
commit 2a3d62282e

@ -152,7 +152,11 @@ export default class dnReceiptDom extends BasePage {
}
//
async query() {
this.empty();
this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
if (this.form.documentNo == '') {
uni.showToast({
icon: 'none',

@ -567,7 +567,7 @@ export default class dnReceiptDom extends BasePage {
line-height: 100rpx;
}
.search {
padding-left: 1px;
padding-left: 20px;
}
}
.library-right {

@ -7,6 +7,11 @@ export const headers = [
label: vm.$t('message.Line'),
key: 'poLine',
},
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo',
width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode',

@ -49,6 +49,7 @@
<view class="number-right">
<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="allNum" :placeholder="$t('message.po_PleaseInput')" :type="type" :border="border" class="input" disabled /> -->
</view>
</view>
<!-- 库位 -->
@ -113,6 +114,7 @@ export default class dnReceiptDom extends BasePage {
type = 'text';
//
DNReceivingList: any = [];
allNum: any = 0;
//
DNReceivingListIndex: any = null;
border = true;
@ -211,6 +213,7 @@ export default class dnReceiptDom extends BasePage {
}
//
poListChoice(e: any) {
this.receiptAmount = '';
this.poNo = e.pickerName.value;
//
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
@ -229,8 +232,15 @@ export default class dnReceiptDom extends BasePage {
}
// receiptAmount requestAmount
async materialChoice(e: any) {
this.receiptAmount = '';
//
this.every = { ...e.pickerName };
this.LocationList.forEach((item: any) => {
if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
this.every.receiptAmount += parseFloat(item.receiptAmount);
}
});
this.every.wllist = [];
//
this.Location = [];
//
@ -247,7 +257,9 @@ export default class dnReceiptDom extends BasePage {
}
//
Add() {
const count = this.totalLocation(this.LocationList);
// const count = this.totalLocation(this.LocationList);
const count = parseFloat(this.every.requestAmount);
console.log('count', count);
if (this.receiptAmount == '' || !this.wl.value) {
uni.showToast({
icon: 'none',
@ -262,11 +274,13 @@ export default class dnReceiptDom extends BasePage {
});
return;
}
if (parseFloat(this.receiptAmount) > this.every.requestAmount || +this.receiptAmount + count > this.every.requestAmount) {
if (parseFloat(this.receiptAmount) > this.every.requestAmount || parseFloat(this.receiptAmount) + parseFloat(this.every.receiptAmount) > count) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips4') as any,
});
console.log('2333');
console.log('parseFloat(this.every.this.receiptAmount)', this.receiptAmount + parseFloat(this.every.receiptAmount));
return;
}
this.LocationList.push({
@ -274,39 +288,64 @@ export default class dnReceiptDom extends BasePage {
wlCode: this.wl.label,
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 {
if (this.DNReceivingList.length != 0) {
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) {
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;
}
});
}
});
console.log('isTrue', isTrue);
if (isTrue == true) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.forEach((item: any) => {
if (item.poNo == this.LocationList[this.LocationList.length - 1].poNo && item.poLine == this.LocationList[this.LocationList.length - 1].poLine && item.materialCode == this.LocationList[this.LocationList.length - 1].materialCode && item.wlCode == this.LocationList[this.LocationList.length - 1].wlCode && item.receiptAmount == this.LocationList[this.LocationList.length - 1].receiptAmount) {
wllistIsTrue = true;
}
});
console.log('wllistIsTrue', wllistIsTrue);
}
console.log(1);
if (isTrue == false) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == true) {
uni.showToast({
icon: 'none',
title: this.$t('message.repeatedly') as any,
});
// this.LocationList.splice(this.LocationList[this.LocationList.length - 1], 1);
this.LocationList.pop();
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == false) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
isTrue = false;
wllistIsTrue = false;
this.DNReceivingListIndex = null;
}
if (this.DNReceivingList.length == 0) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
this.DNReceivingListIndex = null;
}
this.receiptAmount = '';
this.business();
@ -324,13 +363,13 @@ export default class dnReceiptDom extends BasePage {
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
DNIndex = index;
item.wllist.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) {
nemIndex = index;
this.DNReceivingList[DNIndex].wllist.splice(nemIndex, 1);
}
});
}
this.DNReceivingList[DNIndex].wllist.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) {
nemIndex = index;
this.DNReceivingList[DNIndex].wllist.splice(nemIndex, 1);
}
});
});
this.LocationList.splice(e.contentIndex, 1);
} else if (res.cancel) {
@ -372,12 +411,7 @@ export default class dnReceiptDom extends BasePage {
});
return null;
}
let obj = {
factoryCode: this.session.factoryCode,
loginName: this.session.loginName,
list: this.DNReceivingList,
};
await this.model.submitOrderInEnter(obj);
await this.model.submitOrderInEnter(this.DNReceivingList);
this.resetForm();
}
async bill() {
@ -399,6 +433,7 @@ export default class dnReceiptDom extends BasePage {
//
business() {
this.every.receiptAmount = this.totalLocation(this.LocationList);
console.log('this.every.receiptAmount', this.every.receiptAmount);
}
}
</script>
@ -571,7 +606,7 @@ export default class dnReceiptDom extends BasePage {
line-height: 100rpx;
}
.search {
padding-left: 1px;
padding-left: 20px;
}
}
.library-right {

Loading…
Cancel
Save