From d7862b2890b68743ec9c4fc05800bb23ec9b412e Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期日, 27 四月 2025 16:05:02 +0800
Subject: [PATCH] 完成新增报修单

---
 eims-ui-mobile/src/pages/inspect/insp-st.vue |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/eims-ui-mobile/src/pages/inspect/insp-st.vue b/eims-ui-mobile/src/pages/inspect/insp-st.vue
index d380724..44d5ef2 100644
--- a/eims-ui-mobile/src/pages/inspect/insp-st.vue
+++ b/eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -1,6 +1,7 @@
 <route lang="json5" type="page">
 {
   layout: 'default',
+  needLogin: true,
   style: {
     navigationBarTitleText: '鐐规姹囨��',
   },
@@ -14,10 +15,8 @@
         <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" />
         <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
       </wd-drop-menu>
-      <wd-divider></wd-divider>
     </template>
     <view class="bg-base">
-      <view class="w-full h-[24rpx]"></view>
       <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">
         <template #title>
           <view class="flex justify-between">
@@ -28,11 +27,15 @@
             </view>
 
             <view class="flex items-center">
-              <text class="text-color-gray text-mini">{{ item.planTimeStr }}</text>
+              <text class="text-color-gray text-mini">
+                {{
+                  viewMode === 'Day' ? item.planTimeStr : item?.planTimeStr?.substring(0, 7) || ''
+                }}
+              </text>
             </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">
@@ -50,13 +53,16 @@
             <view class="text-color-gray text-xs mt-2 flex">
               <text>鐘舵�侊細</text>
               <template v-if="item.recordCount === item.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>
                 <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
                 <text class="ml-1">杩涜涓�</text>
               </template>
+            </view>
+            <view class="text-color-gray text-xs mt-2 flex">
+              鍒涘缓鏃堕棿: {{item.createTime}}
             </view>
           </view>
           <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">鏄庣粏</wd-button>
@@ -69,6 +75,7 @@
 <script setup lang="ts">
 import { ref } from 'vue'
 import { getInspStList } from '@/service/inspect'
+import { onShow } from '@dcloudio/uni-app'
 
 const viewMode = ref<string>('Day')
 const equName = ref<string>('鎵�鏈夎澶�')
@@ -79,7 +86,7 @@
 ])
 const equList = ref<Record<string, any>[]>([{ label: '鎵�鏈夎澶�', value: '鎵�鏈夎澶�' }])
 function handleViewMode({ value }) {
-  console.log(value)
+  reloadData()
 }
 function handleEquName({ value }) {
   console.log(value)
@@ -91,11 +98,10 @@
 const queryList = (pageNum?: number, pageSize?: number) => {
   // 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲
   // 杩欓噷鐨勮姹傚彧鏄紨绀猴紝璇锋浛鎹㈡垚鑷繁鐨勯」鐩殑缃戠粶璇锋眰锛屽苟鍦ㄧ綉缁滆姹傚洖璋冧腑閫氳繃paging.value.complete(璇锋眰鍥炴潵鐨勬暟缁�)灏嗚姹傜粨鏋滀紶缁檢-paging
-  getInspStList({ pageNum, pageSize })
+  getInspStList({ pageNum, pageSize, viewMode: viewMode.value })
     .then((res: any) => {
       // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡
-      console.log(res)
-      paging.value.complete(res.rows)
+      paging.value.completeByTotal(res.rows, res.total)
     })
     .catch((res) => {
       // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰
@@ -108,12 +114,18 @@
 function itemClick(item) {
   const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}`
   uni.navigateTo({
-    url: `/pages/inspect/insp-record?inspCode=${inspCode}&equName=${item.equName}&assetNo=${item.assetNo}&planTimeStr=${item.planTimeStr}`,
+    url: `/pages/inspect/insp-record?id=${item.id}&createTime=${item.createTime}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`,
   })
 }
 
+function reloadData() {
+  paging.value.reload()
+}
 onLoad(() => {
-  queryList()
+  uni.$on('insp-st-refresh', reloadData)
+})
+onUnload(() => {
+  uni.$off('insp-st-refresh', reloadData)
 })
 </script>
 

--
Gitblit v1.9.3