diff --git a/src/pages/raw/commission/RUS-entrant/index.vue b/src/pages/raw/commission/RUS-entrant/index.vue index ac643a8..1413ad0 100644 --- a/src/pages/raw/commission/RUS-entrant/index.vue +++ b/src/pages/raw/commission/RUS-entrant/index.vue @@ -306,29 +306,24 @@ export default class dnReceiptDom extends BasePage { } //扫描容器码 async searchBarcode() { + if (!this.every) { + this.customToast(this.$t('message.Warehouse_Tip6') as string); + return; + } if (this.Barcode == '') { this.customToast(this.$t('message.barcode') as string); return; } let params = { - productCode: this.every.materialCode, - barcode: this.Barcode, - // locCode: this.Some.originWl, + dnNo: this.form.documentNo, + poNo: this.poNo, + poLine: this.every.poLine, + materialCode: this.every.materialCode, + palletCode: this.Barcode, }; await this.model.searchBarcode(params); this.Container = this.model.ContainerCode; - if (this.Container.cpRef4 == null) { - this.receiptAmount = this.Container.qty; - } else { - this.receiptAmount = this.Container.qty - this.Container.cpRef4; - } - // let arr = { - // label: this.Container.locCode, - // value: this.Container.locCode + '(' + this.Container.sendSpot + ')', - // sendSpot: this.Container.sendSpot, - // }; - // this.Location.push(arr); - // this.wl = this.Location[0]; + this.receiptAmount = this.Container.requestAmount; } //点击添加 Add() { @@ -336,40 +331,26 @@ export default class dnReceiptDom extends BasePage { this.customToast(this.$t('message.barcode') as string); return; } - // if (this.Container == '') { - // this.customToast(this.$t('message.scanningContainer') as any); - // return; - // } - // if (this.Container.cpRef4 == null) { - // if (parseFloat(this.receiptAmount) > this.Container.qty) { - // this.customToast(this.$t('message.AppendMateriel3') as any); - // return; - // } - // } else { - // if (parseFloat(this.receiptAmount) > this.Container.qty - parseFloat(this.Container.cpRef4)) { - // this.customToast(this.$t('message.AppendMateriel3') as any); - // return; - // } - // } - // let num: number = 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) { - // if (parseFloat(this.receiptAmount) + num > this.Container.qty) { - // this.customToast(this.$t('message.AppendMateriel3') as any); - // return; - // } - // } else { - // if (parseFloat(this.receiptAmount) + num > this.Container.qty - parseFloat(this.Container.cpRef4)) { - // this.customToast(this.$t('message.AppendMateriel3') as any); - // return; - // } - // } + if (this.Container == '') { + this.customToast(this.$t('message.scanningContainer') as any); + return; + } + if (parseFloat(this.receiptAmount) > this.Container.requestAmount) { + this.customToast(this.$t('message.AppendMateriel3') as any); + return; + } + let num = 0; + if (this.LocationList.length != 0) { + this.LocationList.forEach((item: any) => { + if (item.palletCode == this.Container.palletCode) { + num += parseFloat(item.receiptAmount); + } + }); + } + if (parseFloat(this.receiptAmount) + num > this.Container.requestAmount) { + this.customToast(this.$t('message.AppendMateriel3') as any); + return; + } const count = parseFloat(this.every.requestAmount); if (this.receiptAmount == '' || !this.wl.value) { this.customToast(this.$t('message.Commission_tips2') as any); @@ -389,8 +370,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]); let num: any = 0; diff --git a/src/pages/raw/commission/RUS-entrant/model.ts b/src/pages/raw/commission/RUS-entrant/model.ts index a1566f3..71d009b 100644 --- a/src/pages/raw/commission/RUS-entrant/model.ts +++ b/src/pages/raw/commission/RUS-entrant/model.ts @@ -289,9 +289,11 @@ export class ReturningModule extends VuexModule { 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, + dnNo: params.dnNo, + poNo: params.poNo, + poLine: params.poLine, + materialCode: params.materialCode, + palletCode: params.palletCode, }); const ContainerCode = res.data; return { ContainerCode }; diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/config.ts b/src/pages/raw/ingoods/RUS-dnReceipt/config.ts index a00dbfe..2e2ce7f 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/config.ts +++ b/src/pages/raw/ingoods/RUS-dnReceipt/config.ts @@ -30,82 +30,35 @@ export const headers = [ key: 'sn', //容器码 width: 700, }, - // { - // label: vm.$t('message.po_RemainingQuantity'), - // key: 'splitAmount', - // }, - // { - // label: vm.$t('message.po_Location'), - // key: 'location', - // }, - // { - // label: '物料详情', - // key: 'materialDesc', - // }, - // { - // label: '收货数量', - // key: 'receiptAmount', - // }, - // { - // label: '发货数量', - // key: 'requestAmount', - // }, - // { - // label: '过账信息', - // key: 'accountingMessage', - // }, - // { - // label: '应', - // key: 'y', - // }, - // { - // label: '过账状态', - // key: 'accountingStatus', - // }, - // { - // label: '采购订单号', - // key: 'poNo', - // }, - // { - // label: '行号', - // key: 'poLine', - // }, - // { - // label: '单位', - // key: 'dw', - // }, - // { - // label: 'sap库存地点', - // key: 'kw', - // }, - // { - // label: 'ID', - // key: 'rawOrderInId', - // }, - // { - // label: '工厂', - // key: 'factoryCodeSap', - // }, - // { - // label: '质检状态', - // key: 'qualityStatus', - // }, - // { - // label: '供应商', - // key: 'supplyCode', - // }, - // { - // label: '采购组', - // key: 'buyerGroup', - // }, - // { - // label: '工位', - // key: 'sendSpot', - // }, - // { - // label: 'mrp', - // key: 'mrpCode', - // }, +]; +export const Tabheaders = [ + { + 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', + width: 350, + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + }, + { + label: vm.$t('message.product_Number'), + key: 'receiptAmount', + }, + { + label: vm.$t('message.Container'), + key: 'palletCode', //容器码 + width: 700, + }, ]; export const ImportPOReceiveListHeaders = [ { diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue index 184db54..b5b32db 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue @@ -79,7 +79,7 @@ {{ $t('message.product_add') }} - + @@ -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 = []; diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/model.ts b/src/pages/raw/ingoods/RUS-dnReceipt/model.ts index aaa33de..f6d5fbe 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/model.ts +++ b/src/pages/raw/ingoods/RUS-dnReceipt/model.ts @@ -289,11 +289,14 @@ export class ReceiptModule extends VuexModule { //俄罗斯扫描容器码 @MutationAction async searchBarcode(params: any) { - const res: any = await http.post(url.auth.query.barcode, { + const res: any = await http.post(url.auth.query.queryContainer, { factoryCode: session.factoryCode, loginName: session.loginName, - barcode: params.barcode, - productCode: params.productCode, + dnNo: params.dnNo, + poNo: params.poNo, + poLine: params.poLine, + materialCode: params.materialCode, + palletCode: params.palletCode, }); const ContainerCode = res.data; return { ContainerCode }; diff --git a/src/utils/url.ts b/src/utils/url.ts index 0540a3d..19f142c 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -29,6 +29,7 @@ export const url = { createAppendList: '/wmspda/bl/createAppendList', lock: '/wmspda/bl/unlock', barcode: '/wmspda/bl/getOdsRawStorageSnNew', + queryContainer: '/wmspda/material/orderin/queryContainer', }, systime: '/wmspda/auth/systime', userInfo: '/wmspda/auth/userinfo',