yanghao 19 часов назад
Родитель
Сommit
9e75d3e808

+ 1 - 1
.env.local

@@ -4,7 +4,7 @@ NODE_ENV=development
 VITE_DEV=true
 
 # 请求路径  http://192.168.188.149:48080  https://iot.deepoil.cc
-VITE_BASE_URL='https://iot.deepoil.cc'
+VITE_BASE_URL='http://192.168.188.149:48080'
 
 # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
 VITE_UPLOAD_TYPE=server

+ 26 - 0
src/api/pms/inspect/order/index.ts

@@ -90,5 +90,31 @@ export const IotInspectOrderApi = {
   // 异常设备列表
   getExceptionDeviceList: async (params: any) => {
     return await request.get({ url: `/rq/iot-inspect-order/exception/device`, params })
+  },
+
+  // 导出巡检报表 Excel
+  exportInspectReport: async (params) => {
+    return await request.download({ url: `/rq/iot-inspect-order/report/export-excel`, params })
+  },
+
+  // 异常巡检点导出 Excel
+  exportExceptionPointInspectReport: async (params) => {
+    return await request.download({
+      url: `/rq/iot-inspect-order/report/exception/item/export-excel`,
+      params
+    })
+  },
+
+  //  异常设备导出 Excel
+  exportExceptionDeviceInspectReport: async (params) => {
+    return await request.download({
+      url: `/rq/iot-inspect-order/report/exception/device/export-excel`,
+      params
+    })
+  },
+
+  // 故障报表导出 Excel
+  exportFaultReport: async (params) => {
+    return await request.download({ url: `/rq/report/failure/report/export-excel`, params })
   }
 }

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

