Browse Source

修改按计划报工

hella_online_20240829
niexiting 3 months ago
parent
commit
dd36693b2d
  1. 123
      src/pages/fg/coms/comReceiptPopup.vue

123
src/pages/fg/coms/comReceiptPopup.vue

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

Loading…
Cancel
Save