|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view> |
|
|
<com-blank-view @goScan="showPopup" v-if="detailSource.length == 0"></com-blank-view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-wraper" v-if="detailSource.length > 0"> |
|
|
<view class="page-wraper" v-if="detailSource.length > 0"> |
|
|
<view class="split_line"></view> |
|
|
<view class="split_line"></view> |
|
@ -30,7 +30,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-button @goScan="showFromLocationPopup"></win-scan-button> |
|
|
<win-scan-button @goScan="showPopup"></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' |
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' |
|
|
@showFromLocationPopup='showFromLocationPopup' |
|
|
@showFromLocationPopup='showFromLocationPopup' |
|
@ -39,10 +39,12 @@ |
|
|
@clickBtnClearFromLocation='clearFromLocation' |
|
|
@clickBtnClearFromLocation='clearFromLocation' |
|
|
@clickBtnClearItemCode='clearItemCode'> |
|
|
@clickBtnClearItemCode='clearItemCode'> |
|
|
</okToHoldRecordPack> |
|
|
</okToHoldRecordPack> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" @clearItemCode='clearItemCode' :title="'箱码'"></win-scan-pack-and-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" |
|
|
|
|
|
:title="'箱码'"> |
|
|
|
|
|
</win-scan-pack-and-location> |
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" |
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" |
|
|
@getLocation="getFromLocation" :locationAreaTypeList="fromLocationAreaTypeList" |
|
|
@getLocation="getFromLocation" :locationAreaTypeList="fromLocationAreaTypeList" |
|
|
@clearFromLocation='clearFromLocation'> |
|
|
> |
|
|
</win-scan-location> |
|
|
</win-scan-location> |
|
|
<com-message ref="comMessageRef" /> |
|
|
<com-message ref="comMessageRef" /> |
|
|
</view> |
|
|
</view> |
|
@ -69,7 +71,7 @@ import { |
|
|
} from '@/common/calc.js'; |
|
|
} from '@/common/calc.js'; |
|
|
import { getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js' |
|
|
import { getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js' |
|
|
|
|
|
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty,createItemInfoForLabel,createDetailInfoForLabel } from '@/common/record.js' |
|
|
import { useCountStore } from '@/store' |
|
|
import { useCountStore } from '@/store' |
|
|
// 获取自定义的store |
|
|
// 获取自定义的store |
|
|
const store = useCountStore() |
|
|
const store = useCountStore() |
|
@ -113,6 +115,7 @@ const isShowEditLocation = ref(false) |
|
|
const scanFromLocationCode = ref() |
|
|
const scanFromLocationCode = ref() |
|
|
const getResult = ref({}) |
|
|
const getResult = ref({}) |
|
|
const managementType = ref('') |
|
|
const managementType = ref('') |
|
|
|
|
|
const isJustReplay = ref(true) |
|
|
|
|
|
|
|
|
const scanPopup = ref() |
|
|
const scanPopup = ref() |
|
|
const businessTypeCode = ref(props.businessTypeCode) |
|
|
const businessTypeCode = ref(props.businessTypeCode) |
|
@ -125,7 +128,9 @@ onMounted(() => { |
|
|
getBusinessType(props.businessTypeCode, (res) => { |
|
|
getBusinessType(props.businessTypeCode, (res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
businessType.value = res.businessType |
|
|
businessType.value = res.businessType |
|
|
openScanPopup(true) |
|
|
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList; |
|
|
|
|
|
toLocationAreaTypeList.value = res.toLocationAreaTypeList; |
|
|
|
|
|
showPopup(true) |
|
|
} else { |
|
|
} else { |
|
|
showErrorMessage(res.message) |
|
|
showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
@ -200,6 +205,7 @@ const getLocationInfo = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
const openScanPopup = () => { |
|
|
|
|
|
isJustReplay.value = true |
|
|
if (fromLocationCode.value == '') { |
|
|
if (fromLocationCode.value == '') { |
|
|
showFromLocationPopup() |
|
|
showFromLocationPopup() |
|
|
return |
|
|
return |
|
@ -207,6 +213,9 @@ const openScanPopup = () => { |
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
} |
|
|
} |
|
|
const showFromLocationPopup = ()=> { |
|
|
const showFromLocationPopup = ()=> { |
|
|
|
|
|
scanFromLocationCode.value.openScanPopup(); |
|
|
|
|
|
} |
|
|
|
|
|
const showPopup = () => { |
|
|
setTimeout(()=>{ |
|
|
setTimeout(()=>{ |
|
|
if(props.showOnePop){ |
|
|
if(props.showOnePop){ |
|
|
okToHoldRecordPackRef.value.fromLocationCode = '' |
|
|
okToHoldRecordPackRef.value.fromLocationCode = '' |
|
@ -222,6 +231,7 @@ const showFromLocationPopup = () => { |
|
|
} |
|
|
} |
|
|
const getFromLocation = (location) => { |
|
|
const getFromLocation = (location) => { |
|
|
fromLocationCode.value = location.code |
|
|
fromLocationCode.value = location.code |
|
|
|
|
|
okToHoldRecordPackRef.value.fromLocationCode = location.code |
|
|
fromLocationInfo.value = location |
|
|
fromLocationInfo.value = location |
|
|
if(!props.showOnePop){ |
|
|
if(!props.showOnePop){ |
|
|
openScanPopup() |
|
|
openScanPopup() |
|
@ -238,11 +248,14 @@ const getToLocation = (location, code) => { |
|
|
const getScanResult = (result,managementTypeParams)=> { |
|
|
const getScanResult = (result,managementTypeParams)=> { |
|
|
managementType.value = managementTypeParams |
|
|
managementType.value = managementTypeParams |
|
|
if(props.showOnePop){ |
|
|
if(props.showOnePop){ |
|
|
|
|
|
if(this.isJustReplay){ |
|
|
okToHoldRecordPackRef.value.itemCode= result.balance.itemCode |
|
|
okToHoldRecordPackRef.value.itemCode= result.balance.itemCode |
|
|
okToHoldRecordPackRef.value.batch = result.balance.batch |
|
|
okToHoldRecordPackRef.value.batch = result.balance.batch |
|
|
getResult.value = result//存储接受的结果 |
|
|
getResult.value = result//存储接受的结果 |
|
|
scanPopup.value.closeScanPopup() |
|
|
scanPopup.value.closeScanPopup() |
|
|
|
|
|
}else{ |
|
|
|
|
|
getScanResultAfterBatch(result,managementTypeParams) |
|
|
|
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
getScanResultAfterBatch(result,managementTypeParams) |
|
|
getScanResultAfterBatch(result,managementTypeParams) |
|
@ -254,21 +267,27 @@ const getScanResult = (result,managementTypeParams)=> { |
|
|
const okToHoldRecordPackConfirm = (obj)=>{ |
|
|
const okToHoldRecordPackConfirm = (obj)=>{ |
|
|
// this.getResult. = result//存储接受的结果 |
|
|
// this.getResult. = result//存储接受的结果 |
|
|
if(!obj.fromLocationCode){ |
|
|
if(!obj.fromLocationCode){ |
|
|
comMessageRef.value.showErrorMessage('请选择来源库位'); |
|
|
comMessageRef.value.showErrorMessage('请输入来源库位'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(!obj.itemCode){ |
|
|
if(!obj.itemCode){ |
|
|
comMessageRef.value.showErrorMessage('请选择零件'); |
|
|
comMessageRef.value.showErrorMessage('请输入零件'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(!obj.handleQty){ |
|
|
if(!obj.handleQty){ |
|
|
comMessageRef.value.showErrorMessage('请输入数量'); |
|
|
comMessageRef.value.showErrorMessage('请输入数量'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
// this.getResult.fromLocationCode = obj.fromLocationCode |
|
|
getResult.value = getResult.value ? getResult.value : { |
|
|
getResult.value.label.batch = obj.handleQty |
|
|
label:{}, |
|
|
|
|
|
fromLocationCode:'' |
|
|
|
|
|
} |
|
|
|
|
|
getResult.value.fromLocationCode = obj.fromLocationCode |
|
|
|
|
|
getResult.value.label.itemCode = obj.itemCode |
|
|
|
|
|
getResult.value.label.batch = obj.batch |
|
|
getResult.value.label.qty = obj.handleQty |
|
|
getResult.value.label.qty = obj.handleQty |
|
|
getScanResultAfterBatch(getResult.value,managementType.value) |
|
|
isJustReplay.value = false |
|
|
|
|
|
scanPopup.value.getScanResult(getResult.value,businessType.value) |
|
|
} |
|
|
} |
|
|
const getScanResultAfter = (result) => { |
|
|
const getScanResultAfter = (result) => { |
|
|
const { balance } = result |
|
|
const { balance } = result |
|
@ -335,8 +354,8 @@ const getScanResultAfterBatch = (result,managementTypeParams)=> { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
let itemp = createItemInfo(balance, pack); |
|
|
let itemp = createItemInfoForLabel(balance, result.label); |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
let newDetail = createDetailInfoForLabel(balance, pack, result.label); |
|
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
if (newDetail.packingNumber == '') { |
|
|
newDetail.packingNumber = pack.number; |
|
|
newDetail.packingNumber = pack.number; |
|
@ -369,7 +388,7 @@ const getScanResultAfterBatch = (result,managementTypeParams)=> { |
|
|
}) |
|
|
}) |
|
|
}else if(managementTypeParams == 'BY_BATCH'){ |
|
|
}else if(managementTypeParams == 'BY_BATCH'){ |
|
|
detail = item.subList.find(r => { |
|
|
detail = item.subList.find(r => { |
|
|
if (r.batch == pack.batch && |
|
|
if (r.batch == result.label.batch && |
|
|
r.fromLocationCode == balance.locationCode && |
|
|
r.fromLocationCode == balance.locationCode && |
|
|
r.scaned == true) { |
|
|
r.scaned == true) { |
|
|
return r; |
|
|
return r; |
|
@ -424,14 +443,14 @@ const getInputMsgResult = (result,fromWitch)=> { |
|
|
// 清除来源库位 |
|
|
// 清除来源库位 |
|
|
const clearFromLocation = (fromLocationCodeParams)=>{ |
|
|
const clearFromLocation = (fromLocationCodeParams)=>{ |
|
|
okToHoldRecordPackRef.value.fromLocationCode = '' |
|
|
okToHoldRecordPackRef.value.fromLocationCode = '' |
|
|
okToHoldRecordPackRef.value.itemCode ='' |
|
|
// okToHoldRecordPackRef.value.itemCode ='' |
|
|
okToHoldRecordPackRef.value.batch ='' |
|
|
// okToHoldRecordPackRef.value.batch ='' |
|
|
// this.isClearFromLocationCode = true |
|
|
// this.isClearFromLocationCode = true |
|
|
} |
|
|
} |
|
|
// 清除批次和物料 |
|
|
// 清除批次和物料 |
|
|
const clearItemCode = (label)=>{ |
|
|
const clearItemCode = (label)=>{ |
|
|
okToHoldRecordPackRef.value.itemCode ='' |
|
|
okToHoldRecordPackRef.value.itemCode ='' |
|
|
okToHoldRecordPackRef.value.batch ='' |
|
|
// okToHoldRecordPackRef.value.batch ='' |
|
|
} |
|
|
} |
|
|
const showErrorMessage = (message) => { |
|
|
const showErrorMessage = (message) => { |
|
|
if(scanPopup.value){ |
|
|
if(scanPopup.value){ |
|
@ -585,9 +604,9 @@ const setParams = () => { |
|
|
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch) |
|
|
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch) |
|
|
const submitItem = deepCopyData(detail) |
|
|
const submitItem = deepCopyData(detail) |
|
|
submitItem.itemCode = detail.itemCode |
|
|
submitItem.itemCode = detail.itemCode |
|
|
submitItem.itemName = detail.package.itemName |
|
|
submitItem.itemName = detail.itemName |
|
|
submitItem.itemDesc1 = detail.package.itemDesc1 |
|
|
submitItem.itemDesc1 = detail.itemDesc1 |
|
|
submitItem.itemDesc2 = detail.package.itemDesc2 |
|
|
submitItem.itemDesc2 = detail.itemDesc2 |
|
|
|
|
|
|
|
|
submitItem.fromInventoryStatus = detail.inventoryStatus |
|
|
submitItem.fromInventoryStatus = detail.inventoryStatus |
|
|
submitItem.toInventoryStatus = detail.toInventoryStatus |
|
|
submitItem.toInventoryStatus = detail.toInventoryStatus |
|
|