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