From 0ae83a895e80a4b9777a27f613d721a7e5e2ac18 Mon Sep 17 00:00:00 2001
From: ali <ali9696@163.com>
Date: 星期二, 03 九月 2024 10:18:27 +0800
Subject: [PATCH] 整体样式修改

---
 energy_management_ui/src/views/electricityPrice/electricity/index.vue |  707 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 396 insertions(+), 311 deletions(-)

diff --git a/energy_management_ui/src/views/electricityPrice/electricity/index.vue b/energy_management_ui/src/views/electricityPrice/electricity/index.vue
index a318b00..132c2a5 100644
--- a/energy_management_ui/src/views/electricityPrice/electricity/index.vue
+++ b/energy_management_ui/src/views/electricityPrice/electricity/index.vue
@@ -1,30 +1,26 @@
-<style scoped>
-  .el-row {
-    margin-bottom: 20px;
-  }
-  .el-col {
-    border-radius: 4px;
-  }
-  .row-bg {
-      padding: 10px 0;
-      background-color: #f9fafc;
-    }
-</style>
 <template>
   <div class="app-container">
     <el-form :model="forms" label-width="100px">
       <el-row :gutter="24" class="mb8">
         <el-col :span="16">
-          <el-form-item prop="effective_date" label="鐢熸晥鏃堕棿锛�" label-width="100px">
+          <el-form-item
+            prop="effective_date"
+            label="鐢熸晥鏃堕棿锛�"
+            label-width="100px"
+          >
             <!--{{changeTime(parseTime(effective_date))}}-->
-            <el-date-picker clearable size="small" style="width: 200px"
-                            v-model="forms.effectiveDate"
-                            type="date"
-                            value-format="yyyy-MM-dd"
-                            :picker-options="pickerOptions"
-                            placeholder="璁剧疆鐢熸晥鏃堕棿">
+            <el-date-picker
+              clearable
+              size="small"
+              style="width: 200px"
+              v-model="forms.effectiveDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              :picker-options="pickerOptions"
+              placeholder="璁剧疆鐢熸晥鏃堕棿"
+            >
             </el-date-picker>
-           <!-- <el-input :disabled="isDisabled" v-model="item.effectiveDate"></el-input>-->
+            <!-- <el-input :disabled="isDisabled" v-model="item.effectiveDate"></el-input>-->
             <!--<el-button size="mini" @click="addDate">璁剧疆鐢熸晥鏃堕棿</el-button>-->
           </el-form-item>
         </el-col>
@@ -34,28 +30,54 @@
             size="mini"
             @click="handleAdd()"
             v-hasPermi="['electricityPrice:electricity:add']"
-          >鏂板鏃舵</el-button>
+            >鏂板鏃舵</el-button
+          >
         </el-col>
         <el-col :span="1.5">
-          <el-button plain
+          <el-button
+            plain
             size="mini"
             @click="handlePrice()"
             v-hasPermi="['electricityPrice:price:add']"
-          >璁剧疆鍗曚环</el-button>
+            >璁剧疆鍗曚环</el-button
+          >
         </el-col>
         <el-col :span="1.5">
-          <router-link :to="'/electricityPrice/listHistory'"  class="link-type">
+          <router-link :to="'/electricityPrice/listHistory'" class="link-type">
             <el-button plain size="mini">鏌ョ湅鍘嗗彶</el-button>
           </router-link>
         </el-col>
       </el-row>
-      <el-table v-loading="loading" :data="electricityList" @selection-change="handleSelectionChange">
+      <el-table
+        v-loading="loading"
+        :data="electricityList"
+        @selection-change="handleSelectionChange"
+      >
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="鏃舵鍚嶇О" align="center" prop="effectiveName" :formatter="effectiveNameFormat" />
-        <el-table-column label="鍗曚环" align="center" prop="price"/>
-        <el-table-column label="鏃舵寮�濮嬫椂闂�" align="center" prop="beginDate" width="180"/>
-        <el-table-column label="鏃舵缁撴潫鏃堕棿" align="center" prop="endDate" width="180"/>
-        <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+        <el-table-column
+          label="鏃舵鍚嶇О"
+          align="center"
+          prop="effectiveName"
+          :formatter="effectiveNameFormat"
+        />
+        <el-table-column label="鍗曚环" align="center" prop="price" />
+        <el-table-column
+          label="鏃舵寮�濮嬫椂闂�"
+          align="center"
+          prop="beginDate"
+          width="180"
+        />
+        <el-table-column
+          label="鏃舵缁撴潫鏃堕棿"
+          align="center"
+          prop="endDate"
+          width="180"
+        />
+        <el-table-column
+          label="鎿嶄綔"
+          align="center"
+          class-name="small-padding fixed-width"
+        >
           <template slot-scope="scope">
             <el-button
               size="mini"
