计量设备树修改

master
zhouhy 1 year ago
parent e960960402
commit b5e5d1478b

@ -1,5 +1,32 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="monitorName"
placeholder="请输入计量设备名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="计量设备编号" prop="monitorId"> <el-form-item label="计量设备编号" prop="monitorId">
<el-input <el-input
@ -157,7 +184,8 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</el-col>
</el-row>
<!-- 添加或修改电实时数据对话框 --> <!-- 添加或修改电实时数据对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@ -242,12 +270,16 @@
<script> <script>
import { listDnbInstant, getDnbInstant, delDnbInstant, addDnbInstant, updateDnbInstant } from "@/api/base/dnbInstant"; import { listDnbInstant, getDnbInstant, delDnbInstant, addDnbInstant, updateDnbInstant } from "@/api/base/dnbInstant";
import { getMonitorInfoTree } from '@/api/report/pointDnb'
export default { export default {
name: "DnbInstant", name: "DnbInstant",
dicts: ['collect_type', 'is_flag'], dicts: ['collect_type', 'is_flag'],
data() { data() {
return { return {
//
deptOptions: undefined,
monitorName:undefined,
// //
loading: true, loading: true,
// //
@ -295,6 +327,10 @@ export default {
}, },
// //
form: {}, form: {},
defaultProps: {
children: "children",
label: "label"
},
// //
rules: { rules: {
}, },
@ -324,10 +360,33 @@ export default {
] ]
}; };
}, },
watch: {
//
monitorName(val) {
this.$refs.tree.filter(val);
}
},
created() { created() {
this.getList(); this.getList();
this.getDeptTrees();
}, },
methods: { methods: {
/** 查询计量设备下拉树结构 */
getDeptTrees() {
getMonitorInfoTree().then(response => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.monitorId = data.code;
this.handleQuery();
},
/** 查询电实时数据列表 */ /** 查询电实时数据列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -382,6 +441,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterangeCollectTime = []; this.daterangeCollectTime = [];
this.queryParams.monitorCode = null;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

@ -1,30 +1,36 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="monitorName"
placeholder="请输入计量设备名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="计量设备编号" prop="monitorCode">
<el-input
v-model="queryParams.monitorCode"
placeholder="请输入计量设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仪表值" prop="instrumentValue">
<el-input
v-model="queryParams.instrumentValue"
placeholder="请输入仪表值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="耗量" prop="expend">
<el-input
v-model="queryParams.expend"
placeholder="请输入耗量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报表日期" prop="reportDate"> <el-form-item label="报表日期" prop="reportDate">
<el-input <el-input
v-model="queryParams.reportDate" v-model="queryParams.reportDate"
@ -33,22 +39,8 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="开始时间" prop="beginTime">
<el-input
v-model="queryParams.beginTime"
placeholder="请输入开始时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-input
v-model="queryParams.endTime"
placeholder="请输入结束时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否标识" prop="isFlag"> <el-form-item label="是否标识" prop="isFlag">
<el-select v-model="queryParams.isFlag" placeholder="请选择是否标识" clearable> <el-select v-model="queryParams.isFlag" placeholder="请选择是否标识" clearable>
<el-option <el-option
@ -67,30 +59,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createdTime">
<el-date-picker clearable
v-model="queryParams.createdTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updatedBy">
<el-input
v-model="queryParams.updatedBy"
placeholder="请输入更新人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新时间" prop="updatedTime">
<el-date-picker clearable
v-model="queryParams.updatedTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -196,7 +165,8 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</el-col>
</el-row>
<!-- 添加或修改电日耗报对话框 --> <!-- 添加或修改电日耗报对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@ -260,12 +230,16 @@
<script> <script>
import { listDayDnb, getDayDnb, delDayDnb, addDayDnb, updateDayDnb } from "@/api/report/DayDnb"; import { listDayDnb, getDayDnb, delDayDnb, addDayDnb, updateDayDnb } from "@/api/report/DayDnb";
import { getMonitorInfoTree } from '@/api/report/pointDnb'
export default { export default {
name: "DayDnb", name: "DayDnb",
dicts: ['is_flag'], dicts: ['is_flag'],
data() { data() {
return { return {
//
deptOptions: undefined,
monitorName:undefined,
// //
loading: true, loading: true,
// //
@ -302,6 +276,10 @@ export default {
}, },
// //
form: {}, form: {},
defaultProps: {
children: "children",
label: "label"
},
// //
rules: { rules: {
}, },
@ -321,10 +299,33 @@ export default {
] ]
}; };
}, },
watch: {
//
monitorName(val) {
this.$refs.tree.filter(val);
}
},
created() { created() {
this.getList(); this.getList();
this.getDeptTrees();
}, },
methods: { methods: {
/** 查询计量设备下拉树结构 */
getDeptTrees() {
getMonitorInfoTree().then(response => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.monitorCode = data.code;
this.handleQuery();
},
/** 查询电日耗报列表 */ /** 查询电日耗报列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -365,6 +366,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.monitorCode = null;
this.handleQuery(); this.handleQuery();
}, },
// //

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="5" :xs="24"> <el-col :span="5" :xs="24">
<div class="head-container"> <div class="head-container">
<el-input <el-input
v-model="monitorName" v-model="monitorName"
@ -26,8 +25,6 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </div>
</el-col> </el-col>
<el-col :span="19" :xs="24"> <el-col :span="19" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
@ -344,7 +341,8 @@ export default {
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.monitorCode = data.id; console.log(data.code)
this.queryParams.monitorCode = data.code;
this.handleQuery(); this.handleQuery();
}, },
// //

Loading…
Cancel
Save