|
|
@@ -56,14 +56,17 @@
|
|
|
:selection.sync="selection"
|
|
|
@update:selection="handleSelectionChange"
|
|
|
tool-class="ele-toolbar-actions"
|
|
|
- max-height="360px"
|
|
|
-
|
|
|
+ max-height="360px"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
<div class="toolbar_box">
|
|
|
<div
|
|
|
><span>基本数量</span>
|
|
|
- <el-input placeholder="请输入" v-model.number="baseCount" disabled>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model.number="baseCount"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
</el-input>
|
|
|
<DictSelection dictName="计量单位" v-model="unit" disabled
|
|
|
/></div>
|
|
|
@@ -75,7 +78,6 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
-
|
|
|
<headerTitle title="计划列表" class="mt20"> </headerTitle>
|
|
|
|
|
|
<ele-pro-table
|
|
|
@@ -85,12 +87,13 @@
|
|
|
:datasource="jhList"
|
|
|
tool-class="ele-toolbar-actions"
|
|
|
max-height="360px"
|
|
|
-
|
|
|
>
|
|
|
+ <template v-slot:requiredFormingNum="{ row }">
|
|
|
+ <el-input v-if="row.isManual" v-model.number="row.requiredFormingNum"></el-input>
|
|
|
+ <span v-else>{{ row.requiredFormingNum }}</span>
|
|
|
+ </template>
|
|
|
|
|
|
</ele-pro-table>
|
|
|
-
|
|
|
-
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div slot="footer">
|
|
|
@@ -99,8 +102,6 @@
|
|
|
</div>
|
|
|
|
|
|
<EquipmentDialog ref="equipmentRefs" @choose="choose"></EquipmentDialog>
|
|
|
-
|
|
|
-
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -153,7 +154,6 @@
|
|
|
label: '用量',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
-
|
|
|
|
|
|
{
|
|
|
prop: 'unit',
|
|
|
@@ -161,7 +161,6 @@
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
|
|
|
-
|
|
|
{
|
|
|
prop: 'brandNo',
|
|
|
label: '牌号',
|
|
|
@@ -206,25 +205,23 @@
|
|
|
}
|
|
|
],
|
|
|
|
|
|
-
|
|
|
statusOpt: {
|
|
|
'': '全部',
|
|
|
0: '已停用',
|
|
|
1: '已发布'
|
|
|
},
|
|
|
|
|
|
-
|
|
|
jsColumns: [
|
|
|
- {
|
|
|
+ {
|
|
|
prop: 'productCode',
|
|
|
- label: '产品编码',
|
|
|
+ label: '编码',
|
|
|
align: 'center',
|
|
|
|
|
|
minWidth: 140
|
|
|
},
|
|
|
{
|
|
|
prop: 'productName',
|
|
|
- label: '产品名称',
|
|
|
+ label: '名称',
|
|
|
align: 'center',
|
|
|
minWidth: 140
|
|
|
},
|
|
|
@@ -250,7 +247,6 @@
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
|
|
|
-
|
|
|
{
|
|
|
prop: 'produceRoutingName',
|
|
|
label: '工艺路线',
|
|
|
@@ -258,7 +254,6 @@
|
|
|
minWidth: 120
|
|
|
},
|
|
|
|
|
|
-
|
|
|
{
|
|
|
prop: 'requiredFormingNum',
|
|
|
label: '要求生产数量',
|
|
|
@@ -269,11 +264,8 @@
|
|
|
prop: 'unit',
|
|
|
label: '计量单位',
|
|
|
showOverflowTooltip: true
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ],
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -299,37 +291,57 @@
|
|
|
},
|
|
|
|
|
|
handleSelectionChange() {
|
|
|
-
|
|
|
- console.log(this.selection);
|
|
|
- let _arr = []
|
|
|
- _arr = this.selection.map(m => {
|
|
|
- let _num = (this.formData.requiredFormingNum || 0 )/ (this.baseCount || 0) * m.dosage;
|
|
|
- _num = _num.toFixed(3);
|
|
|
+ let _arr = [];
|
|
|
+ _arr = this.selection.map((m) => {
|
|
|
+ let _num =
|
|
|
+ ((this.formData.requiredFormingNum || 0) / (this.baseCount || 0)) *
|
|
|
+ m.dosage;
|
|
|
+ _num = _num.toFixed(3);
|
|
|
return {
|
|
|
- productCode: m.code,
|
|
|
- productName: m.name,
|
|
|
- brandNo: m.brandNo,
|
|
|
- specification: m.specification,
|
|
|
- model: m.model,
|
|
|
- produceRoutingId: '',
|
|
|
- produceRoutingName: '',
|
|
|
- requiredFormingNum: _num,
|
|
|
- unit: this.unit,
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ id: m.id,
|
|
|
+ productCode: m.code,
|
|
|
+ productName: m.name,
|
|
|
+ brandNo: m.brandNo,
|
|
|
+ specification: m.specification,
|
|
|
+ model: m.model,
|
|
|
+ produceRoutingId: '',
|
|
|
+ produceRoutingName: '',
|
|
|
+ requiredFormingNum: _num,
|
|
|
+ unit: this.unit,
|
|
|
+ isManual: false
|
|
|
+ };
|
|
|
+ });
|
|
|
this.jhList = _arr;
|
|
|
-
|
|
|
},
|
|
|
|
|
|
handleAdd() {
|
|
|
- this.$refs.equipmentRefs.open();
|
|
|
+ let ids = [];
|
|
|
+ ids = this.jhList.map((m) => m.id);
|
|
|
+
|
|
|
+ // 打开设备选择弹窗
|
|
|
+ this.$refs.equipmentRefs.open(ids);
|
|
|
},
|
|
|
|
|
|
choose(list) {
|
|
|
-
|
|
|
- console.log(list);
|
|
|
+ let _list = [];
|
|
|
+
|
|
|
+ _list = list.map((m) => {
|
|
|
+ return {
|
|
|
+ id: m.id,
|
|
|
+ productCode: m.code,
|
|
|
+ productName: m.name,
|
|
|
+ brandNo: m.brandNo,
|
|
|
+ specification: m.specification,
|
|
|
+ model: m.model,
|
|
|
+ produceRoutingId: '',
|
|
|
+ produceRoutingName: '',
|
|
|
+ requiredFormingNum: '',
|
|
|
+ unit: this.unit,
|
|
|
+ isManual: true
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ this.jhList.push(..._list);
|
|
|
},
|
|
|
|
|
|
cancel() {
|
|
|
@@ -337,9 +349,7 @@
|
|
|
this.visible = false;
|
|
|
},
|
|
|
|
|
|
- confirm() {
|
|
|
- this.$refs.form.validate(async (value) => {});
|
|
|
- }
|
|
|
+ confirm() {}
|
|
|
}
|
|
|
};
|
|
|
</script>
|