|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view> |
|
|
<view> |
|
|
<uni-popup ref="popup" @maskClick="closeScanPopup()"> |
|
|
<uni-popup ref="popup" @maskClick="closeScanPopup()"> |
|
|
<view class="popup_box"> |
|
|
<view class="popup_box"> |
|
|
<view class="pop_title uni-flex space-between"> |
|
|
<view class="pop_title uni-flex space-between"> |
|
|
<view class="" style="font-size: 35rpx;"> |
|
|
<view class="" style="font-size: 35rpx;"> |
|
@ -34,8 +34,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" |
|
|
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
|
|
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> |
|
|
:headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -68,7 +68,7 @@ |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: true |
|
|
default: true |
|
|
}, |
|
|
}, |
|
|
headerType:{ |
|
|
headerType: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: 'HPQ,HMQ' |
|
|
default: 'HPQ,HMQ' |
|
|
} |
|
|
} |
|
@ -86,7 +86,7 @@ |
|
|
workShopName: "", |
|
|
workShopName: "", |
|
|
productionLineName: "", |
|
|
productionLineName: "", |
|
|
workStationName: "", |
|
|
workStationName: "", |
|
|
isEditPosition:true |
|
|
isEditPosition: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -94,8 +94,8 @@ |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
|
|
|
|
|
|
if(this.positionList.length==0){ |
|
|
if (this.positionList.length == 0) { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "数据加载中....", |
|
|
title: "数据加载中....", |
|
|
mask: true |
|
|
mask: true |
|
@ -108,47 +108,49 @@ |
|
|
this.showErrorMessage(error) |
|
|
this.showErrorMessage(error) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.$refs.popup.open('bottom'); |
|
|
this.$refs.popup.open('bottom'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
closeScanPopup() { |
|
|
this.$refs.popup.close(); |
|
|
this.$refs.popup.close(); |
|
|
this.$emit("close", ''); |
|
|
this.$emit("close", ''); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanClick() { |
|
|
scanClick() { |
|
|
this.$refs.comscan.clickScanMsg(); |
|
|
this.$refs.comscan.clickScanMsg(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
cancelClick() { |
|
|
cancelClick() { |
|
|
this.$refs.comscan.clearScanValue(); |
|
|
this.$refs.comscan.clearScanValue(); |
|
|
}, |
|
|
}, |
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
if(this.positionInfo=="请选择位置"){ |
|
|
if (this.positionInfo == "请选择位置") { |
|
|
this.showErrorMessage("请先选择位置") |
|
|
this.showErrorMessage("请先选择位置") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
var param = { |
|
|
var param = { |
|
|
positionInfo:this.positionInfo, |
|
|
positionInfo: this.positionInfo, |
|
|
workshopCode:this.workshopCode, |
|
|
workshopCode: this.workshopCode, |
|
|
productionLineCode:this.productionLineCode, |
|
|
productionLineCode: this.productionLineCode, |
|
|
workStationCode:this.workStationCode |
|
|
workStationCode: this.workStationCode, |
|
|
|
|
|
rawLocationCode: this.rawLocationCode, |
|
|
|
|
|
fgLocationCode: this.fgLocationCode, |
|
|
} |
|
|
} |
|
|
if (result.success) { |
|
|
if (result.success) { |
|
|
this.isEditPosition = false |
|
|
this.isEditPosition = false |
|
|
this.$emit("getResult", result,param); |
|
|
this.$emit("getResult", result, param); |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage(result.message) |
|
|
this.showErrorMessage(result.message) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getfocus() { |
|
|
getfocus() { |
|
|
if (this.$refs.comscan != undefined) { |
|
|
if (this.$refs.comscan != undefined) { |
|
|
this.$refs.comscan.getfocus(); |
|
|
this.$refs.comscan.getfocus(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
losefocus() { |
|
|
losefocus() { |
|
|
if (this.$refs.comscan != undefined) { |
|
|
if (this.$refs.comscan != undefined) { |
|
|
this.$refs.comscan.losefocus(); |
|
|
this.$refs.comscan.losefocus(); |
|
@ -156,17 +158,16 @@ |
|
|
}, |
|
|
}, |
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) {} |
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showSelect() { |
|
|
showSelect() { |
|
|
if(this.isEditPosition){ |
|
|
if (this.isEditPosition) { |
|
|
this.show = !this.show |
|
|
this.show = !this.show |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
confirmSelect(e) { |
|
|
confirmSelect(e) { |
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
@ -177,25 +178,25 @@ |
|
|
this.workShopName = e[0].label |
|
|
this.workShopName = e[0].label |
|
|
this.productionLineName = e[1].label |
|
|
this.productionLineName = e[1].label |
|
|
this.workStationName = e[2].label |
|
|
this.workStationName = e[2].label |
|
|
|
|
|
|
|
|
// let shop = this.positionList.find(shop => shop.value == this.workshopCode); |
|
|
let shop = this.positionList.find(shop => shop.value == this.workshopCode); |
|
|
// if (shop != undefined && shop.children != undefined) { |
|
|
if (shop != undefined && shop.children != undefined) { |
|
|
// let prodLine = shop.children.find(line => line.value == this.productionLineCode); |
|
|
let prodLine = shop.children.find(line => line.value == this.productionLineCode); |
|
|
// if (prodLine != undefined && prodLine.children != undefined) { |
|
|
if (prodLine != undefined && prodLine.children != undefined) { |
|
|
// let station = prodLine.children.find(r => r.value == this.workStationCode); |
|
|
let station = prodLine.children.find(r => r.value == this.workStationCode); |
|
|
// if (station.rawLocationCode == '' && station.rawLocationCode == null) { |
|
|
if (station.rawLocationCode == '' && station.rawLocationCode == null) { |
|
|
// this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择") |
|
|
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择") |
|
|
// return; |
|
|
return; |
|
|
// } else { |
|
|
} else { |
|
|
// this.rawLocationCode = station.rawLocationCode; |
|
|
this.rawLocationCode = station.rawLocationCode; |
|
|
// this.fgLocationCode = station.fgLocationCode; |
|
|
this.fgLocationCode = station.fgLocationCode; |
|
|
// } |
|
|
} |
|
|
// } else { |
|
|
} else { |
|
|
// this.showErrorMessage("生产线-工位基础信息维护错误") |
|
|
this.showErrorMessage("生产线-工位基础信息维护错误") |
|
|
// } |
|
|
} |
|
|
// } else { |
|
|
} else { |
|
|
// this.showErrorMessage("车间-生产线基础信息维护错误") |
|
|
this.showErrorMessage("车间-生产线基础信息维护错误") |
|
|
// } |
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|