Browse Source

修改按计划报工

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

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

@ -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>
@ -187,13 +184,14 @@
},
},
methods: {
openRequestPopup() {
this.initData();
this.planDate = getCurrDate()
this.batch = getBatch8()
// this.batch = getBatch8()
this.batch = this.planDate.replace('-', '');
this.$refs.popup.open('bottom')
},
initData() {
this.itemCode = '请选择物料信息';
this.uom = ""
@ -226,6 +224,7 @@
closeRequestPopup() {
this.$refs.popup.close()
},
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
@ -297,10 +296,13 @@
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.clearItemCode()
// this.clearPackUnit()
this.showProductLineSelect = false;
this.showSelectItemCode();
},
clearItemCode() {
this.planDate = getCurrDate()
this.itemCode = "请选择物料信息"
@ -308,10 +310,15 @@
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() {
@ -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;
@ -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>

Loading…
Cancel
Save