Kaynağa Gözat

月报汇总

yanghao 1 gün önce
ebeveyn
işleme
1c30588f7e

+ 1 - 1
.env.local

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

+ 0 - 214
src/views/pms/qhse/reportSummary/data.json

@@ -1,214 +0,0 @@
-{
-  "code": 0,
-  "data": {
-    "list": [
-      {
-        "id": 5,
-        "title": "5#项目公司2026-05QHSE月报",
-        "yearMonths": "2026-05",
-        "deptId": 388,
-        "employee": "5",
-        "subcontractors": "3",
-        "drivingMileage": "5",
-        "totalManHours": "4",
-        "withoutAccident": "4",
-        "fatality": "4",
-        "injury": "3",
-        "restrictedCase": "4",
-        "medicalCase": "4",
-        "firstAidCase": "4",
-        "vehicleAccident": "3",
-        "nearMiss": "3",
-        "spill": "4",
-        "lifeSavingRules": "3",
-        "toolboxTalk": "4",
-        "committeeMeeting": "5",
-        "monthlyMeeting": "5",
-        "companyHazard": "4",
-        "qhseInspection": "5",
-        "socCards": "0",
-        "ptwAudit": "0",
-        "jsa": "0",
-        "drills": "3",
-        "training": "3",
-        "participantsTraining": "4",
-        "trainingsHours": "4",
-        "waterConsumption": "4",
-        "dieselConsumption": "4",
-        "electricityConsumption": "3",
-        "naturalGasConsumption": "2",
-        "remark": "hhhhhhhhhhh",
-        "dutyPerson": 1,
-        "createTime": 1782377575000,
-        "personName": "超级管理员",
-        "deptName": "5#项目公司"
-      },
-      {
-        "id": 4,
-        "title": "四川瑞都2026-05QHSE月报",
-        "yearMonths": "2026-05",
-        "deptId": 163,
-        "employee": "4",
-        "subcontractors": "4",
-        "drivingMileage": "4",
-        "totalManHours": "1",
-        "withoutAccident": "2",
-        "fatality": "3",
-        "injury": "4",
-        "restrictedCase": "4",
-        "medicalCase": "2",
-        "firstAidCase": "3",
-        "vehicleAccident": "4",
-        "nearMiss": "4",
-        "spill": "2",
-        "lifeSavingRules": "4",
-        "toolboxTalk": "4",
-        "committeeMeeting": "5",
-        "monthlyMeeting": "5",
-        "companyHazard": "4",
-        "qhseInspection": "4",
-        "socCards": "51",
-        "ptwAudit": "4",
-        "jsa": "27",
-        "drills": "2",
-        "training": "5",
-        "participantsTraining": "8",
-        "trainingsHours": "3",
-        "waterConsumption": "7",
-        "dieselConsumption": "3",
-        "electricityConsumption": "4",
-        "naturalGasConsumption": "4",
-        "remark": "她她她她她她她她她她她她",
-        "dutyPerson": 1,
-        "createTime": 1782377575000,
-        "personName": "超级管理员",
-        "deptName": "四川瑞都"
-      },
-      {
-        "id": 3,
-        "title": "瑞恒兴域2026-05QHSE月报",
-        "yearMonths": "2026-05",
-        "deptId": 157,
-        "employee": "3",
-        "subcontractors": "4",
-        "drivingMileage": "3",
-        "totalManHours": "3",
-        "withoutAccident": "4",
-        "fatality": "4",
-        "injury": "4",
-        "restrictedCase": "4",
-        "medicalCase": "4",
-        "firstAidCase": "3",
-        "vehicleAccident": "3",
-        "nearMiss": "4",
-        "spill": "4",
-        "lifeSavingRules": "3",
-        "toolboxTalk": "4",
-        "committeeMeeting": "3",
-        "monthlyMeeting": "2",
-        "companyHazard": "3",
-        "qhseInspection": "2",
-        "socCards": "0",
-        "ptwAudit": "0",
-        "jsa": "0",
-        "drills": "3",
-        "training": "4",
-        "participantsTraining": "4",
-        "trainingsHours": "4",
-        "waterConsumption": "2",
-        "dieselConsumption": "2",
-        "electricityConsumption": "1",
-        "naturalGasConsumption": "1",
-        "remark": null,
-        "dutyPerson": 1,
-        "createTime": 1782377575000,
-        "personName": "超级管理员",
-        "deptName": "瑞恒兴域"
-      },
-      {
-        "id": 2,
-        "title": "瑞鹰国际2026-05QHSE月报",
-        "yearMonths": "2026-05",
-        "deptId": 158,
-        "employee": "4",
-        "subcontractors": "3",
-        "drivingMileage": "3",
-        "totalManHours": "3",
-        "withoutAccident": "3",
-        "fatality": "3",
-        "injury": "2",
-        "restrictedCase": "1",
-        "medicalCase": "2",
-        "firstAidCase": "4",
-        "vehicleAccident": "2",
-        "nearMiss": "1",
-        "spill": "3",
-        "lifeSavingRules": "3",
-        "toolboxTalk": "2",
-        "committeeMeeting": "2",
-        "monthlyMeeting": "3",
-        "companyHazard": "2",
-        "qhseInspection": "3",
-        "socCards": "127",
-        "ptwAudit": "34",
-        "jsa": "46",
-        "drills": "3",
-        "training": "4",
-        "participantsTraining": "3",
-        "trainingsHours": "2",
-        "waterConsumption": "1",
-        "dieselConsumption": "1",
-        "electricityConsumption": "1",
-        "naturalGasConsumption": "1",
-        "remark": null,
-        "dutyPerson": 1,
-        "createTime": 1782377575000,
-        "personName": "超级管理员",
-        "deptName": "瑞鹰国际"
-      },
-      {
-        "id": 1,
-        "title": "科瑞石油技术",
-        "yearMonths": "2026-05",
-        "deptId": 156,
-        "employee": "4",
-        "subcontractors": "7",
-        "drivingMileage": "8",
-        "totalManHours": "3",
-        "withoutAccident": "5",
-        "fatality": "5",
-        "injury": "2",
-        "restrictedCase": "3",
-        "medicalCase": "4",
-        "firstAidCase": "3",
-        "vehicleAccident": "5",
-        "nearMiss": "3",
-        "spill": "4",
-        "lifeSavingRules": "3",
-        "toolboxTalk": "4",
-        "committeeMeeting": "4",
-        "monthlyMeeting": "1",
-        "companyHazard": "1",
-        "qhseInspection": "1",
-        "socCards": "178",
-        "ptwAudit": "38",
-        "jsa": "73",
-        "drills": "1",
-        "training": "1",
-        "participantsTraining": "1",
-        "trainingsHours": "1",
-        "waterConsumption": "3",
-        "dieselConsumption": "3",
-        "electricityConsumption": "3",
-        "naturalGasConsumption": "2",
-        "remark": null,
-        "dutyPerson": 1,
-        "createTime": 1782199003000,
-        "personName": "超级管理员",
-        "deptName": "科瑞石油技术~~en**Kerui Petroleum Technology~~ru**"
-      }
-    ],
-    "total": 5
-  },
-  "msg": ""
-}

