|
|
@ -13,6 +13,18 @@ |
|
|
|
<u-line /> |
|
|
|
<view class="uni-flex uni-column" style="background-color: white; "> |
|
|
|
<view class="uni-flex uni-column "> |
|
|
|
<view class="uni-flex uni-row padding title u-col-center"> |
|
|
|
<text>从仓库代码:</text> |
|
|
|
<view class="uni-flex u-col-center uni-row" @click="showWarseHouseSelect"> |
|
|
|
<view class="" style="margin-left: 20rpx;width: 100% "> |
|
|
|
{{fromWarehouseCode}} |
|
|
|
</view> |
|
|
|
<u-select v-model="showWareHouse" mode="single-column" :list="wareHouseList" |
|
|
|
@confirm="confirmWareHouse"></u-select> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-line /> |
|
|
|
<view class="uni-flex uni-row padding title u-col-center"> |
|
|
|
<text>位置:</text> |
|
|
|
<view class="uni-flex u-col-center uni-row" @click="showSelect"> |
|
|
@ -36,18 +48,20 @@ |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-line /> |
|
|
|
|
|
|
|
<view class="uni-flex uni-row padding title u-col-center"> |
|
|
|
<text>数量: </text> |
|
|
|
<view class="uni-flex uni-row uni-center" |
|
|
|
style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;"> |
|
|
|
|
|
|
|
|
|
|
|
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number" |
|
|
|
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" /> |
|
|
|
|
|
|
|
@confirm="confirm()" :focus="numberFocus" @input="checkNum" |
|
|
|
:maxlength="maxlength" /> |
|
|
|
|
|
|
|
<uom :uom="uom"></uom> |
|
|
|
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;"> |
|
|
|
<view class="" v-if="stdPackInfo!=undefined" |
|
|
|
style="display: flex;flex-direction: row;margin-left: 10rpx;"> |
|
|
|
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>) |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -62,7 +76,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult'> |
|
|
|
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult' |
|
|
|
:itemCodeTypeList="itemCodeTypeList"> |
|
|
|
</win-scan-item> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
@ -73,7 +88,8 @@ |
|
|
|
getBasicLocationByCode, |
|
|
|
getBasicItemByCode, |
|
|
|
getProductionlineItem, |
|
|
|
getWorkShopLineStation |
|
|
|
getWorkShopLineStation, |
|
|
|
getWarehouseCodeList |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
getLocationTypeName, |
|
|
@ -86,18 +102,16 @@ |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import winScanItem from '@/mycomponents/scan/winScanItem.vue' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
uom, |
|
|
|
balanceStatus, |
|
|
|
comMessage, |
|
|
|
winScanItem, |
|
|
|
stdPackQty |
|
|
|
stdPackQty, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// itemCode: 'CE115F11161AG', |
|
|
|
workshopCode: "", //车间 |
|
|
|
workShopName: "", |
|
|
|
productionLineCode: "", //生产线 |
|
|
@ -105,6 +119,7 @@ |
|
|
|
workStationCode: "", //工位 |
|
|
|
workStationName: "", |
|
|
|
itemCode: '请扫描物料信息', |
|
|
|
fromWarehouseCode: "请选择仓库代码", |
|
|
|
itemName: "", |
|
|
|
qty: 0, |
|
|
|
rawLocationCode: "", |
|
|
@ -112,7 +127,6 @@ |
|
|
|
itemCodeFocus: false, |
|
|
|
requestInfo: null, |
|
|
|
itemCodeList: [], |
|
|
|
isCheckItemCode: false, |
|
|
|
counQty: undefined, |
|
|
|
editPosition: true, |
|
|
|
numberFocus: false, |
|
|
@ -122,8 +136,10 @@ |
|
|
|
isModifiedPosition: true, |
|
|
|
positionList: [], |
|
|
|
stdQty: 0, //标包 |
|
|
|
maxlength:10, |
|
|
|
stdPackInfo:undefined |
|
|
|
maxlength: 10, |
|
|
|
stdPackInfo: undefined, |
|
|
|
wareHouseList: [], |
|
|
|
showWareHouse: false |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -131,6 +147,10 @@ |
|
|
|
type: String, |
|
|
|
default: '需求信息' |
|
|
|
}, |
|
|
|
itemCodeTypeList: { |
|
|
|
type: Array, |
|
|
|
default: [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
checkNum(e) { |
|
|
@ -140,7 +160,7 @@ |
|
|
|
if (dot > -1) { |
|
|
|
this.maxlength = dot + 7; //长度是小数点后两位 |
|
|
|
if (value.length > dot + 7) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (reg.test(value)) { //如果是正整数不包含小数点 |
|
|
@ -151,19 +171,28 @@ |
|
|
|
openRequestPopup(editPosition) { |
|
|
|
if (this.positionList.length == 0) { |
|
|
|
getWorkShopLineStation().then(res => { |
|
|
|
this.positionList = res.data |
|
|
|
}).catch(error => { |
|
|
|
if (res.data != null && res.data.length > 0) { |
|
|
|
this.positionList = res.data |
|
|
|
} else { |
|
|
|
this.showErrorMessage('未查找到位置信息'); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showErrorMessage(error); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.editPosition = editPosition; |
|
|
|
if (this.isModifiedPosition) { |
|
|
|
this.isModifiedPosition = false |
|
|
|
} else { |
|
|
|
this.itemCode = ""; |
|
|
|
this.itemCode = "请扫描物料信息"; |
|
|
|
this.show = false |
|
|
|
this.showWareHouse = false |
|
|
|
this.uom = "" |
|
|
|
this.qty = 0; |
|
|
|
this.stdPackInfo = undefined; |
|
|
|
this.counQty = undefined; |
|
|
|
this.numberFocus = false |
|
|
|
this.itemCodeGetFocus(); |
|
|
@ -171,6 +200,29 @@ |
|
|
|
|
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
this.positionList = []; |
|
|
|
this.wareHouseList= [], |
|
|
|
this.showWareHouse = false |
|
|
|
this.editPosition =true; |
|
|
|
this.itemCode = "请扫描物料信息"; |
|
|
|
this.rawLocationCode = "" |
|
|
|
this.positionInfo = "请选择位置" |
|
|
|
this.fromWarehouseCode = "请选择仓库代码" |
|
|
|
this.workshopCode = "" //车间 |
|
|
|
this.workShopName = "" |
|
|
|
this.productionLineCode = "" //生产线 |
|
|
|
this.productionLineName = "" |
|
|
|
this.workStationCode = "" //工位 |
|
|
|
this.workStationName = "" |
|
|
|
this.show = false |
|
|
|
this.uom = "" |
|
|
|
this.qty = 0; |
|
|
|
this.stdPackInfo = undefined; |
|
|
|
this.counQty = undefined; |
|
|
|
this.numberFocus = false |
|
|
|
}, |
|
|
|
|
|
|
|
closeRequestPopup() { |
|
|
|
this.$refs.popup.close() |
|
|
|
}, |
|
|
@ -188,13 +240,20 @@ |
|
|
|
itemCodeLoseFocus() { |
|
|
|
this.itemCodeFocus = false; |
|
|
|
}, |
|
|
|
selectedItem(item) { |
|
|
|
this.itemCode = item.itemCode; |
|
|
|
this.checkItemCode(); |
|
|
|
}, |
|
|
|
|
|
|
|
confirm() { |
|
|
|
if (this.itemCode == "" || !this.isCheckItemCode) { |
|
|
|
if (this.positionInfo == "请选择位置") { |
|
|
|
this.showErrorMessage("请选择位置") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.fromWarehouseCode == "请选择仓库代码") { |
|
|
|
this.showErrorMessage("请选择仓库代码") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.itemCode == "请扫描物料信息") { |
|
|
|
this.showErrorMessage("请输入物料", "itemCode") |
|
|
|
return |
|
|
|
} |
|
|
@ -202,7 +261,7 @@ |
|
|
|
this.showErrorMessage("请输入数量") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.qty == 0) { |
|
|
|
this.showErrorMessage("数量必须大于0") |
|
|
|
return |
|
|
@ -215,28 +274,6 @@ |
|
|
|
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) { |
|
|
|
let item = { |
|
|
|
positionInfo: this.positionInfo, |
|
|
@ -248,6 +285,8 @@ |
|
|
|
workStationName: this.workStationName, |
|
|
|
rawLocationCode: this.rawLocationCode, |
|
|
|
fgLocationCode: this.fgLocationCode, |
|
|
|
fromWarehouseCode: this.fromWarehouseCode, |
|
|
|
toWarehouseCode: this.fromWarehouseCode, |
|
|
|
itemCode: this.itemCode, |
|
|
|
itemName: this.itemName, |
|
|
|
uom: this.uom, |
|
|
@ -267,8 +306,7 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
if (type == "itemCode") { |
|
|
|
this.itemCode = "" |
|
|
|
this.isCheckItemCode = false; |
|
|
|
this.itemCode = "请扫描物料信息" |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -282,8 +320,14 @@ |
|
|
|
if (this.editPosition) { |
|
|
|
this.show = true |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
showWarseHouseSelect() { |
|
|
|
if (this.editPosition) { |
|
|
|
this.wareHouseClick(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
confirmSelect(e) { |
|
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
|
|
console.log("位置", this.positionInfo) |
|
|
@ -315,14 +359,42 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getItemScanResult(code, scanResult) { |
|
|
|
if (code == "") { |
|
|
|
this.showErrorMessage('物料号不能为空') |
|
|
|
return; |
|
|
|
} |
|
|
|
this.itemCode = ""; |
|
|
|
this.checkItemCode(code) |
|
|
|
this.itemCode = code; |
|
|
|
this.itemName = scanResult.name |
|
|
|
this.uom = scanResult.uom |
|
|
|
this.stdPackInfo = scanResult.package; |
|
|
|
} |
|
|
|
this.numberFocus = true |
|
|
|
}, |
|
|
|
wareHouseClick() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "查询中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
getWarehouseCodeList(1, 100).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data != null && res.data.list.length > 0) { |
|
|
|
res.data.list.forEach(item => { |
|
|
|
item.value = item.code; |
|
|
|
item.label = item.name; |
|
|
|
}) |
|
|
|
this.wareHouseList = res.data.list |
|
|
|
this.showWareHouse = true |
|
|
|
} else { |
|
|
|
this.showErrorMessage('未查找到仓库代码'); |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
confirmWareHouse(e) { |
|
|
|
this.fromWarehouseCode = e[0].value; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|