@@ -63,13 +85,14 @@
               icon="el-icon-delete"
               @click="handleDelete(scope.row)"
               v-hasPermi="['electricityPrice:electricity:remove']"
-            >鍒犻櫎</el-button>
+              >鍒犻櫎</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
     </el-form>
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -77,14 +100,23 @@
     />
     <!-- 娣诲姞鎴栦慨鏀筫lectricityPrice瀵硅瘽妗� -->
     <el-dialog :title="title" :visible.sync="time" width="500px">
-      <el-form ref="form" :model="form" :rulesTime="rulesTime" label-width="120px">
+      <el-form
+        ref="form"
+        :model="form"
+        :rulesTime="rulesTime"
+        label-width="120px"
+      >
         <el-form-item label="鐢熸晥鏃ユ湡" prop="effectiveDate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.effectiveDate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          :picker-options="pickerOptions"
-                          placeholder="閫夋嫨鐢熸晥鏃ユ湡">
+          <el-date-picker
+            clearable
+            size="small"
+            style="width: 200px"
+            v-model="form.effectiveDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            :picker-options="pickerOptions"
+            placeholder="閫夋嫨鐢熸晥鏃ユ湡"
+          >
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -96,7 +128,9 @@
     <!-- 娣诲姞鎴栦慨鏀筫lectricityPrice瀵硅瘽妗� -->
     <el-dialog :title="title" :visible.sync="open" width="500px">
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="鐢熸晥鏃堕棿" prop="effectiveDate">{{changeTime(parseTime(form.effectiveDate))}}</el-form-item>
+        <el-form-item label="鐢熸晥鏃堕棿" prop="effectiveDate">{{
+          changeTime(parseTime(form.effectiveDate))
+        }}</el-form-item>
         <el-form-item label="鏃舵鍚嶇О" prop="effectiveName">
           <el-select v-model="form.effectiveName" placeholder="璇烽�夋嫨鏃舵鍚嶇О">
             <el-option
@@ -111,17 +145,17 @@
           <el-time-picker
             v-model="form.beginDate"
             class="date-box"
-            format='HH:mm'
+            format="HH:mm"
             value-format="HH:mm"
             placeholder="閫夋嫨鏃舵寮�濮嬫椂闂�"
-            >
+          >
           </el-time-picker>
         </el-form-item>
         <el-form-item label="鏃舵缁撴潫鏃堕棿" prop="endDate">
           <el-time-picker
             v-model="form.endDate"
             class="date-box"
-            format='HH:mm'
+            format="HH:mm"
             value-format="HH:mm"
             placeholder="閫夋嫨鏃舵寮�濮嬫椂闂�"
           ></el-time-picker>
@@ -136,11 +170,23 @@
     <el-dialog :title="title" :visible.sync="openPrice" width="500px">
       <el-form ref="formPrice" :model="formPrice" :rulesPrice="rulesPrice">
         <el-input type="hidden" v-model="formPrice.effectiveDate"></el-input>
-        <el-table :data="effective_name" ref="multipleTable" tooltip-effect="dark">
-          <el-table-column align="center" property="dictLabel" label="鏃舵鍚嶇О" ></el-table-column>
+        <el-table
+          :data="effective_name"
+          ref="multipleTable"
+          tooltip-effect="dark"
+        >
+          <el-table-column
+            align="center"
+            property="dictLabel"
+            label="鏃舵鍚嶇О"
+          ></el-table-column>
           <el-table-column align="center" property="price" label="鍗曚环(鍏�)">
-           <template scope="scope">
-             <el-input step="0.1" v-model="scope.row.price" placeholder="璇疯緭鍏ュ崟浠�(鍏�)"></el-input>
+            <template scope="scope">
+              <el-input
+                step="0.1"
+                v-model="scope.row.price"
+                placeholder="璇疯緭鍏ュ崟浠�(鍏�)"
+              ></el-input>
             </template>
           </el-table-column>
         </el-table>
@@ -154,208 +200,237 @@
 </template>
 
 <script>
