|
|
@ -14,7 +14,16 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<com-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false" @remove="updateData" @updateData="updateData" @openDetail="openDetail" :locationAreaTypeList="toLocationAreaTypeList"> </com-detail-card> |
|
|
|
<comDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList" v-if="managementType=='BY_BATCH'"> |
|
|
|
</comDetailCardBatch> |
|
|
|
<comLableDetailCard :dataContent="item" :settingParam="jobContent" |
|
|
|
:isShowStatus="false" |
|
|
|
:isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList" v-else> |
|
|
|
</comLableDetailCard > |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</view> |
|
|
@ -33,7 +42,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult"></win-scan-pack-and-location> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult="getScanResult"></win-scan-pack> |
|
|
|
<detail-info-popup ref="detailInfoPopupRef"></detail-info-popup> |
|
|
|
|
|
|
|
<com-message ref="comMessageRef" /> |
|
|
@ -51,9 +60,10 @@ import { goHome, navigateBack, getPackingNumberAndBatch, getInventoryStatusName, |
|
|
|
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' |
|
|
|
import comLableDetailCard from "@/mycomponents/detail/comLableDetailCard.vue" |
|
|
|
import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" |
|
|
|
import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import { useCountStore } from '@/store' |
|
|
@ -75,6 +85,7 @@ const scanPopup = ref() |
|
|
|
const detailInfoPopupRef = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const comScanLocation = ref() |
|
|
|
const managementType = ref('') |
|
|
|
onLoad((option) => { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: `${option.title}详情` |
|
|
@ -153,6 +164,18 @@ const getDetail = () => { |
|
|
|
toLocationCode.value = subList.value[0].toLocationCode |
|
|
|
} |
|
|
|
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
let itemCodes = [] |
|
|
|
detailSource.value.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
item.scaned = false |
|
|
|
}) |
|
|
|
getManagementPrecisions(itemCodes, fromLocationCode.value, res => { |
|
|
|
if (res.success) { |
|
|
|
managementList.value = res.list; |
|
|
|
managementType.value = managementList.value.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
showMessage('列表数据为0') |
|
|
|
} |
|
|
@ -182,26 +205,7 @@ const openDetail = (item) => { |
|
|
|
detailInfoPopupRef.value.openPopup(item) |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
let fromlocationCode = '' |
|
|
|
const fromlocationList = [] |
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
const item = detailSource.value[i] |
|
|
|
item.subList.forEach((l) => { |
|
|
|
// 重复的库位不往里面插入 |
|
|
|
const location = fromlocationList.find((res) => res == l.fromLocationCode) |
|
|
|
if (location == undefined) { |
|
|
|
fromlocationList.push(l.fromLocationCode) |
|
|
|
} |
|
|
|
// 来源库位赋默认值 |
|
|
|
if (fromlocationCode == '') { |
|
|
|
if (!l.scaned) { |
|
|
|
fromlocationCode = l.fromLocationCode |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value) |
|
|
|
detailInfoPopupRef.value.openPopup() |
|
|
|
} |
|
|
|
const closeScanPopup = () => { |
|
|
|
scanPopup.value.closeScanPopup() |
|
|
@ -209,12 +213,10 @@ const closeScanPopup = () => { |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
try { |
|
|
|
const { packingNumber } = result.balance |
|
|
|
const { batch } = result.balance |
|
|
|
const { qty } = result.balance |
|
|
|
const { itemCode } = result.balance |
|
|
|
const { locationCode } = result.balance |
|
|
|
const { inventoryStatus } = result.balance |
|
|
|
const { packingNumber } = result.label |
|
|
|
const { batch } = result.label |
|
|
|
const { qty } = result.label |
|
|
|
const { itemCode } = result.label |
|
|
|
const detail = detailSource.value.find((r) => r.itemCode == itemCode) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
@ -228,40 +230,11 @@ const getScanResult = (result) => { |
|
|
|
} else if (itemDetail.scaned) { |
|
|
|
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) |
|
|
|
} else { |
|
|
|
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) |
|
|
|
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) |
|
|
|
|
|
|
|
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
|
if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { |
|
|
|
showQuestionMessage(`实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续退货?`, (res) => { |
|
|
|
if (res) { |
|
|
|
itemDetail.scaned = true |
|
|
|
itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
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 |
|
|
|
calcHandleQty1() |
|
|
|
} else { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => { |
|
|
|
scanPopupGetFocus() |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true |
|
|
|
itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
itemDetail.toInventoryStatus = 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 |
|
|
|
calcHandleQty1() |
|
|
|
} |
|
|
|
itemDetail.scaned = true |
|
|
|
itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
itemDetail.packQty = Number(result.package.packQty) |
|
|
|
itemDetail.packUnit = result.package.packUnit |
|
|
|
calcHandleQty(); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
@ -279,24 +252,23 @@ const commit = () => { |
|
|
|
if (!checkLocation()) { |
|
|
|
return |
|
|
|
} |
|
|
|
// 提交的数量和任务数量不一致提示 |
|
|
|
let str = '' |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach(cur => { |
|
|
|
if (cur.qty != cur.handleQty) { |
|
|
|
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致` |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (str) { |
|
|
|
str += ',是否确认提交?' |
|
|
|
comMessageRef.value.showQuestionMessage(str, 'red', res => { |
|
|
|
if (res) { |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
submitJob() |
|
|
|
|
|
|
|
// //扫描数量和任务数量相等,直接提交 |
|
|
|
if (scanCount.value == subList.value.length) { |
|
|
|
checkCount(); |
|
|
|
} else if (scanCount.value < subList.value.length) { |
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
if (jobContent.value.allowPartialComplete == "TRUE") { |
|
|
|
//提交 |
|
|
|
checkCount(); |
|
|
|
} else { |
|
|
|
//不允许部分提交,提示 |
|
|
|
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { |
|
|
|
if (res) { |
|
|
|
openScanPopup(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
// // 扫描数量和任务数量相等,直接提交 |
|
|
|
// if (scanCount.value == subList.value.length) { |
|
|
@ -316,6 +288,33 @@ const commit = () => { |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
const checkCount = () => { |
|
|
|
// 提交的数量和任务数量不一致提示 |
|
|
|
let str = '' |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach(cur => { |
|
|
|
if (cur.qty != cur.handleQty) { |
|
|
|
let tempHandleQty |
|
|
|
if(cur.handleQty){ |
|
|
|
tempHandleQty = cur.handleQty |
|
|
|
}else { |
|
|
|
tempHandleQty = 0 |
|
|
|
} |
|
|
|
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (str) { |
|
|
|
str = '任务明细未全部完成,是否提交?\n'+str |
|
|
|
comMessageRef.value.showQuestionMessage(str, 'red', res => { |
|
|
|
if (res) { |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
} |
|
|
|
const submitJob = () => { |
|
|
|
proxy.$modal.loading('提交中...') |
|
|
|
const itemCodes = [] |
|
|
@ -331,7 +330,7 @@ const submitJob = () => { |
|
|
|
uni.hideLoading() |
|
|
|
console.log(res.data) |
|
|
|
if (res.data) { |
|
|
|
showCommitSuccessMessage(`提交成功<br>生成客户退货记录:${res.data}`) |
|
|
|
showCommitSuccessMessage(`提交成功\n生成客户退货记录\n:${res.data}`) |
|
|
|
} else { |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
@ -356,9 +355,11 @@ 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.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = info.batch |
|
|
|
detail.toLocationCode = detail.toLocationCode |
|
|
|
detail.toLocationCode = info.toLocationCode |
|
|
|
detail.toInventoryStatus = 'HOLD' |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
@ -424,13 +425,13 @@ const showQuestionMessage = (message, callback) => { |
|
|
|
|
|
|
|
const scanPopupGetFocus = () => { |
|
|
|
if (scanPopup.value != undefined) { |
|
|
|
scanPopup.value.packGetFocus() |
|
|
|
scanPopup.value.getfocus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const scanPopupLoseFocus = () => { |
|
|
|
if (scanPopup.value != undefined) { |
|
|
|
scanPopup.value.packLoseFocus() |
|
|
|
scanPopup.value.losefocus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|