diff --git a/.env.development b/.env.development index ff5732c2..6bffb490 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,7 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api +#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api + +VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' # 是否是测试环境 diff --git a/src/mycomponents/record/recordComDetailCard.vue b/src/mycomponents/record/recordComDetailCard.vue index ddcce89c..42490f0c 100644 --- a/src/mycomponents/record/recordComDetailCard.vue +++ b/src/mycomponents/record/recordComDetailCard.vue @@ -3,16 +3,16 @@ - - - + + + { return r.packingNumber == packingNumber && r.batch == batch && - r.fromLocationCode == result.fromLocationCode + r.fromLocationCode == result.fromLocationCode&& + r.inventoryStatus == result.balance.inventoryStatus + }) - let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); - //不存在提示 - if (itemDetail == undefined) { - this.showErrorMessage("箱码【" + packingNumber + "】
批次【" + batch + "】
库位【" + result - .fromLocationCode + "】
状态【" + balanceStatus + "】
已经扫描") - return; - } else { + if(itemDetail){ + // 箱码、批次、库位、状态一致 + if (itemDetail.scaned) { + this.showErrorMessage("箱码【" + packingNumber + "】
批次【" + batch + "】
库位【" + result + .fromLocationCode + "】
状态【" + balanceStatus + "】
已经扫描") + return; + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.balance.qty); + itemDetail.toInventoryStatus = result.balance.inventoryStatus; + itemDetail.inventoryStatus =result.balance.inventoryStatus; + itemDetail.balance = result.balance; + itemDetail.balance.balanceQty = Number(result.balance.qty); + itemDetail.balance.packQty = Number(result.package.packQty) + itemDetail.balance.packUnit = result.package.packUnit + this.calcHandleQty(); + } + }else { + //箱码、批次、库位相等 itemDetail = detail.subList.find(r => { return r.packingNumber == packingNumber && r.batch == batch && - r.fromLocationCode == result.fromLocationCode && - r.inventoryStatus == result.balance.inventoryStatus + r.fromLocationCode == result.fromLocationCode }) - //箱码、批次、库位、状态不一致 - if (itemDetail == undefined) { - itemDetail = detail.subList.find(r => { - return r.packingNumber == packingNumber && - r.batch == batch && - r.fromLocationCode == result.fromLocationCode - }) - if (itemDetail.scaned) { - this.showErrorMessage("箱码【" + packingNumber + "】
批次【" + batch + "】
库位【" + result - .fromLocationCode + "】
状态【" + balanceStatus + "】
已经扫描") - return; - } - - let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); + + if(itemDetail){ + //箱码、批次、库位相等,状态不相等 if (this.jobContent.allowModifyInventoryStatus == "TRUE") { this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + ']不一致,是否继续退货?', res => { @@ -293,27 +296,11 @@ this.scanPopupGetFocus(); }); } - - - } else { - // 箱码、批次、库位、状态一致 - if (itemDetail.scaned) { - this.showErrorMessage("箱码【" + packingNumber + "】
批次【" + batch + "】
库位【" + result - .fromLocationCode + "】
状态【" + balanceStatus + "】
已经扫描") - return; - } else { - itemDetail.scaned = true; - itemDetail.handleQty = Number(result.balance.qty); - itemDetail.toInventoryStatus = result.balance.inventoryStatus; - itemDetail.inventoryStatus =result.balance.inventoryStatus; - itemDetail.balance = result.balance; - itemDetail.balance.balanceQty = Number(result.balance.qty); - itemDetail.balance.packQty = Number(result.package.packQty) - itemDetail.balance.packUnit = result.package.packUnit - this.calcHandleQty(); - } + }else { + this.showErrorMessage("箱码【" + packingNumber + "】
批次【" + batch + "】
库位【" + result + .fromLocationCode + "】
状态【" + balanceStatus + "】
不在任务列表中") } - + } } diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index 9a67134d..290d759b 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -9,16 +9,16 @@ 来源库位 : {{fromLocationCode}} - +
- - + @@ -30,7 +30,7 @@ style="background-color:ghostwhite; width: 100%; "> + @getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"> --> @@ -57,6 +57,7 @@ import { goHome, + updateTitle, getCurrDateTime, getPackingNumberAndBatchByList, deepCopyData @@ -75,7 +76,7 @@ getBusinessType, createItemInfo, createDetailInfo, - calcTreeHandleQty + calcHandleQty } from '@/common/record.js'; import { @@ -91,8 +92,7 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' - import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' - + export default { components: { winScanButton, @@ -101,8 +101,7 @@ comBlankView, winScanLocation, winScanPackAndLocation, - recordComDetailCard, - recordDetailCard + recordComDetailCard }, data() { return { @@ -118,12 +117,12 @@ businessType: {}, showToLoaction: true, recommendLocationList: [], //推荐库位列表 - fromWarehouseCode: '' ,//来源仓库 - businessTypeCode:"PurchasePutaway" + fromWarehouseCode: '', //来源仓库 + businessTypeCode: "PurchasePutaway" }; }, onLoad(option) { - this.clearData(); + this.clear(); getBusinessType(this.businessTypeCode, res => { if (res.success) { this.businessType = res.businessType; @@ -166,32 +165,37 @@ this.getRecommendLocation(balance, pack, toLocation => { var itemp = createItemInfo(balance, pack); let newDetail = createDetailInfo(balance, pack); // - newDetail.toLocationCode = toLocation.code; - newDetail.toWarehouseCode = toLocation.warehouseCode; + newDetail.toLocationCode = toLocation.locationCode; + newDetail.toWarehouseCode = toLocation.toWarehouseCode; itemp.subList.push(newDetail); - var dataList = pack.subList this.detailSource.push(itemp) - this.detailSource.forEach(res=>{ - res.subList.forEach(pack=>{ - pack.packList = dataList.filter(c=>c.parentNumber==pack.packingNumber) - pack.packList.forEach(pac=>{ - pac.parentPackingNumber =pac.parentNumber; - pac.packingNumber =pac.number; - pac.inventoryStatus="OK"; - pac.scaned=true; - }) - }) - }) + calcHandleQty(this.detailSource); }) } else { - var itemDetail = item.subList.find(r => r.packingNumber == balance.packingNumber && r.batch == - balance.batch); - if(itemDetail!=undefined){ + var detail = item.subList.find(r => { + if (r.packingNumber == balance.packingNumber && + r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + this.getRecommendLocation(balance, pack, toLocation => { + let newDetail = createDetailInfo(balance, pack); + newDetail.toLocationCode = toLocation.locationCode; + newDetail.toWarehouseCode = toLocation.toWarehouseCode; + item.subList.push(newDetail); + calcHandleQty(this.detailSource); + }); + } else { + if (detail.scaned == true) { this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") } + } } - // calcTreeHandleQty(this.detailSource); + }, //获取推荐库位 @@ -207,20 +211,25 @@ batch: balance.batch, inventoryStatus: balance.inventoryStatus, supplierCode: pack.supplierCode, - businessCode:this.businessTypeCode + businessCode: this.businessTypeCode }; console.log(JSON.stringify(param)) getPutawayRecommendLocation(param).then(res => { this.recommendLocationList.push({ itemCode: balance.itemCode, - locationCode: res.data.code + locationCode: res.data.code, + toWarehouseCode:res.data.toWarehouseCode }) - callback(res.data); + + var result = { + locationCode: res.data.code, + toWarehouseCode:res.data.toWarehouseCode + } + callback(result); uni.hideLoading(); }).catch(error => { uni.hideLoading() this.showErrorMessage(error); - uni.hideLoading(); }) } else { @@ -234,24 +243,22 @@ }); }, - calcTreeHandleQty() { - for (let item of this.detailSource) { - item.qty = 0; - for (let detail of item.subList) { - if (detail != undefined) { - item.qty = calc.add(item.qty,detail.qty) - } + + updateData() { + calcHandleQty(this.detailSource); + for (var i = 0; i < this.detailSource.length; i++) { + let item = this.detailSource[i]; + if (item.qty == 0) { + this.detailSource.splice(i, 1) } } this.$forceUpdate(); - }, - - updateData() { - this.calcTreeHandleQty(); + }, removeItem(index, item) { this.detailSource.splice(index, 1) + this.updateData(); }, removePack() { @@ -383,7 +390,7 @@ // detail.toInventoryStatus = detail.inventoryStatus // detail.toLocationCode = detail.toLocationCode - submitItem.qty = detail.handleQty ; + submitItem.qty = detail.handleQty; submitItem.package = ""; subList.push(submitItem) } @@ -403,13 +410,6 @@ if (res) {} }); }, - showErrorMessage(message) { - this.$refs.comMessage.showErrorMessage(message, res => { - if (res) { - - } - }); - }, showScanMessage(message) { this.$refs.comMessage.showScanMessage(message); @@ -443,21 +443,11 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - this.clearData(); + this.clear(); }) }, - updateData() { - // this.calcTreeHandleQty(); - for (var i = 0; i < this.detailSource.length; i++) { - let item = this.detailSource[i]; - if (item.qty == 0) { - this.detailSource.splice(i, 1) - } - } - }, - - clearData() { + clear() { this.fromLocationInfo = {}; this.fromLocationCode = ''; this.fromWarehouseCode = ''; @@ -503,4 +493,4 @@ background: #e0e0e0; } - + \ No newline at end of file diff --git a/src/pages/putaway/record/putawayRecord_bat.vue b/src/pages/putaway/record/putawayRecord_bat.vue new file mode 100644 index 00000000..9a67134d --- /dev/null +++ b/src/pages/putaway/record/putawayRecord_bat.vue @@ -0,0 +1,506 @@ + + + + +