Преглед изворни кода

✨ feat: 日报汇总添加设备利用率

Zimo пре 9 часа
родитељ
комит
66979a96ef

+ 3 - 3
src/views/pms/iotrddailyreport/summary.vue

@@ -79,7 +79,6 @@ const totalWorkKeys: [string, string | undefined, string, string, number][] = [
     2
   ],
   ['taici', undefined, '台次', 'i-material-symbols:check-circle-outline-rounded text-emerald', 0],
-
   [
     'utilizationRate',
     '%',
@@ -232,7 +231,8 @@ const chartData = ref<Record<string, number[]>>({
   cumulativeGasInjection: [],
   cumulativePowerConsumption: [],
   cumulativeWaterInjection: [],
-  transitTime: []
+  transitTime: [],
+  utilizationRate: []
 })
 
 let chartLoading = ref(false)
@@ -602,7 +602,7 @@ const { ZmTable, ZmTableColumn } = useTableComponents()
                         prop="utilizationRate"
                         cover-formatter
                         :real-value="
-                          (row: List) => `${Number(((row.utilizationRate || 0) * 100).toFixed(2))}%`
+                          (row: List) => (Number(row.utilizationRate ?? 0) * 100).toFixed(2) + '%'
                         "
                       />
                     </zm-table>

+ 28 - 8
src/views/pms/iotrhdailyreport/summary.vue

@@ -45,6 +45,13 @@ const totalWorkKeys: [string, string, string, string, number][] = [
     'i-material-symbols:water-drop-outline-rounded text-sky',
     2
   ],
+  [
+    'utilizationRate',
+    '%',
+    '设备利用率',
+    'i-material-symbols:check-circle-outline-rounded text-emerald',
+    0
+  ],
   [
     'totalPowerConsumption',
     'MWh',
@@ -77,7 +84,8 @@ const totalWork = ref({
   totalFuelConsumption: 0,
   totalPowerConsumption: 0,
   totalWaterInjection: 0,
-  totalGasInjection: 0
+  totalGasInjection: 0,
+  utilizationRate: 0
 })
 
 const totalLoading = ref(false)
@@ -108,7 +116,8 @@ const getTotal = useDebounceFn(async () => {
       totalPowerConsumption: (res2.totalPowerConsumption || 0) / 1000,
       totalWaterInjection: (res2.totalWaterInjection || 0) / 10000,
       totalGasInjection: (res2.totalGasInjection || 0) / 10000,
-      totalFuelConsumption: res2.totalFuelConsumption || 0
+      totalFuelConsumption: res2.totalFuelConsumption || 0,
+      utilizationRate: Number(((res2.utilizationRate || 0) * 100).toFixed(2))
     }
   } finally {
     totalLoading.value = false
@@ -125,6 +134,7 @@ interface List {
   cumulativeFuelConsumption: number | null
   transitTime: number | null
   nonProductiveTime: number | null
+  utilizationRate: number | null
 }
 
 const list = ref<List[]>([])
@@ -190,7 +200,11 @@ const columns = (type: string) => {
             prop: 'sgTeamCount'
           }
         ]
-      : [])
+      : []),
+    {
+      label: '设备利用率(%)',
+      prop: 'utilizationRate'
+    }
   ]
 }
 
@@ -201,6 +215,8 @@ const formatter = (row: List, column: any) => {
     return (Number(row.transitTime ?? 0) * 100).toFixed(2) + '%'
   } else if (column.property === 'nonProductiveTime') {
     return (Number(row.nonProductiveTime ?? 0) * 100).toFixed(2) + '%'
+  } else if (column.property === 'utilizationRate') {
+    return (Number(row.utilizationRate ?? 0) * 100).toFixed(2) + '%'
   } else return row[column.property] ?? 0
 }
 
@@ -222,7 +238,8 @@ const getList = useDebounceFn(async () => {
           cumulativeGasInjection: ((other.cumulativeGasInjection || 0) / 10000).toFixed(2),
           cumulativeWaterInjection: ((other.cumulativeWaterInjection || 0) / 10000).toFixed(2),
           cumulativePowerConsumption: ((other.cumulativePowerConsumption || 0) / 1000).toFixed(2),
-          cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2)
+          cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2),
+          utilizationRate: other.utilizationRate || 0
         }
       }
     )
