|
@ -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 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|