cosmoim-852 fix 俄罗斯新增委外出库&&DN收货逻辑优化

master
hou 3 years ago
parent 3622c2cc5f
commit 9914874d0b

@ -54,6 +54,13 @@
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="nowAmount" type="number" :border="border" class="input" />
</view>
</view>
<!-- 容器编码 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.Container') }}:</view>
<u-search :placeholder="$t('message.PleaseScan')" style="z-index: 10000" v-model="Barcode" @search="searchBarcode" :show-action="false"></u-search>
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
@ -111,6 +118,8 @@ export default class dnReceiptDom extends BasePage {
//
wlCode: any = '';
materialIndex: any = null;
Barcode: any = '';
Container: any = '';
async QueryLoc() {
await this.model.queryItemLoc({
workArea: session.workareaCode,
@ -139,6 +148,8 @@ export default class dnReceiptDom extends BasePage {
this.every = '';
this.materialList = [];
this.Loc = [];
this.Barcode = '';
this.Container = '';
}
async close() {
if (this.form.documentNo == '') {
@ -202,8 +213,55 @@ export default class dnReceiptDom extends BasePage {
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
async searchBarcode() {
if (this.Barcode == '') {
this.customToast(this.$t('message.barcode') as string);
return;
}
let params = {
productCode: this.every.materialCode,
barcode: this.Barcode,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
this.nowAmount = this.Container.qty;
}
//
Add() {
// if (this.Container == '') {
// this.customToast(this.$t('message.scanningContainer') as any);
// return;
// }
// if (this.Container.cpRef4 == null) {
// if (parseFloat(this.nowAmount) > this.Container.qty) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// } else {
// if (parseFloat(this.nowAmount) > this.Container.qty - parseFloat(this.Container.cpRef4)) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// }
// let codenum: number = 0;
// if (this.list.length != 0) {
// this.list.forEach((item: any) => {
// if (item.barCode == this.Container.barcode) {
// num += item.receiptAmount;
// }
// });
// }
// if (this.Container.cpRef4 == null) {
// if (parseFloat(this.nowAmount) + codenum > this.Container.qty) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// } else {
// if (parseFloat(this.nowAmount) + codenum > this.Container.qty - parseFloat(this.Container.cpRef4)) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// }
if (!this.every) {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
@ -232,6 +290,8 @@ export default class dnReceiptDom extends BasePage {
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
// barCode: this.Container.barcode,
barCode: this.Barcode,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
@ -249,6 +309,8 @@ export default class dnReceiptDom extends BasePage {
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
// barCode: this.Container.barcode,
barCode: this.Barcode,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
@ -478,11 +540,14 @@ export default class dnReceiptDom extends BasePage {
.add {
width: 100%;
height: 100rpx;
position: relative;
position: absolute;
top: 349px;
left: 0;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
top: 3rpx;
right: 35rpx;
z-index: 10000;
}
}
}

@ -183,7 +183,7 @@ export class ReturningModule extends VuexModule {
@Action
async submitOutsourcing(upload: any) {
const res = await http.post(url.outbound.stoOutbound.materialComplete, upload);
const res = await http.post(url.outbound.stoOutbound.materialCompleteRussia, upload);
return res;
}
//查询明细
@ -194,6 +194,19 @@ export class ReturningModule extends VuexModule {
this.detailedList = res.data;
return res;
}
ContainerCode: any = '';
@MutationAction
async searchBarcode(params: any) {
const res: any = await http.post(url.auth.query.barcode, {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: params.barcode,
productCode: params.productCode,
// locCode: params.locCode,
});
const ContainerCode = res.data;
return { ContainerCode };
}
}
export default getModule(ReturningModule);

@ -305,12 +305,12 @@ export default class dnReceiptDom extends BasePage {
return;
}
let isTrue = true;
// this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
// if (item.wlCode == this.wl.label && item.receiptAmount == this.receiptAmount) {
// this.customToast(this.$t('message.repeatedly') as any);
// return (isTrue = false);
// }
// });
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
if (item.wlCode == this.wl.label && item.materialCode == this.every.materialCode) {
this.customToast(this.$t('message.repeatedly') as any);
return (isTrue = false);
}
});
if (isTrue == true) {
this.LocationList.push({
...this.every,

@ -307,6 +307,12 @@ export default class dnReceiptDom extends BasePage {
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 (isTrue == true) {
this.LocationList.push({
...this.every,
@ -314,6 +320,7 @@ export default class dnReceiptDom extends BasePage {
wlCode: this.wl.label,
});
this.DNReceivingList[this.everyIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('3 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[this.everyIndex].wllist);
let num: any = 0;
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
@ -344,7 +351,9 @@ export default class dnReceiptDom extends BasePage {
inside = index;
}
});
console.log('1 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[externalIndex].wllist);
this.DNReceivingList[externalIndex].wllist.splice(inside, 1);
console.log('2 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[externalIndex].wllist);
let num = 0;
this.DNReceivingList[externalIndex].wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);

@ -146,6 +146,7 @@ export const url = {
subcDnInfo: '/wmspda/material/orderin/subcDnInfo',
submit: '/wmspda/material/outsourcing/into/materialComplete',
materialComplete: '/wmspda/material/outsourcing/materialComplete',
materialCompleteRussia: '/wmspda/material/outsourcing/materialComplete/russia',
outsourcingQueryOrder: '/wmspda/material/outsourcing/queryOrder',
getDetailByorderNo: '/wmspda/fg/queryListInfoByDnNo',
scanBarcodeDN: '/wmspda/fg/scanBarcodeDN/del',

Loading…
Cancel
Save