|
|
@ -26,17 +26,21 @@ |
|
|
|
</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"> |
|
|
|
<u-input v-model="itemCode" :focus="itemCodeFocus" :border="true" |
|
|
|
placeholder="请输入需求零件" @confirm="itemCodeConfirm" /> |
|
|
|
|
|
|
|
<view class="title padding" style="display: flex;"> |
|
|
|
<text style=" flex-shrink: 0;">物料:</text> |
|
|
|
<view class="" style="width: 100% ;"> |
|
|
|
{{itemCode}} |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<image src="/static/search.svg" mode="" |
|
|
|
style=" width: 40rpx;height: 40rpx;margin-left: 10rpx;" @click="itemCodeClick"> |
|
|
|
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" |
|
|
|
@click="itemCodeClick"> |
|
|
|
</image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<u-line /> |
|
|
|
|
|
|
|
<view class="uni-flex uni-row padding title u-col-center"> |
|
|
@ -60,9 +64,9 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'> |
|
|
|
</win-scan-item> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<selectList ref='selectList' @selectedItem="selectedItem"></selectList> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -81,7 +85,7 @@ |
|
|
|
import uom from '@/mycomponents/qty/uom.vue' |
|
|
|
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import selectList from '@/mycomponents/popup/selectList.vue' |
|
|
|
import winScanItem from '@/mycomponents/scan/winScanItem.vue' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
@ -89,18 +93,18 @@ |
|
|
|
uom, |
|
|
|
balanceStatus, |
|
|
|
comMessage, |
|
|
|
selectList |
|
|
|
winScanItem |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// itemCode: 'CE115F11161AG', |
|
|
|
workshopCode: "", //车间 |
|
|
|
workShopName: "", |
|
|
|
productionLineCode: "",//生产线 |
|
|
|
productionLineName:"", |
|
|
|
workStationCode: "",//工位 |
|
|
|
workStationName:"", |
|
|
|
itemCode: '', |
|
|
|
productionLineCode: "", //生产线 |
|
|
|
productionLineName: "", |
|
|
|
workStationCode: "", //工位 |
|
|
|
workStationName: "", |
|
|
|
itemCode: '请扫描物料信息', |
|
|
|
itemName: "", |
|
|
|
qty: 0, |
|
|
|
itemCodeFocus: false, |
|
|
@ -114,7 +118,7 @@ |
|
|
|
positionInfo: "请选择位置", |
|
|
|
show: false, |
|
|
|
isModifiedPosition: true, |
|
|
|
positionList:[], |
|
|
|
positionList: [], |
|
|
|
list: [{ |
|
|
|
value: 1, |
|
|
|
label: '车间1', |
|
|
@ -189,14 +193,14 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
openRequestPopup(editPosition) { |
|
|
|
if(this.positionList.length==0){ |
|
|
|
getWorkShopLineStation().then(res=>{ |
|
|
|
if (this.positionList.length == 0) { |
|
|
|
getWorkShopLineStation().then(res => { |
|
|
|
this.positionList = res.data |
|
|
|
}).catch(error=>{ |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.editPosition = editPosition; |
|
|
|
if (this.isModifiedPosition) { |
|
|
|
this.isModifiedPosition = false |
|
|
@ -217,12 +221,7 @@ |
|
|
|
this.checkLocatioCode(); |
|
|
|
}, |
|
|
|
itemCodeClick() { |
|
|
|
if (this.positionInfo == "请选择位置") { |
|
|
|
this.showErrorMessage("请先选择位置") |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs.selectList.queryList(this.productionLineCode) |
|
|
|
|
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
itemCodeGetFocus() { |
|
|
@ -238,7 +237,7 @@ |
|
|
|
|
|
|
|
confirm() { |
|
|
|
if (this.itemCode == "" || !this.isCheckItemCode) { |
|
|
|
this.showErrorMessage("请输入零件", "itemCode") |
|
|
|
this.showErrorMessage("请输入物料", "itemCode") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.qty == 0) { |
|
|
@ -250,10 +249,11 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
checkItemCode() { |
|
|
|
//校验零件 |
|
|
|
getBasicItemByCode(this.itemCode).then(res => { |
|
|
|
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 |
|
|
@ -261,7 +261,7 @@ |
|
|
|
this.numberFocus = true |
|
|
|
this.uom = res.data.list[0].uom |
|
|
|
} else { |
|
|
|
this.showErrorMessage('未查找到零件【' + this.itemCode + '】', "itemCode"); |
|
|
|
this.showErrorMessage('未查找到物料【' + this.itemCode + '】', "itemCode"); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
@ -274,12 +274,12 @@ |
|
|
|
callback(action) { |
|
|
|
let item = { |
|
|
|
positionInfo: this.positionInfo, |
|
|
|
workshopCode: this.workshopCode,//车间 |
|
|
|
workshopCode: this.workshopCode, //车间 |
|
|
|
workShopName: this.workShopName, |
|
|
|
productionLineCode: this.productionLineCode,//生产线 |
|
|
|
productionLineName:this.productionLineName, |
|
|
|
workStationCode: this.workStationCode,//工位 |
|
|
|
workStationName:this.workStationName, |
|
|
|
productionLineCode: this.productionLineCode, //生产线 |
|
|
|
productionLineName: this.productionLineName, |
|
|
|
workStationCode: this.workStationCode, //工位 |
|
|
|
workStationName: this.workStationName, |
|
|
|
itemCode: this.itemCode, |
|
|
|
itemName: this.itemName, |
|
|
|
uom: this.uom, |
|
|
@ -304,9 +304,6 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
itemCodeConfirm() { |
|
|
|
this.checkItemCode(); |
|
|
|
}, |
|
|
|
change(value) { |
|
|
|
this.qty = value; |
|
|
|
}, |
|
|
@ -321,28 +318,24 @@ |
|
|
|
}, |
|
|
|
confirmSelect(e) { |
|
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
|
|
console.log("位置",this.positionInfo) |
|
|
|
console.log("位置", this.positionInfo) |
|
|
|
this.workshopCode = e[0].value |
|
|
|
this.productionLineCode = e[1].value |
|
|
|
this.workStationCode = e[2].value |
|
|
|
this.workShopName= e[0].label |
|
|
|
this.workShopName = e[0].label |
|
|
|
this.productionLineName = e[1].label |
|
|
|
this.workStationName = e[2].label |
|
|
|
|
|
|
|
}, |
|
|
|
getItemCodeListByProLine(lineCode) { |
|
|
|
getProductionlineItem(lineCode).then(res => { |
|
|
|
if (res.data != null && res.data.list.length > 0) { |
|
|
|
this.$refs.selectList.openPopup(res.data.list) |
|
|
|
} else { |
|
|
|
//没有查询到生产线对应的零件信息 |
|
|
|
this.showErrorMessage('未查找到生产线【' + lineCode + '】对应的零件', "itemCode"); |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.showErrorMessage(error, "itemCode"); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
getScanCode(code) { |
|
|
|
if (code == "") { |
|
|
|
this.showMessage('物料号不能为空') |
|
|
|
return; |
|
|
|
} |
|
|
|
this.itemCode = ""; |
|
|
|
this.checkItemCode(code) |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|