diff --git a/src/api/request2.js b/src/api/request2.js
index cca0a80b..2e715939 100644
--- a/src/api/request2.js
+++ b/src/api/request2.js
@@ -4302,7 +4302,7 @@ export function overPackageRecordSubmit(params) {
*
*/
export async function getManagementPrecision(params) {
- return request({
+ return await request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post",
data: params,
diff --git a/src/common/label.js b/src/common/label.js
index 9e3a4c8c..4615e948 100644
--- a/src/common/label.js
+++ b/src/common/label.js
@@ -105,6 +105,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
}
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
+ let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息
@@ -114,7 +115,7 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) {
const managementList = res.list;
- const managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
+ managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingNumber = ''
}
@@ -137,11 +138,12 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
callBack(labelResult);
})
} else {
- console.log(999,labelResult)
//线边的物料可能没有箱码
labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber=''
+ labelResult.managementType = managementType
+ console.log(999,labelResult)
callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';
diff --git a/src/mycomponents/detail/comDetailCardBatch.vue b/src/mycomponents/detail/comDetailCardBatch.vue
index a45e3033..4a008109 100644
--- a/src/mycomponents/detail/comDetailCardBatch.vue
+++ b/src/mycomponents/detail/comDetailCardBatch.vue
@@ -1,29 +1,27 @@
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,20 +29,13 @@
diff --git a/src/mycomponents/detail/comJobDetailCardBatch.vue b/src/mycomponents/detail/comJobDetailCardBatch.vue
index 1a6be7a4..bb2be74f 100644
--- a/src/mycomponents/detail/comJobDetailCardBatch.vue
+++ b/src/mycomponents/detail/comJobDetailCardBatch.vue
@@ -1,22 +1,23 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -31,13 +32,7 @@
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
- import location from '@/mycomponents/balance/location.vue'
- import toLocation from '@/mycomponents/balance/toLocation.vue'
- import batch from '@/mycomponents/balance/batch.vue'
- import {
- getRemoveOption,
- getEditRemoveOption
- } from '@/common/array.js';
+
import {
getDetailOption,
getPurchaseReceiptOption
@@ -52,10 +47,7 @@
jobDetailPopup,
receiptDetailInfoPopup,
detailList,
- packageList,
- location,
- toLocation,
- batch,
+ packageList
},
props: {
dataContent: {
@@ -77,10 +69,6 @@
isShowPackListStatus: {
type: Boolean,
default: true
- },
- isEdit: {
- type: Boolean,
- default: true
}
},
watch: {
@@ -97,10 +85,7 @@
},
locatonItem: {},
detailOptions: [],
- scanOptions: [],
- options: [],
- removeOptions: [],
- editAndRemoveOptions: []
+ scanOptions: []
}
},
@@ -112,9 +97,7 @@
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
- this.removeOptions = getRemoveOption();
- this.editAndRemoveOptions = getEditRemoveOption()
-
+
},
@@ -122,13 +105,13 @@
console.log('updated')
},
- methods: {
- collapseChange() {
+ methods: {
+ collapseChange(){
setTimeout(() => {
this.resizeCollapse();
}, 500)
},
-
+
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.resize()
@@ -149,8 +132,8 @@
this.$forceUpdate();
},
- swipeClick(e, item, type) {
- if (e.content.text == "编辑") {
+ swipeClick(e, item) {
+ if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
@@ -175,7 +158,7 @@
this.editItem.handleQty = qty;
this.$emit('updateData')
},
- updateData() {
+ updateData(){
this.$emit('updateData')
}
}
diff --git a/src/mycomponents/scan/winScanPack.vue b/src/mycomponents/scan/winScanPack.vue
index 2da925c1..e901a25d 100644
--- a/src/mycomponents/scan/winScanPack.vue
+++ b/src/mycomponents/scan/winScanPack.vue
@@ -49,7 +49,6 @@
type: String,
default: 'HPQ'
},
-
},
data() {
return {
diff --git a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
index f8284f15..33de6657 100644
--- a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
+++ b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
@@ -1,23 +1,32 @@
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -25,39 +34,42 @@
diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue
index 0eb850ba..087661be 100644
--- a/src/pages/productReceipt/job/productReceiptDetail.vue
+++ b/src/pages/productReceipt/job/productReceiptDetail.vue
@@ -290,17 +290,18 @@
this.showErrorMessage("批次[" + batch + "]不在任务列表中")
} else {
if (itemDetail.scaned) {
- this.showErrorMessage("批次[" + batch + "]已经扫描")
+ // this.showErrorMessage("批次[" + batch + "]已经扫描")
+ itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty);
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
- calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
+ calcHandleQty(this.detailSource);
}
}
},
diff --git a/src/pages/productRecycle/job/productRecycleJobDetail.vue b/src/pages/productRecycle/job/productRecycleJobDetail.vue
index 1d8193ed..d1cbf98b 100644
--- a/src/pages/productRecycle/job/productRecycleJobDetail.vue
+++ b/src/pages/productRecycle/job/productRecycleJobDetail.vue
@@ -71,6 +71,10 @@
import {
getManagementPrecisions
} from '@/common/balance.js';
+
+ import {
+ calc
+ } from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
@@ -366,20 +370,22 @@
if (itemDetail) {
// 箱码、批次、库位、状态一致
if (itemDetail.scaned) {
- this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
- .fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描")
- return;
+ // this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
+ // .fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描")
+ itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty));
+ itemDetail.balanceQty = Number(result.label.qty);
} else {
itemDetail.scaned = true;
- itemDetail.handleQty = Number(result.balance.qty);
+ itemDetail.handleQty = Number(result.label.qty);
+ itemDetail.balanceQty = Number(result.label.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();
}
+ this.calcHandleQty();
} else {
//箱码、批次、库位相等
itemDetail = detail.subList.find(r => {
@@ -390,30 +396,44 @@
if (itemDetail) {
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
//箱码、批次、库位相等,状态不相等
- if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
- this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
- ']不一致,是否继续回收?', res => {
- if (res) {
- 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 = result.balance.qty;
- itemDetail.balance.packQty = result.package.packQty
- itemDetail.balance.packUnit = result.package.packUnit
- this.calcHandleQty();
- } else {
+ if(balanceStatus!=itemStatus){
+ if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
+ this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
+ ']不一致,是否继续回收?', res => {
+ if (res) {
+ itemDetail.scaned = true;
+ itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
+ itemDetail.toInventoryStatus = result.balance.inventoryStatus;
+ itemDetail.inventoryStatus = result.balance.inventoryStatus;
+ itemDetail.balance = result.balance;
+ itemDetail.balance.balanceQty = result.balance.qty;
+ itemDetail.balance.packQty = result.package.packQty
+ itemDetail.balance.packUnit = result.package.packUnit
+ this.calcHandleQty();
+ } else {
+ this.scanPopupGetFocus();
+ }
+ });
+ } else {
+ this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
+ itemStatus +
+ ']不一致,不允许回收!', res => {
this.scanPopupGetFocus();
- }
- });
- } else {
- this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
- itemStatus +
- ']不一致,不允许回收!', res => {
- this.scanPopupGetFocus();
- });
+ });
+ }
+ //箱码、批次、库位相等,状态相等
+ }else{
+ itemDetail.scaned = true;
+ itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
+ itemDetail.toInventoryStatus = result.balance.inventoryStatus;
+ itemDetail.inventoryStatus = result.balance.inventoryStatus;
+ itemDetail.balance = result.balance;
+ itemDetail.balance.balanceQty = result.balance.qty;
+ itemDetail.balance.packQty = result.package.packQty
+ itemDetail.balance.packUnit = result.package.packUnit
+ this.calcHandleQty();
}
+
} else {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中")
@@ -492,6 +512,7 @@
checkCountBatch(){
// 提交的数量和任务数量不一致提示
let str = ''
+ let str1 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
@@ -503,10 +524,17 @@
}
str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
+ if(cur.handleQty > cur.balance.qty){
+ str1 += `物料号【${item.itemCode}】提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balance.qty}】`
+ }
})
})
+ if (str1) {
+ this.$refs.comMessage.showMessage(str1);
+ return
+ }
if (str) {
- str = '任务明细未全部完成,是否提交?\n'+str
+ str = '任务明细未全部完成,是否提交?\n'+ str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
diff --git a/src/pages/productionReturn/job/okToReturnDetail.vue b/src/pages/productionReturn/job/okToReturnDetail.vue
index 017e0c77..5a8ad359 100644
--- a/src/pages/productionReturn/job/okToReturnDetail.vue
+++ b/src/pages/productionReturn/job/okToReturnDetail.vue
@@ -66,7 +66,9 @@
getManagementPrecisions
} from '@/common/balance.js';
-
+ import {
+ calc
+ } from '@/common/calc'
import {
getDataSource,
createRecordInfo,
@@ -256,7 +258,7 @@
},
openScanPopup() {
- this.$refs.scanPopup.openScanPopup();
+ this.$refs.scanPopup.openScanPopup(this.fromLocationCode);
// let fromlocationCode = '';
// let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) {
@@ -282,6 +284,79 @@
getScanResult(result) {
+ this.managementType = result.managementType
+ if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
+ this.setDataBatch(result)
+ } else {
+ this.setData(result)
+ }
+
+ },
+ setDataBatch(result){
+ try {
+ var packingNumber = result.label.packingNumber;
+ var batch = result.label.batch;
+ var qty = result.label.qty;
+ var itemCode = result.label.itemCode;
+ var detail = this.detailSource.find(r => r.itemCode == itemCode);
+ if (detail == undefined) {
+ this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
+ } else {
+ var itemDetail = detail.subList.find(r => {
+ return r.batch == batch
+ })
+ if (itemDetail == undefined) {
+ this.showErrorMessage("批次[" + batch + "]不在列表中")
+ } else {
+ if (itemDetail.scaned) {
+ // this.showErrorMessage("批次[" + batch + "]已经扫描")
+ itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.package.qty))
+ } else {
+ itemDetail.scaned = true;
+ itemDetail.handleQty = Number(result.package.qty)
+ itemDetail.inventoryStatus = "OK"
+ itemDetail.packQty = result.package.packQty
+ itemDetail.packUnit = result.package.packUnit
+
+
+ //合格退料时不能查库存余额,因为生产退料时新生成的批次是000000 --nxt
+ // let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
+ // let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
+ // if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
+ // this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
+ // ']不一致,是否继续上架?', res => {
+ // if (res) {
+ // itemDetail.scaned = true;
+ // itemDetail.handleQty = Number(result.balance.qty)
+ // itemDetail.balance = result.balance;
+ // itemDetail.balance.balanceQty = result.balance.qty;
+ // itemDetail.balance.packQty = result.package.packQty
+ // itemDetail.balance.packUnit = result.package.packUnit
+ // this.calcHandleQty();
+ // } else {
+ // this.scanPopupGetFocus();
+ // }
+ // });
+ // } else {
+ // itemDetail.scaned = true;
+ // itemDetail.handleQty = Number(result.balance.qty)
+ // itemDetail.balance = result.balance;
+ // itemDetail.balance.balanceQty = result.balance.qty;
+ // itemDetail.balance.packQty = result.package.packQty
+ // itemDetail.balance.packUnit = result.package.packUnit
+ // this.calcHandleQty();
+ // }
+ }
+ this.calcHandleQty();
+ }
+ }
+ this.scanPopupGetFocus();
+ } catch (e) {
+ this.showErrorMessage(e.message);
+ }
+ },
+
+ setData(result){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
@@ -306,8 +381,8 @@
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
-
-
+
+
//合格退料时不能查库存余额,因为生产退料时新生成的批次是000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
@@ -400,6 +475,7 @@
itemCode: itemCodes,
locationCode: this.toLocationCode
}
+
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue
index b298b7c0..d5af8ddb 100644
--- a/src/pages/putaway/job/putawayDetail.vue
+++ b/src/pages/putaway/job/putawayDetail.vue
@@ -87,7 +87,9 @@
calcTreeHandleQty,
getScanCount
} from '@/common/detail.js';
-
+ import {
+ calc
+ } from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue"
@@ -275,7 +277,7 @@
updateData() {
console.log("updateData")
// this.calcHandleQty();
- // calcTreeHandleQty(this.detailSource)
+ calcTreeHandleQty(this.detailSource)
},
//模拟扫描功能
openScanPopupSimulate(message) {
@@ -470,7 +472,8 @@
.fromLocationCode + "】不在列表中")
} else {
if (!isExit.cancleScanedHiht && isExit.scaned) {
- this.showMessage("批次【" + batch + "】已经扫描")
+ // this.showMessage("批次【" + batch + "】已经扫描")
+ isExit.handleQty = calc.add(Number(result.label.qty),isExit.handleQty)
} else {
isExit.scaned = true
let qty = 0;
@@ -501,7 +504,8 @@
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList
.length) {
// this.showMessage("箱码【" + packingNumber + "】已经扫描")
- this.showMessage("批次【" + batch + "】已经扫描")
+ // this.showMessage("批次【" + batch + "】已经扫描")
+ itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty)
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序
@@ -513,10 +517,10 @@
pac.toLocationCode = this.toLocationCode;
})
- calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
+ calcTreeHandleQty(this.detailSource);
}
},