@@ -220,7 +220,7 @@ const getList = useDebounceFn(async () => {
           cumulativeRunCount: other.cumulativeRunCount || 0,
           cumulativeWorkingWell: other.cumulativeWorkingWell || 0,
           cumulativeHourCount: other.cumulativeHourCount || 0,
-          totalDailyFuel: ((other.totalDailyFuel || 0) / 10000).toFixed(4),
+          totalDailyFuel: other.totalDailyFuel || 0,
           cumulativeWaterVolume: other.cumulativeWaterVolume || 0,
           cumulativeWorkingLayers: other.cumulativeWorkingLayers || 0,
           cumulativePumpTrips: other.cumulativePumpTrips || 0,

+ 2 - 2
src/views/pms/iotrhdailyreport/index.vue

@@ -253,7 +253,7 @@
                 resizable
               />
               <el-table-column
-                label="用电量(kWh)"
+                label="用电量(MWh)"
                 align="center"
                 prop="dailyPowerUsage"
                 :min-width="columnWidths.dailyPowerUsage.width"
@@ -333,7 +333,7 @@
                 resizable
               />
               <el-table-column
-                label="用电量(万千瓦时)"
+                label="用电量(MWh)"
                 align="center"
                 prop="wellTotalPower"
                 :formatter="gasInjectionFormatter"

+ 41 - 41
src/views/pms/maintenance/IotMaintenancePlanEdit.vue

@@ -106,37 +106,38 @@
           </template>
         </el-table-column>
         <el-table-column
-          :label="t('main.mileage')"
+          :label="t('main.runTime')"
           align="center"
-          key="mileageRule"
-          prop="mileageRule"
-          :min-width="columnWidths.mileageRule"
+          key="runningTimeRule"
+          prop="runningTimeRule"
+          :min-width="columnWidths.runningTimeRule"
         >
           <template #default="scope">
             <el-switch
-              v-model="scope.row.mileageRule"
+              v-model="scope.row.runningTimeRule"
               :active-value="0"
               :inactive-value="1"
-              @change="handleRuleChange(scope.row, 'mileage')"
+              @change="handleRuleChange(scope.row, 'runningTime')"
             />
           </template>
         </el-table-column>
         <el-table-column
-          :label="t('main.runTime')"
+          :label="t('main.mileage')"
           align="center"
-          key="runningTimeRule"
-          prop="runningTimeRule"
-          :min-width="columnWidths.runningTimeRule"
+          key="mileageRule"
+          prop="mileageRule"
+          :min-width="columnWidths.mileageRule"
         >
           <template #default="scope">
             <el-switch
-              v-model="scope.row.runningTimeRule"
+              v-model="scope.row.mileageRule"
               :active-value="0"
               :inactive-value="1"
-              @change="handleRuleChange(scope.row, 'runningTime')"
+              @change="handleRuleChange(scope.row, 'mileage')"
             />
           </template>
         </el-table-column>
+
         <el-table-column
           :label="t('main.date')"
           align="center"
@@ -201,72 +202,71 @@
             </div>
           </template>
         </el-table-column>
-        <!-- 保养里程 分组 -->
-        <el-table-column v-if="hasMileageRuleInCurrentPage" label="保养里程" align="center">
+        <!-- 保养时长 分组 -->
+        <el-table-column v-if="hasTimeRuleInCurrentPage" label="保养时长" align="center">
           <el-table-column
-            :label="t('mainPlan.lastMaintenanceMileage')"
+            :label="t('mainPlan.lastMaintenanceOperationTime')"
             align="center"
-            prop="lastRunningKilometers"
+            prop="lastRunningTime"
             :formatter="erpPriceTableColumnFormatter"
-            :min-width="columnWidths.lastRunningKilometers"
+            :min-width="columnWidths.lastRunningTime"
           >
             <template #default="{ row }">
-              {{ row.lastRunningKilometers }}
+              {{ row.lastRunningTime }}
             </template>
           </el-table-column>
           <el-table-column
-            :label="t('mainPlan.nextMaintenanceKm')"
+            :label="t('mainPlan.nextMaintenanceH')"
             align="center"
-            prop="nextMaintenanceKm"
-            :min-width="columnWidths.nextMaintenanceKm"
+            prop="nextMaintenanceH"
+            :min-width="columnWidths.nextMaintenanceH"
           >
             <template #default="{ row }">
-              {{ row.nextMaintenanceKm ?? '-' }}
+              {{ row.nextMaintenanceH ?? '-' }}
             </template>
           </el-table-column>
           <el-table-column
-            :label="t('mainPlan.remainKm')"
+            :label="t('mainPlan.remainH')"
             align="center"
-            prop="remainKm"
-            :min-width="columnWidths.remainKm"
+            prop="remainH"
+            :min-width="columnWidths.remainH"
           >
             <template #default="{ row }">
-              {{ row.remainKm ?? '-' }}
+              {{ row.remainH ?? '-' }}
             </template>
           </el-table-column>
         </el-table-column>
-
-        <!-- 保养时长 分组 -->
-        <el-table-column v-if="hasTimeRuleInCurrentPage" label="保养时长" align="center">
+        <!-- 保养里程 分组 -->
+        <el-table-column v-if="hasMileageRuleInCurrentPage" label="保养里程" align="center">
           <el-table-column
-            :label="t('mainPlan.lastMaintenanceOperationTime')"
+            :label="t('mainPlan.lastMaintenanceMileage')"
             align="center"
-            prop="lastRunningTime"
+            prop="lastRunningKilometers"
             :formatter="erpPriceTableColumnFormatter"
-            :min-width="columnWidths.lastRunningTime"
+            :min-width="columnWidths.lastRunningKilometers"
           >
             <template #default="{ row }">
-              {{ row.lastRunningTime }}
+              {{ row.lastRunningKilometers }}
             </template>
           </el-table-column>
           <el-table-column
-            :label="t('mainPlan.nextMaintenanceH')"
+            :label="t('mainPlan.nextMaintenanceKm')"
             align="center"
-            prop="nextMaintenanceH"
-            :min-width="columnWidths.nextMaintenanceH"
+            prop="nextMaintenanceKm"
+            :min-width="columnWidths.nextMaintenanceKm"
           >
             <template #default="{ row }">
-              {{ row.nextMaintenanceH ?? '-' }}
+              {{ row.nextMaintenanceKm ?? '-' }}
             </template>
           </el-table-column>
           <el-table-column
-            :label="t('mainPlan.remainH')"
+            :label="t('mainPlan.remainKm')"
             align="center"
-            prop="remainH"
-            :min-width="columnWidths.remainH"
+            prop="remainKm"
+            :min-width="columnWidths.remainKm"
           >
             <template #default="{ row }">
-              {{ row.remainH ?? '-' }}
+              {{ row.remainKm ?? '-' }}
             </template>
           </el-table-column>
         </el-table-column>

+ 1 - 2
src/views/report-statistics/daily-report.vue

@@ -130,8 +130,7 @@ const columns = ref<Column[]>([
       {
         label: '注气量(万方)',
         prop: 'dailyGasInjection',
-        'min-width': '120px',
-        formatter: (row: List) => (row.dailyGasInjection / 10000).toFixed(2)
+        'min-width': '120px'
       },
       {
         label: '注水量(方)',

+ 30 - 6
src/views/report-statistics/device_book/index2.vue

@@ -78,7 +78,7 @@
                 >
               </el-form-item>
               <el-form-item>
-                <el-button type="success" plain @click="handleExport"
+                <el-button type="success" plain @click="handleExport" :loading="exportLoading"
                   ><Icon icon="ep:download" class="mr-3px" /> 导出</el-button
                 >
               </el-form-item>
@@ -239,7 +239,7 @@
         />
       </ContentWrap>
 
-      <el-dialog
+      <!-- <el-dialog
         v-model="exportDialogVisible"
         title="导出设置"
         width="600px"
@@ -281,7 +281,7 @@
             </el-button>
           </div>
         </template>
-      </el-dialog>
+      </el-dialog> -->
     </el-col>
   </el-row>
 </template>
@@ -297,6 +297,7 @@ import echarts from '@/plugins/echarts'
 import { formatDate } from '@/utils/formatTime'
 import { nextTick, watch } from 'vue'
 import download from '@/utils/download'
+const message = useMessage() // 消息弹窗
 
 /** 设备台账 列表 */
 defineOptions({ name: 'IotDevicePms' })
@@ -387,9 +388,32 @@ const getTableColumns = () => {
 }
 
 // 导出功能
+// const handleExport = async () => {
+//   exportDialogVisible.value = true
+//   getTableColumns()
+// }
+
+let exportLoading = ref(false)
 const handleExport = async () => {
-  exportDialogVisible.value = true
-  getTableColumns()
+  try {
+    const exportParams = {
+      pageNo: queryParams.pageNo,
+      pageSize: queryParams.pageSize,
+      deviceCode: queryParams.deviceCode,
+      deviceName: queryParams.deviceName,
+
+      exportFields: selectedColumns.value.join(',')
+    }
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    const data = await IotDeviceApi.exportDeviceReport(exportParams)
+    download.excel(data, '设备报表.xls')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
 }
 
 // 确认导出
@@ -413,7 +437,7 @@ const confirmExport = async () => {
     // 调用后端导出接口
     const res = await IotDeviceApi.exportDeviceReport(exportParams)
 
-    download.excel(res, '设备报表.xls')
+    download.excel(res, '设备报表.xlsx')
     exportDialogVisible.value = false
   } catch (error) {
     console.error('导出失败:', error)

+ 26 - 0
src/views/report-statistics/fault_report/index.vue

@@ -145,6 +145,12 @@
                 >
               </el-form-item>
 
+              <el-form-item>
+                <el-button type="success" plain @click="handleExport" :loading="exportLoading"
+                  ><Icon icon="ep:download" class="mr-3px" /> 导出</el-button
+                >
+              </el-form-item>
+
               <el-form-item>
                 <el-button @click="resetQuery"
                   ><Icon icon="ep:refresh" class="mr-3px" />
@@ -263,6 +269,10 @@ import { DICT_TYPE } from '@/utils/dict'
 import DeptTree from '@/views/system/user/DeptTree.vue'
 import { dateFormatter } from '@/utils/formatTime'
 
+const message = useMessage() // 消息弹窗
+import { watch } from 'vue'
+import download from '@/utils/download'
+
 const { params } = useRoute()
 /** 巡检工单 列表 */
 defineOptions({ name: 'IotInspectOrder' })
@@ -303,6 +313,22 @@ const statusList = ref({
   close: false
 })
 
+let exportLoading = ref(false)
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+
+    const data = await IotInspectOrderApi.exportFaultReport(queryParams)
+    download.excel(data, '故障上报报表.xlsx')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
 /** 查询列表 */
 const getList = async (status: string = '', shouldResetStatus = true) => {
   if (shouldResetStatus) {

+ 34 - 2
src/views/report-statistics/inspection_order/index.vue

@@ -145,13 +145,18 @@
       </el-row>
 
       <el-row :gutter="20">
-        <el-col :span="24">
+        <el-col :span="22">
           <el-radio-group v-model="dateType" size="default" fill="#409eff">
             <el-radio-button label="年" value="year" />
             <el-radio-button label="月" value="month" />
             <el-radio-button label="日" value="day" />
           </el-radio-group>
         </el-col>
+        <el-col :span="2">
+          <el-button type="success" plain @click="handleExport" :loading="exportLoading"
+            ><Icon icon="ep:download" class="mr-3px" /> 导出</el-button
+          >
+        </el-col>
       </el-row>
 
       <!-- 列表 -->
@@ -328,8 +333,9 @@ import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 import { DICT_TYPE } from '@/utils/dict'
 import DeptTree from '@/views/system/user/DeptTree.vue'
 import { IotInspectItemVO, IotInspectOrderDetailApi } from '@/api/pms/inspect/order/detail'
-
+const message = useMessage() // 消息弹窗
 import { watch } from 'vue'
+import download from '@/utils/download'
 
 const { push } = useRouter()
 const { params } = useRoute()
@@ -419,6 +425,32 @@ const handleRowClick = (row, column: any, event: Event) => {
   }
 }
 
+let exportLoading = ref(false)
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+
+    if (isException.value) {
+      const data = await IotInspectOrderApi.exportExceptionDeviceInspectReport(queryParams)
+      download.excel(data, '异常设备报表.xlsx')
+    } else if (isExceptionPoint.value) {
+      const data = await IotInspectOrderApi.exportExceptionPointInspectReport(queryParams)
+      download.excel(data, '异常点报表.xlsx')
+    } else {
+      const data = await IotInspectOrderApi.exportInspectReport(queryParams)
+      download.excel(data, '巡检报表.xlsx')
+    }
+    // const data = await IotInspectOrderApi.exportInspectReport(queryParams)
+    // download.excel(data, '巡检报表.xlsx')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
 let isExceptionPoint = ref(false)
 const list2 = ref<IotInspectItemVO[]>([]) // 列表的数据