|
|
@ -34,8 +34,8 @@ |
|
|
|
<view class="customerBorder" @click="showSelectDate"> |
|
|
|
{{planDate}} |
|
|
|
</view> |
|
|
|
<u-select v-model="showDateSelect" mode="mutil-column-auto" |
|
|
|
:list="planDateList" @confirm="confirmSelectDate"></u-select> |
|
|
|
<u-select v-model="showDateSelect" mode="mutil-column-auto" :list="planDateList" |
|
|
|
@confirm="confirmSelectDate"></u-select> |
|
|
|
|
|
|
|
<view class=""> |
|
|
|
<image src="/static/icons/down.svg" mode="" |
|
|
@ -54,8 +54,7 @@ |
|
|
|
@confirm="confirmSelectItem"></u-select> |
|
|
|
<view class=""> |
|
|
|
<image src="/static/icons/down.svg" mode="" |
|
|
|
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" |
|
|
|
@click="showSelectItemCode"> |
|
|
|
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showItemList"> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -96,8 +95,6 @@ |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class='split_line'></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -170,10 +167,10 @@ |
|
|
|
showItemCodeSelect: false, |
|
|
|
workStationCode: "", |
|
|
|
planDate: '', |
|
|
|
showDateSelect:false, |
|
|
|
planDateList:[], |
|
|
|
fgLocationCode:"", |
|
|
|
rawLocationCode:"" |
|
|
|
showDateSelect: false, |
|
|
|
planDateList: [], |
|
|
|
fgLocationCode: "", |
|
|
|
rawLocationCode: "" |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -187,13 +184,14 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
openRequestPopup() { |
|
|
|
this.initData(); |
|
|
|
this.planDate =getCurrDate() |
|
|
|
this.batch = getBatch8() |
|
|
|
this.planDate = getCurrDate() |
|
|
|
// this.batch = getBatch8() |
|
|
|
this.batch = this.planDate.replace('-', ''); |
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
}, |
|
|
|
|
|
|
|
initData() { |
|
|
|
this.itemCode = '请选择物料信息'; |
|
|
|
this.uom = "" |
|
|
@ -209,23 +207,24 @@ |
|
|
|
this.batch = "" |
|
|
|
this.packUnitName = "请选择包装规格" |
|
|
|
this.packUnit = "", |
|
|
|
this.packQtyHint = "" |
|
|
|
this.packQtyHint = "" |
|
|
|
this.showPackUnitSelect = false |
|
|
|
// this.packUnitList = [] |
|
|
|
this.itemCodeList = [] |
|
|
|
this.showItemCodeSelect = false |
|
|
|
this.workStationCode = "" |
|
|
|
this.planDate="" |
|
|
|
this.showDateSelect =false |
|
|
|
this.planDateList=[] |
|
|
|
this.fgLocationCode="" |
|
|
|
this.rawLocationCode="" |
|
|
|
this.planDate = "" |
|
|
|
this.showDateSelect = false |
|
|
|
this.planDateList = [] |
|
|
|
this.fgLocationCode = "" |
|
|
|
this.rawLocationCode = "" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
closeRequestPopup() { |
|
|
|
this.$refs.popup.close() |
|
|
|
}, |
|
|
|
|
|
|
|
itemCodeLoseFocus() { |
|
|
|
this.itemCodeFocus = false; |
|
|
|
}, |
|
|
@ -274,8 +273,8 @@ |
|
|
|
goodQty: this.goodQty, |
|
|
|
planNumber: this.planNumber, |
|
|
|
workStationCode: this.workStationCode, |
|
|
|
fgLocationCode:this.fgLocationCode, |
|
|
|
rawLocationCode:this.rawLocationCode |
|
|
|
fgLocationCode: this.fgLocationCode, |
|
|
|
rawLocationCode: this.rawLocationCode |
|
|
|
}; |
|
|
|
this.closeRequestPopup(); |
|
|
|
this.$emit("confirm", item); |
|
|
@ -294,34 +293,42 @@ |
|
|
|
this.productionLineName = data[0].label + "—" + data[1].label |
|
|
|
this.productionLineCode = data[0].value |
|
|
|
this.workStationCode = data[1].value |
|
|
|
var parent =this.productLineList.filter(res=>res.value==this.productionLineCode) |
|
|
|
var fgLocation =parent[0].children.filter(children=>children.value==this.workStationCode) |
|
|
|
this.fgLocationCode= fgLocation[0].fgLocationCode; |
|
|
|
this.clearItemCode() |
|
|
|
this.clearPackUnit() |
|
|
|
var parent = this.productLineList.filter(res => res.value == this.productionLineCode) |
|
|
|
var fgLocation = parent[0].children.filter(children => children.value == this.workStationCode) |
|
|
|
this.fgLocationCode = fgLocation[0].fgLocationCode; |
|
|
|
// this.clearItemCode() |
|
|
|
// this.clearPackUnit() |
|
|
|
this.showProductLineSelect = false; |
|
|
|
this.showSelectItemCode(); |
|
|
|
|
|
|
|
}, |
|
|
|
clearItemCode(){ |
|
|
|
this.planDate =getCurrDate() |
|
|
|
this.itemCode ="请选择物料信息" |
|
|
|
|
|
|
|
clearItemCode() { |
|
|
|
this.planDate = getCurrDate() |
|
|
|
this.itemCode = "请选择物料信息" |
|
|
|
this.uom = "" |
|
|
|
this.planQty = 0; |
|
|
|
this.goodQty = 0 |
|
|
|
this.planNumber = "" |
|
|
|
this.packUnit = ""; |
|
|
|
this.packQty = 0; |
|
|
|
}, |
|
|
|
|
|
|
|
confirmSelectDate(data) { |
|
|
|
this.planDate=data[0].label |
|
|
|
this.planDate = data[0].label; |
|
|
|
this.batch = this.planDate.replace('-', ''); |
|
|
|
this.afterSelectPlanData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showSelectDate(){ |
|
|
|
this.showDateSelect =true; |
|
|
|
var list =lastThreeDays(3); |
|
|
|
this.planDateList=[] |
|
|
|
list.forEach(res=>{ |
|
|
|
showSelectDate() { |
|
|
|
this.showDateSelect = true; |
|
|
|
var list = lastThreeDays(3); |
|
|
|
this.planDateList = [] |
|
|
|
list.forEach(res => { |
|
|
|
this.planDateList.push({ |
|
|
|
label :res, |
|
|
|
value:"" |
|
|
|
label: res, |
|
|
|
value: "" |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
@ -348,9 +355,28 @@ |
|
|
|
} else { |
|
|
|
this.showProductLineSelect = true |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
afterSelectPlanData() { |
|
|
|
this.itemCode = '请选择物料信息'; |
|
|
|
this.packUnit = ""; |
|
|
|
this.packQty = 0; |
|
|
|
this.planQty = 0; |
|
|
|
this.itemCode = '请选择物料信息'; |
|
|
|
this.uom = "" |
|
|
|
this.packUnitName = "请选择包装规格" |
|
|
|
this.packUnit = "" |
|
|
|
this.packQtyHint = "" |
|
|
|
|
|
|
|
// this.packUnitList = [] |
|
|
|
this.itemCodeList = []; |
|
|
|
this.showSelectItemCode(); |
|
|
|
}, |
|
|
|
|
|
|
|
showItemList() { |
|
|
|
this.showItemCodeSelect = true; |
|
|
|
}, |
|
|
|
|
|
|
|
showSelectItemCode() { |
|
|
|
if (!this.planDate) { |
|
|
|
this.showErrorMessage('请先选择计划日期'); |
|
|
@ -368,13 +394,21 @@ |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
res.data.forEach(item => { |
|
|
|
item.label = item.itemCode + "(" + item.planQty + this.getUomInfo(item.uom) + ")" |
|
|
|
item.label = item.itemCode + "(" + item.planQty + this.getUomInfo(item.uom) + |
|
|
|
")" |
|
|
|
item.value = item |
|
|
|
}) |
|
|
|
this.itemCodeList = res.data |
|
|
|
this.showItemCodeSelect = true |
|
|
|
|
|
|
|
if (this.itemCodeList.length == 1) { |
|
|
|
this.itemCode = this.itemCodeList[0].itemCode; |
|
|
|
} else { |
|
|
|
this.showItemCodeSelect = true; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showErrorMessage('未查找到物料信息'); |
|
|
|
this.showErrorMessage('未查找到该生产线在【' + this.planDate + |
|
|
|
'】日期的生产计划'); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
@ -382,6 +416,7 @@ |
|
|
|
this.showErrorMessage(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
confirmSelectItem(data) { |
|
|
|
let productionPlan = data[0].value; |
|
|
|
this.itemCode = productionPlan.itemCode; |
|
|
@ -405,7 +440,7 @@ |
|
|
|
.getUomInfo(item.uom) + ")"; |
|
|
|
}) |
|
|
|
this.packUnitList = res.data.list |
|
|
|
var defaultData =res.data.list.filter(item=>item.defaultPackageunit=="TRUE") |
|
|
|
var defaultData = res.data.list.filter(item => item.defaultPackageunit == "TRUE") |
|
|
|
this.confirmSelectPackUnit(defaultData) |
|
|
|
} |
|
|
|
|
|
|
@ -414,7 +449,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
clearPackUnit(){ |
|
|
|
clearPackUnit() { |
|
|
|
this.packUnitName = "请选择包装规格" |
|
|
|
this.packUnit = "" |
|
|
|
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit); |
|
|
@ -461,6 +496,7 @@ |
|
|
|
.getUomInfo(pack[0].uom) + ")"; |
|
|
|
this.packQty = pack[0].packQty |
|
|
|
}, |
|
|
|
|
|
|
|
getUomInfo(uom) { |
|
|
|
let item = getUomInfo(uom); |
|
|
|
if (item == '') { |
|
|
@ -469,11 +505,6 @@ |
|
|
|
return item.label |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|