|
|
|
@ -78,7 +78,7 @@
|
|
|
|
|
<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="detailHeader" :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="RUSdetailHeader" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<div class="extra">
|
|
|
|
@ -128,7 +128,7 @@ import model from './model';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
import { detailHeader } from './config';
|
|
|
|
|
import { RUSdetailHeader } from './config';
|
|
|
|
|
import { auth } from '@/store/modules/auth';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
@ -159,6 +159,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
Location: any = [];
|
|
|
|
|
someIndex = 0;
|
|
|
|
|
some: any = {};
|
|
|
|
|
Container: any = {};
|
|
|
|
|
qty: any = '';
|
|
|
|
|
form: any = {
|
|
|
|
|
documentNo: '',
|
|
|
|
@ -171,7 +172,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
|
|
|
|
|
};
|
|
|
|
|
detailHeader = detailHeader;
|
|
|
|
|
RUSdetailHeader = RUSdetailHeader;
|
|
|
|
|
sapSupplyIdList: any = [];
|
|
|
|
|
// async onReady() {
|
|
|
|
|
// let content = {
|
|
|
|
@ -213,6 +214,8 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.materialList = [];
|
|
|
|
|
this.model.blDetailList.length = 0;
|
|
|
|
|
this.LocationList = [];
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
this.Container = {};
|
|
|
|
|
}
|
|
|
|
|
async back() {
|
|
|
|
|
if (this.sapSupplyIdList.length != 0) {
|
|
|
|
@ -232,7 +235,6 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.sapSupplyIdList = [];
|
|
|
|
|
}
|
|
|
|
|
this.LocEmpty();
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
let inPrdOrderList = this.form.documentNo.split(',');
|
|
|
|
|
let params = {
|
|
|
|
|
inPrdOrderList,
|
|
|
|
@ -248,24 +250,9 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
item.wlList = [];
|
|
|
|
|
this.sapSupplyIdList.push(item.sapSupplyId);
|
|
|
|
|
});
|
|
|
|
|
console.log('this.sapSupplyIdList', this.sapSupplyIdList);
|
|
|
|
|
this.some = this.model.blDetailList[0];
|
|
|
|
|
this.someIndex = 0;
|
|
|
|
|
});
|
|
|
|
|
await this.model.queryItemLoc({
|
|
|
|
|
workArea: session.workareaCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
sendSpot: null,
|
|
|
|
|
materialCode: this.some.materialCode,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
});
|
|
|
|
|
if (this.model.LocList.length != 0) {
|
|
|
|
|
this.Location = [];
|
|
|
|
|
this.Location = this.model.LocList;
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
} else {
|
|
|
|
|
console.log('1');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
|
this.model.blDetailList.forEach((item: any, index: any) => {
|
|
|
|
@ -309,7 +296,32 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.barcode') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.materialList.length == 0) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.searchBarcode(this.Barcode);
|
|
|
|
|
this.Container = this.model.ContainerCode;
|
|
|
|
|
let arr = {
|
|
|
|
|
label: this.Container.locCode,
|
|
|
|
|
value: this.Container.locCode + '(' + this.Container.sendSpot + ')',
|
|
|
|
|
sendSpot: this.Container.sendSpot,
|
|
|
|
|
};
|
|
|
|
|
this.Location.push(arr);
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
if (item.barcode == this.Container.barcode) {
|
|
|
|
|
num += parseFloat(item.qty);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
this.qty = parseFloat(this.Container.qty) - num;
|
|
|
|
|
} else {
|
|
|
|
|
this.qty = parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4) - num;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Add() {
|
|
|
|
|
if (this.qty == '' || this.wlCode == '') {
|
|
|
|
@ -332,6 +344,33 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Container == '' || this.Container.barcode.length == 0) {
|
|
|
|
|
this.customToast(this.$t('message.scanningContainer') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.some == {}) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let CodeNum = 0;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
if (item.barcode == this.Container.barcode) {
|
|
|
|
|
CodeNum += parseFloat(item.qty);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
if (parseFloat(this.qty) > parseFloat(this.Container.qty) - CodeNum) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (parseFloat(this.qty) > parseFloat(this.Container.qty) - CodeNum - parseFloat(this.Container.cpRef4)) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
|
|
|
|
@ -341,15 +380,12 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.some == {}) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isTrue == true) {
|
|
|
|
|
let arr = {
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
qty: this.qty,
|
|
|
|
|
Code: this.wlCode.sendSpot,
|
|
|
|
|
barcode: this.Container.barcode,
|
|
|
|
|
...this.some,
|
|
|
|
|
};
|
|
|
|
|
this.LocationList.push(arr);
|
|
|
|
|