wuhb 5 ماه پیش
والد
کامیت
f53931d4a8
3فایلهای تغییر یافته به همراه14 افزوده شده و 13 حذف شده
  1. 2 2
      api/dict/index.uts
  2. 1 1
      api/order/list.uts
  3. 11 10
      pages/order/index.uvue

+ 2 - 2
api/dict/index.uts

@@ -9,10 +9,10 @@ import type { DictDataResponse } from '../../types/dict'
  * @param dictType 字典类型
  */
 export const getDictDataByType = (dictType: string): Promise<DictDataResponse> => {
-    return request<DictDataResponse>({
+    return request({
         url: `/system/dict/data/type/${dictType}`,
         method: 'GET'
-    })
+    }) as Promise<DictDataResponse>
 }
 
 /**

+ 1 - 1
api/order/list.uts

@@ -10,7 +10,7 @@ import { request } from '../../utils/request'
  * @param keyword 关键字(可选,支持工单编号和风机编号查询)
  * @param status 工单状态(可选)
  */
-export const getOrderList = (page: number, rows: number, keyword: string | null, status: string | null = null): Promise<any> => {
+export const getOrderList = (page: number, rows: number, keyword: string | null, status: string | null): Promise<any> => {
     let url = `/mobile/order/list?pageNum=${page}&pageSize=${rows}`
     if (keyword != null && keyword.length > 0) {
         // 支持工单编号和风机编号查询

+ 11 - 10
pages/order/index.uvue

@@ -6,7 +6,7 @@
             <view class="search-box">
                 <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
                 <input class="search-input" type="text" placeholder="搜索工单编号、风机编号" v-model="keyword" @confirm="handleSearch" />
-                <text v-if="keyword && keyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
+                <text v-if="keyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
             </view>
         </view>
 
@@ -131,11 +131,11 @@
         const orderInfoItem = item as orderInfo
         const rawStatus = orderInfoItem.workOrderStatus
         
-        if (!rawStatus) return ''
+        if (rawStatus==null) return ''
         
         // 查找字典中对应的标签
         const dictItem = statusDictList.value.find(dict => dict.dictValue === rawStatus)
-        return dictItem ? dictItem.dictLabel : rawStatus
+        return dictItem!=null ? dictItem.dictLabel : rawStatus
     }
 
     const getPcsStationName = (item: any | null): string | null=> {
@@ -185,12 +185,6 @@
 		return getCreateTime(item)
 	}
 
-    // 切换状态
-    const switchStatus = (status: string): void => {
-        currentStatus.value = status
-        page.value = 1
-        loadData(true)
-    }
 
     // 获取工单状态字典列表
     const loadStatusDictList = async (): Promise<void> => {
@@ -224,7 +218,7 @@
 
             // 调用 API,传递关键字参数
             const searchKeyword = keyword.value.length > 0 ? keyword.value : null
-            const result = await getOrderList(page.value, pageSize, searchKeyword, currentStatus.value || null)
+            const result = await getOrderList(page.value, pageSize, searchKeyword, currentStatus.value)
 
             // 提取响应数据
             const resultObj = result as UTSJSONObject
@@ -303,6 +297,13 @@
         // #endif
     }
 
+    // 切换状态
+    const switchStatus = (status: string): void => {
+        currentStatus.value = status
+        page.value = 1
+        loadData(true)
+    }
+	
     // 下拉刷新
     const handleRefresh = async (): Promise<void> => {
         refreshing.value = true