From 2c7a88ee40e8030ab10733211afa8963682d395f Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Wed, 31 Jul 2024 22:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=89=A9=E6=96=99=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E5=8A=9F=E8=83=BD=E5=8F=8A=E6=8C=89=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=AE=8C=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/request2.js | 21 ++ src/common/style/new_style.css | 7 +- src/mycomponents/balance/balance.vue | 4 +- src/mycomponents/balance/light.vue | 39 +++ src/mycomponents/scan/winComScanBalance.vue | 34 ++- src/pages/fg/fgChange.vue | 317 ++++++++------------ src/pages/fg/receiptByPlan.vue | 14 +- src/pages/fg/receiptNoPlan.vue | 13 +- 9 files changed, 227 insertions(+), 224 deletions(-) create mode 100644 src/mycomponents/balance/light.vue diff --git a/.env.development b/.env.development index 9acfffb3..a216fad1 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -VITE_BASE_URL=http://192.168.0.128:12080/admin-api +VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api # 租户配置 diff --git a/src/api/request2.js b/src/api/request2.js index c29caa58..02362e27 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -4367,6 +4367,27 @@ export function getProductionlineAndWorkStation() { }); } + +//获取物料变更信息 +export function getSpareitemcode(params) { + return request({ + url: baseApi + "/wms/productionitemcode-spareitemcode/getRelation", + method: "get", + data: params, + }); +} + +//获取物料变更信息 +export function getProductreceiptDetailbByPackingNumber(packingNumber) { + return request({ + url: baseApi + "/wms/productreceipt-detailb/getProductreceiptDetailbByPackingNumber?packingNumber=" + + packingNumber, + method: "get", + data: {}, + }); +} + + /** * 打印机列表 */ diff --git a/src/common/style/new_style.css b/src/common/style/new_style.css index cb624456..ecf5e7a4 100644 --- a/src/common/style/new_style.css +++ b/src/common/style/new_style.css @@ -2070,7 +2070,7 @@ button::after { .card_content { font-size: 35rpx; font-weight: bold; - padding: 5px; + /* padding: 5px; */ } .card_big_content { @@ -2109,6 +2109,11 @@ button::after { font-size: 30rpx; } +.card_light { + color: #0076F6; + padding: 5px; + font-size: 30rpx; +} .card_container_content { font-size: 32rpx; diff --git a/src/mycomponents/balance/balance.vue b/src/mycomponents/balance/balance.vue index e3a345e2..b4ed53fb 100644 --- a/src/mycomponents/balance/balance.vue +++ b/src/mycomponents/balance/balance.vue @@ -20,9 +20,9 @@ :isShowStatus='isShowStatus'> - + - @@ -75,9 +73,11 @@ bussinessCode: { type: String, default: '' + }, + verifyCategory: { + type: Boolean, + default: false } - - }, data() { return { @@ -178,11 +178,21 @@ getBasicItemByCode(itemCode).then(res => { if (res.data != null && res.data.list.length > 0) { var result = res.data.list[0]; - var status = result.status; + var status = result.available; var type = result.type; - if (status == "ENABLE") { + if (status == "TRUE") { if (checkDirectoryItemExist(this.itemTypesList, type)) { - callBack() + if (this.verifyCategory) { + if (result.category == 'LCJ' || result.category == 'BJ') { + callBack() + } + else + { + this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") + } + } else { + callBack() + } } else { var hint = getListItemTypeDesc(this.itemTypesList); uni.hideLoading() @@ -223,12 +233,12 @@ if (this.$refs.comscan) { this.$refs.comscan.getfocus() } + }, + losefocus() { + if (this.$refs.comscan) { + this.$refs.comscan.losefocus() + } } - - - - - } } diff --git a/src/pages/fg/fgChange.vue b/src/pages/fg/fgChange.vue index 22fcb03f..5a2a1d0e 100644 --- a/src/pages/fg/fgChange.vue +++ b/src/pages/fg/fgChange.vue @@ -6,69 +6,74 @@ - + - + + 变更前物料 + + {{currentPackage.itemCode}} + + + + 变更后物料 + + + {{toItemCode}} + + + + + + + + + 变更原因 + + + + + + - - - - - - - - - 唯一码 - {{item.remark}} - - - - - - - + + + + + + + + + + - - - 变更后物料 - - - {{toItemCode}} - - - - - - - - - + - + - + - + @@ -114,6 +119,8 @@ import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue" + import balance from '@/mycomponents/balance/balance.vue' + import light from '@/mycomponents/balance/light.vue' export default { components: { @@ -123,24 +130,20 @@ comBlankView, PackageAndItemCard, winComScanBalance, - winScanFgLabel + winScanFgLabel, + balance, + light }, data() { return { - detailSource: [], //绑定在页面上的数据源 - toLocationCode: "", - fromLocationTypeList: [], - fromLocationCode: "", + bussinessCode: "Relegate", businessType: {}, - dataContent: {}, - managementList: [], show: false, toItemCode: "请选择变更后物料", toItemList: [], fgList: [], - options: [], currentPackage: null, - bussinessCode: "Relegate" + reason: '' }; }, mounted() { @@ -179,7 +182,6 @@ }); }, - getPackScanResult(result) { let label = result.label; let pack = result.package; @@ -218,6 +220,7 @@ getProductreceiptDetailbByPackingNumber(pack.number).then(res => { if (res.data.length > 0) { this.fgList = res.data; + let pack = result.package; let balance = result.balance; this.currentPackage = result.package; @@ -231,9 +234,6 @@ }).catch(res => { this.showErrorMessage(res.message); }) - - - } }).catch(res => { this.showErrorMessage(res.message); @@ -241,36 +241,38 @@ }, getFgScanResult(result) { - let that = this; - var itemIndex = this.allList.findIndex(r => - r.content == result.content); + var item = this.fgList.find(r => + r.remark == result.content); //不存在 - if (itemIndex == -1) { - // if (this.allList.length > this.dataContent.packQty) { - // this.showErrorMessage("唯一码数量不能大于计划数量") - // return; - // } - result.countTime = new Date(); - this.allList.push(result); - this.allList.sort(compare('countTime')); //按扫描信息排序 - this.initList() - this.scanPopupGetFocus(); - this.calcFgQty(); + if (item != undefined) { + var index = this.fgList.findIndex(r => + r.remark == result.content); + if (item.scaned == true) { + this.$refs.comMessage.showQuestionMessage("灯码【" + result.content + + '】已经扫描,是否移除', + res => { + if (res) { + item.scaned = false; + this.fgList.splice(index, 1) + this.fgList.push(item); //置底(); + } + }) + } else { + item.scaned = true; + this.fgList.unshift(this.fgList.splice(index, 1)[0]); //置顶(); + } + this.calcHandleQty(); } else { - this.$refs.comMessage.showQuestionMessage("唯一码【" + result.content + - '】已经扫描,是否移除', - res => { - if (res) { - this.allList.splice(itemIndex, 1) - this.allList.sort(compare('countTime')); //按扫描信息排序 - this.initList() - that.calcFgQty(); - } - }) + this.showErrorMessage("扫描的灯码不在灯码列表中") } - }, + calcHandleQty() { + if (this.fgList.length > 0) { + this.currentPackage.handleQty = + this.fgList.filter(r => r.scaned == true).length + } + }, openScanPopup() { setTimeout(r => { @@ -279,118 +281,45 @@ }) }, + openScanFgPopup() { + setTimeout(r => { + this.$refs.scanFgPopup.openScanPopup(this.currentPackage.itemCode); + this.scanFgPopupGetFocus(); + + }) + }, + commit() { - if (this.positionInfo == "请选择位置") { - this.showMessage("请先选择位置") + if (this.toItemCode == "请选择变更后物料") { + this.showMessage("请选择变更后物料") return; } - - if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { - //查询管理模式 - uni.showLoading({ - title: "提交中....", - mask: true - }); - this.managementList = []; - var precisionStrategParams = this.setPrecisionStrategParams() - - getPrecisionStrategyList(precisionStrategParams, res => { - if (res.success) { - this.managementList = res.list; - var params = this.setParams() - console.log("提交" + JSON.stringify(params)) - productionReceiptRecordSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功
生成制品收货记录
" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") - } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) - }) - - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); + if (this.currentPackage.handleQty == null) { + this.$refs.comMessage.showQuestionMessage('是否要将全部灯码进行变更?', res => { + if (res) { + this.commitRecord(); } }) } else { - this.showErrorMessage("没有要提交的数据,请先扫描") + this.$refs.comMessage.showQuestionMessage('是否要将已扫描的【' + this.currentPackage.handleQty + '】个灯码进行变更?', + res => { + if (res) { + this.commitRecord(); + } + }) } - }, - setPrecisionStrategParams() { - var itemList = [] - this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - detail.toLocationCode = this.fgLocationCode; - var filterResult = itemList.filter(res => { - if (res.itemCode == item.itemCode && - detail.toLocationCode == res.locationCode) { - return res - } - }) - //去掉重复元素 - if (filterResult.length == 0) { - var result = { - itemCode: item.itemCode, - locationCode: detail.toLocationCode - } - itemList.push(result) - } - - } - }) - }) - return itemList; + commitRecord() { + // this.showCommitSuccessMessage('提交成功') }, setParams() { + let scanedList = this.fgList.filter(r => r.scaned == true) + if (this.currentPackage.handleQty > 0) { + scanedList = this.fgList.filter(r => r.scaned == true) + } - var subList = [] var creator = this.$store.state.user.id - this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - var submitItem = deepCopyData(detail) - var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, - detail.packingNumber, detail.toLocationCode, detail.batch); - submitItem.itemCode = detail.itemCode; - submitItem.itemName = detail.package.itemName; - submitItem.itemDesc1 = detail.package.itemDesc1; - submitItem.itemDesc2 = detail.package.itemDesc2; - - submitItem.inventoryStatus = detail.inventoryStatus; - - submitItem.fromPackingNumber = info.packingNumber; - submitItem.toPackingNumber = info.packingNumber; - - submitItem.fromContainerNumber = detail.containerNumber; - submitItem.toContainerNumber = detail.containerNumber - - submitItem.fromBatch = info.batch; - submitItem.toBatch = info.batch; - - submitItem.fromLocationCode = detail.locationCode; - submitItem.toLocationCode = detail.toLocationCode; - - submitItem.productionlineCode = this.productionLineCode; - submitItem.workStationCode = this.workStationCode; - - submitItem.qty = detail.handleQty; - submitItem.package = ""; - - subList.push(submitItem) - } - }) - }) - this.dataContent.subList = subList; - this.dataContent.creator = creator; - this.dataContent.workshopCode = this.workshopCode; - return this.dataContent; }, @@ -426,6 +355,12 @@ } }, + scanFgPopupGetFocus() { + if (this.$refs.scanFgPopup != undefined) { + this.$refs.scanFgPopup.getfocus(); + } + }, + scanPopupLoseFocus() { if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.losefocus(); @@ -443,29 +378,17 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { this.clearData(); + this.openScanPopup(); }) }, clearData() { - this.subList = []; - this.detailSource = []; - this.toLocationCode = ''; - this.dataContent = {}; - this.positionInfo = "请选择位置"; - this.fgLocationCode = "" - }, - removePack() { - for (var i = 0; i < this.detailSource.length; i++) { - var item = this.detailSource[i]; - if (item.subList.length == 0) { - this.detailSource.splice(i, 1) - } - } - this.updateData(); + this.toItemCode = "请选择变更后物料"; + this.toItemList = []; + this.fgList = []; + this.currentPackage = null; + this.reason = ''; }, - removeItem(index, item) { - this.detailSource.splice(index, 1) - }, showSelect() { this.show = !this.show diff --git a/src/pages/fg/receiptByPlan.vue b/src/pages/fg/receiptByPlan.vue index 5384eb70..acc8513a 100644 --- a/src/pages/fg/receiptByPlan.vue +++ b/src/pages/fg/receiptByPlan.vue @@ -47,7 +47,7 @@ {{dataContent.handleQty}}/ - {{dataContent.packQtyHint}} + {{dataContent.packQtyHint}} @@ -61,15 +61,15 @@ - + style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;" > + + - @@ -122,6 +122,7 @@ import pack from '@/mycomponents/balance/pack.vue' import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue" import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue" + import light from '@/mycomponents/balance/light.vue' import { Exception } from 'sass'; @@ -135,7 +136,8 @@ pack, winScanButton, winScanFgLabel, - comFgCard + comFgCard, + light }, data() { return { diff --git a/src/pages/fg/receiptNoPlan.vue b/src/pages/fg/receiptNoPlan.vue index a06faeff..c2ab1f73 100644 --- a/src/pages/fg/receiptNoPlan.vue +++ b/src/pages/fg/receiptNoPlan.vue @@ -34,7 +34,8 @@ {{dataContent.handleQty}}/ - {{dataContent.packQtyHint}} + + {{dataContent.packQtyHint}} @@ -46,11 +47,12 @@ - + style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;" > + + @@ -108,6 +110,7 @@ import pack from '@/mycomponents/balance/pack.vue' import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue" import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue" + import light from '@/mycomponents/balance/light.vue' import { Exception } from 'sass'; @@ -121,7 +124,7 @@ pack, winScanButton, winScanFgLabel, - comFgCard + comFgCard,light }, data() { return {