创建调令时,水泵增加数量;反馈加原调令内容

master
xy 2 years ago
parent 02c296ec14
commit 4d9162b286

@ -16,6 +16,10 @@
<Select clearable v-model="select.filter[0].value" placeholder="请选择范围" style="width: 140px;margin-left: 6px;">
<Option v-for="item in Array.from(areas)" :value="item[0]">{{ item[1] }}</Option>
</Select>
<Select clearable v-model="select.filter[1].value" placeholder="请选择类型" style="width: 140px;margin-left: 6px;">
<Option v-for="item in Array.from(types)" :value="item[0]">{{ item[1] }}</Option>
</Select>
<Input placeholder="请输入关键词" v-model="select.filter[2].value" clearable style="width: 140px;margin-left: 6px;"/>
<Button
style="margin-left: 10px"
type="primary"
@ -288,6 +292,7 @@ export default {
},
data() {
return {
types: new Map(),
areas: new Map(),
@ -301,6 +306,16 @@ export default {
op: "eq",
value: "",
},
{
key: "type",
op: "eq",
value: ""
},
{
key: "name",
op: "like",
value: ""
}
],
},
selectQuery: [],
@ -313,6 +328,15 @@ export default {
};
},
methods: {
async getType () {
const obj = (await fieldShow({ id: 1 }, false))?.select_item;
if (obj && typeof obj === "object") {
let keys = Object.keys(obj);
if (keys.length > 0) {
this.types = new Map(keys.map((key) => [/^\d*$/.test(obj[key]) ? Number(obj[key]) : obj[key],key]));
}
}
},
async getArea() {
const obj = (await fieldShow({ id: 4 }, false))?.select_item;
if (obj && typeof obj === "object") {
@ -649,6 +673,7 @@ export default {
created() {
this.getFormDetail();
this.getArea();
this.getType();
},
};
</script>

@ -52,9 +52,14 @@
</div>
<div class="list-item__name">
<p>{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}</p>
<div style="display: flex;align-items: center;" v-if="item.equipment_id_equipments_id_relation && item.equipment_id_equipments_id_relation.type === 1">
<div style="display: flex;align-items: center;">
<p style="zoom:.85;">闸门</p>
<div class="list-item__number" v-for="(i,index) in Number(item.equipment_id_equipments_id_relation.bengzhashuliang || 0)" :style="index >= item.kaiqishuliang ? 'background: red;' : ''"></div>
</div>
<div style="display: flex;align-items: center;">
<p style="zoom:.85;">水泵</p>
<div class="list-item__number" v-for="(i,index) in Number(item.equipment_id_equipments_id_relation.shuibengtaishu || 0)" :style="index >= item.kaiqishuliang1 ? 'background: red;' : ''"></div>
</div>
</div>
<div class="list-item__content">
<el-tooltip class="item" effect="dark" :content="item.content" placement="top-start">

@ -55,9 +55,14 @@
<svg-icon v-if="item.diaolingleixing === 3" icon-class="ship" style="font-size: 2rem;padding-right: 2px;"></svg-icon>
<span>{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}</span>
</p>
<div style="display: flex;align-items: center;" v-if="item.equipment_id_equipments_id_relation && item.equipment_id_equipments_id_relation.type === 1">
<div style="display: flex;align-items: center;">
<p style="zoom:.85;">闸门</p>
<div class="list-item__number" v-for="(i,index) in Number(item.equipment_id_equipments_id_relation.bengzhashuliang || 0)" :style="index >= item.kaiqishuliang ? 'background: red;' : ''"></div>
</div>
<div style="display: flex;align-items: center;">
<p style="zoom:.85;">水泵</p>
<div class="list-item__number" v-for="(i,index) in Number(item.equipment_id_equipments_id_relation.shuibengtaishu || 0)" :style="index >= item.kaiqishuliang1 ? 'background: red;' : ''"></div>
</div>
</div>
<div class="list-item__content">
<el-tooltip class="item" effect="dark" :content="item.content" placement="top-start">

@ -264,7 +264,7 @@ export default {
// key: 'index'
// },
{
title: "点位",
title: "工程名称",
width: 240,
key: "equipment_id",
align: "center",
@ -504,6 +504,48 @@ export default {
]);
},
},
{
title: "闸门数量",
key: "kaiqishuliang",
width: 200,
align: "center",
render: (h, { row, index }) => this.$createElement('CheckboxGroup',{
class: "equip-number",
ref: `bengzhashuliang${index}`,
props: {
value: Array.from({ length: Number(row.kaiqishuliang || 0) },(_,i) => i),
},
on: {
["on-change"]:e => {
this.$nextTick(() => {
this.data[index].kaiqishuliang = this.$refs[`bengzhashuliang${index}`].$children.reduce((pre, cur) => (pre + (cur.currentValue ? 1 : 0)),0)
})
}
}
}, Array.from({ length: Number(row.equipment.bengzhashuliang || 0)},
(_,i) => this.$createElement("Checkbox",{ props: { label: i } })))
},
{
title: "水泵数量",
key: "kaiqishuliang1",
width: 200,
align: "center",
render: (h, { row, index }) => this.$createElement('CheckboxGroup',{
class: "equip-number",
ref: `shuibengtaishu${index}`,
props: {
value: Array.from({ length: Number(row.kaiqishuliang1 || 0) },(_,i) => i),
},
on: {
["on-change"]:e => {
this.$nextTick(() => {
this.data[index].kaiqishuliang1 = this.$refs[`shuibengtaishu${index}`].$children.reduce((pre, cur) => (pre + (cur.currentValue ? 1 : 0)),0)
})
}
}
}, Array.from({ length: Number(row.equipment.shuibengtaishu || 0)},
(_,i) => this.$createElement("Checkbox",{ props: { label: i } })))
},
{
title: "机组运行状态",
width: 200,
@ -559,27 +601,6 @@ export default {
);
},
},
{
title: "机组数量",
key: "kaiqishuliang",
width: 200,
align: "center",
render: (h, { row, index }) => this.$createElement('CheckboxGroup',{
class: "equip-number",
ref: `bengzhashuliang${index}`,
props: {
value: Array.from({ length: Number(row.kaiqishuliang || 0) },(_,i) => i),
},
on: {
["on-change"]:e => {
this.$nextTick(() => {
this.data[index].kaiqishuliang = this.$refs[`bengzhashuliang${index}`].$children.reduce((pre, cur) => (pre + (cur.currentValue ? 1 : 0)),0)
})
}
}
}, Array.from({ length: Number(row.equipment.bengzhashuliang || 0)},
(_,i) => this.$createElement("Checkbox",{ props: { label: i } })))
},
{
title: "类别",
key: "yinpaishui",
@ -886,6 +907,7 @@ export default {
content: i.content,
level: i.level,
kaiqishuliang: i.kaiqishuliang,
kaiqishuliang1: i.kaiqishuliang1,
diaolingleixing: i.diaolingleixing,
leibie: i.leibie,
situations: this.equipmentList.find((j) => j.id === i.equipment_id)?.id_equip_situation_relations_equipment_id_relation
@ -903,6 +925,7 @@ export default {
level: 1,
kaiqishuliang: 0,
diaolingleixing: "",
kaiqishuliang1: 0,
leibie: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -980,6 +1003,7 @@ export default {
content: i.content,
level: i.level,
kaiqishuliang: i.kaiqishuliang,
kaiqishuliang1: i.kaiqishuliang1,
diaolingleixing: i.diaolingleixing,
leibie: i.leibie
}))
@ -1018,6 +1042,7 @@ export default {
content: "",
level: 1,
kaiqishuliang: 0,
kaiqishuliang1: 0,
leibie: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1027,6 +1052,9 @@ export default {
if (/bengzhashuliang/g.test(key)) {
this.$refs[key].$children.forEach(i => i.currentValue = false)
}
if (/shuibengtaishu/g.test(key)) {
this.$refs[key].$children.forEach(i => i.currentValue = false)
}
}
})
},
@ -1289,6 +1317,7 @@ export default {
content: "",
level: 1,
kaiqishuliang: 0,
kaiqishuliang1: 0,
leibie: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1326,6 +1355,7 @@ export default {
content: "",
level: 1,
kaiqishuliang: 0,
kaiqishuliang1: 0,
leibie: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1339,6 +1369,7 @@ export default {
content: "",
level: 1,
kaiqishuliang: 0,
kaiqishuliang1: 0,
leibie: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];

@ -163,6 +163,18 @@ export default {
align: 'center',
render: (h,{ row }) => h('span', (this.abilities.find(i => i.value === row.leibie))?.key)
},
{
title: "开启闸门数量",
width: 130,
key: "kaiqishuliang",
align: "center"
},
{
title: "开启水泵数量",
width: 130,
key: "kaiqishuliang1",
align: "center"
},
{
title: "调令日期",
width: 120,

@ -286,6 +286,7 @@
$refs['dialog'].show();
}
"
@loaded="adjustAlignment"
>
<template #reject="{ row }">
<Button
@ -346,6 +347,7 @@ export default {
},
data() {
return {
firstAdjustTable: true,
op,
select: {
table_name: "",
@ -656,7 +658,6 @@ export default {
}
}
let alignLeft = [];
if (this.resetTable.get(i.field)) {
this.table.push(this.resetTable.get(i.field))
} else {
@ -666,7 +667,7 @@ export default {
prop: i.field,
label: i.name,
width: i.width,
align: alignLeft.find((m) => m === i.field) ? "left" : "center",
align: "center",
fixed: i.is_fixed,
},
linkOb
@ -674,12 +675,45 @@ export default {
);
}
});
this.table.unshift({
width: 180,
label: "调令内容",
prop: "transfer_id_transfers_id_relation.content"
})
this.table.unshift({
type: "index",
width: 60,
label: "序号",
});
},
adjustAlignment () {
if (this.firstAdjustTable) {
const data = this.$refs['xyTable'].getListData();
if (data.length === 0) return;
this.form.filter(i => i.list_show).forEach((i) => {
let lengthTemp;
let temp = 0;
while (!lengthTemp || temp < data.length) {
lengthTemp = data[temp][i.field]?.length??0;
temp++;
}
for (let j = 0;j < data.length;j++) {
if (/^-?\d+\.\d+/.test(data[j][i.field])) {
this.table.find(a => a.prop === i.field).align = 'right';
return
}
if (Math.abs(lengthTemp - (data[j][i.field]?.length)??0) > 4) {
this.table.find(a => a.prop === i.field).align = 'left';
return
}
}
})
this.$nextTick(() => {
this.$refs['xyTable'].doLayout();
this.firstAdjustTable = false;
})
}
}
},
computed: {

Loading…
Cancel
Save