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. 107
      src/pages/inventoryMove/coms/comMoveRecord.vue

19
src/common/directory.js

@ -211,6 +211,18 @@ export function getListItemTypeDesc(list) {
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) {
var resultInfo = "";
@ -311,6 +323,13 @@ export function getItemTypeName(value) {
return location == '' ? value : location.label;
}
//获取物品状态名称
export function getItemStatusName(value) {
let location = getItemStateInfo(value);
return location == '' ? value : location.label;
}
//获取库位类型名称
export function getLocationTypeName(value) {

6
src/common/record.js

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

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

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

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

@ -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") {
@ -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)
}
@ -351,13 +389,16 @@
})
},
isInItemCodeTypeList(itemType) {
var item = this.itemCodeTypeList.find(res => res == itemType)
checkInventoryStatus(result,inventoryStatus) {
var isPass=true;
if (!checkDirectoryItemExist(this.fromInventoryStatuses, inventoryStatus)) {
isPass=false
var hint = getInventoryStatusDesc(this.fromInventoryStatuses);
this.showErrorMessage("查询库存是[" +
getInventoryStatusName(inventoryStatus) + "],需要的库存状态是[" + hint + "]")
if (item = undefined) {
return false
}
return true
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)
}
},
//

Loading…
Cancel
Save