diff --git a/src/pages/wms/Raw/ReceivePO/index.vue b/src/pages/wms/Raw/ReceivePO/index.vue index fc0660e..9c1a013 100644 --- a/src/pages/wms/Raw/ReceivePO/index.vue +++ b/src/pages/wms/Raw/ReceivePO/index.vue @@ -264,7 +264,7 @@ export default class receivePO extends BasePage { if (model.getidcardcode == '200') { let alreadyList = model.byidcardobj; alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/)); - let id = alreadyList.userDefined1.split('-')[4]; + let id = alreadyList.userDefined4; this.list.forEach((item) => { if (item.id == id) { item.realityNumber += alreadyList.planNumber; @@ -278,9 +278,9 @@ export default class receivePO extends BasePage { } confirmNumber(changeobj) { let addNumber = 0; - let id = changeobj.userDefined1.split('-')[4]; + let id = changeobj.userDefined4; this.receivedlist.forEach((item) => { - if (item.userDefined1.split('-')[4] === id) { + if (item.userDefined4 === id) { addNumber += parseFloat(item.planNumber ? item.planNumber : '0'); } }); @@ -484,7 +484,7 @@ export default class receivePO extends BasePage { } delet(deletobj: any, index: number) { this.receivedlist.splice(index, 1); - let id = deletobj.userDefined1.split('-')[4]; + let id = deletobj.userDefined4; this.list.forEach((item) => { if (item.id == id) { item.realityNumber -= deletobj.planNumber; diff --git a/src/pages/wms/Raw/ReceiveSRM/index.vue b/src/pages/wms/Raw/ReceiveSRM/index.vue index 3c09305..3700f2f 100644 --- a/src/pages/wms/Raw/ReceiveSRM/index.vue +++ b/src/pages/wms/Raw/ReceiveSRM/index.vue @@ -352,7 +352,7 @@ export default class receiveSRM extends BasePage { if (model.getidcardcode == '200') { let alreadyList = model.byidcardobj; alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/)); - let id = alreadyList.userDefined1.split('-')[4]; + let id = alreadyList.userDefined4; this.list.forEach((item) => { if (item.id == id) { item.realityNumber += alreadyList.planNumber; @@ -456,9 +456,9 @@ export default class receiveSRM extends BasePage { confirmNumber(changeobj) { let addNumber = 0; - let id = changeobj.userDefined1.split('-')[4]; + let id = changeobj.userDefined4; this.receivedlist.forEach((item) => { - if (item.userDefined1.split('-')[4] === id) { + if (item.userDefined4 === id) { addNumber += parseFloat(item.planNumber ? item.planNumber : '0'); } }); @@ -472,7 +472,7 @@ export default class receiveSRM extends BasePage { } delet(deletobj: any, index: number) { this.receivedlist.splice(index, 1); - let id = deletobj.userDefined1.split('-')[4]; + let id = deletobj.userDefined4; this.list.forEach((item) => { if (item.id == id) { item.realityNumber -= deletobj.planNumber; diff --git a/src/pages/wms/WhiteManagement/WhiteInstorage/index.vue b/src/pages/wms/WhiteManagement/WhiteInstorage/index.vue index d847603..439ed9d 100644 --- a/src/pages/wms/WhiteManagement/WhiteInstorage/index.vue +++ b/src/pages/wms/WhiteManagement/WhiteInstorage/index.vue @@ -12,7 +12,7 @@ - 报工单号: + 工单号: @@ -82,15 +82,15 @@ - 批次号: - {{ item.batchCode }} + 物料号: + {{ item.productCode }} 数量: {{ item.batchQuantity }} - + @@ -123,16 +123,16 @@ - + - + 数量: @@ -222,9 +222,10 @@ export default class WhiteInstorage extends BasePage { async confirm() { //this.itemdetail.orderNo = this.orderNo; console.log(this.delindex, 'this.delindex'); - if (this.itemdetail.batchCode === this.cimWl.value) { - this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity); - } + this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity); + // if (this.itemdetail.batchCode === this.cimWl.value) { + // this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity); + // } this.list.splice(this.delindex, 1); // await this.model.deleteTray(this.itemdetail); // if (this.model.SubmitCode == '200') { @@ -267,6 +268,7 @@ export default class WhiteInstorage extends BasePage { await this.model.queryOrderNo(this.orderNo); if (model.orderNoItemList) { this.orderNoItemList = model.orderNoItemList; + this.actplanQuantity = this.orderNoItemList.attr1; // this.number1 = this.orderNoItemList.attr3; } else { this.orderNoItemList = {}; @@ -274,8 +276,8 @@ export default class WhiteInstorage extends BasePage { if (model.Picilist) { this.Picilist = model.Picilist; this.cimWl = this.Picilist[0]; - this.planQuantity = this.Picilist[0].batchQuantity - parseFloat(this.Picilist[0].realityNumber); - this.actplanQuantity = this.planQuantity; + //this.planQuantity = this.Picilist[0].batchQuantity - parseFloat(this.Picilist[0].realityNumber); + //this.actplanQuantity = this.Picilist[0].attr1; // this.number1 = this.orderNoItemList.attr3; } else { @@ -300,52 +302,52 @@ export default class WhiteInstorage extends BasePage { }); return; } - let shijinumber = 0; - this.Picilist.forEach((item) => { - shijinumber = shijinumber + parseFloat(item.batchQuantity); - }); + // let shijinumber = 0; + // this.Picilist.forEach((item) => { + // shijinumber = shijinumber + parseFloat(item.batchQuantity); + // }); + if (this.actplanQuantity < 0) { + (this.$refs.uToast as any).show({ + title: '实际入库数量不能超过计划数量', + // url: '/pages/user/index' + }); + return; + } let insertTarynumber = 0; this.list.forEach((item) => { insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity); }); //console.log(insertTarynumber, model.orderNoItemList.putQuantity, insertTarynumber == model.orderNoItemList.putQuantity); - if (insertTarynumber <= shijinumber) { - let params = { - siteCode: session.FactoryCode, - orderCode: this.orderNoItemList.orderCode, - materialCode: this.orderNoItemList.productCode, - materialDesc: this.orderNoItemList.productName, - unit: this.orderNoItemList.unit, - planNumber: insertTarynumber, - userDefined1: this.cimWl.value, - createBy: session.loginName, - wmsWhiteBilletInforList: this.list, - }; - console.log('参数', params); - await this.model.handPut(params); - if (this.model.SubmitCode == '200') { - (this.$refs.uToast as any).show({ - title: '成功', - type: 'success', - }); - this.show = false; - this.list = []; - this.query(); - //this.getlist(); - } else { - (this.$refs.uToast as any).show({ - title: '失败', - type: 'error', - }); - this.show = false; - //this.getlist(); - } + let params = { + siteCode: session.FactoryCode, + orderCode: this.orderNo, + materialCode: this.orderNoItemList.productCode, + materialDesc: this.orderNoItemList.productName, + unit: this.orderNoItemList.unit, + planNumber: insertTarynumber, + userDefined1: this.cimWl.value, + createBy: session.loginName, + wmsWhiteBilletInforList: this.list, + }; + console.log('参数', params); + await this.model.handPut(params); + if (this.model.SubmitCode == '200') { + (this.$refs.uToast as any).show({ + title: '成功', + type: 'success', + }); + this.show = false; + this.list = []; + this.query(); + //this.getlist(); } else { (this.$refs.uToast as any).show({ - title: '实际入库总数量不能超过入库数量,请正确入库', - // url: '/pages/user/index' + title: '失败', + type: 'error', }); + this.show = false; + //this.getlist(); } } async getlist() { @@ -367,10 +369,10 @@ export default class WhiteInstorage extends BasePage { return; } if (this.list.length > 0) { - let insertTarynumber = 0; - this.list.forEach((item) => { - insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity); - }); + // let insertTarynumber = 0; + // this.list.forEach((item) => { + // insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity); + // }); //let ordernumber = this.number1 || 0; if (this.actplanQuantity <= 0) { (this.$refs.uToast as any).show({ @@ -387,26 +389,27 @@ export default class WhiteInstorage extends BasePage { //弹窗入库按钮 async onOk() { console.log(this.form5); - if (this.form5.sn == '' || this.form5.wlCode == '' || this.form5.batchQuantity == '') { - (this.$refs.uToast as any).show({ - title: '不能为空', - // url: '/pages/user/index' - }); - return; - } + // if (this.form5.sn == '' || this.form5.wlCode == '' || this.form5.batchQuantity == '') { + // (this.$refs.uToast as any).show({ + // title: '不能为空', + // // url: '/pages/user/index' + // }); + // return; + // } if (this.list.length) { - let sum = this.list.reduce((total, item) => { - if (item.batchCode === this.cimWl.value) { - return total + parseFloat(item.batchQuantity); - } else { - return total; - } - }, 0); + // let sum = this.list.reduce((total, item) => { + // if (item.batchCode === this.cimWl.value) { + // return total + parseFloat(item.batchQuantity); + // } else { + // return total; + // } + // }, 0); + let sum = this.list.reduce((acc, item) => acc + parseFloat(item.batchQuantity), 0); console.log('sum', sum); - console.log('this.planQuantity', this.planQuantity); + //console.log('this.planQuantity', this.planQuantity); console.log('this.form5.batchQuantity', this.form5.batchQuantity); - if (sum >= this.planQuantity || sum + parseFloat(this.form5.batchQuantity) > this.planQuantity) { + if (sum >= this.actplanQuantity || sum + parseFloat(this.form5.batchQuantity) > this.actplanQuantity) { (this.$refs.uToast as any).show({ title: '实际入库数量不能超过该批次数量', }); @@ -416,9 +419,7 @@ export default class WhiteInstorage extends BasePage { } this.list.push({ batchQuantity: this.form5.batchQuantity, - wlCode: this.form5.wlCode, - sn: this.form5.sn, - batchCode: this.cimWl.value, + productCode: this.orderNoItemList.productCode, }); this.show = false; this.actplanQuantity = this.actplanQuantity - this.form5.batchQuantity;