|
|
@ -12,7 +12,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=""> |
|
|
|
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" @updateData="updateData" @openDetail="openDetail"> </comInventoryDetailCard> |
|
|
|
<comInventoryDetailCardBatch :dataContent="item" :settingParam="jobContent" @remove="updateData" |
|
|
|
@updateData='updateData' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList" |
|
|
|
@openDetail="openDetail" v-if="managementType=='BY_BATCH'"> |
|
|
|
</comInventoryDetailCardBatch> |
|
|
|
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" |
|
|
|
@updateData='updateData' :locationAreaTypeList="toLocationAreaTypeList" |
|
|
|
:allowEditQty ="jobContent.allowModifyQty=='TRUE'?true:false" |
|
|
|
@openDetail="openDetail" v-else> |
|
|
|
</comInventoryDetailCard> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
@ -42,14 +51,16 @@ import { getManagementPrecisions, getPrecisionStrategyList } from '@/common/bala |
|
|
|
|
|
|
|
import { getDataSource, getScanCount, calcHandleQty } from '@/common/detail.js' |
|
|
|
import { goHome, navigateBack, getCurrDateTime, getPackingNumberAndBatchByList, getInventoryStatusName } from '@/common/basic.js' |
|
|
|
|
|
|
|
import {getDirectoryItemArray} from '@/common/directory.js'; |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' |
|
|
|
import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue' |
|
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
|
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import { useCountStore } from '@/store' |
|
|
|
import {a} from "unocss-preset-weapp/dist/utilities-322cd311"; |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
|
const { proxy } = getCurrentInstance() |
|
|
@ -70,6 +81,8 @@ const scanPopup = ref() |
|
|
|
const detailInfoPopupRef = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const comScanLocation = ref() |
|
|
|
const managementType = ref() |
|
|
|
const toLocationAreaTypeList = ref([]) |
|
|
|
onLoad((option) => { |
|
|
|
title.value = option.title |
|
|
|
id.value = option.id |
|
|
@ -122,6 +135,10 @@ const initData = () => { |
|
|
|
name = '隔离转合格' |
|
|
|
toLocationCode.value = '' |
|
|
|
toInventoryStatus.value = 'OK' |
|
|
|
} else if(this.businessTypeCode == "HoldToWip"){ |
|
|
|
name = '隔离转线边' |
|
|
|
toLocationCode.value = '' |
|
|
|
toInventoryStatus.value = 'OK' |
|
|
|
}else if (businessTypeCode.value == 'HoldToScrap') { |
|
|
|
name = '隔离转报废' |
|
|
|
toLocationCode.value = 'SCRAP' |
|
|
@ -166,15 +183,30 @@ const receive = (callback) => { |
|
|
|
const getDetail = () => { |
|
|
|
proxy.$modal.loading('加载中...') |
|
|
|
getInventoryMoveJobDetail(id.value) |
|
|
|
.then((res) => { |
|
|
|
.then(async (res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data == null) { |
|
|
|
showMessage('未获取到详情') |
|
|
|
} else if (res.data.subList.length > 0) { |
|
|
|
jobContent.value = res.data |
|
|
|
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes); |
|
|
|
jobStatus.value = res.data.status |
|
|
|
subList.value = res.data.subList |
|
|
|
detailSource.value = getDataSource(subList.value) |
|
|
|
detailSource.value = await getDataSource(subList.value) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
let itemCodes = [] |
|
|
|
detailSource.value.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
item.scaned = false |
|
|
|
}) |
|
|
|
toLocationCode.value = subList.value[0].toLocationCode |
|
|
|
getManagementPrecisions(itemCodes, toLocationCode.value, res => { |
|
|
|
if (res.success) { |
|
|
|
managementList.value = res.list; |
|
|
|
managementType.value = managementList.value.some(item => item.ManagementPrecision == |
|
|
|
'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
showMessage('列表数据为0') |
|
|
|
} |
|
|
@ -226,7 +258,7 @@ const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value) |
|
|
|
} |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
const getScanResult = (result,managementPrecision) => { |
|
|
|
try { |
|
|
|
const { packingNumber } = result.label |
|
|
|
const { batch } = result.label |
|
|
@ -236,13 +268,20 @@ const getScanResult = (result) => { |
|
|
|
if (detail == undefined) { |
|
|
|
showMessage(`物料号【${itemCode}】不在列表中`) |
|
|
|
} else { |
|
|
|
const itemDetail = detail.subList.find((r) => { |
|
|
|
return r.packingNumber == packingNumber && r.batch == batch |
|
|
|
let itemDetail = '' |
|
|
|
if(managementPrecision == 'BY_QUANTITY'){ |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.itemCode == result.label.itemCode |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.batch == batch |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在列表中`) |
|
|
|
} |
|
|
|
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') { |
|
|
|
showErrorMessage(`批次[${batch}]不在列表中`) |
|
|
|
} else if (itemDetail.scaned) { |
|
|
|
showMessage(`箱码【${packingNumber}】已经扫描`) |
|
|
|
showMessage(`批次【${batch}】已经扫描`) |
|
|
|
} else { |
|
|
|
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) |
|
|
|
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) |
|
|
@ -292,18 +331,43 @@ const commit = () => { |
|
|
|
showErrorMessage('扫描数为0,请先扫描') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//允许部分提交 |
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
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) { |
|
|
|
this.openScanPopup(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const checkCount = ()=>{ |
|
|
|
// 提交的数量和任务数量不一致提示 |
|
|
|
let str = '' |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach(cur => { |
|
|
|
if (cur.qty != cur.handleQty) { |
|
|
|
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致` |
|
|
|
let tempHandleQty |
|
|
|
if (cur.handleQty) { |
|
|
|
tempHandleQty = cur.handleQty |
|
|
|
} else { |
|
|
|
tempHandleQty = 0 |
|
|
|
} |
|
|
|
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n` |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (str) { |
|
|
|
str += ',是否确认提交?' |
|
|
|
str = '任务明细未全部完成,是否提交?\n' + str |
|
|
|
comMessageRef.value.showQuestionMessage1(str, 'red', res => { |
|
|
|
if (res) { |
|
|
|
submitJob() |
|
|
@ -313,7 +377,6 @@ const commit = () => { |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const submitJob = () => { |
|
|
|
proxy.$modal.loading('提交中...') |
|
|
|
|
|
|
@ -329,7 +392,11 @@ const submitJob = () => { |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
showCommitSuccessMessage(`提交成功<br>生成库存转移记录<br>${res.data}`) |
|
|
|
let showTitle = this.title |
|
|
|
if (title.value.indexOf('任务') == title.value.length - 2) { |
|
|
|
showTitle = this.title.replace('任务', '') |
|
|
|
} |
|
|
|
showCommitSuccessMessage(`提交成功\n生成${showTitle}库存转移记录\n${res.data}`) |
|
|
|
} else { |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
@ -378,6 +445,8 @@ const setParams = () => { |
|
|
|
if (detail.scaned) { |
|
|
|
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch) |
|
|
|
detail.toPackingNumber = info.packingNumber |
|
|
|
detail.packingNumber = info.packingNumber; |
|
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
|
detail.toBatch = info.batch |
|
|
|
detail.toContainerNumber = '' |
|
|
|
// detail.toLocationCode = this.toLocationCode; |
|
|
|