From 53bf1e11c46964e15ab2d334457066ed3b68c98d Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期五, 06 六月 2025 12:57:57 +0800
Subject: [PATCH] refactor(lb-eims):调整代码和更新配置- 注释掉 EimsEquImportVo 中的 @ExcelProperty 注解 - 优化 EimsEquImportListener 中的异常日志输出- 更新 snailjob 监控页面的 iframe 源地址- 修改移动端项目的 API 基础 URL - 优化移动端页面跳转逻辑 - 改进维修请求列表的接单操作流程

---
 eims-ui-mobile/src/pages/inspect/insp-record.vue |  122 ++++++++++++++++++++++++++++++++--------
 1 files changed, 97 insertions(+), 25 deletions(-)

diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue
index f0b128d..a276635 100644
--- a/eims-ui-mobile/src/pages/inspect/insp-record.vue
+++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -1,14 +1,12 @@
 <route lang="json5">
 {
-  style: {
-    navigationBarTitleText: '鐐规璁板綍',
-    navigationStyle: 'custom',
-    navigationBarBackgroundColor: '#4D80F0',
-  },
+  layout: 'default',
+  needLogin: true,
+  style: { navigationBarTitleText: '鐐规璁板綍', navigationStyle: 'custom' },
 }
 </route>
 <template>
-  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
+  <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time>
     <template #top>
       <wd-navbar
         title="鐐规璁板綍"
@@ -18,8 +16,11 @@
         @click-right="handleClickRight"
         custom-style="background: #4D80F0;"
         safeAreaInsetTop
-      ></wd-navbar>
-
+      >
+        <template #right>
+          <text v-if="isOperatorOrRepair()" class="text-white">鎻愪氦</text>
+        </template>
+      </wd-navbar>
       <wd-card type="rectangle">
         <template #title>
           <view class="flex justify-between">
@@ -34,7 +35,7 @@
             </view>
           </view>
         </template>
-        <view class="flex h-[100rpx]" items-center>
+        <view class="flex h-[140rpx]" items-center>
           <image class="slot-img text-center" src="/static/images/camera.png" />
           <view class="flex-1">
             <view class="text-color-gray text-xs mt-1 flex">
@@ -52,7 +53,7 @@
             <view class="text-color-gray text-xs mt-2 flex">
               <text>鐘舵�侊細</text>
               <template v-if="dataCount > 0 && dataCount === checkCount">
-                <wd-icon class="icon-color-success" name="check-outline" size="40rpx"></wd-icon>
+                <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon>
                 <text class="ml-1">宸插畬鎴�</text>
               </template>
               <template v-else>
@@ -60,6 +61,7 @@
                 <text class="ml-1">杩涜涓�</text>
               </template>
             </view>
+            <view class="text-color-gray text-xs mt-2 flex">鍒涘缓鏃堕棿: {{ inspSt.createTime }}</view>
           </view>
         </view>
       </wd-card>
@@ -76,11 +78,11 @@
         </wd-button>
       </wd-cell>
       <wd-collapse v-model="collSelects" title="鐐规椤�" ref="collapseRef">
-        <wd-collapse-item :name="item.id" v-for="(item, index) in dataList">
+        <wd-collapse-item :name="item.id" v-for="(item, index) in dataList" disabled>
           <template #title="{ expanded, disabled, isFirst }">
             <view class="flex justify-between">
-              <view class="flex justify-center items-center">
-                <text class="text-sm">{{ item.inspName }}</text>
+              <view class="flex justify-center items-center" style="max-width: 60%;">
+                <text class="text-sm" >{{ item.inspName }}</text>
               </view>
 
               <view class="flex items-center">
@@ -109,7 +111,29 @@
           </view>
         </wd-collapse-item>
       </wd-collapse>
-      <view class="w-full h-[1rpx] bg-base"></view>
+      <view class="w-full h-[24rpx]"></view>
+      <wd-cell>
+        <template #title>
+          <text class="text-color-gray">鍏朵粬</text>
+        </template>
+      </wd-cell>
+      <view class="w-full h-[1px] bg-base"></view>
+      <wd-input
+        label="杩愯鏃堕棿"
+        label-width="200rpx"
+        clearable
+        v-model="inspSt.runTimes"
+        placeholder="璇疯緭鍏ヨ繍琛屾椂闂�(h)"
+        inputmode="numeric"
+      />
+      <wd-input
+        label="鏁呴殰鏃堕棿"
+        label-width="200rpx"
+        clearable
+        v-model="inspSt.faultTimes"
+        placeholder="璇疯緭鍏ユ晠闅滄椂闂�(h)"
+        inputmode="numeric"
+      />
       <wd-textarea
         label="鐗硅浜嬮」"
         label-width="200rpx"
