Browse Source

发料记录修改扫描物料校验

wms3.0_pda
lijuncheng 10 months ago
parent
commit
daa186e85f
  1. 49
      common/directory.js
  2. 1
      common/record.js
  3. 8
      mycomponents/scan/winComScan.vue
  4. 103
      mycomponents/scan/winScanItem.vue
  5. 2
      pages/index/index.vue
  6. 52
      pages/issue/coms/comIssueRequestPopup.vue
  7. 7
      pages/issue/record/issueRecord.vue

49
common/directory.js

@ -1,5 +1,6 @@
let jobStatusList = []; let jobStatusList = [];
let itemStatusList = []; let itemStatusList = [];
let itemTypeList =[];
let locationTypeList = []; let locationTypeList = [];
let uomList = []; let uomList = [];
let inventoryStatusList = []; let inventoryStatusList = [];
@ -39,6 +40,7 @@ export function getBusinessTypeDesc(type) {
export function clearCacheData() { export function clearCacheData() {
jobStatusList = []; jobStatusList = [];
itemStatusList = []; itemStatusList = [];
itemTypeList =[];
locationTypeList = []; locationTypeList = [];
uomList = []; uomList = [];
inventoryStatusList = []; inventoryStatusList = [];
@ -143,16 +145,57 @@ export function getJobStateStyle(value) {
} }
} }
//获取库位描述 //获取库位描述(多个库位)
export function getListLocationTypeDesc(lst) { export function getListLocationTypeDesc(list) {
let desc = ''; let desc = '';
lst.forEach(res => { list.forEach(res => {
desc += getLocationTypeInfo(res).label + "," desc += getLocationTypeInfo(res).label + ","
}) })
desc = desc.slice(0, -1); desc = desc.slice(0, -1);
return desc; return desc;
} }
//获取物品状态(多个状态)
export function getListItemStateDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemStateInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型(多个)
export function getListItemTypeDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemTypeInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型
export function getItemTypeInfo(value) {
var resultInfo = "";
if (itemTypeList.length == 0) {
itemTypeList = getDirectoryInfo("item_type")
}
if (itemTypeList.length > 0) {
for (let item of itemTypeList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取物品状态 //获取物品状态
export function getItemStateInfo(value) { export function getItemStateInfo(value) {
var resultInfo = ""; var resultInfo = "";

1
common/record.js

@ -67,6 +67,7 @@ export function getBusinessType(typeCode, callback) {
result.businessType = res.data.list[0]; result.businessType = res.data.list[0];
result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes)
result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes)
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
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;
callback(result) callback(result)

8
mycomponents/scan/winComScan.vue

@ -141,13 +141,19 @@
// }) // })
let that = this; let that = this;
let index = that.scanMsg.indexOf('\n'); let index = that.scanMsg.indexOf('\n');
if (index > 0) { if (index >= 0) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => { setTimeout(() => {
that.losefocus(); that.losefocus();
let content = uni.$u.trim(that.scanMsg) let content = uni.$u.trim(that.scanMsg)
if (content == "") { if (content == "") {
that.getfocus(); that.getfocus();
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => {
if (res) {
that.scanMsg=""
that.getfocus();
}
})
return; return;
} }

103
mycomponents/scan/winScanItem.vue

@ -13,29 +13,42 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" <win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
:placeholder='title' headerType="HMQ,HPQ">
:clearResult="false"
headerType="HMQ,HPQ">
</win-com-scan> </win-com-scan>
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import {
getBasicItemByCode
} from '@/api/request2.js';
import {
getLocationTypeName,
getListLocationTypeDesc,
checkDirectoryItemExist,
getListItemTypeDesc,
getItemTypeInfo
} from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default { export default {
name: 'winScanItem', name: 'winScanItem',
components: { components: {
winComScan winComScan,
comMessage
}, },
emits: ["getScanCode",'getScanResult'], emits: ["getScanCode", 'getScanResult'],
props: { props: {
title: { title: {
type: String, type: String,
@ -44,7 +57,11 @@
isShowRecord: { isShowRecord: {
type: Boolean, type: Boolean,
default: true default: true
} },
itemCodeTypeList: {
type: Array,
default: []
},
}, },
data() { data() {
return { return {
@ -80,22 +97,76 @@
this.$refs.scan.clearScanValue(); this.$refs.scan.clearScanValue();
}, },
getScanResult(result) { getScanResult(result) {
this.result = result; uni.showLoading({
if (result.label.barType == "QRCode") { title: '扫描中...',
this.code = result.label.itemCode; mask: true
} else if (result.label.barType == "BarCode") { });
this.code = result.label.code;
var scanResult = result;
if (scanResult.label.barType == "QRCode") {
this.code = scanResult.label.itemCode;
} else if (scanResult.label.barType == "BarCode") {
this.code = scanResult.label.code;
}
if (this.code == undefined) {
uni.hideLoading();
this.showErrorMessage("扫描物料[" + this.code + "]为空,请输入正确的物料")
return
} }
this.callBack(); getBasicItemByCode(this.code).then(res => {
uni.hideLoading();
if (res.data != null && res.data.list.length > 0) {
var result =res.data.list[0];
var status =result.status;
var type = result.type;
var itemCode = result.code
var itemName =result.name
var uom = result.uom
var std = result.uom
result.package = scanResult.package
if(status=="ENABLE"){
if(checkDirectoryItemExist(this.itemCodeTypeList,type)){
this.result =result;
this.callBack()
}else {
var hint = getListItemTypeDesc(this.itemCodeTypeList);
this.showErrorMessage("扫描物料[" + this.code + "]是[" +
getItemTypeInfo(type).label + "],需要的物料类型是[" + hint + "]")
}
}else {
this.showErrorMessage('物料【' + this.code + '】不可用');
}
} else {
this.showErrorMessage('未查找到物料【' + this.code + '】');
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}, },
callBack() { callBack() {
this.closeScanPopup();
this.$refs.scan.clear(); this.$refs.scan.clear();
this.$emit("getScanCode", this.code); // this.$emit("getScanCode", this.code);
this.$emit("getScanResult", this.code, this.result); this.$emit("getScanResult", this.code, this.result);
}, },
change(e) { change(e) {
this.isShow = e.show this.isShow = e.show
} },
showErrorMessage(message) {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
},
getfocus() {
this.$refs.scan.getfocus();
},
losefocus() {
this.$refs.scan.losefocus();
},
} }
} }
</script> </script>

2
pages/index/index.vue

@ -317,7 +317,7 @@
}, },
getDictory() { getDictory() {
var params = { var params = {
types: ["job_status", "location_type", "item_status", "uom", types: ["job_status", "location_type", "item_status","item_type","uom",
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason", "inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason", "unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode", "request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",

52
pages/issue/coms/comIssueRequestPopup.vue

@ -62,7 +62,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult'> <win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult' :itemCodeTypeList="itemCodeTypeList" >
</win-scan-item> </win-scan-item>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -97,7 +97,6 @@
}, },
data() { data() {
return { return {
// itemCode: 'CE115F11161AG',
workshopCode: "", // workshopCode: "", //
workShopName: "", workShopName: "",
productionLineCode: "", //线 productionLineCode: "", //线
@ -112,7 +111,6 @@
itemCodeFocus: false, itemCodeFocus: false,
requestInfo: null, requestInfo: null,
itemCodeList: [], itemCodeList: [],
isCheckItemCode: false,
counQty: undefined, counQty: undefined,
editPosition: true, editPosition: true,
numberFocus: false, numberFocus: false,
@ -131,6 +129,10 @@
type: String, type: String,
default: '需求信息' default: '需求信息'
}, },
itemCodeTypeList: {
type: Array,
default: []
},
}, },
methods: { methods: {
checkNum(e) { checkNum(e) {
@ -162,7 +164,6 @@
this.isModifiedPosition = false this.isModifiedPosition = false
} else { } else {
this.itemCode = ""; this.itemCode = "";
this.isCheckItemCode = false;
this.show = false this.show = false
this.uom = "" this.uom = ""
this.qty = 0; this.qty = 0;
@ -177,7 +178,6 @@
initData(){ initData(){
this.positionList = []; this.positionList = [];
this.itemCode = "请扫描物料信息"; this.itemCode = "请扫描物料信息";
this.isCheckItemCode = false;
this.rawLocationCode ="" this.rawLocationCode =""
this.positionInfo ="请选择位置" this.positionInfo ="请选择位置"
this.workshopCode= "" // this.workshopCode= "" //
@ -211,10 +211,6 @@
itemCodeLoseFocus() { itemCodeLoseFocus() {
this.itemCodeFocus = false; this.itemCodeFocus = false;
}, },
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() { confirm() {
if (this.positionInfo == "请选择位置" ) { if (this.positionInfo == "请选择位置" ) {
@ -222,7 +218,7 @@
return return
} }
if (this.itemCode == "" || !this.isCheckItemCode) { if (this.itemCode == "请扫描物料信息") {
this.showErrorMessage("请输入物料", "itemCode") this.showErrorMessage("请输入物料", "itemCode")
return return
} }
@ -243,28 +239,6 @@
this.callback('add'); this.callback('add');
}, },
checkItemCode(itemCode) {
//
getBasicItemByCode(itemCode).then(res => {
uni.hideLoading();
this.$refs.scanPopup.closeScanPopup();
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到物料【' + itemCode + '】', "itemCode");
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "itemCode");
})
},
callback(action) { callback(action) {
let item = { let item = {
positionInfo: this.positionInfo, positionInfo: this.positionInfo,
@ -295,8 +269,7 @@
} }
}) })
if (type == "itemCode") { if (type == "itemCode") {
this.itemCode = "" this.itemCode = "请扫描物料信息"
this.isCheckItemCode = false;
} }
}) })
}, },
@ -343,13 +316,12 @@
}, },
getItemScanResult(code, scanResult) { getItemScanResult(code, scanResult) {
if (code == "") { this.itemCode = code;
this.showErrorMessage('物料号不能为空') this.itemName = scanResult.name
return; this.uom =scanResult.uom
}
this.itemCode = "";
this.checkItemCode(code)
this.stdPackInfo = scanResult.package; this.stdPackInfo = scanResult.package;
this.numberFocus = true
} }
} }
} }

7
pages/issue/record/issueRecord.vue

@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup> <com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm' :itemCodeTypeList="itemCodeTypeList"></com-issue-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> <com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack> </com-scan-issue-pack>
@ -113,7 +113,8 @@
toInventoryStatuses: "", toInventoryStatuses: "",
requestList: [], requestList: [],
dataContent: {}, dataContent: {},
managementList: [] managementList: [],
itemCodeTypeList: []
} }
}, },
mounted() { mounted() {
@ -129,7 +130,7 @@
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList; this.itemCodeTypeList = res.itemCodeTypeList;
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.fromInventoryStatuses = res.fromInventoryStatuses this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses this.toInventoryStatuses = res.toInventoryStatuses

Loading…
Cancel
Save