-  import { listElectricity, getElectricity, delElectricity, addElectricity, updateElectricity, exportElectricity,listDate} from "@/api/electricityPrice/electricity";
+import {
+  listElectricity,
+  getElectricity,
+  delElectricity,
+  addElectricity,
+  updateElectricity,
+  exportElectricity,
+  listDate
+} from "@/api/electricityPrice/electricity";
 
-  import { listPrice, getPrice, delPrice, addPrice, updatePrice ,EdictType,dictTypeList } from "@/api/electricityPrice/price";
+import {
+  listPrice,
+  getPrice,
+  delPrice,
+  addPrice,
+  updatePrice,
+  EdictType,
+  dictTypeList
+} from "@/api/electricityPrice/price";
 
-  export default {
-    data() {
-      return {
-        // 閬僵灞�
-        loading: true,
-        // 閫変腑鏁扮粍
-        ids: [],
-        // 闈炲崟涓鐢�
-        single: true,
-        // 闈炲涓鐢�
-        multiple: true,
-        // 鎬绘潯鏁�
-        total: 0,
-        // electricityPrice琛ㄦ牸鏁版嵁
-        electricityList: [],
-        list: [],
-        // 寮瑰嚭灞傛爣棰�
-        title: "",
-        // 鏄惁鏄剧ず寮瑰嚭灞�
-        open: false,
-        time: false,
-        openPrice: false,
-        // 鏃舵鍚嶇О瀛楀吀
-        effectiveNameOptions: [],
-        effective_name: [],
-        ifeffective: [],
-        effective:{
-          dictLabel:'',
-          dictValue:'',
-          price:''
-        },
-        dictType:"",
-        effective_date:"",
-        // 鏌ヨ鍙傛暟
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          effectiveDate: undefined,
-          priceId: undefined,
-          beginDate: undefined,
-          endDate: undefined,
-          effectiveName: undefined,
-          dictType: undefined,
-        },
-        // 琛ㄥ崟鍙傛暟
-        form: {},
-        forms:{},
-        formPrice:{},
-        // 琛ㄥ崟鏍¢獙
-        rules: {
-          effectiveDate: [
-            { required: true, message: "鐢熸晥鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }
-          ],
-          beginDate: [
-            { required: true, message: "鏃舵寮�濮嬫椂闂翠笉鑳戒负绌�", trigger: "blur" }
-          ],
-          endDate: [
-            { required: true, message: "鏃舵缁撴潫鏃堕棿涓嶈兘涓虹┖", trigger: "blur" }
-          ],
-          effectiveName: [
-            { required: true, message: "鏃舵鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
-          ]
-        },
-        rulesTime: {
-          effectiveDate: [
-            { required: true, message: "鐢熸晥鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }
-          ]
-        },
-        rulesPrice: {
-          timePeriod: [
-            { required: true, message: "鏃舵涓嶈兘涓虹┖", trigger: "blur" }
-          ],
-          price:[{ required: true, message: "鍗曚环涓嶈兘涓虹┖", trigger: "blur" }]
-        },
-        pickerOptions: { // 涓嶈閫夋嫨浠婂ぉ浠ュ墠鐨�
-          disabledDate(time) {
-            return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
-          }
+export default {
+  data() {
+    return {
+      // 閬僵灞�
+      loading: true,
+      // 閫変腑鏁扮粍
+      ids: [],
+      // 闈炲崟涓鐢�
+      single: true,
+      // 闈炲涓鐢�
+      multiple: true,
+      // 鎬绘潯鏁�
+      total: 0,
+      // electricityPrice琛ㄦ牸鏁版嵁
+      electricityList: [],
+      list: [],
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 鏄惁鏄剧ず寮瑰嚭灞�
+      open: false,
+      time: false,
+      openPrice: false,
+      // 鏃舵鍚嶇О瀛楀吀
+      effectiveNameOptions: [],
+      effective_name: [],
+      ifeffective: [],
+      effective: {
+        dictLabel: "",
+        dictValue: "",
+        price: ""
+      },
+      dictType: "",
+      effective_date: "",
+      // 鏌ヨ鍙傛暟
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        effectiveDate: undefined,
+        priceId: undefined,
+        beginDate: undefined,
+        endDate: undefined,
+        effectiveName: undefined,
+        dictType: undefined
+      },
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      forms: {},
+      formPrice: {},
+      // 琛ㄥ崟鏍¢獙
+      rules: {
+        effectiveDate: [
+          { required: true, message: "鐢熸晥鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        beginDate: [
+          { required: true, message: "鏃舵寮�濮嬫椂闂翠笉鑳戒负绌�", trigger: "blur" }
+        ],
+        endDate: [
+          { required: true, message: "鏃舵缁撴潫鏃堕棿涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        effectiveName: [
+          { required: true, message: "鏃舵鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+        ]
+      },
+      rulesTime: {
+        effectiveDate: [
+          { required: true, message: "鐢熸晥鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }
+        ]
+      },
+      rulesPrice: {
+        timePeriod: [
+          { required: true, message: "鏃舵涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        price: [{ required: true, message: "鍗曚环涓嶈兘涓虹┖", trigger: "blur" }]
+      },
+      pickerOptions: {
+        // 涓嶈閫夋嫨浠婂ぉ浠ュ墠鐨�
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
         }
-      };
-    },
+      }
+    };
+  },
 
-    created() {
-      this.getList();
-      this.getLists();
-      this.getDicts("electricity_price").then(response => {
-        this.effectiveNameOptions = response.data;
+  created() {
+    this.getList();
+    this.getLists();
+    this.getDicts("electricity_price").then(response => {
+      this.effectiveNameOptions = response.data;
+    });
+  },
+  methods: {
+    /** 鏌ヨelectricityPrice鍒楄〃 */
+    getList() {
+      this.loading = true;
+      listDate(this.queryParams).then(response => {
+        this.list = response.rows;
+        if (this.list.length > 0) {
+          this.forms.effectiveDate = this.list[0].effectiveDate;
+          this.effective_date = this.list[0].effectiveDate;
+        }
+        this.loading = false;
       });
     },
-    methods: {
-      /** 鏌ヨelectricityPrice鍒楄〃 */
-      getList() {
-        this.loading = true;
-        listDate(this.queryParams).then(response => {
-          this.list= response.rows;
-          if(this.list.length>0){
-            this.forms.effectiveDate=this.list[0].effectiveDate;
-            this.effective_date=this.list[0].effectiveDate;
-          }
-          this.loading = false;
-        });
-      },
-      getLists(){
-        listElectricity(this.queryParams).then(response => {
-          this.electricityList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
-      // 鏃舵鍚嶇О瀛楀吀缈昏瘧
-      effectiveNameFormat(row, column) {
-        return this.selectDictLabel(this.effectiveNameOptions, row.effectiveName);
-      },
-      // 鍙栨秷鎸夐挳
-      cancel() {
-        this.open = false;
-        this.time = false;
-        this.openPrice = false;
+    getLists() {
+      listElectricity(this.queryParams).then(response => {
+        this.electricityList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 鏃舵鍚嶇О瀛楀吀缈昏瘧
+    effectiveNameFormat(row, column) {
+      return this.selectDictLabel(this.effectiveNameOptions, row.effectiveName);
+    },
+    // 鍙栨秷鎸夐挳
+    cancel() {
+      this.open = false;
+      this.time = false;
+      this.openPrice = false;
+      this.reset();
+    },
+    // 琛ㄥ崟閲嶇疆
+    reset() {
+      this.form = {
+        id: undefined,
+        effectiveDate: undefined,
+        priceId: undefined,
+        beginDate: undefined,
+        endDate: undefined,
+        effectiveName: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 鎼滅储鎸夐挳鎿嶄綔 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    handleSelectionChange(selection) {
+      console.log(selection);
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+    /** 鏂板鎸夐挳鎿嶄綔 */
+    handleAdd() {
+      this.reset();
+      this.queryParams.effectiveDate = this.forms.effectiveDate;
+      listPrice(this.queryParams).then(response => {
         this.reset();
-      },
-      // 琛ㄥ崟閲嶇疆
-      reset() {
-        this.form = {
-          id: undefined,
-          effectiveDate: undefined,
-          priceId: undefined,
-          beginDate: undefined,
-          endDate: undefined,
-          effectiveName: undefined
-        };
-        this.resetForm("form");
-      },
-      /** 鎼滅储鎸夐挳鎿嶄綔 */
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      /** 閲嶇疆鎸夐挳鎿嶄綔 */
-      resetQuery() {
-        this.resetForm("queryForm");
-        this.handleQuery();
-      },
-      // 澶氶�夋閫変腑鏁版嵁
-      handleSelectionChange(selection) {
-        console.log(selection);
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length!=1
-        this.multiple = !selection.length
-      },
-      /** 鏂板鎸夐挳鎿嶄綔 */
-      handleAdd() {
-        this.reset();
-        this.queryParams.effectiveDate = this.forms.effectiveDate;
-        listPrice(this.queryParams).then(response => {
-          this.reset();
-          this.ifeffective = response.rows;
-          if (this.ifeffective.length > 0) {
-            this.form.effectiveDate = this.forms.effectiveDate;
-            this.open = true;
-            this.title = "娣诲姞鏂板鏃舵";
-          } else {
-            this.msgSuccess("璇峰厛璁剧疆浠锋牸");
-          }
-        });
-      },
-      handlePrice(){
-        this.queryParams.effectiveDate = this.forms.effectiveDate.substring(0, 10);
-        this.queryParams.dictType="electricity_price",
+        this.ifeffective = response.rows;
+        if (this.ifeffective.length > 0) {
+          this.form.effectiveDate = this.forms.effectiveDate;
+          this.open = true;
+          this.title = "娣诲姞鏂板鏃舵";
+        } else {
+          this.msgSuccess("璇峰厛璁剧疆浠锋牸");
+        }
+      });
+    },
+    handlePrice() {
+      this.queryParams.effectiveDate = this.forms.effectiveDate.substring(
+        0,
+        10
+      );
+      (this.queryParams.dictType = "electricity_price"),
         dictTypeList(this.queryParams).then(response => {
           this.reset();
-          this.formPrice.effectiveDate=this.forms.effectiveDate;
-          this.effective_name=response.data;
+          this.formPrice.effectiveDate = this.forms.effectiveDate;
+          this.effective_name = response.data;
           this.openPrice = true;
           this.title = "璁剧疆鍗曚环";
         });
-      },
-      /** 鎻愪氦鎸夐挳 */
-      submitPrice: function() {
-        this.formPrice.effectiveDate;
-        this.$nextTick(() => {
-          this.formPrice.TimeJson=this.$refs['multipleTable'].data
-          let tourId = '';
-          let tourLabels = '';
-          let tourValue = '';
-          let tourPrice = '';
-          for (let i = 0; i < this.formPrice.TimeJson.length; i++) {
-            tourLabels +=this.formPrice.TimeJson[i].dictLabel+",";
-            tourValue +=this.formPrice.TimeJson[i].dictValue+",";
-            tourPrice +=this.formPrice.TimeJson[i].price+",";
-            tourId +=this.formPrice.TimeJson[i].id+",";
-          }
-          this.formPrice.dictLabel=tourLabels.substring(0, tourLabels.lastIndexOf(','));
-          this.formPrice.dictValue=tourValue.substring(0, tourValue.lastIndexOf(','));
-          this.formPrice.price=tourPrice.substring(0, tourPrice.lastIndexOf(','));
-          this.formPrice.id=tourId.substring(0, tourId.lastIndexOf(','));
-          //console.log(this.formPrice.TimeJson[0].id);
-         if (this.formPrice.TimeJson[0].id != undefined) {
-           updatePrice(this.formPrice).then(response => {
+    },
+    /** 鎻愪氦鎸夐挳 */
+    submitPrice: function() {
+      this.formPrice.effectiveDate;
+      this.$nextTick(() => {
+        this.formPrice.TimeJson = this.$refs["multipleTable"].data;
+        let tourId = "";
+        let tourLabels = "";
+        let tourValue = "";
+        let tourPrice = "";
+        for (let i = 0; i < this.formPrice.TimeJson.length; i++) {
+          tourLabels += this.formPrice.TimeJson[i].dictLabel + ",";
+          tourValue += this.formPrice.TimeJson[i].dictValue + ",";
+          tourPrice += this.formPrice.TimeJson[i].price + ",";
+          tourId += this.formPrice.TimeJson[i].id + ",";
+        }
+        this.formPrice.dictLabel = tourLabels.substring(
+          0,
+          tourLabels.lastIndexOf(",")
+        );
+        this.formPrice.dictValue = tourValue.substring(
+          0,
+          tourValue.lastIndexOf(",")
+        );
+        this.formPrice.price = tourPrice.substring(
+          0,
+          tourPrice.lastIndexOf(",")
+        );
+        this.formPrice.id = tourId.substring(0, tourId.lastIndexOf(","));
+        //console.log(this.formPrice.TimeJson[0].id);
+        if (this.formPrice.TimeJson[0].id != undefined) {
+          updatePrice(this.formPrice).then(response => {
             if (response.code === 200) {
               this.msgSuccess("淇敼鎴愬姛");
               this.openPrice = false;
@@ -363,7 +438,7 @@
               this.msgError(response.msg);
             }
           });
-        }else{
+        } else {
           addPrice(this.formPrice).then(response => {
             if (response.code === 200) {
               this.msgSuccess("鏂板鎴愬姛");
@@ -373,89 +448,99 @@
             }
           });
         }
-        })
-        this.loading = false;
-      },
-      addDate() {
-        this.reset();
-        this.time = true;
-        this.title = "娣诲姞鐢熸晥鏃ユ湡";
-      },
-      /** 淇敼鎸夐挳鎿嶄綔 */
-      handleUpdate() {
-        this.reset();
-        const id =this.ids
-        getElectricity(id).then(response => {
-          this.form = response.data;
-          this.open = true;
-          this.title = "淇敼鏂板鏃舵";
-        });
-      },
-      /** 鎻愪氦鎸夐挳 */
-      submitForm: function() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            if (this.form.id != undefined) {
-              updateElectricity(this.form).then(response => {
-                if (response.code === 200) {
-                  this.msgSuccess("淇敼鎴愬姛");
-                  this.open = false;
-                  this.getList();
-                  this.getLists();
-                } else {
-                  this.msgError(response.msg);
-                }
-              });
-            } else {
-              addElectricity(this.form).then(response => {
-                if (response.code === 200) {
-                  this.msgSuccess("鏂板鎴愬姛");
-                  this.open = false;
-                  this.getList();
-                  this.getLists();
-                } else {
-                  this.msgError(response.msg);
-                }
-              });
-            }
+      });
+      this.loading = false;
+    },
+    addDate() {
+      this.reset();
+      this.time = true;
+      this.title = "娣诲姞鐢熸晥鏃ユ湡";
+    },
+    /** 淇敼鎸夐挳鎿嶄綔 */
+    handleUpdate() {
+      this.reset();
+      const id = this.ids;
+      getElectricity(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "淇敼鏂板鏃舵";
+      });
+    },
+    /** 鎻愪氦鎸夐挳 */
+    submitForm: function() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != undefined) {
+            updateElectricity(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("淇敼鎴愬姛");
+                this.open = false;
+                this.getList();
+                this.getLists();
+              } else {
+                this.msgError(response.msg);
+              }
+            });
+          } else {
+            addElectricity(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("鏂板鎴愬姛");
+                this.open = false;
+                this.getList();
+                this.getLists();
+              } else {
+                this.msgError(response.msg);
+              }
+            });
           }
-        });
-      },
-      /** 鍒犻櫎鎸夐挳鎿嶄綔 */
-      handleDelete(row) {
-        const ids = row.id || this.ids;
-        this.$confirm('鏄惁纭鍒犻櫎鏂板鏃舵缂栧彿涓�"' + ids + '"鐨勬暟鎹」?', "璀﹀憡", {
+        }
+      });
+    },
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(
+        '鏄惁纭鍒犻櫎鏂板鏃舵缂栧彿涓�"' + ids + '"鐨勬暟鎹」?',
+        "璀﹀憡",
+        {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
           type: "warning"
-        }).then(function() {
+        }
+      )
+        .then(function() {
           return delElectricity(ids);
-        }).then(() => {
+        })
+        .then(() => {
           this.getList();
           this.getLists();
           this.msgSuccess("鍒犻櫎鎴愬姛");
-        }).catch(function() {});
-      },
-      /** 瀵煎嚭鎸夐挳鎿嶄綔 */
-      handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('鏄惁纭瀵煎嚭鎵�鏈塭lectricityPrice鏁版嵁椤�?', "璀﹀憡", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        }).then(function() {
+        })
+        .catch(function() {});
+    },
+    /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm("鏄惁纭瀵煎嚭鎵�鏈塭lectricityPrice鏁版嵁椤�?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(function() {
           return exportElectricity(queryParams);
-        }).then(response => {
+        })
+        .then(response => {
           this.download(response.msg);
-        }).catch(function() {});
-      },
-      changeTime(time) {
-        if (time !== null && time !== undefined && time !== "") {
-          return time.substring(0, 10);
-        } else {
-          return "";
-        }
+        })
+        .catch(function() {});
+    },
+    changeTime(time) {
+      if (time !== null && time !== undefined && time !== "") {
+        return time.substring(0, 10);
+      } else {
+        return "";
       }
     }
-  };
+  }
+};
 </script>

--
Gitblit v1.9.3