@@ -128,7 +152,13 @@
 <script setup lang="ts">
 import { ref } from 'vue'
 import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store'
-import { getInspStRecordList, updateInspectSt, updateInspRecordBatch } from '@/service/inspect'
+import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils'
+import {
+  getInspStRecordList,
+  getInspSt,
+  updateInspectSt,
+  updateInspRecordBatch,
+} from '@/service/inspect'
 import { useToast, useMessage } from 'wot-design-uni'
 import type { CollapseInstance } from 'wot-design-uni/components/wd-collapse/types'
 const message = useMessage()
@@ -136,6 +166,7 @@
 
 const collapseRef = ref<CollapseInstance>()
 const isAllExpanded = ref(false)
+const viewMode = ref<string>('Day')
 
 // 瀹氫箟鎺ュ彛
 interface QueryParams {
@@ -151,9 +182,12 @@
   equName: string
   assetNo: string
   planTimeStr?: string
+  createTime?: string
   status: string
   inspUser: number | string
   specialNote: string
+  runTimes: number
+  faultTimes: number
 }
 
 const dataChange = ref(false)
@@ -169,9 +203,12 @@
   equName: '',
   assetNo: '',
   planTimeStr: '',
+  createTime: '',
   status: '',
   inspUser: '',
   specialNote: '',
+  runTimes: 0,
+  faultTimes: 0,
 })
 
 const paging = ref(null)
@@ -189,7 +226,7 @@
   getInspStRecordList(params)
     .then((res: any) => {
       // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡
-      paging.value.complete(res.rows)
+      paging.value.completeByTotal(res.rows, res.total)
     })
     .catch((res) => {
       // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰
@@ -206,8 +243,12 @@
 const goBack = () => {
   uni.navigateBack()
 }
+
 function handleClickRight() {
-  handleConfirm()
+  if(isOperatorOrRepair()){
+    handleConfirm()
+  }
+
 }
 
 const toggleCollapse = () => {
@@ -228,7 +269,9 @@
         updateData(resolve)
       },
     })
-    .then(() => {})
+    .then(() => {
+      goBack()
+    })
     .catch((error) => {
       console.log(error)
     })
@@ -245,6 +288,7 @@
     })
     .catch((res) => {
       console.error(res)
+      toast.error('鎿嶄綔澶辫触')
     })
 }
 function updateInspSt(resolve: any) {
@@ -252,12 +296,14 @@
   inspSt.status = '1'
   updateInspectSt(inspSt)
     .then((res: any) => {
+      toast.success('鎿嶄綔鎴愬姛')
       paging.value.reload()
       uni.$emit('insp-st-refresh')
       resolve(true)
     })
     .catch((res) => {
       console.error(res)
+      toast.error('鎿嶄綔澶辫触')
     })
 }
 
@@ -277,15 +323,40 @@
   { deep: true },
 )
 onLoad((options) => {
-  inspSt.id = options.id
-  inspSt.inspCode = options.inspCode
-  inspSt.equName = options.equName
-  inspSt.assetNo = options.assetNo
-  inspSt.planTimeStr = options.planTimeStr
-  inspSt.specialNote = options?.specialNote
-  inspSt.inspUser = userStore?.userInfo?.userId
+  // inspSt.id = options.id
+  // inspSt.inspCode = options.inspCode
+  // inspSt.equName = options.equName
+  // inspSt.assetNo = options.assetNo
+  // inspSt.planTimeStr = options.planTimeStr
+  // inspSt.createTime = options.createTime
+  // inspSt.specialNote = options?.specialNote
+  // inspSt.inspUser = userStore?.userInfo?.userId
+  viewMode.value = options.viewMode
+  initData(options.id)
 })
 
+function initData(id: any) {
+  getInspSt(id)
+    .then((res: any) => {
+      if (res?.id) {
+        const inspCode = `${res?.equId}_${res?.planTime}_${viewMode.value}`
+        inspSt.inspCode = inspCode
+        Object.assign(inspSt, res)
+        reloadData()
+      } else {
+        uni.showToast({
+          title: '鏁版嵁鏌ヨ澶辫触锛岃鑱旂郴绠$悊鍛�',
+          icon: 'none',
+        })
+      }
+    })
+    .catch((res) => {
+      console.error(res)
+    })
+}
+function reloadData() {
+  paging.value.reload()
+}
 const dataCount = computed(() => dataList.value.length)
 const checkCount = computed(() => dataList.value.filter((item) => item.status === '1').length)
 const normalNum = computed(() => dataList.value.filter((item) => item.inspResult === '1').length)
@@ -330,5 +401,6 @@
 :deep(.wd-navbar__title) {
   color: white;
   font-weight: 0;
+  font-size: 32rpx;
 }
 </style>

--
Gitblit v1.9.3