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