Просмотр исходного кода

✨ feat(瑞鹰钻井修井): 添加平均油耗

Zimo 2 дней назад
Родитель
Сommit
2e2ddc8ca5

+ 19 - 4
src/views/pms/iotrydailyreport/summary.vue

@@ -47,6 +47,13 @@ const totalWorkKeys: [string, string, string, string, number][] = [
     0
   ],
   ['notReported', '个', '未填报', 'i-material-symbols:cancel-outline-rounded text-rose', 0],
+  [
+    'averageFuelConsumption',
+    '升',
+    '平均油耗',
+    'i-material-symbols:directions-car-outline-rounded text-sky',
+    2
+  ],
   [
     'totalFuelConsumption',
     '升',
@@ -70,7 +77,8 @@ const totalWork = ref({
   notReported: 0,
   totalFuelConsumption: 0,
   totalPowerConsumption: 0,
-  totalFootage: 0
+  totalFootage: 0,
+  averageFuelConsumption: 0
 })
 
 const totalLoading = ref(false)
@@ -101,7 +109,8 @@ const getTotal = useDebounceFn(async () => {
       ...res2,
       totalPowerConsumption: (res2.totalPowerConsumption || 0) / 1000,
       totalGasInjection: (res2.totalGasInjection || 0) / 10000,
-      totalFuelConsumption: res2.totalFuelConsumption || 0
+      totalFuelConsumption: res2.totalFuelConsumption || 0,
+      averageFuelConsumption: res2.averageFuelConsumption || 0
     }
   } finally {
     totalLoading.value = false
@@ -118,6 +127,7 @@ interface List {
   cumulativeFuelConsumption: number | null
   transitTime: number | null
   nonProductiveTime: number | null
+  averageFuelConsumption: number | null
 }
 
 const list = ref<List[]>([])
@@ -142,6 +152,10 @@ const columns = (type: string) => {
       label: '累计油耗(升)',
       prop: 'cumulativeFuelConsumption'
     },
+    {
+      label: '平均油耗(升)',
+      prop: 'averageFuelConsumption'
+    },
     {
       label: '平均时效(%)',
       prop: 'transitTime'
@@ -178,7 +192,8 @@ const getList = useDebounceFn(async () => {
         name: type === '2' ? projectDeptName : teamName,
         ...other,
         cumulativePowerConsumption: ((other.cumulativePowerConsumption || 0) / 1000).toFixed(2),
-        cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2)
+        cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2),
+        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2)
       })
     )
   } finally {
@@ -527,7 +542,7 @@ const tolist = (id: number, non: boolean = false) => {
           <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
         </el-form-item>
       </el-form>
-      <div class="grid grid-cols-6 gap-8">
+      <div class="grid grid-cols-7 gap-8">
         <div
           v-for="info in totalWorkKeys"
           :key="info[0]"

+ 19 - 4
src/views/pms/iotrydailyreport/xsummary.vue

@@ -54,6 +54,13 @@ const totalWorkKeys: [string, string, string, string, number][] = [
     'i-material-symbols:directions-car-outline-rounded text-sky',
     2
   ],
+  [
+    'averageFuelConsumption',
+    '升',
+    '平均油耗',
+    'i-material-symbols:directions-car-outline-rounded text-sky',
+    2
+  ],
   [
     'totalPowerConsumption',
     'MWh',
@@ -72,7 +79,8 @@ const totalWork = ref({
   totalFuelConsumption: 0,
   totalPowerConsumption: 0,
   constructionWells: 0,
-  completedWells: 0
+  completedWells: 0,
+  averageFuelConsumption: 0
 })
 
 const totalLoading = ref(false)
@@ -103,7 +111,8 @@ const getTotal = useDebounceFn(async () => {
       completedWells: 0,
       ...res2,
       totalPowerConsumption: (res2.totalPowerConsumption || 0) / 1000,
-      totalFuelConsumption: res2.totalFuelConsumption || 0
+      totalFuelConsumption: res2.totalFuelConsumption || 0,
+      averageFuelConsumption: res2.averageFuelConsumption || 0
     }
   } finally {
     totalLoading.value = false
@@ -120,6 +129,7 @@ interface List {
   cumulativeFuelConsumption: number | null
   transitTime: number | null
   nonProductiveTime: number | null
+  averageFuelConsumption: number | null
 }
 
 const list = ref<List[]>([])
@@ -148,6 +158,10 @@ const columns = (type: string) => {
       label: '累计油耗(升)',
       prop: 'cumulativeFuelConsumption'
     },
+    {
+      label: '平均油耗(升)',
+      prop: 'averageFuelConsumption'
+    },
     {
       label: '平均时效(%)',
       prop: 'transitTime'
@@ -184,7 +198,8 @@ const getList = useDebounceFn(async () => {
         name: type === '2' ? projectDeptName : teamName,
         ...other,
         cumulativePowerConsumption: ((other.cumulativePowerConsumption || 0) / 1000).toFixed(2),
-        cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2)
+        cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2),
+        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2)
       })
     )
   } finally {
@@ -525,7 +540,7 @@ const tolist = (id: number, non: boolean = false) => {
           <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
         </el-form-item>
       </el-form>
-      <div class="grid grid-cols-7 gap-8">
+      <div class="grid grid-cols-8 gap-8">
         <div
           v-for="info in totalWorkKeys"
           :key="info[0]"