Эх сурвалжийг харах

feat: 集中抄表添加用能分类字段并优化属性命名

yusheng 5 сар өмнө
parent
commit
a04c07c0dd

+ 13 - 6
src/views/centralizedMeterReading/collectionList.vue

@@ -269,13 +269,20 @@
             align: 'center',
             minWidth: 130,
             showOverflowTooltip: true
+          },
+          {
+            prop: 'energyClassificationName',
+            label: '用能分类',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true
           }
         ];
         // 日采集 - 1-24时
         if (this.pageName == 'dailyCollection') {
           for (let i = 1; i <= 24; i++) {
             arr.push({
-              prop: 'hour0' + i,
+              prop: i < 10 ? 'hour0' + i : 'hour' + i,
               label: i + '时',
               align: 'center',
               minWidth: 90,
@@ -290,10 +297,10 @@
           const daysInMonth = dayjs(queryMonth).daysInMonth();
           for (let i = 1; i <= daysInMonth; i++) {
             arr.push({
-              prop: 'day0' + i,
+              prop: i < 10 ? 'day0' + i : 'day' + i,
               label: i + '日',
               align: 'center',
-              minWidth: 80,
+              minWidth: 90,
               showOverflowTooltip: true
             });
           }
@@ -302,7 +309,7 @@
         if (this.pageName == 'yearlyCollection') {
           for (let i = 1; i <= 12; i++) {
             arr.push({
-              prop: 'month0' + i,
+              prop: i < 10 ? 'month0' + i : 'month' + i,
               label: i + '月',
               align: 'center',
               minWidth: 100,
@@ -410,7 +417,7 @@
             return;
           }
         } else {
-          if (!this.where.queryDate) {
+          if (!this.queryDate) {
             this.$message.warning('查询日期不能为空');
             return;
           }
@@ -469,7 +476,7 @@
         if (this.pageName == 'fullYearCollection') {
           if (res.list.length) {
             res.list = res.list[0].dataList.map((item) => {
-              let data = { substanceName: item.substanceName };
+              let data = { substanceName: item.substanceName, energyClassificationName: item.energyClassificationName  };
               for (let key in item.yearDataMap) {
                 data[key] = item.yearDataMap[key] || '';
               }