|
|
@ -36,13 +36,13 @@ |
|
|
|
<!-- 合格转隔离单独的弹窗--> |
|
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' |
|
|
|
@showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' |
|
|
|
@onConfirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" |
|
|
|
></okToHoldRecordPack> |
|
|
|
@onConfirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult"></okToHoldRecordPack> |
|
|
|
<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="clearFromLocationCode"></win-scan-location> |
|
|
|
|
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -57,9 +57,6 @@ |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import okToHoldRecordPack from '@/pages/inventoryMove/coms/okToHoldRecordPack.vue' |
|
|
|
|
|
|
|
import { |
|
|
|
getInventoryStatusName |
|
|
|
} from '@/common/directory.js'; |
|
|
|
import { |
|
|
|
inventoryMoveRecordSubmit, |
|
|
|
getBasicLocationByCode, |
|
|
@ -69,8 +66,12 @@ |
|
|
|
import { |
|
|
|
getDirectoryItemArray, |
|
|
|
getItemTypeName, |
|
|
|
getInventoryStatusName, |
|
|
|
checkDirectoryItemExist, |
|
|
|
getListItemTypeDesc |
|
|
|
getListItemTypeDesc, |
|
|
|
getListItemStatusDesc, |
|
|
|
getItemStatusName, |
|
|
|
getInventoryStatusDesc |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -104,7 +105,7 @@ |
|
|
|
comBlankView, |
|
|
|
winScanLocation, |
|
|
|
winScanPackAndLocation, |
|
|
|
okToHoldRecordPack |
|
|
|
okToHoldRecordPack, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
// fromInventoryStatus: { |
|
|
@ -155,7 +156,9 @@ |
|
|
|
dataContent: {}, |
|
|
|
fromLocationAreaTypeList: [], |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
itemCodeTypeList: [], |
|
|
|
itemTypeList: [], |
|
|
|
itemStatusList: [], |
|
|
|
fromInventoryStatuses:[], |
|
|
|
isShowEditLocation: false, |
|
|
|
isJustReplay: true, //是否只是回显,不走库存余额接口 |
|
|
|
fromWarehouseCode: "" |
|
|
@ -166,9 +169,11 @@ |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.itemCodeTypeList = res.itemCodeTypeList; |
|
|
|
this.itemTypeList = res.itemTypeList; |
|
|
|
this.itemStatusList = res.itemStatusList; |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|
|
|
this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
|
|
|
this.fromInventoryStatuses =getDirectoryItemArray(res.fromInventoryStatuses); |
|
|
|
this.showPopup() |
|
|
|
} else { |
|
|
|
this.showErrorMessage(res.message) |
|
|
@ -288,17 +293,46 @@ |
|
|
|
this.toLocationInfo = location; |
|
|
|
}, |
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
this.fromWarehouseCode =result.fromWarehouseCode |
|
|
|
this.fromWarehouseCode = result.fromWarehouseCode |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if (this.showOnePop) { |
|
|
|
if (this.isJustReplay) { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = result.label.itemCode |
|
|
|
this.$refs.okToHoldRecordPackRef.batch = result.label.batch |
|
|
|
this.$refs.okToHoldRecordPackRef.uom = result.balance?result.balance.uom:"" |
|
|
|
this.getResult = result //存储接受的结果 |
|
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
|
this.checkItemCode(result.label.itemCode, callBack => { |
|
|
|
if (callBack) { |
|
|
|
var itemType = callBack.itemType |
|
|
|
var itemStatus = callBack.itemStatus |
|
|
|
if (checkDirectoryItemExist(this.itemTypeList, itemType)) { |
|
|
|
if (checkDirectoryItemExist(this.itemStatusList, itemStatus)) { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = result.label.itemCode |
|
|
|
this.$refs.okToHoldRecordPackRef.batch = result.label.batch |
|
|
|
this.$refs.okToHoldRecordPackRef.uom = result.balance ? result.balance.uom : "" |
|
|
|
this.getResult = result //存储接受的结果 |
|
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
|
} else { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
var hint = getListItemStatusDesc(this.itemStatusList); |
|
|
|
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" + |
|
|
|
getItemStatusName(itemStatus) + "],需要的物料状态是[" + hint + "]") |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
var hint = getListItemTypeDesc(this.itemTypeList); |
|
|
|
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" + |
|
|
|
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]") |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】'); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.getScanResultAfterBatch(result, managementTypeParams) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
@ -323,7 +357,7 @@ |
|
|
|
this.$refs.comMessage.showErrorMessage('请输入数量'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.getResult = this.getResult ? this.getResult : { |
|
|
|
label: {}, |
|
|
|
fromLocationCode: '' |
|
|
@ -336,12 +370,16 @@ |
|
|
|
this.$refs.scanPopup.getScanResult(this.getResult, this.businessType) |
|
|
|
|
|
|
|
}, |
|
|
|
//checkItemCode |
|
|
|
checkItemCode(itemCode, callBack) { |
|
|
|
getBasicItemByCode(itemCode).then(res => { |
|
|
|
if (res.data.list.length > 0) { |
|
|
|
var itemType = res.data.list[0].type |
|
|
|
callBack(itemType) |
|
|
|
var itemStatus = res.data.list[0].status |
|
|
|
var info = { |
|
|
|
itemType: itemType, |
|
|
|
itemStatus: itemStatus |
|
|
|
} |
|
|
|
callBack(info) |
|
|
|
} else { |
|
|
|
callBack(null) |
|
|
|
} |
|
|
@ -350,14 +388,17 @@ |
|
|
|
callBack(null) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
isInItemCodeTypeList(itemType) { |
|
|
|
var item = this.itemCodeTypeList.find(res => res == itemType) |
|
|
|
|
|
|
|
if (item = undefined) { |
|
|
|
return false |
|
|
|
} |
|
|
|
return true |
|
|
|
|
|
|
|
checkInventoryStatus(result,inventoryStatus) { |
|
|
|
var isPass=true; |
|
|
|
if (!checkDirectoryItemExist(this.fromInventoryStatuses, inventoryStatus)) { |
|
|
|
isPass=false |
|
|
|
var hint = getInventoryStatusDesc(this.fromInventoryStatuses); |
|
|
|
this.showErrorMessage("查询库存是[" + |
|
|
|
getInventoryStatusName(inventoryStatus) + "],需要的库存状态是[" + hint + "]") |
|
|
|
|
|
|
|
} |
|
|
|
return isPass; |
|
|
|
}, |
|
|
|
|
|
|
|
clearFromLocationCode() { |
|
|
@ -426,6 +467,9 @@ |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
getScanResultAfterBatch(result, managementTypeParams) { |
|
|
|
if(!this.checkInventoryStatus(result,result.balance.inventoryStatus)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
var balance = result.balance; |
|
|
|
this.balanceInfo = result.balance; |
|
|
|
var pack = result.package; |
|
|
@ -539,11 +583,22 @@ |
|
|
|
result.label.itemCode = result.label.code |
|
|
|
this.checkItemCode(result.label.itemCode, callBack => { |
|
|
|
if (callBack) { |
|
|
|
if (checkDirectoryItemExist(this.itemCodeTypeList, callBack)) { |
|
|
|
this.$refs.scanPopup.getScanResult(result) |
|
|
|
var itemType = callBack.itemType |
|
|
|
var itemStatus = callBack.itemStatus |
|
|
|
|
|
|
|
if (checkDirectoryItemExist(this.itemTypeList, itemType)) { |
|
|
|
if (checkDirectoryItemExist(this.itemStatusList, itemStatus)) { |
|
|
|
this.$refs.scanPopup.getScanResult(result) |
|
|
|
} else { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
var hint = getListItemStatusDesc(this.itemStatusList); |
|
|
|
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" + |
|
|
|
getItemStatusName(itemStatus) + "],需要的物料状态是[" + hint + "]") |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
var hint = getListItemTypeDesc(this.itemCodeTypeList); |
|
|
|
var hint = getListItemTypeDesc(this.itemTypeList); |
|
|
|
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" + |
|
|
|
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]") |
|
|
|
} |
|
|
@ -554,8 +609,6 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$refs.scanPopup.getScanResult(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 清除来源库位 |
|
|
|