dongjh 1 рік тому
батько
коміт
5a1655f80e

+ 232 - 0
src/views/module_base/elecfeeBase/ElecfeeBaseList.vue

@@ -0,0 +1,232 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24"> </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_base')">导出</a-button>
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query
+        :fieldList="superFieldList"
+        ref="superQueryModal"
+        @handleSuperQuery="handleSuperQuery"
+      ></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+      >
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
+          <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+
+    <elecfee-base-modal ref="modalForm" @ok="modalFormOk"></elecfee-base-modal>
+  </a-card>
+</template>
+
+<script>
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import ElecfeeBaseModal from './modules/ElecfeeBaseModal'
+import { loadCategoryData } from '@/api/api'
+import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
+
+export default {
+  name: 'ElecfeeBaseList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    ElecfeeBaseModal,
+    filterMultiDictText,
+  },
+  data() {
+    return {
+      description: '基本电费管理页面',
+      // 表头
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          },
+        },
+        {
+          title: '部门',
+          align: 'center',
+          dataIndex: 'deptid_dictText',
+          width: 200,
+        },
+        {
+          title: '计费类型',
+          align: 'center',
+          dataIndex: 'feetype_dictText',
+          width: 150,
+        },
+        {
+          title: '变压器容量/合同最大需量(kVA)',
+          align: 'center',
+          dataIndex: 'kva',
+          width: 200,
+        },
+        {
+          title: '基本电价(元/kw)',
+          align: 'center',
+          dataIndex: 'price',
+          width: 150,
+        },
+        {
+          title: '开始时间',
+          align: 'center',
+          dataIndex: 'begintime',
+          customRender: function (text) {
+            return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
+          },
+          width: 130,
+        },
+        {
+          title: '结束时间',
+          align: 'center',
+          dataIndex: 'endtime',
+          customRender: function (text) {
+            return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
+          },
+          width: 130,
+        },
+        {
+          title: '备注',
+          align: 'center',
+          dataIndex: 'remark',
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          width: 147,
+          scopedSlots: { customRender: 'action' },
+        },
+      ],
+      url: {
+        list: '/elecfeeBase/elecfeeBase/list',
+        delete: '/elecfeeBase/elecfeeBase/delete',
+        deleteBatch: '/elecfeeBase/elecfeeBase/deleteBatch',
+        exportXlsUrl: '/elecfeeBase/elecfeeBase/exportXls',
+        importExcelUrl: 'elecfeeBase/elecfeeBase/importExcel',
+      },
+      dictOptions: {},
+      superFieldList: [],
+    }
+  },
+  created() {
+    // this.getSuperFieldList()
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    },
+  },
+  methods: {
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = []
+      fieldList.push({ type: 'int', value: 'elecfeebaseid', text: '基本电费ID', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
+      fieldList.push({ type: 'sel_depart', value: 'deptid', text: '部门' })
+      fieldList.push({ type: 'string', value: 'feetype', text: '计费类型', dictCode: 'elecfee_base_feetype' })
+      fieldList.push({ type: 'double', value: 'kva', text: '变压器容量/合同最大需量(kVA)', dictCode: '' })
+      fieldList.push({ type: 'double', value: 'price', text: '基本电价(元/kw)', dictCode: '' })
+      fieldList.push({ type: 'date', value: 'begintime', text: '开始时间' })
+      fieldList.push({ type: 'date', value: 'endtime', text: '结束时间' })
+      this.superFieldList = fieldList
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 151 - 0
src/views/module_base/elecfeeBase/modules/ElecfeeBaseForm.vue

@@ -0,0 +1,151 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deptid">
+              <j-select-depart v-model="model.deptid" :multi="true"  />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="计费类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="feetype">
+              <j-dict-select-tag type="list" v-model="model.feetype" dictCode="elecfee_base_feetype" placeholder="请选择计费类型" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="变压器容量/合同最大需量(kVA)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kva">
+              <a-input-number v-model="model.kva" placeholder="请输入变压器容量/合同最大需量(kVA)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="基本电价(元/kw)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
+              <a-input-number v-model="model.price" placeholder="请输入基本电价(元/kw)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
+              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endtime">
+              <j-date placeholder="请选择结束时间" v-model="model.endtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-textarea v-model="model.remark" rows="4" placeholder="请输入备注" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'ElecfeeBaseForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           feetype: [
+              { required: true, message: '请选择计费类型!'},
+           ],
+           kva: [
+              { required: true, message: '请输入变压器容量/合同最大需量(kVA)!'},
+              { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
+           ],
+           price: [
+              { required: true, message: '请输入基本电价(元/kw)!'},
+              { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
+           ],
+           begintime: [
+              { required: true, message: '请输入开始时间!'},
+           ],
+        },
+        url: {
+          add: "/elecfeeBase/elecfeeBase/add",
+          edit: "/elecfeeBase/elecfeeBase/edit",
+          queryById: "/elecfeeBase/elecfeeBase/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+      handleCategoryChange(value,backObj){
+         this.model = Object.assign(this.model, backObj);
+      }
+    }
+  }
+</script>

+ 84 - 0
src/views/module_base/elecfeeBase/modules/ElecfeeBaseModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <elecfee-base-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></elecfee-base-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ElecfeeBaseForm from './ElecfeeBaseForm'
+
+  export default {
+    name: 'ElecfeeBaseModal',
+    components: {
+      ElecfeeBaseForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_base/elecfeeBase/modules/ElecfeeBaseModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <elecfee-base-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></elecfee-base-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ElecfeeBaseForm from './ElecfeeBaseForm'
+  export default {
+    name: 'ElecfeeBaseModal',
+    components: {
+      ElecfeeBaseForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 9 - 14
src/views/module_base/energyRate/EnergyRateList.vue

@@ -81,8 +81,8 @@
         <!-- 内嵌table区域 begin -->
         <template slot="expandedRowRender" slot-scope="record">
           <a-tabs tabPosition="top">
-            <a-tab-pane tab="base_energy_rate_detail" key="baseEnergyRateDetail" forceRender>
-              <base-energy-rate-detail-sub-table :record="record"/>
+            <a-tab-pane tab="详情" key="baseEnergyRateDetail" forceRender>
+              <energy-rate-detail-sub-table :record="record"/>
             </a-tab-pane>
           </a-tabs>
         </template>
@@ -167,16 +167,6 @@
             customRender: (t, r, index) => parseInt(index) + 1
           },
           {
-            title: '能源费率ID',
-            align: 'center',
-            dataIndex: 'energyrateid',
-          },
-          {
-            title: '备注',
-            align: 'center',
-            dataIndex: 'remark',
-          },
-          {
             title: '名称',
             align: 'center',
             dataIndex: 'name',
@@ -187,7 +177,7 @@
             dataIndex: 'energytypeid',
           },
           {
-            title: '费率类型:分时费率、阶梯费率',
+            title: '费率类型',
             align: 'center',
             dataIndex: 'ratetype',
           },
@@ -207,6 +197,11 @@
             dataIndex: 'endtime',
           },
           {
+            title: '备注',
+            align: 'center',
+            dataIndex: 'remark',
+          },
+          {
             title: '操作',
             dataIndex: 'action',
             align: 'center',
@@ -252,7 +247,7 @@
         fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
         fieldList.push({type:'string',value:'name',text:'名称',dictCode:''})
         fieldList.push({type:'int',value:'energytypeid',text:'能源分类ID',dictCode:''})
-        fieldList.push({type:'string',value:'ratetype',text:'费率类型:分时费率、阶梯费率',dictCode:''})
+        fieldList.push({type:'string',value:'ratetype',text:'费率类型',dictCode:''})
         fieldList.push({type:'string',value:'rateunit',text:'单位',dictCode:''})
         fieldList.push({type:'date',value:'begintime',text:'费率有效期开始'})
         fieldList.push({type:'date',value:'endtime',text:'费率有效期结束'})

+ 8 - 13
src/views/module_base/energyRate/modules/EnergyRateForm.vue

@@ -5,16 +5,6 @@
        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
          <a-row>
           <a-col :xs="24" :sm="12">
-            <a-form-model-item label="能源费率ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="energyrateid">
-              <a-input-number v-model="model.energyrateid" placeholder="请输入能源费率ID" style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :xs="24" :sm="12">
-            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
-              <a-input v-model="model.remark" placeholder="请输入备注" ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :xs="24" :sm="12">
             <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
               <a-input v-model="model.name" placeholder="请输入名称" ></a-input>
             </a-form-model-item>
@@ -25,8 +15,8 @@
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="12">
-            <a-form-model-item label="费率类型:分时费率、阶梯费率" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratetype">
-              <a-input v-model="model.ratetype" placeholder="请输入费率类型:分时费率、阶梯费率" ></a-input>
+            <a-form-model-item label="费率类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratetype">
+              <a-input v-model="model.ratetype" placeholder="请输入费率类型" ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="12">
@@ -44,12 +34,17 @@
               <j-date placeholder="请选择费率有效期结束" v-model="model.endtime" style="width: 100%" />
             </a-form-model-item>
           </a-col>
+          <a-col :xs="24" :sm="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-textarea v-model="model.remark" placeholder="请输入备注" style="width: 100%" ></a-textarea>
+            </a-form-model-item>
+          </a-col>
         </a-row>
       </a-form-model>
      </j-form-container>
       <!-- 子表单区域 -->
       <a-tabs v-model="activeKey" @change="handleChangeTabs">
-        <a-tab-pane tab="base_energy_rate_detail" :key="refKeys[0]" :forceRender="true">
+        <a-tab-pane tab="详情" :key="refKeys[0]" :forceRender="true">
           <j-editable-table
             :ref="refKeys[0]"
             :loading="baseEnergyRateDetailTable.loading"

+ 1 - 1
src/views/module_base/energyRate/subTables/EnergyRateDetailSubTable.vue

@@ -68,7 +68,7 @@
             dataIndex: 'endtime',
           },
           {
-            title: '峰平谷:尖、峰、谷、平',
+            title: '峰平谷',
             align: 'center',
             dataIndex: 'pandv',
           },

+ 13 - 14
src/views/module_base/energyType/EnergyTypeList.vue

@@ -122,34 +122,33 @@
             }
           },
           {
-            title:'能源分类ID',
-            align:"center",
-            dataIndex: 'id'
-          },
-          {
-            title:'备注',
-            align:"center",
-            dataIndex: 'remark'
-          },
-          {
             title:'名称',
             align:"center",
-            dataIndex: 'name'
+            dataIndex: 'name',
+            width:250,
           },
           {
             title:'单位',
             align:"center",
-            dataIndex: 'unit'
+            dataIndex: 'unit',
+            width:200,
           },
           {
             title:'千克标准煤',
             align:"center",
-            dataIndex: 'kgce'
+            dataIndex: 'kgce',
+            width:200,
           },
           {
             title:'千克二氧化碳排放',
             align:"center",
-            dataIndex: 'co2'
+            dataIndex: 'co2',
+            width:200,
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark',
           },
           {
             title: '操作',