diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue
index b1893cf2..6c0054f6 100644
--- a/src/pages/putaway/job/putawayDetail.vue
+++ b/src/pages/putaway/job/putawayDetail.vue
@@ -13,7 +13,16 @@
-
+
+
+
+
+
+
@@ -32,7 +41,9 @@
-
+
+
@@ -54,6 +65,7 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v
import comJobDetailCard from '@/mycomponents/detail/comJobDetailCard.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
+import comJobDetailCardBatch from "@/mycomponents/detail/comJobDetailCardBatch.vue"
import { useCountStore } from '@/store'
// 获取自定义的store
@@ -65,6 +77,7 @@ const jobContent = ref({}) // 任务内容
const subList = ref([]) // 接口返回的任务subList
const detailSource = ref([]) // 绑定在页面上的数据源
const managementList = ref([])
+const managementType = ref('')
const fromLocationCode = ref('')
const toLocationCode = ref('')
const toLocationAreaTypeList = ref([])
@@ -145,9 +158,12 @@ const getDetail = () => {
} else if (res.data.subList.length > 0) {
jobContent.value = res.data
jobStatus.value = res.data.status
+ //赋值给真实的状态
+ res.data.subList.forEach(item => {
+ item.inventoryStatus = item.inspectResult
+ })
subList.value = res.data.subList
detailSource.value = getTreeDataSource(subList.value)
-
fromLocationCode.value = subList.value[0].fromLocationCode
jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
@@ -157,6 +173,19 @@ const getDetail = () => {
} else {
toLocationCode.value = jobToLocationCode.value
}
+ //获取管理模式,封装参数
+ let itemCodes = []
+ detailSource.value.forEach(item => {
+ itemCodes.push(item.itemCode)
+ item.scaned = false
+ })
+ getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
+ if (res.success) {
+ managementList.value = res.list;
+ managementType.value = managementList.value.some(item => item.ManagementPrecision ==
+ 'BY_BATCH') ? 'BY_BATCH' : ''
+ }
+ })
// 外部进入详情,如果有扫描信息,模拟自动扫描
if (scanMessage.value) {
openScanPopupSimulate(scanMessage.value)
@@ -197,7 +226,7 @@ const continueScan = () => {
}
}
const updateData = () => {
- calcTreeHandleQty(detailSource.value)
+ // calcTreeHandleQty(detailSource.value)
}
// 模拟扫描功能
const openScanPopupSimulate = (message) => {
@@ -255,8 +284,9 @@ const openScanPopup = () => {
const closeScanPopup = () => {
scanPopup.value.closeScanPopup()
}
-const getScanResult = (result) => {
+const getScanResult = (result,managementPrecision) => {
try {
+ managementType.value = managementPrecision
const { packingNumber } = result.label
const { batch } = result.label
const { qty } = result.label
@@ -272,70 +302,158 @@ const getScanResult = (result) => {
if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else {
- const itemDetail = detail.subList.find((r) => {
- return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode
- })
-
- if (itemDetail == undefined) {
- let isExit
- for (const subItem of detail.subList) {
- var item
- for (const pack of subItem.packList) {
- if (pack.packingNumber == packingNumber && pack.batch == batch) {
- item = pack
- isExit = pack
- break
+ detail.scaned = true
+ if (managementType.value == 'BY_BATCH') {
+ verificationBatch(detail, packingNumber, batch, qty, itemCode, locationCode, result)
+ }else {
+ const itemDetail = detail.subList.find((r) => {
+ return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode
+ })
+ if (itemDetail == undefined) {
+ let isExit
+ for (const subItem of detail.subList) {
+ let item
+ for (const pack of subItem.packList) {
+ if (pack.packingNumber == packingNumber && pack.batch == batch) {
+ item = pack
+ isExit = pack
+ break
+ }
+ }
+ if (item != undefined) {
+ subItem.scaned = true
+ subItem.handleQty = 0
+ item = undefined
}
}
- if (item != undefined) {
- subItem.scaned = true
- subItem.handleQty = 0
- item = undefined
- }
- }
- if (isExit == undefined) {
- showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
- } else if (!isExit.cancleScanedHiht && isExit.scaned) {
- showMessage(`箱码【${packingNumber}】已经扫描`)
- } else {
- isExit.scaned = true
- let qty = 0
- if (result.balance != null) {
- qty = Number(result.balance.qty)
+ if (isExit == undefined) {
+ showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
+ } else if (!isExit.cancleScanedHiht && isExit.scaned) {
+ showMessage(`箱码【${packingNumber}】已经扫描`)
} else {
- qty = Number(result.label.qty)
+ isExit.scaned = true
+ let qty = 0
+ if (result.balance != null) {
+ qty = Number(result.balance.qty)
+ } else {
+ qty = Number(result.label.qty)
+ }
+ isExit.handleQty = Number(result.label.qty)
+ isExit.toLocationCode = toLocationCode.value
}
- isExit.handleQty = Number(result.label.qty)
- isExit.toLocationCode = toLocationCode.value
+ calcTreeHandleQty(detailSource.value)
+ continueScan()
}
- calcTreeHandleQty(detailSource.value)
- } else {
- let scanedLength = 0
- itemDetail.packList.forEach((res) => {
- if (res.scaned) {
- scanedLength++
+ else {
+ let scanedLength = 0
+ itemDetail.packList.forEach((res) => {
+ if (res.scaned) {
+ scanedLength++
+ }
+ })
+ itemDetail.fromInventoryStatus = result.balance.inventoryStatus
+ if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList.length) {
+ showMessage(`箱码【${packingNumber}】已经扫描`)
}
+ else {
+ itemDetail.scaned = true
+ detailSource.value[0].subList.sort(compareAsc('scaned')) // 按扫描信息排序
+ itemDetail.handleQty = result.label.qty
+ // itemDetail.toInventoryStatus = 'OK'
+ itemDetail.packList.forEach((pac) => {
+ pac.scaned = true
+ pac.handleQty = Number(pac.qty)
+ pac.toLocationCode = toLocationCode.value
+ })
+ calcTreeHandleQty(detailSource.value)
+ continueScan()
+ }
+ }
+ }
+ }
+ if (managementType.value == 'BY_BATCH') {
+ detailSource.value.forEach(item => {
+ item.subList.forEach(detail => {
+ detail.packingNumber = ''
})
- itemDetail.fromInventoryStatus = result.balance.inventoryStatus
- if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList.length) {
- showMessage(`箱码【${packingNumber}】已经扫描`)
+ })
+ }
+ } catch (e) {
+ showMessage(e.message)
+ }
+}
+// 按批次的时候校验 代码和按包装的代码基本一致,只不过是校验提示不一致
+const verificationBatch = (detail,packingNumber,batch,qty,itemCode,locationCode,result)=>{
+ let itemDetail = detail.subList.find(r => {
+ return r.batch == batch &&
+ r.fromLocationCode == result.fromLocationCode
+ })
+
+ if (itemDetail == undefined) {
+ let isExit;
+ for (let subItem of detail.subList) {
+ let item;
+ for (let pack of subItem.packList) {
+ if (pack.batch == batch) {
+ item = pack;
+ isExit = pack;
+ break;
+ }
+ }
+ if (item != undefined) {
+ subItem.scaned = true
+ subItem.handleQty = 0;
+ item = undefined
+ }
+ }
+
+ if (isExit == undefined) {
+ showErrorMessage("批次【" + batch + "】库位【" + result
+ .fromLocationCode + "】不在列表中")
+ } else {
+ if (!isExit.cancleScanedHiht && isExit.scaned) {
+ showMessage("批次【" + batch + "】已经扫描")
+ } else {
+ isExit.scaned = true
+ let qty = 0;
+ if (result.balance != null) {
+ qty = Number(result.balance.qty);
} else {
- itemDetail.scaned = true
- detailSource.value[0].subList.sort(compareAsc('scaned')) // 按扫描信息排序
- itemDetail.handleQty = result.label.qty
- // itemDetail.toInventoryStatus = 'OK'
- itemDetail.packList.forEach((pac) => {
- pac.scaned = true
- pac.handleQty = Number(pac.qty)
- pac.toLocationCode = toLocationCode.value
- })
- calcTreeHandleQty(detailSource.value)
- continueScan()
+ qty = Number(result.label.qty);
}
+ isExit.handleQty = Number(result.label.qty);
+ isExit.toLocationCode = this.toLocationCode;
}
}
- } catch (e) {
- // showMessage(e.message)
+ calcTreeHandleQty(this.detailSource);
+ continueScan()
+ } else {
+ let scanedLength = 0;
+ itemDetail.packList.forEach(res => {
+ if (res.scaned) {
+ scanedLength++;
+ }
+ })
+ //大哥让加的
+ itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
+ if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList
+ .length) {
+ // this.showMessage("箱码【" + packingNumber + "】已经扫描")
+ showMessage("批次【" + batch + "】已经扫描")
+ } else {
+ itemDetail.scaned = true;
+ detailSource.value[0].subList.sort(compareAsc('scaned')); //按扫描信息排序
+ itemDetail.handleQty = result.label.qty;
+ // itemDetail.toInventoryStatus = "OK"
+ itemDetail.packList.forEach(pac => {
+ pac.scaned = true
+ pac.handleQty = Number(pac.qty);
+ pac.toLocationCode = toLocationCode.value;
+ })
+
+ calcTreeHandleQty(this.detailSource);
+ continueScan()
+ }
}
}
const scanLocationCode = (location, code) => {
@@ -384,12 +502,16 @@ const commit = () => {
// 扫描数量小于任务数量,判断是否允许部分提交
if (jobContent.value.allowPartialComplete == 'TRUE') {
// 提交
- submitJob()
+ comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
+ if (res) {
+ submitJob()
+ }
+ });
} else {
// 不允许部分提交,提示
- comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交
' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => {
+ comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
- openScanPopup()
+ openScanPopup();
}
})
}
@@ -412,7 +534,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
- showCommitSuccessMessage(`提交成功
生成采购上架记录
${res.data}`)
+ showCommitSuccessMessage(`提交成功\n生成采购上架记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@@ -435,6 +557,8 @@ const setParams = () => {
if (detail.scaned) {
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber
+ detail.packingNumber = info.packingNumber;
+ detail.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch
detail.toContainerNumber = ''
diff --git a/src/pages/putaway/job/putawayJob.vue b/src/pages/putaway/job/putawayJob.vue
index b2ab8586..8744cb3f 100644
--- a/src/pages/putaway/job/putawayJob.vue
+++ b/src/pages/putaway/job/putawayJob.vue
@@ -26,7 +26,6 @@ import { getPutawayJobList, cancleTakePutawayJob } from '@/api/request2.js'
import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
-import {Exception} from 'sass';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comPutawayJobCard from '@/pages/putaway/coms/comPutawayJobCard.vue'
@@ -264,8 +263,14 @@ const getDataListByType = (code) => {
}
const showMessage = (message) => {
+ if(scanPopup.value){
+ scanPopup.value.packLoseFocus()
+ }
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
+ if(scanPopup.value){
+ scanPopup.value.packGetFocus()
+ }
}
})
}
@@ -348,23 +353,23 @@ const getScanResult = (result) => {
if (list[0].acceptUserId == store.id) {
selectItem(list[0])
} else {
- showMessage(`该任务已经被[${list[0].acceptUserName}]承接` + `
任务号[${list[0].number}]扫描[${result.scanMessage}]`)
+ showMessage(`该任务已经被[${list[0].acceptUserName}]承接` + `\n任务号[${list[0].number}]扫描[${result.scanMessage}]`)
}
} else if (list[0].status == 3) {
- showMessage(`该任务已经完成
承接人[${list[0].acceptUserName}]
任务号[${list[0].number}]扫描[${result.scanMessage}]`)
+ showMessage(`该任务已经完成\n承接人[${list[0].acceptUserName}]\n任务号[${list[0].number}]扫描[${result.scanMessage}]`)
}
} else {
- showMessage('查询到多条任务
' + `扫描[${result.scanMessage}]`)
+ showMessage('查询到多条任务\n' + `扫描[${result.scanMessage}]`)
}
} else {
- showMessage('未查找到任务
' + `扫描[${result.scanMessage}]`)
+ showMessage('未查找到任务\n' + `扫描[${result.scanMessage}]`)
}
})
.catch((error) => {
- showMessage(`${error}
扫描[${result.scanMessage}]`)
+ showMessage(`${error}\n扫描[${result.scanMessage}]`)
})
} catch (e) {
- showMessage(`${e}
扫描[${result.scanMessage}]`)
+ showMessage(`${e}\n扫描[${result.scanMessage}]`)
}
}
diff --git a/src/pages/putaway/job/quantityPutawayJob.vue b/src/pages/putaway/job/quantityPutawayJob.vue
new file mode 100644
index 00000000..24098f0d
--- /dev/null
+++ b/src/pages/putaway/job/quantityPutawayJob.vue
@@ -0,0 +1,517 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 当前页({{ jobList.length }})
+
+
+
+
+ 第{{ pageNo }}页,每页/{{ pageSize }}, 共:{{ totalCount }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ({{ index + 1 }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/putaway/job/quantityPutawayJobDetail.vue b/src/pages/putaway/job/quantityPutawayJobDetail.vue
new file mode 100644
index 00000000..4a522bcc
--- /dev/null
+++ b/src/pages/putaway/job/quantityPutawayJobDetail.vue
@@ -0,0 +1,508 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file