Compare commits

...

2 Commits

  1. 19
      src/common/directory.js
  2. 6
      src/common/record.js
  3. 2
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  4. 115
      src/pages/inventoryMove/coms/comMoveRecord.vue

19
src/common/directory.js

@ -211,6 +211,18 @@ export function getListItemTypeDesc(list) {
return desc; return desc;
} }
//获取物品状态(多个)
export function getListItemStatusDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemStateInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型 //获取物品类型
export function getItemTypeInfo(value) { export function getItemTypeInfo(value) {
var resultInfo = ""; var resultInfo = "";
@ -311,6 +323,13 @@ export function getItemTypeName(value) {
return location == '' ? value : location.label; return location == '' ? value : location.label;
} }
//获取物品状态名称
export function getItemStatusName(value) {
let location = getItemStateInfo(value);
return location == '' ? value : location.label;
}
//获取库位类型名称 //获取库位类型名称
export function getLocationTypeName(value) { export function getLocationTypeName(value) {

6
src/common/record.js

@ -151,7 +151,8 @@ export function getBusinessType(typeCode, callback) {
businessType: '', businessType: '',
fromLocationAreaTypeList: '', fromLocationAreaTypeList: '',
toLocationAreaTypeList: '', toLocationAreaTypeList: '',
itemCodeTypeList: "", itemTypeList: "",
itemStatusList:"",
useOnTheWay: "FALSE", useOnTheWay: "FALSE",
fromInventoryStatuses: '', fromInventoryStatuses: '',
toInventoryStatuses: '', toInventoryStatuses: '',
@ -162,7 +163,8 @@ export function getBusinessType(typeCode, callback) {
result.businessType = res.data.list[0]; result.businessType = res.data.list[0];
result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes); result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes);
result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes); result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes);
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes) result.itemTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.itemStatusList =getDirectoryItemArray(res.data.list[0].itemStatuses)
result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses; result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses;
result.toInventoryStatuses = res.data.list[0].inInventoryStatuses; result.toInventoryStatuses = res.data.list[0].inInventoryStatuses;
result.useOnTheWay = res.data.list[0].useOnTheWay result.useOnTheWay = res.data.list[0].useOnTheWay

2
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -140,6 +140,8 @@
item.scaned = false item.scaned = false
item.balance = {} item.balance = {}
item.handleQty = 0; item.handleQty = 0;
item.packUnit="";
item.packQty=undefined;
this.$forceUpdate() this.$forceUpdate()
this.$emit('remove', item) this.$emit('remove', item)
} }

115
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -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.scanPopup.getScanResult(result)
} 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)
} }
}, },
// //

Loading…
Cancel
Save