@@ -264,7 +281,8 @@ const legend = ref<string[][]>([
   // ['累计用电量 (MWh)', 'cumulativePowerConsumption'],
   ['累计注水量 (方)', 'cumulativeWaterInjection'],
   // ['累计注水量 (万方)', 'cumulativeWaterInjection'],
-  ['平均时效 (%)', 'transitTime']
+  ['平均时效 (%)', 'transitTime'],
+  ['设备利用率 (%)', 'utilizationRate']
 ])
 
 const chartData = ref<Record<string, number[]>>({
@@ -272,7 +290,8 @@ const chartData = ref<Record<string, number[]>>({
   cumulativeGasInjection: [],
   cumulativePowerConsumption: [],
   cumulativeWaterInjection: [],
-  transitTime: []
+  transitTime: [],
+  utilizationRate: []
 })
 
 let chartLoading = ref(false)
@@ -291,7 +310,8 @@ const getChart = useDebounceFn(async () => {
       // cumulativePowerConsumption: res.map((item) => (item.cumulativePowerConsumption || 0) / 1000),
       cumulativeWaterInjection: res.map((item) => item.cumulativeWaterInjection || 0),
       // cumulativeWaterInjection: res.map((item) => (item.cumulativeWaterInjection || 0) / 10000),
-      transitTime: res.map((item) => (item.transitTime || 0) * 100)
+      transitTime: res.map((item) => (item.transitTime || 0) * 100),
+      utilizationRate: res.map((item) => Number(((item.utilizationRate || 0) * 100).toFixed(2)))
     }
 
     xAxisData.value = res.map((item) => item.reportDate || '')
@@ -575,7 +595,7 @@ const { ZmTable, ZmTableColumn } = useTableComponents()
         <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]"

+ 27 - 7
src/views/pms/iotrydailyreport/summary.vue

@@ -39,6 +39,13 @@ const query = ref<Query>({
 
 const totalWorkKeys: [string, string, string, string, number][] = [
   ['totalFootage', 'M', '累计进尺', 'i-solar:ruler-bold text-sky', 2],
+  [
+    'utilizationRate',
+    '%',
+    '设备利用率',
+    'i-material-symbols:check-circle-outline-rounded text-emerald',
+    0
+  ],
   [
     'totalPowerConsumption',
     'MWh',
@@ -78,7 +85,8 @@ const totalWork = ref({
   totalFuelConsumption: 0,
   totalPowerConsumption: 0,
   totalFootage: 0,
-  averageFuelConsumption: 0
+  averageFuelConsumption: 0,
+  utilizationRate: 0
 })
 
 const totalLoading = ref(false)
@@ -110,7 +118,8 @@ const getTotal = useDebounceFn(async () => {
       totalPowerConsumption: (res2.totalPowerConsumption || 0) / 1000,
       totalGasInjection: (res2.totalGasInjection || 0) / 10000,
       totalFuelConsumption: res2.totalFuelConsumption || 0,
-      averageFuelConsumption: res2.averageFuelConsumption || 0
+      averageFuelConsumption: res2.averageFuelConsumption || 0,
+      utilizationRate: Number(((res2.utilizationRate || 0) * 100).toFixed(2))
     }
   } finally {
     totalLoading.value = false
@@ -128,6 +137,7 @@ interface List {
   transitTime: number | null
   nonProductiveTime: number | null
   averageFuelConsumption: number | null
+  utilizationRate: number | null
 }
 
 const list = ref<List[]>([])
@@ -163,6 +173,10 @@ const columns = (type: string) => {
     {
       label: '非生产时效(%)',
       prop: 'nonProductiveTime'
+    },
+    {
+      label: '设备利用率(%)',
+      prop: 'utilizationRate'
     }
   ]
 }
@@ -174,6 +188,8 @@ const formatter = (row: List, column: any) => {
     return (Number(row.transitTime ?? 0) * 100).toFixed(2) + '%'
   } else if (column.property === 'nonProductiveTime') {
     return (Number(row.nonProductiveTime ?? 0) * 100).toFixed(2) + '%'
+  } else if (column.property === 'utilizationRate') {
+    return (Number(row.utilizationRate ?? 0) * 100).toFixed(2) + '%'
   } else return row[column.property] ?? 0
 }
 
@@ -193,7 +209,8 @@ const getList = useDebounceFn(async () => {
         ...other,
         cumulativePowerConsumption: ((other.cumulativePowerConsumption || 0) / 1000).toFixed(2),
         cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2),
-        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2)
+        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2),
+        utilizationRate: other.utilizationRate || 0
       })
     )
   } finally {
@@ -231,14 +248,16 @@ const legend = ref<string[][]>([
   ['进尺 (M)', 'cumulativeFootage'],
   ['用电量 (KWh)', 'cumulativePowerConsumption'],
   // ['累计用电量 (MWh)', 'cumulativePowerConsumption'],
-  ['平均时效 (%)', 'transitTime']
+  ['平均时效 (%)', 'transitTime'],
+  ['设备利用率 (%)', 'utilizationRate']
 ])
 
 const chartData = ref<Record<string, number[]>>({
   cumulativeFuelConsumption: [],
   cumulativeFootage: [],
   cumulativePowerConsumption: [],
-  transitTime: []
+  transitTime: [],
+    utilizationRate: []
 })
 
 let chartLoading = ref(false)
@@ -266,7 +285,8 @@ const getChart = useDebounceFn(async () => {
       cumulativeFootage: res.map((item) => item.cumulativeFootage || 0),
       cumulativePowerConsumption: res.map((item) => item.cumulativePowerConsumption || 0),
       // cumulativePowerConsumption: res.map((item) => (item.cumulativePowerConsumption || 0) / 1000),
-      transitTime: res.map((item) => (item.transitTime || 0) * 100)
+      transitTime: res.map((item) => (item.transitTime || 0) * 100),
+      utilizationRate: res.map((item) => Number(((item.utilizationRate || 0) * 100).toFixed(2)))
     }
 
     xAxisData.value = res.map((item) => item.reportDate || '')
@@ -544,7 +564,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]"

+ 27 - 7
src/views/pms/iotrydailyreport/xsummary.vue

@@ -40,6 +40,13 @@ const query = ref<Query>({
 const totalWorkKeys: [string, string, string, string, number][] = [
   ['constructionWells', '个', '累计施工井数', 'i-mdi:progress-wrench text-sky', 0],
   ['completedWells', '个', '累计完工井数', 'i-mdi:wrench-check-outline text-emerald', 0],
+  [
+    'utilizationRate',
+    '%',
+    '设备利用率',
+    'i-material-symbols:check-circle-outline-rounded text-emerald',
+    0
+  ],
   [
     'totalPowerConsumption',
     'MWh',
@@ -80,7 +87,8 @@ const totalWork = ref({
   totalPowerConsumption: 0,
   constructionWells: 0,
   completedWells: 0,
-  averageFuelConsumption: 0
+  averageFuelConsumption: 0,
+  utilizationRate: 0
 })
 
 const totalLoading = ref(false)
@@ -112,7 +120,8 @@ const getTotal = useDebounceFn(async () => {
       ...res2,
       totalPowerConsumption: (res2.totalPowerConsumption || 0) / 1000,
       totalFuelConsumption: res2.totalFuelConsumption || 0,
-      averageFuelConsumption: res2.averageFuelConsumption || 0
+      averageFuelConsumption: res2.averageFuelConsumption || 0,
+      utilizationRate: Number(((res2.utilizationRate || 0) * 100).toFixed(2))
     }
   } finally {
     totalLoading.value = false
@@ -130,6 +139,7 @@ interface List {
   transitTime: number | null
   nonProductiveTime: number | null
   averageFuelConsumption: number | null
+  utilizationRate: number | null
 }
 
 const list = ref<List[]>([])
@@ -169,6 +179,10 @@ const columns = (type: string) => {
     {
       label: '非生产时效(%)',
       prop: 'nonProductiveTime'
+    },
+    {
+      label: '设备利用率(%)',
+      prop: 'utilizationRate'
     }
   ]
 }
@@ -180,6 +194,8 @@ const formatter = (row: List, column: any) => {
     return (Number(row.transitTime ?? 0) * 100).toFixed(2) + '%'
   } else if (column.property === 'nonProductiveTime') {
     return (Number(row.nonProductiveTime ?? 0) * 100).toFixed(2) + '%'
+  } else if (column.property === 'utilizationRate') {
+    return (Number(row.utilizationRate ?? 0) * 100).toFixed(2) + '%'
   } else return row[column.property] ?? 0
 }
 
@@ -199,7 +215,8 @@ const getList = useDebounceFn(async () => {
         ...other,
         cumulativePowerConsumption: ((other.cumulativePowerConsumption || 0) / 1000).toFixed(2),
         cumulativeFuelConsumption: (other.cumulativeFuelConsumption || 0).toFixed(2),
-        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2)
+        averageFuelConsumption: (other.averageFuelConsumption || 0).toFixed(2),
+        utilizationRate: other.utilizationRate || 0
       })
     )
   } finally {
@@ -238,7 +255,8 @@ const legend = ref<string[][]>([
   ['油耗 (升)', 'cumulativeFuelConsumption'],
   // ['累计用电量 (MWh)', 'cumulativePowerConsumption'],
   ['用电量 (KWh)', 'cumulativePowerConsumption'],
-  ['平均时效 (%)', 'transitTime']
+  ['平均时效 (%)', 'transitTime'],
+  ['设备利用率 (%)', 'utilizationRate']
 ])
 
 const chartData = ref<Record<string, number[]>>({
@@ -246,7 +264,8 @@ const chartData = ref<Record<string, number[]>>({
   cumulativeConstructWells: [],
   cumulativeCompletedWells: [],
   cumulativePowerConsumption: [],
-  transitTime: []
+  transitTime: [],
+  utilizationRate: []
 })
 
 let chartLoading = ref(false)
@@ -264,7 +283,8 @@ const getChart = useDebounceFn(async () => {
       cumulativeCompletedWells: res.map((item) => item.cumulativeCompletedWells || 0),
       cumulativePowerConsumption: res.map((item) => item.cumulativePowerConsumption || 0),
       // cumulativePowerConsumption: res.map((item) => (item.cumulativePowerConsumption || 0) / 1000),
-      transitTime: res.map((item) => (item.transitTime || 0) * 100)
+      transitTime: res.map((item) => (item.transitTime || 0) * 100),
+      utilizationRate: res.map((item) => Number(((item.utilizationRate || 0) * 100).toFixed(2)))
     }
 
     xAxisData.value = res.map((item) => item.reportDate || '')
@@ -542,7 +562,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-8 gap-8">
+    <div class="grid grid-cols-9 gap-8">
       <div
         v-for="info in totalWorkKeys"
         :key="info[0]"