From 7aecebdcc3ad51f1560211959a4c9e880714c849 Mon Sep 17 00:00:00 2001
From: xy <271556543@qq.com>
Date: Mon, 29 Jul 2024 16:52:10 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=B0=83=E4=BB=A4=E5=8E=BB?=
=?UTF-8?q?=E6=8E=89=E6=93=8D=E4=BD=9C=E3=80=81=E5=AF=BC=E5=87=BA=E7=9A=84?=
=?UTF-8?q?=E5=88=97=E5=92=8C=E5=B7=A6=E4=B8=8B=E8=A7=92=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E4=B8=80=E8=87=B4=E3=80=82=E6=B0=B4?=
=?UTF-8?q?=E6=B3=B5=E5=92=8C=E9=97=B8=E9=97=A8=E7=9A=84=E6=95=B0=E9=87=8F?=
=?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=AD=A3=E7=A1=AE=E9=80=89=E6=8B=A9=EF=BC=8C?=
=?UTF-8?q?=E5=90=8C=E6=97=B6=E6=B0=B4=E6=B3=B5=E5=A2=9E=E5=8A=A0=E5=85=A8?=
=?UTF-8?q?=E5=85=B3=E3=80=81=E5=87=8F=E5=B0=91=E3=80=81=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E9=80=89=E9=A1=B9=EF=BC=8C=E8=B0=83=E4=BB=A4=E5=BC=80=E5=90=AF?=
=?UTF-8?q?=E5=89=8D=E5=8F=AF=E4=BB=A5=E5=8F=96=E6=B6=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/order/component/adjust.vue | 42 +++++++++++++++++++++-------
src/views/order/handle.vue | 1 +
src/views/order/history.vue | 20 +++++++------
3 files changed, 45 insertions(+), 18 deletions(-)
diff --git a/src/views/order/component/adjust.vue b/src/views/order/component/adjust.vue
index 87c2d73..b4a8443 100644
--- a/src/views/order/component/adjust.vue
+++ b/src/views/order/component/adjust.vue
@@ -46,7 +46,7 @@
-
+
水泵
闸门
@@ -55,6 +55,7 @@
v-model="form.tiaozhengleixing"
clearable
placeholder="请选择调整类型"
+ @change="temp++"
>
-
+
@@ -117,16 +118,19 @@ export default {
},
data() {
return {
+ temp: 0,//更新调整数量
adjustEquipmentType: 1,
isShow: false,
id: "",
type: "",
detail: {},
+ kaiqishuliang: 0,
form: {
content: "",
tiaozhengleixing: "",
kaiqishuliang: 0,
+ kaiqishuliang1: 0,
start_time: "",
end_time: ""
},
@@ -200,23 +204,27 @@ export default {
}
const leixingLabel = this.types.find(i => i.id === this.form.tiaozhengleixing)?.id
if (leixingLabel === 0) {
- this.form.kaiqishuliang = Number(this.detail?.kaiqishuliang) - Number(this.form.kaiqishuliang)
+ this.equipmentType === 1 ? (this.form.kaiqishuliang1 = Number(this.detail?.kaiqishuliang1) - Number(this.kaiqishuliang)) : (this.form.kaiqishuliang = Number(this.detail?.kaiqishuliang) - Number(this.kaiqishuliang))
} else if (leixingLabel === 1) {
- this.form.kaiqishuliang = Number(this.detail?.kaiqishuliang) + Number(this.form.kaiqishuliang)
+ this.equipmentType === 1 ? (this.form.kaiqishuliang1 = Number(this.detail?.kaiqishuliang1) + Number(this.kaiqishuliang)) : (this.form.kaiqishuliang = Number(this.detail?.kaiqishuliang) + Number(this.kaiqishuliang))
} else {
+ this.equipmentType === 1 ? this.form.kaiqishuliang1 = 0 : this.form.kaiqishuliang = 0;
}
let updateData = JSON.stringify(this.form);
let text = ""
+ console.log(this.form)
+ return
if (updateData !== this.originalData) {
let originalData = JSON.parse(this.originalData)
let nowData = JSON.parse(updateData)
let kv = new Map([
['content','调令内容'],
['tiaozhengleixing','调整状态'],
- ['kaiqishuliang','调整数量'],
+ ['kaiqishuliang1','水泵调整数量'],
+ ['kaiqishuliang','闸门调整数量'],
])
for (let key of kv.keys()) {
- if (key === 'kaiqishuliang') {
+ if (key === 'kaiqishuliang' || key === 'kaiqishuliang1') {
if (this.detail.equipment_id_equipments_id_relation?.type === 1) {
text += nowData[key] === originalData[key] ? "" : (`【${kv.get(key)}】从"${originalData[key] || "0"}"更改为"${nowData[key]}"` || " ")
}
@@ -274,11 +282,14 @@ export default {
},
openNumberMax () {
+ let a = this.temp;
const leixingLabel = this.types.find(i => i.id === this.form.tiaozhengleixing)?.value
if (leixingLabel === '关闭') {
- return Number(this.detail?.kaiqishuliang) || 0
- } else {
- return (Number(this.detail?.equipment_id_equipments_id_relation?.bengzhashuliang) - Number(this.detail?.kaiqishuliang)) || 0
+ return this.equipmentType === 1 ? (Number(this.detail?.kaiqishuliang1 || 0)) : (Number(this.detail?.kaiqishuliang || 0))
+ } else if (leixingLabel === '全关') {
+ return this.equipmentType === 1 ? (Number(this.detail?.kaiqishuliang1 || 0)) : (Number(this.detail?.kaiqishuliang || 0));
+ } else {
+ return this.equipmentType === 1 ? ((Number(this.detail?.equipment_id_equipments_id_relation?.shuibengtaishu) - Number(this.detail?.kaiqishuliang1) || 0)) : ((Number(this.detail?.equipment_id_equipments_id_relation?.bengzhashuliang) - Number(this.detail?.kaiqishuliang) || 0))
}
},
@@ -298,6 +309,10 @@ export default {
{
id: 1,
value: "增开"
+ },
+ {
+ id: 2,
+ value: "全关"
}
]
} else {
@@ -309,6 +324,10 @@ export default {
{
id: 1,
value: "调整开度"
+ },
+ {
+ id: 2,
+ value: "全关"
}
]
}
@@ -329,6 +348,9 @@ export default {
delete this.form.id;
}
},
+ temp(val) {
+ this.kaiqishuliang = 0;
+ }
},
};
diff --git a/src/views/order/handle.vue b/src/views/order/handle.vue
index 2a365d0..9e595ba 100644
--- a/src/views/order/handle.vue
+++ b/src/views/order/handle.vue
@@ -82,6 +82,7 @@
:destroy-action="destroy"
ref="xyTable"
:border="true"
+ :row-key="row => row.id"
:action="index"
:req-opt="tableSelect"
:destroy-req-opt="select"
diff --git a/src/views/order/history.vue b/src/views/order/history.vue
index d64aa5b..262640e 100644
--- a/src/views/order/history.vue
+++ b/src/views/order/history.vue
@@ -635,18 +635,28 @@ export default {
},
async exportExcel(sheetName) {
+ let filterTableColumns = this.$refs['xyTable']?.tableFormat || []
const res = await index(
Object.assign(this.select, { page: 1, page_size: 9999 })
);
if (res.data) {
- let headers = this.form.filter(i => i.list_show).map((i) => {
+ let headers = this.form.filter(i => filterTableColumns.find(j => j.prop === i.field)).map((i) => {
return {
key: i.field,
title: i.name,
};
});
+ if (filterTableColumns.find(i => i.label === '范围')) {
+ headers.splice(1,0,{
+ key: "",
+ title: '范围',
+ })
+ }
const data = res.data.map((row) =>
headers.map((header) => {
+ if (header.title === '范围') {
+ return this.areas.find(i => i.value === row?.equipment_id_equipments_id_relation?.area)?.key
+ }
const i = this.form.find(i => i.field === header.key)
//if (i.edit_input === 'file' || i.edit_input === 'files') return ''
if (
@@ -908,7 +918,7 @@ export default {
)
);
});
- this.table.unshift({
+ this.table.splice(1,0,{
width: 100,
label: "范围",
prop: "equipment_id_equipments_id_relation.area",
@@ -916,12 +926,6 @@ export default {
return this.areas.find(i => i.value === val)?.key
}
});
- this.table.unshift({
- type: "index",
- width: 60,
- label: "序号",
- prop: "index"
- });
},
},