Przeglądaj źródła

✨ feat(瑞恒日报): 添加气电比

Zimo 18 godzin temu
rodzic
commit
81db9439ce

+ 11 - 0
src/views/pms/iotrhdailyreport/approval.vue

@@ -52,6 +52,7 @@ interface List {
   auditStatus: number // 审核状态
   auditStatus: number // 审核状态
   status: number // 状态
   status: number // 状态
   opinion: string // 审核意见
   opinion: string // 审核意见
+  gasElectricityRatio: number // 气电比
 }
 }
 
 
 interface Column {
 interface Column {
@@ -173,6 +174,16 @@ const columns = ref<Column[]>([
         label: '油耗(L)',
         label: '油耗(L)',
         prop: 'dailyOilUsage',
         prop: 'dailyOilUsage',
         'min-width': '120px'
         'min-width': '120px'
+      },
+      {
+        label: '气电比',
+        prop: 'gasElectricityRatio',
+        'min-width': '120px',
+        formatter: (row: List) => {
+          const gasElectricityRatio = row?.gasElectricityRatio ?? 0
+
+          return (gasElectricityRatio * 100).toFixed(2) + '%'
+        }
       }
       }
     ]
     ]
   },
   },

+ 11 - 0
src/views/pms/iotrhdailyreport/fill.vue

@@ -52,6 +52,7 @@ interface List {
   auditStatus: number // 审核状态
   auditStatus: number // 审核状态
   status: number // 状态
   status: number // 状态
   opinion: string // 审核意见
   opinion: string // 审核意见
+  gasElectricityRatio: number // 气电比
 }
 }
 
 
 interface Column {
 interface Column {
@@ -173,6 +174,16 @@ const columns = ref<Column[]>([
         label: '油耗(L)',
         label: '油耗(L)',
         prop: 'dailyOilUsage',
         prop: 'dailyOilUsage',
         'min-width': '120px'
         'min-width': '120px'
+      },
+      {
+        label: '气电比',
+        prop: 'gasElectricityRatio',
+        'min-width': '120px',
+        formatter: (row: List) => {
+          const gasElectricityRatio = row?.gasElectricityRatio ?? 0
+
+          return (gasElectricityRatio * 100).toFixed(2) + '%'
+        }
       }
       }
     ]
     ]
   },
   },

+ 25 - 1
src/views/pms/iotrhdailyreport/index.vue

@@ -266,6 +266,14 @@
                 :min-width="columnWidths.dailyOilUsage.width"
                 :min-width="columnWidths.dailyOilUsage.width"
                 resizable
                 resizable
               />
               />
+              <el-table-column
+                label="气电比"
+                align="center"
+                prop="gasElectricityRatio"
+                :formatter="gasElectricityRatioFormatter"
+                :min-width="columnWidths.gasElectricityRatio.width"
+                resizable
+              />
             </el-table-column>
             </el-table-column>
             <el-table-column label="非生产时间" align="center">
             <el-table-column label="非生产时间" align="center">
               <el-table-column
               <el-table-column
@@ -695,6 +703,11 @@ const columnWidths = ref<
     prop: 'dailyOilUsage',
     prop: 'dailyOilUsage',
     width: '120px'
     width: '120px'
   },
   },
+  gasElectricityRatio: {
+    label: '气电比',
+    prop: 'gasElectricityRatio',
+    width: '120px'
+  },
   accidentTime: {
   accidentTime: {
     label: '工程质量',
     label: '工程质量',
     prop: 'accidentTime',
     prop: 'accidentTime',
@@ -806,6 +819,12 @@ const columnWidths = ref<
   }
   }
 })
 })
 
 
+const gasElectricityRatioFormatter = (row: any) => {
+  const gasElectricityRatio = row?.gasElectricityRatio ?? 0
+
+  return (gasElectricityRatio * 100).toFixed(2) + '%'
+}
+
 // 计算文本宽度
 // 计算文本宽度
 const getTextWidth = (text: string, fontSize = 12) => {
 const getTextWidth = (text: string, fontSize = 12) => {
   const span = document.createElement('span')
   const span = document.createElement('span')
@@ -836,7 +855,12 @@ const calculateColumnWidths = useDebounceFn(() => {
                 return getTextWidth(fn ? fn(v) : v[prop])
                 return getTextWidth(fn ? fn(v) : v[prop])
               })
               })
             ]
             ]
-          ) + (label === '施工状态' || label === '非生产时间原因' ? 30 : 20),
+          ) +
+            (label === '施工状态' || label === '非生产时间原因'
+              ? 30
+              : label === '气电比'
+                ? 40
+                : 20),
           200
           200
         ]
         ]
       ) + 'px'
       ) + 'px'