yusheng 5 сар өмнө
parent
commit
991df20c5f

+ 50 - 17
src/views/alarmConfiguration/alarmDialog.vue

@@ -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;
+              });
           }
         });
       }

+ 8 - 2
src/views/alarmConfiguration/index.vue

@@ -122,7 +122,7 @@
 
           {
             prop: 'areaName',
-            label: '能源分类',
+            label: '用能分区',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 150
@@ -134,7 +134,13 @@
             showOverflowTooltip: true,
             minWidth: 150
           },
-
+     {
+            prop: 'energyTypeName',
+            label: '能源名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
           {
             prop: 'description',
             label: '告警描述',

+ 9 - 3
src/views/useEnergyWarning/index.vue

@@ -111,6 +111,7 @@
             <el-link
               type="primary"
               :underline="false"
+              v-if="row.handleStatus != 2"
               @click="handleProcess(row)"
               >处理</el-link
             >
@@ -202,7 +203,7 @@
 
           {
             prop: 'areaName',
-            label: '能源分类',
+            label: '用能分区',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 150
@@ -214,7 +215,13 @@
             showOverflowTooltip: true,
             minWidth: 150
           },
-
+          {
+            prop: 'energyTypeName',
+            label: '能源名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
           {
             prop: 'description',
             label: '告警描述',
@@ -350,7 +357,6 @@
       },
       // 表格数据源
       datasource({ page, limit, where, order }) {
-
         return alarmlogsheetPage({
           pageNum: page,
           size: limit,

+ 4 - 2
src/views/useEnergyWarning/processDialog.vue

@@ -88,7 +88,7 @@
       </el-row>
       <el-row>
         <el-col :span="24">
-          <el-form-item label="处理意见:"></el-form-item>
+          <el-form-item label="处理意见:">
             <el-input
               v-model="form.handleOpinion"
               type="textarea"
@@ -186,7 +186,9 @@
               this.$message.success('操作成功');
               this.cancel();
               this.$emit('reload');
-            });
+            }).finally(() => {
+                this.loading = false;
+              });
           }
         });
       }

+ 31 - 3
src/views/useEnergyZoning/index.vue

@@ -10,6 +10,7 @@
         :default-expand-all="false"
         :need-page="false"
         @columns-change="handleColumnChange"
+        :selection.sync="selection"
         :cache-key="cacheKeyUrl"
       >
         <!-- 表头工具栏 -->
@@ -20,7 +21,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit('add')"
-            v-if="$hasPermission('main:basicarea:save')"
+            v-if="$hasPermission('main:basicarea:save') && !isModal"
           >
             添加
           </el-button>
@@ -104,6 +105,12 @@
   import dictMixins from '@/mixins/dictMixins';
 
   export default {
+    props: {
+      isModal: {
+        type: Boolean,
+        default: false
+      }
+    },
     mixins: [tabMixins, dictMixins],
     name: 'SystemOrganization',
     components: { areaEdit, energyPriceConfig },
@@ -121,13 +128,15 @@
         // 编辑回显数据
         editData: null,
         // 上级id
+        selection: [],
         parentId: null,
         dictList: {},
         cacheKeyUrl: 'fb2f4315-enterpriseModel-organization',
         columnsVersion: 1,
         // 价格方案弹窗
         showPriceScheme: false,
-        priceSchemeRow: null
+        priceSchemeRow: null,
+        disabledList: []
       };
     },
     computed: {
@@ -143,6 +152,16 @@
             showOverflowTooltip: true,
             fixed: 'left'
           },
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            align: 'center',
+            isNone: !this.isModal,
+            // selectable: (row, index) => {
+            //   return !this.disabledList.includes(row.id);
+            // },
+            width: 55
+          },
           {
             prop: 'name',
             label: '区域名称',
@@ -199,10 +218,11 @@
             width: 250,
             align: 'center',
             resizable: false,
+            isNone: this.isModal,
             slot: 'action',
             showOverflowTooltip: true
           }
-        ];
+        ].filter((item) => !item.isNone);
       }
     },
     created() {
@@ -249,6 +269,14 @@
           this.$refs.areaEditRef.init(type, row);
         });
       },
+      getTabelValue() {
+        return this.selection;
+      },
+      setValue(value = []) {
+        this.selection = [];
+        this.$refs.table.clearSelection()
+        // this.disabledList = value;
+      },
       /* 删除 */
       remove(row) {
         this.$confirm('确定要删除选中的区域吗?', '提示', {