diff --git a/src/pages/repleinsh/coms/comRepleinshJobCard.vue b/src/pages/repleinsh/coms/comRepleinshJobCard.vue
index 109c7daa..acaab83a 100644
--- a/src/pages/repleinsh/coms/comRepleinshJobCard.vue
+++ b/src/pages/repleinsh/coms/comRepleinshJobCard.vue
@@ -1,13 +1,15 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue
index 55da4ad0..5bf2aa98 100644
--- a/src/pages/repleinsh/coms/comScanReplishPack.vue
+++ b/src/pages/repleinsh/coms/comScanReplishPack.vue
@@ -17,7 +17,7 @@
-
+
@@ -107,9 +107,9 @@ const openScanPopup = (content, jobcontent) => {
dataContent.value = content
jobContent.value = jobcontent
initData()
- positionInfo.value = `${jobContent.value.workShopCode}-${jobContent.value.subList[0].productionLineCode}-${jobContent.value.subList[0].workStationCode}`
+ show.value = true
setTimeout((res) => {
- show.value = true
+ getfocus()
}, 500)
}
const openScanPopupForJobSimulate = (content, jobcontent, scanMessage) => {
@@ -174,7 +174,9 @@ const fromLocationUpdate = (fromlocation) => {
const location = fromLocationList.value.find((r) => r == fromlocation)
if (location == undefined) {
fromLocationCode.value = ''
- showErrorMessage(`发料库位【${fromlocation}】不存在`)
+ showErrorMessage(`发料库位【${fromlocation}】不存在`,()=>{
+ getfocus()
+ })
}
}
const onScan = (result)=> {
@@ -189,7 +191,9 @@ const onScan = (result)=> {
if (toLocation.value && result.package.packUnit) {
let item = toLocation.value.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
- showErrorMessage('扫描物料代码不属于该任务');
+ showErrorMessage('扫描物料代码不属于该任务',()=>{
+ getfocus()
+ });
return
}
if (result.package.packUnit !== item.packUnit) {
@@ -202,6 +206,8 @@ const onScan = (result)=> {
} else {
getToLocationBalance(result)
}
+ }else{
+ getToLocationBalance(result)
}
}
//查询到目标库位的库存余额
@@ -252,14 +258,18 @@ const getToLocationBalance = (result)=> {
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
- showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
+ showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额",()=>{
+ getfocus()
+ });
} else {
queryBalance(result);
}
// callback(res.data)
}).catch(err => {
uni.hideLoading()
- showErrorMessage(err.message);
+ showErrorMessage(err.message,()=>{
+ getfocus()
+ });
})
}
const queryBalance = (result) => {
@@ -301,13 +311,15 @@ const queryBalance = (result) => {
let status = getInventoryStatusDesc(params.inventoryStatus)
let areaType = getListLocationAreaTypeDesc(params.areaType)
let hint =
- "按物料号 [" + params.itemCode + "]
" +
- "包装号 [" + params.packingNumber + "]
" +
- "批次 [" + params.batch + "]
" +
- "状态 [" + status + "]
" +
- "库区 [" + areaType + "]
" +
+ "按物料号 [" + params.itemCode + "] \n" +
+ "包装号 [" + params.packingNumber + "] \n" +
+ "批次 [" + params.batch + "] \n" +
+ "状态 [" + status + "] \n" +
+ "库区 [" + areaType + "] \n" +
"未查找到库存余额"
- showErrorMessage(hint)
+ showErrorMessage(hint,()=>{
+ getfocus()
+ })
} else if (res.data.length == 1) {
result.balance = res.data[0]
@@ -324,7 +336,9 @@ const queryBalance = (result) => {
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
- showErrorMessage(error)
+ showErrorMessage(error,()=>{
+ getfocus()
+ })
})
// getBalance(result.label, packageInfoParams, (balances) => {
// packageInfo.value = packageInfoParams
@@ -386,7 +400,9 @@ const queryBalance = (result) => {
// uni.hideLoading()
// })
} catch (e) {
- showErrorMessage(e.stack)
+ showErrorMessage(e.stack,()=>{
+ getfocus()
+ })
uni.hideLoading()
}
}
@@ -445,7 +461,7 @@ const queryBalance = (result) => {
// }
const selectBalanceItem = (balanceParams) => {
- afterGetBalance(label.value, balanceParams, packageInfo.value)
+ afterGetBalance(balanceParams, balanceParams, packageInfo.value)
}
const afterGetBalance = (labelParams, balanceParams, packageInfo) => {
@@ -457,7 +473,7 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => {
fromLocationCode.value = balanceParams.locationCode;
const fromLocation = item.Locations.find((l) => l.fromLocationCode == fromLocationCode.value)
//如果库存余额中的库位与任务推荐的不一致
- if (fromLocation != undefined) {
+ if (fromLocation) {
const batch = fromLocation.Batchs.find((r) => r.batch == lot)
if (batch != undefined) {
if (batch.Records == undefined) {
@@ -497,6 +513,7 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => {
batch.detail = fromLocation.Batchs[0].detail
}
fromLocation.Batchs.unshift(batch)
+ getfocus()
}
})
} else {
@@ -505,11 +522,21 @@ const afterGetBalance = (labelParams, balanceParams, packageInfo) => {
})
}
} else {
- let locaion = createLocationInfo(labelParams, balanceParams, packageInfo);
- item.Locations.push(locaion);
- // showErrorMessage(`未查找到推荐库位【${fromLocationCode.value}】的发料明细`, (res) => {
- // getfocus()
- // })
+ if (jobContent.value.allowModifyLocation == "TRUE") {
+ this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + fromLocationCode.value +
+ "】与推荐的库位不一致,是否要继续发料?", res => {
+ if (res) {
+ let locaion = createLocationInfo(label, balance, packageInfo);
+ item.Locations.push(locaion);
+ getfocus();
+ emit("afterScan");
+ }
+ })
+
+ } else {
+ showErrorMessage("扫描物料[" + itemCode + "]的库位【" + fromLocationCode.value +
+ "】与推荐的库位不一致,不允许继续发料?")
+ }
}
} catch (e) {
showErrorMessage(e.stack, (res) => {
@@ -524,6 +551,7 @@ const createLocationInfo = (labelParams, balanceParams, packageInfo)=> {
qty: balanceParams.qty,
uom: balanceParams.uom,
handleQty: 0,
+ isNewAdd: true,
Batchs: []
}
let batch = createBatchInfo(labelParams, balanceParams, packageInfo);
@@ -537,6 +565,7 @@ const createBatchInfo = (labelParams, balanceParams, packageInfo) => {
batch: labelParams.batch,
qty: 0,
uom: labelParams.uom,
+ handleQty: Number(balanceParams.qty),
Records: []
}
let record = {}
@@ -625,12 +654,52 @@ const addRecord = (batch, labelParams, balanceParams, packageInfo) => {
console.log(8888)
record = creatRecordByBalance(balanceParams, packageInfo)
}
-
- batch.Records.push(record)
- console.log(34989, record)
- issueRecord.value.unshift(record)
- calcBatchHandleQty(batch)
- getfocus()
+ if (packageInfo.parentNumber) {
+ let checkData = batch.Records.find(r => {
+ if (r.packingNumber == packageInfo.parentNumber &&
+ r.batch == packageInfo.batch) {
+ return r;
+ }
+ })
+ if (checkData) {
+ //提示已经扫描
+ showErrorMessage("箱码[" + packageInfo.number + "]批次[" + packageInfo.batch +
+ "]的父包装已经扫描")
+ } else {
+ batch.Records.push(record)
+ issueRecord.value.unshift(record)
+ calcBatchHandleQty(batch)
+ getfocus()
+ }
+ } else {
+ //扫描的是父包装
+ let checkData = batch.Records.find(r => {
+ if (r.parentPackingNumber == packageInfo.number &&
+ r.batch == packageInfo.batch) {
+ return r;
+ }
+ })
+ if (checkData) {
+ //是否移除
+ comMessageRef.value.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" +
+ packageInfo
+ .batch + "]是父包装,是否移除子包装", res => {
+ if (res) {
+ batch.Records = []
+ batch.Records.push(record);
+ issueRecord.value.unshift(record)
+ calcBatchHandleQty(batch);
+ getfocus();
+ }
+ })
+ console.log("扫描的是父包装,是否移除子包装")
+ } else {
+ batch.Records.push(record);
+ issueRecord.value.unshift(record)
+ calcBatchHandleQty(batch);
+ getfocus();
+ }
+ }
}
const getfocus = () => {
diff --git a/src/pages/repleinsh/coms/comScanReplishPackBatch.vue b/src/pages/repleinsh/coms/comScanReplishPackBatch.vue
new file mode 100644
index 00000000..d16c77d3
--- /dev/null
+++ b/src/pages/repleinsh/coms/comScanReplishPackBatch.vue
@@ -0,0 +1,624 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file