|
|
|
@ -79,7 +79,7 @@
|
|
|
|
|
<view class="config">
|
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="Tabheaders" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
@ -104,7 +104,7 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import model from './model';
|
|
|
|
|
import LocationDetail from './model.location';
|
|
|
|
|
import { headers } from './config';
|
|
|
|
|
import { Tabheaders } from './config';
|
|
|
|
|
import { url } from '@/utils/url';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
@ -124,7 +124,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
every: any = {};
|
|
|
|
|
everyIndex: any = '';
|
|
|
|
|
value = '';
|
|
|
|
|
headers = headers;
|
|
|
|
|
Tabheaders = Tabheaders;
|
|
|
|
|
type = 'text';
|
|
|
|
|
//要提交的数据
|
|
|
|
|
DNReceivingList: any = [];
|
|
|
|
@ -314,25 +314,20 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!this.every) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
productCode: this.every.materialCode,
|
|
|
|
|
barcode: this.Barcode,
|
|
|
|
|
dnNo: this.form.documentNo,
|
|
|
|
|
poNo: this.poNo,
|
|
|
|
|
poLine: this.every.poLine,
|
|
|
|
|
materialCode: this.every.materialCode,
|
|
|
|
|
palletCode: this.Barcode,
|
|
|
|
|
};
|
|
|
|
|
console.log('params', params);
|
|
|
|
|
await this.model.searchBarcode(params);
|
|
|
|
|
this.Container = this.model.ContainerCode;
|
|
|
|
|
// let num = 0;
|
|
|
|
|
// if (this.LocationList.length != 0) {
|
|
|
|
|
// this.LocationList.forEach((item: any) => {
|
|
|
|
|
// if (item.palletCode == this.Container.barcode) {
|
|
|
|
|
// num += parseFloat(item.receiptAmount);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
this.receiptAmount = parseFloat(this.Container.qty);
|
|
|
|
|
} else {
|
|
|
|
|
this.receiptAmount = parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//点击添加
|
|
|
|
|
Add() {
|
|
|
|
@ -340,6 +335,10 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.scanningContainer') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!this.Container.palletCode) {
|
|
|
|
|
this.customToast(this.$t('message.scanningContainer') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const count = parseFloat(this.every.requestAmount);
|
|
|
|
|
if (this.receiptAmount == '' || !this.wl.value) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips2') as any);
|
|
|
|
@ -353,27 +352,10 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (this.Container.cpRef4 == null) {
|
|
|
|
|
// if (num + parseFloat(this.receiptAmount) > parseFloat(this.Container.qty)) {
|
|
|
|
|
// this.customToast(this.$t('message.dn_Tip') as any);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (num + parseFloat(this.receiptAmount) > parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4)) {
|
|
|
|
|
// this.customToast(this.$t('message.dn_Tip') as any);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
// this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
|
|
|
|
|
// if (item.materialCode == this.every.materialCode && item.wlCode == this.wl.label) {
|
|
|
|
|
// this.customToast(this.$t('message.repeatedly') as any);
|
|
|
|
|
// return (isTrue = false);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
if (item.palletCode == this.Container.barcode) {
|
|
|
|
|
if (item.palletCode == this.Container.palletCode) {
|
|
|
|
|
this.customToast(this.$t('message.repeatedly') as any);
|
|
|
|
|
return (isTrue = false);
|
|
|
|
|
}
|
|
|
|
@ -384,8 +366,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
...this.every,
|
|
|
|
|
receiptAmount: this.receiptAmount,
|
|
|
|
|
wlCode: this.wl.label,
|
|
|
|
|
// palletCode: this.Container.barcode,
|
|
|
|
|
palletCode: this.Barcode,
|
|
|
|
|
palletCode: this.Container.palletCode,
|
|
|
|
|
});
|
|
|
|
|
this.DNReceivingList[this.everyIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
|
|
|
|
|
console.log('3 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[this.everyIndex].wllist);
|
|
|
|
@ -459,6 +440,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
await this.query();
|
|
|
|
|
}
|
|
|
|
|
empty() {
|
|
|
|
|
this.Container = {};
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
this.LocationList = [];
|
|
|
|
|
this.Location = [];
|
|
|
|
|