|
|
@@ -59,11 +59,17 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="用能分区:" prop="areaIds">
|
|
|
- <areaSelect
|
|
|
+ <el-input
|
|
|
+ v-model="form.areaName"
|
|
|
+ placeholder="请选择(可多选,为空则统计全部)"
|
|
|
+ readonly
|
|
|
+ @click.native="openAreaIds"
|
|
|
+ />
|
|
|
+ <!-- <areaSelect
|
|
|
v-model="form.areaIds"
|
|
|
placeholder="请选择"
|
|
|
@changeData="changeData"
|
|
|
- ></areaSelect>
|
|
|
+ ></areaSelect> -->
|
|
|
<!-- <el-select
|
|
|
v-model="form.energyAreaIds"
|
|
|
multiple
|
|
|
@@ -226,6 +232,19 @@
|
|
|
>
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
</template>
|
|
|
+ <ele-modal
|
|
|
+ :visible.sync="visible1"
|
|
|
+ title="选择用能分区"
|
|
|
+ width="70%"
|
|
|
+ append-to-body
|
|
|
+ :maxable="true"
|
|
|
+ >
|
|
|
+ <areaSelect :is-modal="true" ref="areaSelectREf"></areaSelect>
|
|
|
+ <template v-slot:footer>
|
|
|
+ <el-button type="primary" @click="changeData()">确定</el-button>
|
|
|
+ <el-button @click="visible1 = false">取消</el-button>
|
|
|
+ </template>
|
|
|
+ </ele-modal>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -234,7 +253,7 @@
|
|
|
import { getUserPage } from '@/api/system/organization';
|
|
|
import { save, update, getById } from '@/api/alarmConfiguration/index.js';
|
|
|
import { energyConsumingUnitList } from '@/enum/dict.js';
|
|
|
- import areaSelect from '@/components/CommomSelect/area-select.vue';
|
|
|
+ import areaSelect from '@/views/useEnergyZoning/index.vue';
|
|
|
const defForm = {
|
|
|
level: '',
|
|
|
name: '',
|
|
|
@@ -285,8 +304,9 @@
|
|
|
components: { areaSelect },
|
|
|
data() {
|
|
|
return {
|
|
|
- alarmNotifierList:[],
|
|
|
+ alarmNotifierList: [],
|
|
|
visible: false,
|
|
|
+ visible1: false,
|
|
|
loading: false,
|
|
|
isEdit: false,
|
|
|
energyConsumingUnitList,
|
|
|
@@ -339,8 +359,8 @@
|
|
|
onEnergyClassificationChange(data) {
|
|
|
this.form.energyTypeId = data.id;
|
|
|
this.form.energyTypeName = data.name;
|
|
|
- this.form.energyClassificationCode=data.energyClassificationCode
|
|
|
- this.form.energyClassificationName=data.energyClassificationName
|
|
|
+ this.form.energyClassificationCode = data.energyClassificationCode;
|
|
|
+ this.form.energyClassificationName = data.energyClassificationName;
|
|
|
|
|
|
const unit = this.getUnitByCode(data.code);
|
|
|
this.form.conditions.forEach((item) => {
|
|
|
@@ -383,34 +403,47 @@
|
|
|
noticeTypes: '3'
|
|
|
});
|
|
|
},
|
|
|
+ openAreaIds() {
|
|
|
+ this.visible1 = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.areaSelectREf.setValue(this.form.areaIds?.split(','));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeData() {
|
|
|
+ const data = this.$refs.areaSelectREf.getTabelValue();
|
|
|
+ this.form.areaIds = data.map((item) => item.id).toString();
|
|
|
+ this.form.areaCode = data.map((item) => item.code).toString();
|
|
|
+ this.form.areaName = data.map((item) => item.name).toString();
|
|
|
+ this.visible1 = false;
|
|
|
+ },
|
|
|
// 获取通知人列表数据
|
|
|
async getUserList() {
|
|
|
try {
|
|
|
let data = { pageNum: 1, size: -1 };
|
|
|
const res = await getUserPage(data);
|
|
|
- console.log(res,'res')
|
|
|
+ console.log(res, 'res');
|
|
|
this.alarmNotifierList = res.list;
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
removeNotifyPerson(index) {
|
|
|
this.form.notices.splice(index, 1);
|
|
|
},
|
|
|
- changeData(val, data) {
|
|
|
- this.form.areaCode = data.code;
|
|
|
- this.form.areaName = data.name;
|
|
|
- },
|
|
|
|
|
|
save() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
let api = this.form.id ? update : save;
|
|
|
- api(this.form).then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success(this.isEdit ? '编辑成功' : '新增成功');
|
|
|
- this.cancel();
|
|
|
- this.$emit('reload');
|
|
|
- });
|
|
|
+ api(this.form)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success(this.isEdit ? '编辑成功' : '新增成功');
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('reload');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
}
|