+ 4 - 12
src/views/pms/qhse/reportSummary/index.vue

@@ -78,20 +78,12 @@ onMounted(() => {
       inline
       label-position="left"
       class="report-summary-query min-w-0 overflow-hidden rounded-lg bg-white p-4 shadow dark:bg-[#1d1e1f]">
-      <!-- <el-form-item label="月报标题" prop="title">
-        <el-input v-model="queryParams.title" placeholder="请输入月报标题" clearable />
-      </el-form-item> -->
       <el-form-item label="月报期次" prop="yearMonths">
-        <!-- <el-date-picker
+        <el-date-picker
           v-model="queryParams.yearMonths"
-          type="daterange"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          :shortcuts="rangeShortcuts"
-          class="w-full!" /> -->
+          type="month"
+          value-format="YYYY-MM"
+          class="w-full!" />
       </el-form-item>
       <el-form-item class="report-summary-query__actions">
         <el-button type="primary" @click="handleQuery">搜索</el-button>

+ 70 - 124
src/views/pms/qhse/reportSummary/preview-drawer.vue

@@ -1,10 +1,6 @@
 <script lang="ts" setup>
 import { QhseMonthReportSummaryApi } from '@/api/pms/qhse'
-import type {
-  QhseMonthReportItem,
-  ReportCompanyColumn,
-  ReportMetricRow
-} from './types'
+import type { QhseMonthReportItem, ReportCompanyColumn, ReportMetricRow } from './types'
 import dayjs from 'dayjs'
 import { computed, ref, watch } from 'vue'
 
@@ -28,153 +24,98 @@ const loading = ref(false)
 const reportList = ref<QhseMonthReportItem[]>([])
 
 const metricRows: ReportMetricRow[] = [
+  { category: '人工时和安全行驶公里数', label: '员工人数', field: 'employee', unit: '人' },
+  { category: '人工时和安全行驶公里数', label: '分包商人数', field: 'subcontractors', unit: '人' },
   {
-    category: '\u4eba\u5de5\u65f6\u548c\u5b89\u5168\u884c\u9a76\u516c\u91cc\u6570',
-    label: '\u5458\u5de5\u4eba\u6570',
-    field: 'employee',
-    unit: '\u4eba'
-  },
-  {
-    category: '\u4eba\u5de5\u65f6\u548c\u5b89\u5168\u884c\u9a76\u516c\u91cc\u6570',
-    label: '\u5206\u5305\u5546\u4eba\u6570',
-    field: 'subcontractors',
-    unit: '\u4eba'
-  },
-  {
-    category: '\u4eba\u5de5\u65f6\u548c\u5b89\u5168\u884c\u9a76\u516c\u91cc\u6570',
-    label: '\u5b89\u5168\u884c\u9a76\u91cc\u7a0b\u6570\uff08\u516c\u91cc\uff09',
+    category: '人工时和安全行驶公里数',
+    label: '安全行驶里程数(公里)',
     field: 'drivingMileage',
-    unit: '\u516c\u91cc'
+    unit: '公里'
   },
   {
-    category: '\u4eba\u5de5\u65f6\u548c\u5b89\u5168\u884c\u9a76\u516c\u91cc\u6570',
-    label: '\u603b\u4eba\u5de5\u65f6\u6570\uff08\u5c0f\u65f6\uff09',
+    category: '人工时和安全行驶公里数',
+    label: '总人工时数(小时)',
     field: 'totalManHours',
-    unit: '\u5c0f\u65f6'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u65e0\u4e8b\u6545\u7d2f\u8ba1\u5929\u6570',
-    field: 'withoutAccident',
-    unit: '\u5929'
+    unit: '小时'
   },
-  { category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: '\u6b7b\u4ea1\u4e8b\u6545\uff08\u8d77\uff09', field: 'fatality', unit: '\u8d77' },
+  { category: 'QHSE被动性指标统计', label: '无事故累计天数', field: 'withoutAccident', unit: '天' },
+  { category: 'QHSE被动性指标统计', label: '死亡事故(起)', field: 'fatality', unit: '起' },
+  { category: 'QHSE被动性指标统计', label: '损失工时事故(起)', field: 'injury', unit: '起' },
   {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u635f\u5931\u5de5\u65f6\u4e8b\u6545\uff08\u8d77\uff09',
-    field: 'injury',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u5de5\u4f5c\u53d7\u9650\u4e8b\u4ef6\uff08\u8d77\uff09',
+    category: 'QHSE被动性指标统计',
+    label: '工作受限事件(起)',
     field: 'restrictedCase',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u533b\u7597\u5904\u7406\u4e8b\u4ef6\uff08\u8d77\uff09',
-    field: 'medicalCase',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u6025\u6551\u7bb1\u4e8b\u4ef6\uff08\u8d77\uff09',
-    field: 'firstAidCase',
-    unit: '\u8d77'
+    unit: '起'
   },
+  { category: 'QHSE被动性指标统计', label: '医疗处理事件(起)', field: 'medicalCase', unit: '起' },
+  { category: 'QHSE被动性指标统计', label: '急救箱事件(起)', field: 'firstAidCase', unit: '起' },
+  { category: 'QHSE被动性指标统计', label: '交通事故(起)', field: 'vehicleAccident', unit: '起' },
+  { category: 'QHSE被动性指标统计', label: '未遂事件(起)', field: 'nearMiss', unit: '起' },
+  { category: 'QHSE被动性指标统计', label: '泄漏事件(起)', field: 'spill', unit: '起' },
   {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u4ea4\u901a\u4e8b\u6545\uff08\u8d77\uff09',
-    field: 'vehicleAccident',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u672a\u9042\u4e8b\u4ef6\uff08\u8d77\uff09',
-    field: 'nearMiss',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u6cc4\u6f0f\u4e8b\u4ef6\uff08\u8d77\uff09',
-    field: 'spill',
-    unit: '\u8d77'
-  },
-  {
-    category: 'QHSE\u88ab\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u8fdd\u53cd\u4fdd\u547d\u89c4\u5219\u7684\u6b21\u6570\uff08\u6b21\uff09',
+    category: 'QHSE被动性指标统计',
+    label: '违反保命规则的次数(次)',
     field: 'lifeSavingRules',
-    unit: '\u6b21'
+    unit: '次'
   },
-  { category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: '\u73ed\u524d\u4f1a\uff08\u6b21\uff09', field: 'toolboxTalk', unit: '\u6b21' },
+  { category: 'QHSE主动性指标统计', label: '班前会(次)', field: 'toolboxTalk', unit: '次' },
   {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: 'QHSE\u7ba1\u7406\u59d4\u5458\u4f1a\u4f1a\u8bae\uff08\u6b21\uff09',
+    category: 'QHSE主动性指标统计',
+    label: 'QHSE管理委员会会议(次)',
     field: 'committeeMeeting',
-    unit: '\u6b21'
+    unit: '次'
   },
   {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: 'QHSE\u6708\u5ea6\u4f8b\u4f1a\uff08\u6b21\uff09',
+    category: 'QHSE主动性指标统计',
+    label: 'QHSE月度例会(次)',
     field: 'monthlyMeeting',
-    unit: '\u6b21'
+    unit: '次'
   },
   {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u516c\u53f8\u7ea7\u9690\u60a3\u6392\u67e5\uff08\u6b21\uff09',
+    category: 'QHSE主动性指标统计',
+    label: '公司级隐患排查(次)',
     field: 'companyHazard',
-    unit: '\u6b21'
+    unit: ''
   },
-  { category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: 'QHSE\u68c0\u67e5\uff08\u6b21\uff09', field: 'qhseInspection', unit: '\u6b21' },
+  { category: 'QHSE主动性指标统计', label: 'QHSE检查(次)', field: 'qhseInspection', unit: '次' },
+  { category: 'QHSE主动性指标统计', label: '安全观察卡(张)', field: 'socCards', unit: '张' },
+  { category: 'QHSE主动性指标统计', label: '工作许可审核(份)', field: 'ptwAudit', unit: '份' },
+  { category: 'QHSE主动性指标统计', label: '工作安全分析(次)', field: 'jsa', unit: '次' },
+  { category: 'QHSE主动性指标统计', label: '演练次数', field: 'drills', unit: '次' },
+  { category: 'QHSE主动性指标统计', label: 'QHSE培训次数', field: 'training', unit: '次' },
   {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u5b89\u5168\u89c2\u5bdf\u5361\uff08\u5f20\uff09',
-    field: 'socCards',
-    unit: '\u5f20'
+    category: 'QHSE主动性指标统计',
+    label: 'QHSE培训人次',
+    field: 'participantsTraining',
+    unit: '人次'
   },
   {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u5de5\u4f5c\u8bb8\u53ef\u5ba1\u6838\uff08\u4efd\uff09',
-    field: 'ptwAudit',
-    unit: '\u4efd'
-  },
-  {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: '\u5de5\u4f5c\u5b89\u5168\u5206\u6790\uff08\u6b21\uff09',
-    field: 'jsa',
-    unit: '\u6b21'
-  },
-  { category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: '\u6f14\u7ec3\u6b21\u6570', field: 'drills', unit: '\u6b21' },
-  { category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: 'QHSE\u57f9\u8bad\u6b21\u6570', field: 'training', unit: '\u6b21' },
-  { category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1', label: 'QHSE\u57f9\u8bad\u4eba\u6b21', field: 'participantsTraining', unit: '\u4eba\u6b21' },
-  {
-    category: 'QHSE\u4e3b\u52a8\u6027\u6307\u6807\u7edf\u8ba1',
-    label: 'QHSE\u57f9\u8bad\u5b66\u65f6\u6570\uff08\u5c0f\u65f6\uff09',
+    category: 'QHSE主动性指标统计',
+    label: 'QHSE培训学时数(小时)',
     field: 'trainingsHours',
-    unit: '\u5c0f\u65f6'
+    unit: '小时'
   },
-  { category: '\u73af\u5883\u6570\u636e', label: '\u6c34\u6d88\u8017\uff08\u5428\uff09', field: 'waterConsumption', unit: '\u5428' },
-  { category: '\u73af\u5883\u6570\u636e', label: '\u67f4\u6cb9\u6d88\u8017\uff08\u5347\uff09', field: 'dieselConsumption', unit: '\u5347' },
+  { category: '环境数据', label: '水消耗(吨)', field: 'waterConsumption', unit: '吨' },
+  { category: '环境数据', label: '柴油消耗(升)', field: 'dieselConsumption', unit: '升' },
   {
-    category: '\u73af\u5883\u6570\u636e',
-    label: '\u7528\u7535\u91cf\uff08\u5343\u74e6\u65f6\uff09',
+    category: '环境数据',
+    label: '用电量(千瓦时)',
     field: 'electricityConsumption',
-    unit: '\u5343\u74e6\u65f6'
+    unit: '千瓦时'
   },
   {
-    category: '\u73af\u5883\u6570\u636e',
-    label: '\u5929\u7136\u6c14\u6d88\u8017\u91cf\uff08\u7acb\u65b9\u7c73\uff09',
+    category: '环境数据',
+    label: '天然气消耗量(立方米)',
     field: 'naturalGasConsumption',
-    unit: '\u7acb\u65b9\u7c73'
-  },
-  { category: '\u5176\u4ed6\u4fe1\u606f', label: '\u5907\u6ce8', field: 'remark', unit: '/' }
+    unit: '立方米'
+  }
+  // { category: '其他信息', label: '备注', field: 'remark', unit: '/' }
 ]
 
 const companyColumns = computed<ReportCompanyColumn[]>(() =>
   reportList.value.map((item, index) => ({
     key: getCompanyKey(index),
-    label: item.deptName || `Company ${index + 1}`
+    label: item.deptName || `公司${index + 1}`
   }))
 )
 
@@ -199,7 +140,10 @@ const firstRowIndexByCategory = computed(() =>
 const tableRows = computed<TableRow[]>(() =>
   metricRows.map((row) => {
     const companyValues = Object.fromEntries(
-      companyColumns.value.map((company) => [company.key, getMetricCompanyValue(row.field, company.key)])
+      companyColumns.value.map((company) => [
+        company.key,
+        getMetricCompanyValue(row.field, company.key)
+      ])
     )
 
     return {
@@ -218,7 +162,9 @@ async function loadDetail() {
     const res = await QhseMonthReportSummaryApi.getQhseMonthReportSummary({
       yearMonths: props.yearMonths
     })
-    reportList.value = ((res as any)?.data?.list ?? (res as any)?.list ?? []) as QhseMonthReportItem[]
+    reportList.value = ((res as any)?.data?.list ??
+      (res as any)?.list ??
+      []) as QhseMonthReportItem[]
   } finally {
     loading.value = false
   }
@@ -255,7 +201,7 @@ function getMetricSummaryValue(field: keyof QhseMonthReportItem) {
   if (!values.length) return '-'
 
   if (field === 'remark') {
-    return values.map((value) => String(value)).join('; ')
+    return values.map((value) => String(value)).join('')
   }
 
   const numericValues = values.map((value) => Number(value))
@@ -264,7 +210,7 @@ function getMetricSummaryValue(field: keyof QhseMonthReportItem) {
     return Number.isInteger(total) ? String(total) : total.toFixed(2)
   }
 
-  return values.map((value) => String(value)).join('; ')
+  return values.map((value) => String(value)).join('')
 }
 
 function tableSpanMethod({
@@ -318,8 +264,8 @@ watch(
         <div class="qhse-report-preview__sheet-title">QHSE 月度报告</div>
         <div class="qhse-report-preview__meta">
           <span>年月:{{ props.yearMonths || '-' }}</span>
-          <span>填报人:{{ previewMeta.personName }}</span>
-          <span>创建日期:{{ previewMeta.createTime }}</span>
+          <!-- <span>填报人:{{ previewMeta.personName }}</span>
+          <span>创建日期:{{ previewMeta.createTime }}</span> -->
         </div>
 
         <div class="qhse-report-preview__table-wrap">
@@ -332,11 +278,11 @@ watch(
             class="qhse-report-preview__el-table">
             <el-table-column
               prop="category"
-              label="分组"
+              label="基本信息"
               fixed="left"
               width="170"
               align="center" />
-            <el-table-column prop="label" label="指标名称" fixed="left" width="240" align="center" />
+            <el-table-column prop="label" label="单位" fixed="left" width="240" align="center" />
             <el-table-column
               v-for="company in companyColumns"
               :key="company.key"