yanghao hace 2 días
padre
commit
9803d2334f

+ 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='https://iot.deepoil.cc:5443'
+VITE_BASE_URL='http://172.26.0.56:48080'
 
 # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
 VITE_UPLOAD_TYPE=server

+ 13 - 0
src/api/pms/qhse/index.ts

@@ -535,6 +535,19 @@ export const QhseMonthReportApi = {
   }
 }
 
+// 月报汇总
+export const QhseMonthReportSummaryApi = {
+  // 获得QHSE月报汇总分页
+  getQhseMonthReportSummaryList: async (params) => {
+    return await request.get({ url: `/rq/qhse-month-report/page/year-month`, params })
+  },
+
+  // 获得QHSE月报汇总详情
+  getQhseMonthReportSummary: async (params) => {
+    return await request.get({ url: `/rq/qhse-month-report/page`, params })
+  }
+}
+
 // 应检设备证书
 export const InspectDeviceCertApi = {
   // 获得设备证书分页 rq/qhse-device-cert/create

+ 50 - 4
src/views/pms/qhse/certificate.vue

@@ -13,7 +13,7 @@
       @node-click="handleDeptNodeClick" />
 
     <div class="stats-cards">
-      <div class="stats-card stats-card--expired">
+      <div class="stats-card stats-card--expired stats-card--clickable" @click="handleStatCardClick('expired')">
         <div class="flex items-center gap-2">
           <Icon icon="ep:info-filled" color="#de3b3b" />
           <div class="stats-card__label">已过期</div>
@@ -27,7 +27,7 @@
             class="stats-card__value text-[40px]! pt-10 text-center! text-[#e35656]!" />
         </div>
       </div>
-      <div class="stats-card stats-card--warn">
+      <div class="stats-card stats-card--warn stats-card--clickable" @click="handleStatCardClick('warn')">
         <div class="flex items-center gap-2">
           <Icon icon="ep:bell-filled" color="#d97706" />
           <div class="stats-card__label">60天预警</div>
@@ -40,7 +40,7 @@
             class="stats-card__value text-[40px]! pt-10 text-center! text-[#d97706]!" />
         </div>
       </div>
-      <div class="stats-card stats-card--total">
+      <div class="stats-card stats-card--total stats-card--clickable" @click="handleStatCardClick('total')">
         <div class="flex items-center gap-2">
           <Icon icon="eos-icons:counting" color="#2563eb" />
           <div class="stats-card__label">证书总数</div>
@@ -54,7 +54,7 @@
             class="stats-card__value text-[40px]! pt-10 text-center! text-[#2563eb]!" />
         </div>
       </div>
-      <div class="stats-card stats-card--personal">
+      <div class="stats-card stats-card--personal stats-card--clickable" @click="handleStatCardClick('personal')">
         <div class="flex items-center gap-2">
           <Icon
             icon="material-symbols-light:account-circle-outline"
@@ -575,6 +575,39 @@ const handleQuery = () => {
   getList()
 }
 
+const handleStatCardClick = (type: 'expired' | 'warn' | 'total' | 'personal') => {
+  queryParams.pageNo = 1
+
+  if (type === 'expired') {
+    queryParams.expired = true
+    queryParams.alertWarn = undefined
+    queryParams.type = undefined
+    getList()
+    return
+  }
+
+  if (type === 'warn') {
+    queryParams.alertWarn = true
+    queryParams.expired = undefined
+    queryParams.type = undefined
+    getList()
+    return
+  }
+
+  if (type === 'personal') {
+    queryParams.type = 'personal'
+    queryParams.expired = undefined
+    queryParams.alertWarn = undefined
+    getList()
+    return
+  }
+
+  queryParams.type = undefined
+  queryParams.expired = undefined
+  queryParams.alertWarn = undefined
+  getList()
+}
+
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryParams.deptId = ''
@@ -861,6 +894,19 @@ onMounted(async () => {
   box-shadow: 0 4px 12px rgb(31 91 184 / 8%);
 }
 
+.stats-card--clickable {
+  cursor: pointer;
+  transition:
+    transform 0.18s ease,
+    box-shadow 0.18s ease,
+    border-color 0.18s ease;
+}
+
+.stats-card--clickable:hover {
+  transform: translateY(-2px);
+  box-shadow: 0 10px 24px rgb(31 91 184 / 14%);
+}
+
 .stats-card__label {
   font-size: 14px;
   font-weight: 600;

+ 32 - 2
src/views/pms/qhse/index.vue

@@ -12,7 +12,7 @@
       @node-click="handleDeptNodeClick" />
 
     <div class="stats-cards min-w-0">
-      <div class="stats-card stats-card--expired">
+      <div class="stats-card stats-card--expired stats-card--clickable" @click="handleStatCardClick('expired')">
         <div class="stats-card__header">
           <el-icon class="stats-card__icon" :size="28">
             <Icon icon="ep:info-filled" />
@@ -27,7 +27,7 @@
             class="stats-card__value text-[40px]! pt-10 text-center! text-[#e35656]!" />
         </div>
       </div>
-      <div class="stats-card stats-card--warn">
+      <div class="stats-card stats-card--warn stats-card--clickable" @click="handleStatCardClick('warn')">
         <div class="stats-card__header">
           <el-icon class="stats-card__icon" :size="28">
             <Icon icon="ep:bell-filled" />
@@ -646,6 +646,23 @@ const handleQuery = () => {
   getList()
 }
 
+const handleStatCardClick = (type: 'expired' | 'warn') => {
+  queryParams.pageNo = 1
+
+  if (type === 'expired') {
+    queryParams.expired = true
+    queryParams.alertWarn = undefined
+    getList()
+    return
+  }
+
+  if (type === 'warn') {
+    queryParams.alertWarn = true
+    queryParams.expired = undefined
+    getList()
+  }
+}
+
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields()
@@ -1038,6 +1055,19 @@ onUnmounted(() => {
   box-shadow: 0 4px 12px rgb(31 91 184 / 8%);
 }
 
+.stats-card--clickable {
+  cursor: pointer;
+  transition:
+    transform 0.18s ease,
+    box-shadow 0.18s ease,
+    border-color 0.18s ease;
+}
+
+.stats-card--clickable:hover {
+  transform: translateY(-2px);
+  box-shadow: 0 10px 24px rgb(31 91 184 / 14%);
+}
+
 .stats-card__label {
   font-size: 14px;
   font-weight: 600;

+ 3 - 2
src/views/pms/qhse/monthlyReport/index.vue

@@ -102,7 +102,8 @@ const router = useRouter()
 const queryParams = reactive({
   createTime: null,
   title: '',
-  deptId: ''
+  deptId: '',
+  yearMonths: ''
 })
 
 let queryFormRef = ref(null)
@@ -256,7 +257,7 @@ const loadTableData = async () => {
       pageNo: pagination.pageNo,
       pageSize: pagination.pageSize,
       createTime: queryParams.createTime,
-
+      yearMonths: queryParams.yearMonths,
       title: queryParams.title,
       deptId: queryParams.deptId
     }

+ 25 - 22
src/views/pms/qhse/reportSummary/index.vue

@@ -1,5 +1,5 @@
 <script lang="ts" setup>
-import { QhseMonthReportApi } from '@/api/pms/qhse'
+import { QhseMonthReportSummaryApi, QhseMonthReportApi } from '@/api/pms/qhse'
 import { useTableComponents } from '@/components/ZmTable/useTableComponents'
 import QhseMonthReportPreviewDrawer from './preview-drawer.vue'
 import type { QhseMonthReportItem, QhseMonthReportListItem } from './types'
@@ -13,8 +13,7 @@ const currentId = ref<number>()
 
 const queryFormRef = ref()
 const queryParams = reactive({
-  title: '',
-  createTime: undefined as string[] | undefined
+  yearMonths: ''
 })
 const pagination = reactive({
   pageNo: 1,
@@ -26,7 +25,7 @@ const { ZmTable, ZmTableColumn } = useTableComponents<QhseMonthReportListItem>()
 async function getList() {
   loading.value = true
   try {
-    const res = await QhseMonthReportApi.getQhseMonthReportPage({
+    const res = await QhseMonthReportSummaryApi.getQhseMonthReportSummaryList({
       ...queryParams,
       pageNo: pagination.pageNo,
       pageSize: pagination.pageSize
@@ -49,7 +48,10 @@ function resetQuery() {
   getList()
 }
 
-function handleView(row: QhseMonthReportItem) {
+async function handleView(row: QhseMonthReportItem) {
+  const res = await QhseMonthReportSummaryApi.getQhseMonthReportSummary({
+    yearMonths: row.yearMonths
+  })
   currentId.value = row.id
   visible.value = true
 }
@@ -85,17 +87,20 @@ 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-form-item label="月报标题" prop="title">
         <el-input v-model="queryParams.title" placeholder="请输入月报标题" clearable />
-      </el-form-item>
-      <el-form-item label="创建日期" prop="createTime">
-        <el-date-picker
-          v-model="queryParams.createTime"
+      </el-form-item> -->
+      <el-form-item label="月报期次" prop="yearMonths">
+        <!-- <el-date-picker
+          v-model="queryParams.yearMonths"
           type="daterange"
           value-format="YYYY-MM-DD HH:mm:ss"
+          range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
-          class="!w-300px" />
+          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+          :shortcuts="rangeShortcuts"
+          class="w-full!" /> -->
       </el-form-item>
       <el-form-item class="report-summary-query__actions">
         <el-button type="primary" @click="handleQuery">搜索</el-button>
@@ -103,7 +108,8 @@ onMounted(() => {
       </el-form-item>
     </el-form>
 
-    <div class="report-summary-data-panel bg-white dark:bg-[#1d1e1f] shadow rounded-lg flex flex-col p-4 min-h-0">
+    <div
+      class="report-summary-data-panel bg-white dark:bg-[#1d1e1f] shadow rounded-lg flex flex-col p-4 min-h-0">
       <div class="flex-1 min-h-0 relative">
         <el-auto-resizer class="report-summary-table-view absolute">
           <template #default="{ width, height }">
@@ -114,14 +120,14 @@ onMounted(() => {
               :max-height="height"
               :height="height"
               show-border>
-              <ZmTableColumn label="月报标题" prop="title" :min-width="260" />
-              <ZmTableColumn label="工单填报人" prop="personName" width="160" />
-              <ZmTableColumn
+              <ZmTableColumn label="月报期次" prop="yearMonths" />
+              <ZmTableColumn label="月报标题" prop="title" />
+              <!-- <ZmTableColumn
                 label="创建日期"
                 prop="createTime"
                 cover-formatter
                 :real-value="({ createTime }) => formatDate(createTime)"
-                width="160" />
+                width="160" /> -->
               <ZmTableColumn label="操作" width="100" fixed="right">
                 <template #default="{ row }">
                   <el-button size="default" link type="success" @click="handleView(row)">
@@ -141,13 +147,10 @@ onMounted(() => {
                 <strong>{{ item.title || '-' }}</strong>
               </div>
               <div class="report-summary-card__field">
-                <span>填报人</span>
-                <strong>{{ item.personName || '-' }}</strong>
-              </div>
-              <div class="report-summary-card__field">
-                <span>创建日期</span>
-                <strong>{{ formatDate(item.createTime) }}</strong>
+                <span>月报期次</span>
+                <strong>{{ item.yearMonths || '-' }}</strong>
               </div>
+
               <div class="report-summary-card__actions">
                 <el-button size="default" link type="success" @click="handleView(item)">
                   查看