Browse Source

负责人列表添加部门显示

HD_wangm 4 months ago
parent
commit
48d9fc2510

+ 4 - 4
api/order/list.uts

@@ -7,13 +7,13 @@ import { request } from '../../utils/request'
  * 获取工单列表
  * @param page 页码
  * @param rows 每页数量
- * @param keyword 关键字(可选,支持工单编和风机编号查询)
+ * @param keyword 关键字(可选,支持工单编和风机编号查询)
  * @param status 工单状态(可选)
  */
 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) {
-        // 支持工单编和风机编号查询
+        // 支持工单编和风机编号查询
         url += `&keyword=${encodeURIComponent(keyword)}`
     }
     // 添加状态筛选参数
@@ -33,7 +33,7 @@ export const getOrderList = (page: number, rows: number, keyword: string | null,
 export const almostOverdueList = (page: number, rows: number, keyword: string | null): Promise<any> => {
     let url = `/mobile/order/almostOverdue?pageNum=${page}&pageSize=${rows}`
 	if (keyword != null && keyword.length > 0) {
-	    // 支持工单编和风机编号查询
+	    // 支持工单编和风机编号查询
 	    url += `&keyword=${encodeURIComponent(keyword)}`
 	}
     return request({
@@ -50,7 +50,7 @@ export const almostOverdueList = (page: number, rows: number, keyword: string |
 export const overdueList = (page: number, rows: number, keyword: string | null): Promise<any> => {
     let url = `/mobile/order/overdue?pageNum=${page}&pageSize=${rows}`
 	if (keyword != null && keyword.length > 0) {
-	    // 支持工单编和风机编号查询
+	    // 支持工单编和风机编号查询
 	    url += `&keyword=${encodeURIComponent(keyword)}`
 	}
     return request({

+ 2 - 2
api/user/list.uts

@@ -10,7 +10,7 @@ import type { UserInfo } from '../../types/user'
 export const getUserList = (deptId: any): Promise<any> => {
 	let url = `/system/user/listNoPermi?status=0`
 	if (deptId != null ) {
-	    // 支持工单编和风机编号查询
+	    // 支持工单编和风机编号查询
 	    url += `&deptId=${deptId}`
 	}
 
@@ -28,4 +28,4 @@ export const getUserList = (deptId: any): Promise<any> => {
 //         url: '/system/user/listNoPermi?status=0',
 //         method: 'GET'
 //     })
-// }
+// }

+ 1 - 1
api/workbench/list.uts

@@ -36,7 +36,7 @@ export const getContractorList = (page: number, rows: number, contractorName: st
  * 获取承包商列表
  * @param page 页码
  * @param rows 每页数量
- * @param workOrderProjectNo 工单编(可选)
+ * @param workOrderProjectNo 工单编(可选)
  */
 export const getOrderList = (page: number, rows: number, workOrderProjectNo: string | null): Promise<any> => {
     let url = `/mobile/order/list?pageNum=${page}&pageSize=${rows}`

+ 28 - 29
pages/index/index.uvue

@@ -48,7 +48,7 @@
 			</view> -->
 
 			<!-- 即将超时工单列表 -->
-			<view class="section-title-container" v-if="almostOverdueListData.length > 0">
+			<!-- <view class="section-title-container" v-if="almostOverdueListData.length > 0">
 				<view class="section-header">
 					<text class="section-title">即将超时工单</text>
 					<text class="view-all" @click="navigateToAlmostOverdueOrders">查看全部</text>
@@ -68,10 +68,9 @@
 						<view class="item-container">
 							<view class="item-header">
 								<text class="item-title">{{ getPcsDeviceName(item) }}-{{ getStationName(item) }}</text>
-								<!-- <text class="status-tag status-assigned">{{ getWorkOrderStatus(item) }}</text> -->
 							</view>
 							<view class="info-row">
-								<text class="text-gray">工单编:{{ getWorkOrderProjectNo(item) }}</text>
+								<text class="text-gray">工单编:{{ getWorkOrderProjectNo(item) }}</text>
 								<text class="text-gray" :class="getRemarkClass(item)">{{ getRemark(item) }}</text>
 							</view>
 						</view>
@@ -80,7 +79,7 @@
 				<template #loadMore>
 					<view></view>
 				</template>
-			</common-list>
+			</common-list> -->
 
 			<!-- 超时工单列表 -->
 			<view class="section-title-container" v-if="overdueListData.length > 0">
@@ -106,7 +105,7 @@
 								<!-- <text class="status-tag status-suspended">{{ getWorkOrderStatus(item) }}</text> -->
 							</view>
 							<view class="info-row">
-								<text class="text-gray">工单编:{{ getWorkOrderProjectNo(item) }}</text>
+								<text class="text-gray">工单编:{{ getWorkOrderProjectNo(item) }}</text>
 								<text class="text-gray overdue-title">{{ getRemark(item) }}</text>
 							</view>
 						</view>
@@ -151,7 +150,7 @@
 	// 		console.log(res)
 	// 	});
 	// };
-	
+
 	const handleKeepAlive = (userId: string)=>{
 		var keep=new KeepLive()
 		keep.setTitle("工效通")
@@ -163,11 +162,11 @@
 		})
 		keep.onAddScrrenListenerCallback(function(res:boolean){
 		    console.log("屏幕开启状态 "+res)
-		})  
+		})
 		keep.setWakeLock(1,"keeptag");// 设置唤醒类型
 		keep.setAutoStartEnable(true)
 		keep.doStartApplicationWithPackageName("uni.app.UNI1050C07");
-		
+
 		if(!keep.checkAppNotification()){
 		    keep.onOpenNotificationSetting(function(res:boolean){
 		        keep.register();
@@ -183,7 +182,7 @@
 		        keep.requestIgnoreBatteryOptimizations();
 		    }
 		}
-		
+
 		// keep.wifilock();
 		// 稳定定时器 需要的用户使用(默认定时器1 )
 		keep.onStartCSystemTimer(10,function(){
@@ -206,7 +205,7 @@
 		    keep.acquire(1000);// 唤醒一秒钟
 		});
 	}
-	
+
     // 用户名
     const userName = ref<string>('用户')
 
@@ -226,22 +225,22 @@
 	// 超时工单列表
 	const overdueListData = ref<any[]>([])
 	const overdueLoading = ref<boolean>(false)
-	
+
 	// 维保类型字典列表
-	const inspectionTypeList = ref<SysDictData[]>([]) 
+	const inspectionTypeList = ref<SysDictData[]>([])
 	// 添加字典加载状态
 	const dictLoaded = ref<boolean>(false)
-	
+
 	// 获取工单状态字典列表
 	const loadStatusDictList = async (): Promise<void> => {
 	    try {
 	        const result = await getDictDataByType('gxt_inspection_type')
 	        const resultObj = result as UTSJSONObject
-	
+
 	        if (resultObj['code'] == 200) {
 	            const data = resultObj['data'] as any[]
 	            const dictData: SysDictData[] = []
-	
+
 	            if (data.length > 0) {
 	                for (let i = 0; i < data.length; i++) {
 	                    const item = data[i] as UTSJSONObject
@@ -263,7 +262,7 @@
 	                    dictData.push(dictItem)
 	                }
 	            }
-	
+
 	            inspectionTypeList.value = dictData
 	            dictLoaded.value = true
 	        }
@@ -512,22 +511,22 @@
 		const orderInfoItem = item as UTSJSONObject
 		return orderInfoItem['remark'] as string != null ? orderInfoItem['remark'] as string : ''
 	}
-	
+
 	// 根据剩余时间获取颜色类名
 	const getRemarkClass = (item: any | null): string => {
 		if (item == null) return ''
 		const orderInfoItem = item as UTSJSONObject
 		const remark = orderInfoItem['remark'] as string
-		
+
 		if (remark == null || remark.length === 0) return ''
-		
+
 		// 解析备注中的剩余时间(假设格式为包含数字和小时的字符串)
 		// 例如:"剩余时间:5小时" 或 "还剩10小时"
 		const timeMatch = remark.match(/(\d+(\.\d+)?)\s*(小时|时)/)
-		
+
 		if (timeMatch != null && timeMatch.length > 1 && timeMatch[1] != null) {
 			const hours = parseFloat(timeMatch[1] as string)
-			
+
 			if (hours < 6) {
 				return 'time-critical' // 红色
 			} else if (hours < 12) {
@@ -536,22 +535,22 @@
 				return 'time-notice' // 黄色
 			}
 		}
-		
+
 		return ''
 	}
-	
+
 	// 辅助函数:从 any 类型提取属性
 	const getOrderType = (item: any | null): string => {
 	    if (item == null) return ''
 	    const orderInfoItem = item as UTSJSONObject
 	    return orderInfoItem['orderType'] == 1?"维修工单":"维保工单";
 	}
-	
+
 	const getInspectionType = (item: any | null): string | null => {
 	    if (item == null) return ''
 	    const orderInfoItem = item as UTSJSONObject
 	    const rawStatus = orderInfoItem['inspectionType']
-	
+
 	    if (rawStatus==null) return ''
 		// 如果字典尚未加载,返回原始值
 		    if (!dictLoaded.value) {
@@ -613,7 +612,7 @@
 		loadOverdueCount()
 
 		// 加载即将超时工单列表
-		loadAlmostOverdueList()
+		// loadAlmostOverdueList()
 
 		// 加载超时工单列表
 		loadOverdueList()
@@ -627,7 +626,7 @@
 		uni.$on('refreshSelfScoreCount', () => {
 			loadSelfScoreCount()
 		})
-		
+
 		// 监听超时工单状态更新事件
 		uni.$on('refreshOverdueCount', () => {
 			loadOverdueCount()
@@ -697,13 +696,13 @@
 	.section-title-container {
 		padding: 20rpx 30rpx 10rpx 30rpx;
 	}
-	
+
 	.section-header {
 		flex-direction: row;
 		justify-content: space-between;
 		align-items: center;
 	}
-	
+
 	.view-all {
 		font-size: 28rpx;
 		color: #165dff;

+ 3 - 3
pages/order/almostOverdue.uvue

@@ -5,7 +5,7 @@
         <view class="search-bar">
             <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" @blur="handleSearch" />
+                <input class="search-input" type="text" placeholder="搜索工单编、风机编号" v-model="keyword" @confirm="handleSearch" @blur="handleSearch" />
                 <text v-if="keyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
             </view>
         </view>
@@ -245,7 +245,7 @@ import { getDictDataByType } from '../../api/dict/index'
 	    const dictItem = statusDictList.value.find(dict => dict.dictValue == rawStatus)
 	    return dictItem!=null ? dictItem.dictLabel : rawStatus
 	}
-	
+
 	const getStatusClass = (item: any | null): string => {
 		if (item == null) return ''
 		const orderInfoItem = item as acceptOrderInfo
@@ -473,4 +473,4 @@ import { getDictDataByType } from '../../api/dict/index'
 	color: #5cb87a;
 	border-color: #c2e7b0;
 }
-</style>
+</style>

+ 20 - 29
pages/order/detail/acceptIndex.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">
@@ -40,7 +40,7 @@
 					    <text class="info-value">{{ detailData.assignTime ?? '' }}</text>
 					</view>
 					<view class="info-item" v-if="detailData.orderType == 2">
-					    <text class="info-label">MIS工单编</text>
+					    <text class="info-label">MIS工单编</text>
 					    <text class="info-value">{{ detailData.misNo ?? '' }}</text>
 					</view>
 					<view class="info-item" v-if="detailData.orderType == 2">
@@ -91,19 +91,21 @@
 			    <view class="modal-mask" @click="showLeaderPicker = false"></view>
 			    <view class="modal-content">
 			        <view class="modal-header">
-			            <text class="modal-title">选择负责人</text>
+			            <text class="modal-title">选择工作负责人</text>
 			            <text class="modal-close" @click="showLeaderPicker = false">取消</text>
 			        </view>
 			        <scroll-view class="modal-body" scroll-y="true">
 			            <view
-			                v-for="(option, index) in teamLeaderNameOptions"
+			                v-for="(option, index) in teamLeaderList"
 			                :key="index"
 			                class="picker-option"
 			                :class="{ 'selected': index === selectedTeamLeaderIndex }"
 			                @click="selectLeaderManually(index)"
 			            >
-			                <text class="option-text">{{ option.label }}</text>
-							<text class="option-text">{{ option.value }}</text>
+							<!-- <text class="option-text">{{ option.label }}</text>
+							<text class="option-text">{{ option.value }}</text> -->
+			                <text class="option-text">{{ option.nickName }}</text>
+							<text class="option-text">{{ option.deptName }}</text>
 			                <text v-if="index === selectedTeamLeaderIndex" class="option-check">✓</text>
 			            </view>
 			        </scroll-view>
@@ -199,46 +201,38 @@
 	}
 
 	// 选中的负责人信息
-	const selectedTeamLeaderId = ref<string>('')
 	const selectedTeamLeaderName = ref<string>('')
 	const selectedTeamLeaderIndex = ref<number>(-1)
-	const teamLeaderNameOptions = ref<PickerOption[]>([])
 	const showLeaderPicker = ref<boolean>(false)
+	const teamLeaderList = ref<UserInfo[]>([])
 
 	// 获取负责人列表(使用用户列表接口)
 	const loadTeamLeaderList = async (): Promise<void> => {
 	    try {
 			const deptId = detailData.value.gxtCenterId
-	        const result = await getUserList(deptId)
+	        const result = await getUserList(-1)
 	        const resultObj = result as UTSJSONObject
 
 	        if (resultObj['code'] == 200) {
 	            const data = resultObj['data'] as any[]
 	            const leaders: UserInfo[] = []
-				const options: PickerOption[] = []
 
 	            if (data.length > 0) {
 	                for (let i = 0; i < data.length; i++) {
 	                    const item = data[i] as UTSJSONObject
+	                    const deptObj = item['dept'] as UTSJSONObject
 	                    let leader: UserInfo = {
 							userName: item['userName'] as string,
 							nickName: item['nickName'] as string,
 							userId: new Int32Array([item['userId'] != null ? (item['userId'] as number) : 0]),
 							phone: item['phonenumber'] as string,
-							deptName : item['deptName'] != null ? (item['deptName'] as string) : ''
+							deptName : (deptObj['deptName'] != null) ? (deptObj['deptName'] as string) : ''
 	                    }
 	                    leaders.push(leader)
-
-						// 构建选择器选项(只使用用户名)
-						options.push({
-						    label: leader.nickName,
-						    value: leader.userId.toString()
-						})
 	                }
 	            }
 
-	            // teamLeaderList.value = leaders
-				teamLeaderNameOptions.value = options
+	            teamLeaderList.value = leaders
 	        }
 	    } catch (e: any) {
 	        console.error('获取负责人列表失败:', e.message)
@@ -248,15 +242,12 @@
 	// 手动选择负责人
 	const selectLeaderManually = (index: number): void => {
 	    selectedTeamLeaderIndex.value = index
-	    if (index >= 0 && index < teamLeaderNameOptions.value.length) {
-	        const selectedOption = teamLeaderNameOptions.value[index]
-	        selectedTeamLeaderName.value = selectedOption.label
-	        selectedTeamLeaderId.value = selectedOption.value
-			const leaderId = (selectedOption.value != null && selectedOption.value.length > 0) ? parseInt(selectedOption.value) : 0
-			detailData.value.teamLeaderId = leaderId
-			detailData.value.teamLeaderName = selectedOption.label
-			console.log("=======",detailData.value.teamLeaderName)
-	    }
+		if (index >= 0 && index < teamLeaderList.value.length) {
+		    const selectedOption = teamLeaderList.value[index]
+		    selectedTeamLeaderName.value = selectedOption.nickName
+		    detailData.value.teamLeaderId = selectedOption.userId[0] as number
+			detailData.value.teamLeaderName = selectedOption.nickName
+		}
 	    showLeaderPicker.value = false
 	}
 
@@ -399,7 +390,7 @@
 				    // 维保工单
 				    flowList = data['workOrderFlowList'] as UTSJSONObject[]
 				}
-                if (flowList.length > 0 && flowList != null) {
+                if (flowList.length > 0) {
                     workOrderFlowList = []
                     for (let i = 0; i < flowList.length; i++) {
                         const flowItem = flowList[i]

+ 6 - 6
pages/order/detail/approveIndex.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">
@@ -40,7 +40,7 @@
 					    <text class="info-value">{{ detailData.assignTime ?? '' }}</text>
 					</view>
 					<view class="info-item" v-if="detailData.orderType == 2">
-					    <text class="info-label">MIS工单编</text>
+					    <text class="info-label">MIS工单编</text>
 					    <text class="info-value">{{ detailData.misNo ?? '' }}</text>
 					</view>
 					<view class="info-item" v-if="detailData.orderType == 2">
@@ -78,7 +78,7 @@
 			    </view>
 			    <view class="info-card">
 			        <view class="form-item">
-			             <textarea 
+			             <textarea
 							class="reject-reason-textarea"
 							placeholder="请输入审批意见(必填)"
 							v-model="rejectReason"
@@ -301,7 +301,7 @@
 		}
 
 	}
-	
+
 	// 处理接单操作
 	const handleAcceptOrder = async (): Promise<void> => {
 		detailData.value.rejectionReason = rejectReason.value
@@ -326,7 +326,7 @@
 		} catch (error) {
 		  console.error('请求失败:', error);
 		}
-	
+
 	}
 
 
@@ -651,7 +651,7 @@
 		    font-size: 32rpx;
 		    border-radius: 16rpx;
 		    border: none;
-		
+
 		    &:active {
 		        background-color: #d9363e;
 		    }

+ 5 - 5
pages/order/detail/index.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">
@@ -149,21 +149,21 @@
 
     // 控制工单流转列表是否展开
     const isFlowListExpanded = ref<boolean>(false)
-    
+
     // 计算显示的工单流转列表
     const displayedFlowList = computed(() => {
         if (detailData.value.workOrderFlowList == null) return []
-        
+
         // 如果已经展开,则显示全部
         if (isFlowListExpanded.value) {
             return detailData.value.workOrderFlowList
         }
-        
+
         // 默认只显示最后一条
         const length = detailData.value.workOrderFlowList.length
         return length > 0 ? [detailData.value.workOrderFlowList[length - 1]] : []
     })
-    
+
     // 切换工单流转列表的展开/收起状态
     const toggleFlowList = () => {
         isFlowListExpanded.value = !isFlowListExpanded.value

+ 4 - 4
pages/order/detail/resumeIndex.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">
@@ -224,7 +224,7 @@
 	        dictLoaded.value = true
 	    }
 	}
-	
+
 	// 处理恢复操作
 	const handleResumeOrder = async (): Promise<void> => {
 		detailData.value.rejectionReason = rejectReason.value
@@ -249,7 +249,7 @@
 		} catch (error) {
 		  console.error('请求失败:', error);
 		}
-	
+
 	}
 
 
@@ -570,7 +570,7 @@
 		    font-size: 32rpx;
 		    border-radius: 16rpx;
 		    border: none;
-		
+
 		    &:active {
 		        background-color: #d9363e;
 		    }

+ 1 - 1
pages/order/detail/suspendIndex.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">

+ 3 - 3
pages/order/index.uvue

@@ -5,12 +5,12 @@
         <view class="search-bar">
             <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" @blur="handleSearch" />
+                <input class="search-input" type="text" placeholder="搜索工单编、风机编号" v-model="keyword" @confirm="handleSearch" @blur="handleSearch" />
                 <text v-if="keyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
             </view>
         </view>
 
-		<view class="status-bar">			
+		<view class="status-bar">
 			<scroll-view class="scroll-view_H" direction="horizontal" show-scrollbar="false">
 				<view class="scroll-view-item_H uni-bg-red">
 					<text class="status-txt" :class="{'stauts-sel': currentStatus === ''}" @click="switchStatus('')">全部</text>
@@ -702,7 +702,7 @@ import { getDictDataByType } from '../../api/dict/index'
 .scroll-view-item_H {
   justify-content: center;
   align-items: center;
-  
+
   .status-txt{
 	padding: 8px 12px;
 	text-align: center;

+ 3 - 3
pages/order/overdue.uvue

@@ -5,7 +5,7 @@
         <view class="search-bar">
             <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" @blur="handleSearch" />
+                <input class="search-input" type="text" placeholder="搜索工单编、风机编号" v-model="keyword" @confirm="handleSearch" @blur="handleSearch" />
                 <text v-if="keyword.length > 0" class="clear-icon" @click="clearSearch">✕</text>
             </view>
         </view>
@@ -245,7 +245,7 @@ import { getDictDataByType } from '../../api/dict/index'
 	    const dictItem = statusDictList.value.find(dict => dict.dictValue == rawStatus)
 	    return dictItem!=null ? dictItem.dictLabel : rawStatus
 	}
-	
+
 	const getStatusClass = (item: any | null): string => {
 		if (item == null) return ''
 		const orderInfoItem = item as acceptOrderInfo
@@ -480,4 +480,4 @@ import { getDictDataByType } from '../../api/dict/index'
 // 	color: #ff4d4f;
 // 	border-color: #ffccc7;
 // }
-</style>
+</style>

+ 110 - 108
pages/score/index.uvue

@@ -5,9 +5,9 @@
     <view class="search-bar">
       <view class="search-box">
         <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
-        <input 
-          class="search-input" 
-          placeholder="搜索工单编、风机编号"
+        <input
+          class="search-input"
+          placeholder="搜索工单编、风机编号"
           v-model="searchKeyword"
           @confirm="handleSearch"
         />
@@ -18,36 +18,36 @@
     <!-- 工单评分状态筛选 -->
     <view class="status-bar">
       <view class="status-box">
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': statusFilter === '' }"
           @click="filterByStatus('')"
         >
           全部
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': statusFilter === 'to_self' }"
           @click="filterByStatus('to_self')"
         >
           待自评
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': statusFilter === 'to_re' }"
           @click="filterByStatus('to_re')"
         >
           待复评
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': statusFilter === 'to_confirm' }"
           @click="filterByStatus('to_confirm')"
         >
           待确认
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': statusFilter === 'to_final' }"
           @click="filterByStatus('to_final')"
         >
@@ -61,22 +61,22 @@
       <view class="stats-header">
         <text class="stats-title">{{ monthTitle }}月度工分</text>
         <view class="month-filters">
-          <text 
-            class="month-filter" 
+          <text
+            class="month-filter"
             :class="{ 'month-filter-sel': selectedMonth === 'prev' }"
             @click="changeMonth('prev')"
           >
             上月
           </text>
-          <text 
-            class="month-filter" 
+          <text
+            class="month-filter"
             :class="{ 'month-filter-sel': selectedMonth === 'current' }"
             @click="changeMonth('current')"
           >
             本月
           </text>
-          <text 
-            class="month-filter" 
+          <text
+            class="month-filter"
             :class="{ 'month-filter-sel': selectedMonth === 'custom' }"
             @click="showCustomDatePicker"
           >
@@ -91,7 +91,7 @@
           <text class="score-value">{{ totalScore }}分</text>
           <text class="score-label">{{ monthTitle }}总工分</text>
         </view>
-        
+
         <view class="score-breakdown">
           <view class="breakdown-item">
             <text class="breakdown-label">维保工分</text>
@@ -110,14 +110,14 @@
     </view>
 
     <!-- 工单评分列表 -->
-    <common-list 
-      :dataList="orderList" 
-      :loading="loading" 
-      :refreshing="refreshing" 
-      :hasMore="hasMore" 
-      @refresh="handleRefresh" 
-      @loadMore="loadMore" 
-      @itemClick="handleItemClick" 
+    <common-list
+      :dataList="orderList"
+      :loading="loading"
+      :refreshing="refreshing"
+      :hasMore="hasMore"
+      @refresh="handleRefresh"
+      @loadMore="loadMore"
+      @itemClick="handleItemClick"
       class="list-with-padding"
     >
       <template #default="{ item, index }">
@@ -140,7 +140,7 @@
 			<view class="info-row">
 			  <view class="info-label">
 			    <text class="text-gray">工作结束时间: {{ formatDate(getPropertyValue(item, 'assignTime')) }}</text>
-			  </view> 
+			  </view>
 			</view>
           </view>
         </view>
@@ -156,7 +156,7 @@
             <text class="cancel-btn" @click="closeDatePicker">取消</text>
           </view>
         </view>
-        
+
         <view class="date-picker-container">
           <view class="date-picker-item">
             <!-- <text class="date-label">选择年月</text> -->
@@ -167,14 +167,14 @@
         </view>
       </view>
     </l-popup>
-    
+
     <!-- Date Picker -->
     <l-popup v-model="showDatePicker" position="bottom" :z-index="1000">
-      <l-date-time-picker 
-        :mode="3" 
+      <l-date-time-picker
+        :mode="3"
         format="YYYY-MM"
         :modelValue="customDate"
-        confirm-btn="确定" 
+        confirm-btn="确定"
         cancel-btn="取消"
         @confirm="onDateConfirm"
         @cancel="showDatePicker = false">
@@ -191,7 +191,7 @@
     import { listOrderScores, getOrderScoreStatistics, listMobileOrderScores } from '@/api/score/index'
     import { getDictDataByType } from '@/api/dict/index'
     import type { SysDictData } from '@/types/dict'
-    
+
     // 数据状态
     const searchKeyword = ref<string>('')
     const statusFilter = ref<string>('')
@@ -207,11 +207,11 @@
     const rank = ref<number | null>(null)
     const totalRankingUsers = ref<number | null>(null)
     const customDate = ref<string>('')
-    
+
     // 弹窗显示状态
     const showDatePickerPopup = ref<boolean>(false)
     const showDatePicker = ref<boolean>(false)
-    
+
     // 工单状态字典列表
     const statusDictList = ref<SysDictData[]>([])
     // 维保类型字典列表
@@ -219,7 +219,7 @@
     // 检修类型字典列表
     const maintenanceTypeDictList = ref<SysDictData[]>([])
     const dictLoaded = ref<boolean>(false)
-    
+
     // 计算属性
     const monthTitle = computed(() => {
       switch (selectedMonth.value) {
@@ -234,32 +234,32 @@
           return '本月'
       }
     })
-    
+
     // 打开自定义日期选择弹窗
     function showCustomDatePicker() {
-      showDatePickerPopup.value = true 
+      showDatePickerPopup.value = true
     }
-    
+
     function closeDatePicker() {
       showDatePicker.value = false
       showDatePickerPopup.value = false
     }
-    
+
     // 打开日期选择器
     function openDatePicker() {
       showDatePicker.value = true
-    } 
-    
+    }
+
     // 获取工单评分状态字典列表
     const loadStatusDictList = async (): Promise<void> => {
         try {
             const result = await getDictDataByType('gxt_scoring_status')
             const resultObj = result as UTSJSONObject
-            
+
             if (resultObj['code'] == 200) {
                 const data = resultObj['data'] as any[]
                 const dictData: SysDictData[] = []
-                
+
                 if (data != null && data.length > 0) {
                     for (let i = 0; i < data.length; i++) {
                         const item = data[i] as UTSJSONObject
@@ -281,23 +281,24 @@
                         dictData.push(dictItem)
                     }
                 }
-                
+
                 statusDictList.value = dictData
             }
         } catch (e: any) {
             console.error('获取工单评分状态字典失败:', e.message)
         }
     }
-    
+
     // 获取维保类型字典列表
     const loadInspectionTypeDictList = async (): Promise<void> => {
         try {
             const result = await getDictDataByType('gxt_inspection_type')
             const resultObj = result as UTSJSONObject
+
             if (resultObj['code'] == 200) {
                 const data = resultObj['data'] as any[]
                 const dictData: SysDictData[] = []
-                
+
                 if (data != null && data.length > 0) {
                     for (let i = 0; i < data.length; i++) {
                         const item = data[i] as UTSJSONObject
@@ -319,24 +320,24 @@
                         dictData.push(dictItem)
                     }
                 }
-                
+
                 inspectionTypeDictList.value = dictData
             }
         } catch (e: any) {
             console.error('获取维保类型字典失败:', e.message)
         }
     }
-    
+
     // 获取检修类型字典列表
     const loadMaintenanceTypeDictList = async (): Promise<void> => {
         try {
             const result = await getDictDataByType('gxt_maintenance_type')
             const resultObj = result as UTSJSONObject
-            
+
             if (resultObj['code'] == 200) {
                 const data = resultObj['data'] as any[]
                 const dictData: SysDictData[] = []
-                
+
                 if (data != null && data.length > 0) {
                     for (let i = 0; i < data.length; i++) {
                         const item = data[i] as UTSJSONObject
@@ -358,14 +359,14 @@
                         dictData.push(dictItem)
                     }
                 }
-                
+
                 maintenanceTypeDictList.value = dictData
             }
         } catch (e: any) {
             console.error('获取检修类型字典失败:', e.message)
         }
     }
-    
+
     // Helper function to safely extract properties from item
     function getPropertyValue(item: any | null, propertyName: string): string {
       if (item == null) return ''
@@ -373,7 +374,7 @@
       const value = itemObj[propertyName]
       return value != null ? '' + value : ''
     }
-    
+
     // 获取工单类型文本
     function getWorkOrderTypeText(orderType: string | null): string {
       if (orderType != null) {
@@ -385,13 +386,13 @@
       }
       return ""
     }
-    
+
     // 获取工单类型相关信息(维保类型或检修类型)
     function getWorkOrderTypeInfo(item: any | null): string {
       if (item == null) return ''
-      
+
       const orderType = getPropertyValue(item, 'orderType')
-      
+
       // 维保工单显示维保类型
       if (orderType == "2") {
         const inspectionType = getPropertyValue(item, 'inspectionType')
@@ -400,12 +401,12 @@
           if (inspectionTypeDictList.value.length == 0) {
             return inspectionType
           }
-          
+
             // 查找字典中对应的标签
             const dictItem = inspectionTypeDictList.value.find(dict => dict.dictValue == inspectionType)
             return (dictItem != null ? dictItem.dictLabel : inspectionType) as string
         }
-      } 
+      }
       // 维修工单显示检修类型
       else if (orderType == "1") {
         const maintenanceType = getPropertyValue(item, 'maintenanceType')
@@ -414,33 +415,33 @@
           if (maintenanceTypeDictList.value.length == 0) {
             return maintenanceType
           }
-          
+
             // 查找字典中对应的标签
             const dictItem = maintenanceTypeDictList.value.find(dict => dict.dictValue == maintenanceType)
             return (dictItem != null ? dictItem.dictLabel : maintenanceType) as string
         }
       }
-      
+
       return ""
     }
-    
+
     // 获取工单状态文本
     function getScoringStatus(item: any | null): string | null {
         if (item == null) return ''
         const rawStatus = getPropertyValue(item, 'scoringStatus')
-        
+
         if (rawStatus == null || rawStatus == '') return ''
-        
+
         // 如果字典尚未加载,返回原始值
         if (!dictLoaded.value) {
             return rawStatus
         }
-        
+
         // 查找字典中对应的标签
         const dictItem = statusDictList.value.find(dict => dict.dictValue == rawStatus)
         return dictItem != null ? dictItem.dictLabel : rawStatus
     }
-    
+
     // 获取工单评分状态文本
     function getOrderStatusText(status: string | null): string {
       const statusMap: UTSJSONObject = {
@@ -449,12 +450,12 @@
         '3': '待确认',
         '4': '待终评'
       }
-      
+
       if (status == null) return ''
       const result = statusMap[status]
       return result != null ? result as string : '未知状态'
     }
-    
+
     // 获取统计数据
     function getStatistics() {
       // Convert 'current' and 'prev' values to actual date strings
@@ -471,16 +472,16 @@
           const monthStr = prevMonth === 0 ? '12' : prevMonth.toString().padStart(2, '0');
         monthValue = `${prevYear}-${monthStr}`;
       }
-      
+
       const params: UTSJSONObject = {
         //scoringStatus: statusFilter.value,
         month: monthValue
       }
-      
+
       getOrderScoreStatistics(params).then((response: any) => {
         const resultObj = response as UTSJSONObject
         const responseData = resultObj['data'] as UTSJSONObject
-        
+
         if (responseData != null) {
           totalScore.value = (responseData['totalScore'] != null) ? parseFloat((responseData['totalScore'] as number).toFixed(2)) : 0
           maintenanceScore.value = (responseData['maintenanceScore'] != null) ? parseFloat((responseData['maintenanceScore'] as number).toFixed(2)) : 0
@@ -496,7 +497,7 @@
         }
       })
     }
-	
+
 	function onDateConfirm(value: string) {
 	  customDate.value = value
 	  showDatePicker.value = false
@@ -504,21 +505,21 @@
 	  selectedMonth.value = 'custom'
 	  getStatistics()
 	}
-		
+
     // 方法
     function loadData(isRefresh: boolean) {
       const shouldRefresh = isRefresh
-      
+
       if (loading.value && !shouldRefresh) {
         return
-      } 
-      
+      }
+
       loading.value = true
       if (shouldRefresh) {
         currentPage.value = 1
         refreshing.value = true
       }
-      
+
       // Convert 'current' and 'prev' values to actual date strings
       let monthValue = '';
       if (selectedMonth.value === 'custom') {
@@ -526,7 +527,7 @@
       } else if (selectedMonth.value === 'current') {
         const now = new Date();
         const m = now.getMonth() + 1
-        let mStr = m.toString() 
+        let mStr = m.toString()
         if (m < 10) {
           mStr = '0' + mStr
         }
@@ -537,11 +538,11 @@
         const prevYear = prevMonth === 0 ? now.getFullYear() - 1 : now.getFullYear();
         let monthStr = prevMonth === 0 ? '12' : prevMonth.toString()
         if (prevMonth !== 0 && prevMonth < 10) {
-          monthStr = '0' + monthStr 
+          monthStr = '0' + monthStr
         }
         monthValue = `${prevYear}-${monthStr}`;
       }
-      
+
       const params: UTSJSONObject = {
         pageNum: currentPage.value,
         pageSize: 5,
@@ -549,21 +550,21 @@
         scoringStatus: statusFilter.value,
         month: monthValue
       }
-      
+
       listMobileOrderScores(params).then((response: any) => {
         // 提取响应数据
         const resultObj = response as UTSJSONObject
         console.log('API响应数据:', resultObj)
         const responseData = resultObj['rows'] as any[]
         const responseTotal = resultObj['total'] as number
-        
+
         if (shouldRefresh) {
           orderList.value = Array.isArray(responseData) ? responseData : []
         } else {
           const currentRows = Array.isArray(responseData) ? responseData : []
           orderList.value = [...orderList.value, ...currentRows]
         }
-        
+
         hasMore.value = orderList.value.length < responseTotal
         loading.value = false
         refreshing.value = false
@@ -572,39 +573,39 @@
         refreshing.value = false
       })
     }
-    
+
     function handleSearch() {
       loadData(true)
     }
-    
+
     function clearSearch() {
       searchKeyword.value = ""
       loadData(true)
     }
-    
+
     function filterByStatus(status: string) {
       statusFilter.value = status
       loadData(true)
       getStatistics()
     }
-    
+
     function changeMonth(month: string) {
       selectedMonth.value = month
       //loadData(true)
       getStatistics()
     }
-    
+
     function loadMore() {
       if (!hasMore.value || loading.value) return
-      
+
       currentPage.value++
       loadData(false)
     }
-    
+
     function handleRefresh() {
       loadData(true)
     }
-    
+
     // 点击列表项
     function handleItemClick(item: any | null, index: number): void {
       if (item == null) return
@@ -620,12 +621,12 @@
         })
       }
     }
-    
+
     function formatNumber(value: number | null) {
       if (value === null) return '0.0'
       return value.toFixed(2)
     }
-    
+
 	// 获取工单评分状态样式类
 	function getStatusClass(item: any | null): string {
 	    if (item == null) return ''
@@ -633,7 +634,7 @@
 	    if (rawStatus == null || rawStatus == '') return ''
 	    return `status-${rawStatus}`
 	}
-	
+
 	function formatDate(dateString: string) {
 	  if (dateString == '' || dateString == null) return ''
 	  const date = new Date(dateString)
@@ -644,7 +645,7 @@
 	  const minutes = date.getMinutes().toString().padStart(2, '0')
 	  return `${year}-${month}-${day} ${hours}:${minutes}`
 	}
-	
+
     // 生命周期
     onMounted(() => {
       loadStatusDictList()
@@ -688,7 +689,7 @@
     font-size: 28rpx;
     color: #333333;
   }
-  
+
   .clear-icon {
     margin-left: 12rpx;
     font-size: 28rpx;
@@ -708,7 +709,7 @@
   align-items: center;
   height: 72rpx;
   flex: 1;
-  
+
   .status-txt {
     padding: 8px 12px;
     text-align: center;
@@ -717,7 +718,7 @@
     background-color: #fff;
     font-size: 28rpx;
   }
-  
+
   .stauts-sel {
     background-color: #007AFF;
     color: #fff;
@@ -810,7 +811,7 @@
   line-height: 1.4;
 }
 
-.breakdown-value { 
+.breakdown-value {
   font-size: 28rpx;
   color: #666;
   display: flex;
@@ -855,24 +856,24 @@
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
-  
+
   .info-label {
     font-size: 26rpx;
     color: #666;
   }
-  
+
   .info-value-row {
     flex-direction: row;
     align-items: center;
   }
-  
+
   .score-text {
     font-size: 28rpx;
     color: #ff9900;
     font-weight: bold;
     margin-right: 20rpx;
   }
-  
+
   .status-text {
     font-size: 24rpx;
     padding: 4rpx 12rpx;
@@ -977,7 +978,7 @@
   background-color: #ebf5ff;
   color: #409eff;
   border-color: #d8ebff;
-} 
+}
 
 /* 待确认 */
 .status-to_confirm {
@@ -992,7 +993,7 @@
   background-color: #ebf5ff;
   color: #409eff;
   border-color: #d8ebff;
-} 
+}
 
 /* 待归档 */
 .status-to_archive {
@@ -1007,4 +1008,5 @@
   color: #5cb87a;
   border-color: #c2e7b0;
 }
-</style>
+</style>
+

+ 34 - 34
pages/worktime/detail/index.uvue

@@ -8,7 +8,7 @@
                 </view>
                 <view class="info-card">
                     <view class="info-item">
-                        <text class="info-label">工单编</text>
+                        <text class="info-label">工单编</text>
                         <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
                     </view>
                     <view class="info-item">
@@ -145,7 +145,7 @@
     const chartRef = ref<TuiCharts | null>(null)
     // 保存图表实例
     const chartInstance = ref<TuiCharts | null>(null)
-    
+
     // 图例数据类型
     type ChartLegendItem = {
         name: string
@@ -153,10 +153,10 @@
         color: string
     }
     const chartLegendData = ref<ChartLegendItem[]>([])
-    
+
     // 颜色配置
     const chartColors = ['#5B9BF3', '#4DD4C0', '#FF9966', '#FF6B96', '#9B7FE8', '#FFD700', '#8A2BE2']
-    
+
     // 格式化小时数
     const formatHours = (hourValue: number | null): string => {
         if (hourValue == null) return '0.0'
@@ -172,14 +172,14 @@
                 console.log('图表数据为空,无法绘制')
                 return
             }
-            
+
             console.log('图表实例状态:', charts)
-            
+
             // 清除之前的图表
             if (charts.chartsMap != null) {
                 charts.chartsMap.clear()
             }
-            
+
             // 创建饼图配置 - 使用环形图配置以匹配 flow-chart 组件
             const pieOption = {
                 type: 'ring',
@@ -190,7 +190,7 @@
                 series: chartData.value.map((item: UTSJSONObject, index: number) => {
                     return {
                         name: item.get('name'),
-                        legendText: item.get('name'),  
+                        legendText: item.get('name'),
                         data: [{
                             name: item.get('name'),
                             value: item.get('value')
@@ -218,9 +218,9 @@
                     }
                 }
             } as UTSJSONObject
-            
+
             console.log('图表配置:', pieOption)
-            
+
             console.log('准备创建图表对象')
             const pieChart = charts.add(0, pieOption)
             console.log('创建图表对象完成:', pieChart)
@@ -236,11 +236,11 @@
     const prepareChartData = (data: orderInfo): void => {
         const chartItems = [] as UTSJSONObject[]
         const legendItems = [] as ChartLegendItem[]
-        
+
         // 添加各项工时数据
         if (data.issueHour != null) {
             const item = {
-				name: '下发时长', 
+				name: '下发时长',
 				value: data.issueHour
 			} as UTSJSONObject
             chartItems.push(item)
@@ -250,7 +250,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.acceptHour != null) {
             const item = {name: '接单时长', value: data.acceptHour} as UTSJSONObject
             chartItems.push(item)
@@ -260,7 +260,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.prepareHour != null) {
             const item = {name: '准备时长', value: data.prepareHour} as UTSJSONObject
             chartItems.push(item)
@@ -270,7 +270,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.workHour != null) {
             const item = {name: '作业时长', value: data.workHour} as UTSJSONObject
             chartItems.push(item)
@@ -280,7 +280,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.restartHour != null) {
             const item = {name: '复运时长', value: data.restartHour} as UTSJSONObject
             chartItems.push(item)
@@ -290,7 +290,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.handleHour != null) {
             const item = {name: '处理时长', value: data.handleHour} as UTSJSONObject
             chartItems.push(item)
@@ -300,7 +300,7 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         if (data.suspendHour != null) {
             const item = {name: '挂起时长', value: data.suspendHour} as UTSJSONObject
             chartItems.push(item)
@@ -310,25 +310,25 @@
                 color: chartColors[legendItems.length % chartColors.length]
             } as ChartLegendItem)
         }
-        
+
         chartData.value = chartItems
         chartLegendData.value = legendItems
         console.log('更新chartData:', chartItems)
         console.log('更新chartLegendData:', legendItems)
-        
+
         // 如果图表已经初始化,则直接绘制
         if (chartInstance.value != null && chartItems.length > 0) {
             drawChart(chartInstance.value)
-        } 
+        }
     }
 
     // 加载详情数据
     const loadDetail = async (id: string, orderType: string): Promise<void> => {
         try {
             loading.value = true
-            
+
             const result = await getOrderHourDetail(orderType, id)
-            
+
             // 提取响应数据
             const resultObj = result as UTSJSONObject
             const code = resultObj.get('code') as number
@@ -366,9 +366,9 @@
                     handleHour: (data.get('handleHour') as number | null) ?? 0,
                     suspendHour: (data.get('suspendHour') as number | null) ?? 0
                 } as orderInfo
-                
+
                 detailData.value = orderDetail
-                
+
                 // 准备图表数据
                 prepareChartData(orderDetail)
             } else {
@@ -507,46 +507,46 @@
                 justify-content: space-between;
                 margin: 20rpx 0;
             }
-            
+
             .chart-legend {
                 flex: 1;
                 padding-left: 20rpx;
             }
-            
+
             .legend-item {
                 flex-direction: row;
                 align-items: center;
                 justify-content: space-between;
                 margin-bottom: 20rpx;
-            
+
                 &:last-child {
                     margin-bottom: 0;
                 }
-             
+
                 .legend-left {
                     flex-direction: row;
                     align-items: center;
                 }
-             
+
                 .legend-right {
                     flex-direction: row;
                     align-items: center;
                 }
             }
-            
+
             .legend-color {
                 width: 24rpx;
                 height: 24rpx;
                 border-radius: 4rpx;
                 margin-right: 12rpx;
             }
-            
+
             .legend-name {
                 font-size: 26rpx;
                 color: #333333;
                 margin-right: 8rpx;
             }
-            
+
             .legend-value {
                 font-size: 26rpx;
                 color: #666666;
@@ -580,4 +580,4 @@
             border-radius: 12rpx;
         }
     }
-</style>
+</style>

+ 82 - 82
pages/worktime/index.uvue

@@ -5,9 +5,9 @@
     <view class="search-bar">
       <view class="search-box">
         <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
-        <input 
-          class="search-input" 
-          placeholder="搜索工单编、风机编号"
+        <input
+          class="search-input"
+          placeholder="搜索工单编、风机编号"
           v-model="searchKeyword"
           @confirm="handleSearch"
         />
@@ -18,22 +18,22 @@
     <!-- 工单分类筛选 -->
     <view class="status-bar">
       <view class="status-box">
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': orderTypeFilter === '' }"
           @click="filterByOrderType('')"
         >
           全部
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': orderTypeFilter === '1' }"
           @click="filterByOrderType('1')"
         >
           维修工单
         </text>
-        <text 
-          class="status-txt" 
+        <text
+          class="status-txt"
           :class="{ 'stauts-sel': orderTypeFilter === '2' }"
           @click="filterByOrderType('2')"
         >
@@ -47,22 +47,22 @@
       <view class="stats-header">
         <text class="stats-title">{{ timeRangeTitle }}工时统计</text>
         <view class="time-filters">
-          <text 
-            class="time-filter" 
+          <text
+            class="time-filter"
             :class="{ 'time-filter-sel': timeRange === 'week' }"
             @click="changeTimeRange('week')"
           >
             本周
           </text>
-          <text 
-            class="time-filter" 
+          <text
+            class="time-filter"
             :class="{ 'time-filter-sel': timeRange === 'month' }"
             @click="changeTimeRange('month')"
           >
             本月
           </text>
-          <text 
-            class="time-filter" 
+          <text
+            class="time-filter"
             :class="{ 'time-filter-sel': timeRange === 'custom' }"
             @click="showCustomDatePicker"
           >
@@ -77,7 +77,7 @@
           <text class="hours-value">{{ totalHours }}小时</text>
           <text class="hours-label">{{ timeRangeTitle }}总工时</text>
         </view>
-        
+
         <view class="hours-breakdown">
           <view v-if="orderTypeFilter !== '1'" class="breakdown-item">
             <text class="breakdown-label">维保工时</text>
@@ -96,14 +96,14 @@
     </view>
 
     <!-- 工单列表 -->
-    <common-list 
-      :dataList="orderList" 
-      :loading="loading" 
-      :refreshing="refreshing" 
-      :hasMore="hasMore" 
-      @refresh="handleRefresh" 
-      @loadMore="loadMore" 
-      @itemClick="handleItemClick" 
+    <common-list
+      :dataList="orderList"
+      :loading="loading"
+      :refreshing="refreshing"
+      :hasMore="hasMore"
+      @refresh="handleRefresh"
+      @loadMore="loadMore"
+      @itemClick="handleItemClick"
       class="list-with-padding"
     >
       <template #default="{ item, index }">
@@ -141,7 +141,7 @@
             <text class="cancel-btn" @click="closeDatePicker">取消</text>
           </view>
         </view>
-        
+
         <view class="date-picker-container">
           <view class="date-picker-item">
             <text class="date-label">开始时间</text>
@@ -149,7 +149,7 @@
               {{ startDate != null && startDate != '' ? startDate : '请选择开始时间' }}
             </view>
           </view>
-          
+
           <view class="date-picker-item">
             <text class="date-label">结束时间</text>
             <view class="date-display" @click="openEndDatePicker">
@@ -159,27 +159,27 @@
         </view>
       </view>
     </l-popup>
-    
+
     <!-- Start Date Picker -->
     <l-popup v-model="showStartDatePicker" position="bottom">
-      <l-date-time-picker 
-        :mode="7" 
+      <l-date-time-picker
+        :mode="7"
         format="YYYY-MM-DD"
         :modelValue="startDate"
-        confirm-btn="确定" 
+        confirm-btn="确定"
         cancel-btn="取消"
         @confirm="onStartDateConfirm"
         @cancel="showStartDatePicker = false">
       </l-date-time-picker>
     </l-popup>
-    
+
     <!-- End Date Picker -->
     <l-popup v-model="showEndDatePicker" position="bottom">
-      <l-date-time-picker 
-        :mode="7" 
+      <l-date-time-picker
+        :mode="7"
         format="YYYY-MM-DD"
         :modelValue="endDate"
-        confirm-btn="确定" 
+        confirm-btn="确定"
         cancel-btn="取消"
         @confirm="onEndDateConfirm"
         @cancel="showEndDatePicker = false">
@@ -196,7 +196,7 @@ import { ref, computed, onMounted } from 'vue'
 import { listOrderHours, getOrderHourStatistics } from '@/api/worktime/index'
 import { getDictDataByType } from '@/api/dict/index'
 import type { SysDictData } from '@/types/dict'
- 
+
 // 数据状态
 const searchKeyword = ref<string>('')
 const orderTypeFilter = ref<string>('')
@@ -215,7 +215,7 @@ const totalRankingUsers = ref<number | null>(null)
 // 弹窗显示状态
 const showDatePickerPopup = ref<boolean>(false)
 const showStartDatePicker = ref<boolean>(false)
-const showEndDatePicker = ref<boolean>(false)  
+const showEndDatePicker = ref<boolean>(false)
 
 // 自定义日期表单
 const startDate = ref<string>('')
@@ -241,7 +241,7 @@ const timeRangeTitle = computed(() => {
     default:
       return '本月'
   }
-}) 
+})
 
 // 获取工单状态字典列表
 const loadStatusDictList = async (): Promise<void> => {
@@ -251,7 +251,7 @@ const loadStatusDictList = async (): Promise<void> => {
         if (resultObj['code'] == 200) {
             const data = resultObj['data'] as any[]
             const dictData: SysDictData[] = []
-            
+
             if (data != null && data.length > 0) {
                 for (let i = 0; i < data.length; i++) {
                     const item = data[i] as UTSJSONObject
@@ -273,7 +273,7 @@ const loadStatusDictList = async (): Promise<void> => {
                     dictData.push(dictItem)
                 }
             }
-            
+
             statusDictList.value = dictData
             dictLoaded.value = true
         }
@@ -288,11 +288,11 @@ const loadInspectionTypeDictList = async (): Promise<void> => {
 	try {
 		const result = await getDictDataByType('gxt_inspection_type')
 		const resultObj = result as UTSJSONObject
-		
+
 		if (resultObj['code'] == 200) {
 			const data = resultObj['data'] as any[]
 			const dictData: SysDictData[] = []
-			
+
 			if (data != null && data.length > 0) {
 				for (let i = 0; i < data.length; i++) {
 					const item = data[i] as UTSJSONObject
@@ -314,7 +314,7 @@ const loadInspectionTypeDictList = async (): Promise<void> => {
 					dictData.push(dictItem)
 				}
 			}
-			
+
 			inspectionTypeDictList.value = dictData
 		}
 	} catch (e: any) {
@@ -327,11 +327,11 @@ const loadMaintenanceTypeDictList = async (): Promise<void> => {
 	try {
 		const result = await getDictDataByType('gxt_maintenance_type')
 		const resultObj = result as UTSJSONObject
-		
+
 		if (resultObj['code'] == 200) {
 			const data = resultObj['data'] as any[]
 			const dictData: SysDictData[] = []
-			
+
 			if (data != null && data.length > 0) {
 				for (let i = 0; i < data.length; i++) {
 					const item = data[i] as UTSJSONObject
@@ -353,7 +353,7 @@ const loadMaintenanceTypeDictList = async (): Promise<void> => {
 					dictData.push(dictItem)
 				}
 			}
-			
+
 			maintenanceTypeDictList.value = dictData
 		}
 	} catch (e: any) {
@@ -385,14 +385,14 @@ function getWorkOrderTypeText(orderType: string | null): string {
 function getWorkOrderStatus(item: any | null): string | null {
     if (item == null) return ''
     const rawStatus = getPropertyValue(item, 'workOrderStatus')
-    
+
     if (rawStatus == null || rawStatus == '') return ''
-    
+
     // 如果字典尚未加载,返回原始值
     if (!dictLoaded.value) {
         return rawStatus
     }
-    
+
     // 查找字典中对应的标签
     const dictItem = statusDictList.value.find(dict => dict.dictValue == rawStatus)
     return dictItem != null ? dictItem.dictLabel : rawStatus
@@ -413,16 +413,16 @@ function getStatistics() {
     orderType: orderTypeFilter.value,
     timeRange: timeRange.value
   }
-  
+
   if (timeRange.value === 'custom') {
     params.beginDate = startDate.value
     params.endDate = endDate.value
   }
-  
+
   getOrderHourStatistics(params).then((response: any) => {
     const resultObj = response as UTSJSONObject
     const responseData = resultObj['data'] as UTSJSONObject
-    
+
     if (responseData != null) {
       totalHours.value = (responseData['totalHours'] != null) ? parseFloat((responseData['totalHours'] as number).toFixed(1)) : 0
       maintenanceHours.value = (responseData['maintenanceHours'] != null) ? parseFloat((responseData['maintenanceHours'] as number).toFixed(1)) : 0
@@ -442,17 +442,17 @@ function getStatistics() {
 // 方法
 function loadData(isRefresh: boolean) {
   const shouldRefresh = isRefresh
-  
+
   if (loading.value && !shouldRefresh) {
     return
-  } 
-  
+  }
+
   loading.value = true
   if (shouldRefresh) {
     currentPage.value = 1
     refreshing.value = true
   }
-  
+
   const params: UTSJSONObject = {
     pageNum: currentPage.value,
     pageSize: 5,
@@ -460,26 +460,26 @@ function loadData(isRefresh: boolean) {
     orderType: orderTypeFilter.value,
     timeRange: timeRange.value
   }
-  
+
   if (timeRange.value === 'custom') {
     params.beginDate = startDate.value
     params.endDate = endDate.value
   }
-  
+
   listOrderHours(params).then((response: any) => {
     // 提取响应数据
     const resultObj = response as UTSJSONObject
     console.log('API响应数据:', resultObj)
     const responseData = resultObj['rows'] as any[]
     const responseTotal = resultObj['total'] as number
-    
+
     if (shouldRefresh) {
       orderList.value = Array.isArray(responseData) ? responseData : []
     } else {
       const currentRows = Array.isArray(responseData) ? responseData : []
       orderList.value = [...orderList.value, ...currentRows]
     }
-    
+
     hasMore.value = orderList.value.length < responseTotal
     loading.value = false
     refreshing.value = false
@@ -514,7 +514,7 @@ function changeTimeRange(range: string) {
 
 function loadMore() {
   if (!hasMore.value || loading.value) return
-  
+
   currentPage.value++
   loadData(false)
 }
@@ -531,7 +531,7 @@ function showCustomDatePicker() {
     const month = (now.getMonth() + 1).toString().padStart(2, '0')
     const day = now.getDate().toString().padStart(2, '0')
     endDate.value = `${year}-${month}-${day}`
-    
+
     // 默认开始日期为7天前
     const weekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000)
     const weekAgoYear = weekAgo.getFullYear()
@@ -539,8 +539,8 @@ function showCustomDatePicker() {
     const weekAgoDay = weekAgo.getDate().toString().padStart(2, '0')
     startDate.value = `${weekAgoYear}-${weekAgoMonth}-${weekAgoDay}`
   }
-  
-  showDatePickerPopup.value = true 
+
+  showDatePickerPopup.value = true
 }
 
 function closeDatePicker() {
@@ -554,12 +554,12 @@ function confirmCustomDate() {
     uni.showToast({ title: '请选择开始时间和结束时间', icon: 'none' })
     return
   }
-  
+
   if (startDate.value != null && endDate.value != null && new Date(startDate.value as string) > new Date(endDate.value as string)) {
     uni.showToast({ title: '开始时间不能大于结束时间', icon: 'none' })
     return
   }
-  
+
   closeDatePicker()
   timeRange.value = 'custom'
   loadData(true)
@@ -582,7 +582,7 @@ function onStartDateConfirm(value: string) {
     uni.showToast({ title: '开始时间不能大于结束时间', icon: 'none' })
     return
   }
-  
+
   startDate.value = value
   showStartDatePicker.value = false
 }
@@ -593,7 +593,7 @@ function onEndDateConfirm(value: string) {
     uni.showToast({ title: '结束时间不能小于开始时间', icon: 'none' })
     return
   }
-  
+
   endDate.value = value
   showEndDatePicker.value = false
 }
@@ -644,9 +644,9 @@ function formatNumber(value: number | null) {
 // 获取工单类型相关信息(维保类型或检修类型)
 function getWorkOrderTypeInfo(item: any | null): string {
   if (item == null) return ''
-  
+
   const orderType = getPropertyValue(item, 'orderType')
-  
+
   // 维保工单显示维保类型
   if (orderType == "2") {
 	const inspectionType = getPropertyValue(item, 'inspectionType')
@@ -655,12 +655,12 @@ function getWorkOrderTypeInfo(item: any | null): string {
 	  if (inspectionTypeDictList.value.length == 0) {
 		return inspectionType
 	  }
-	  
+
 		// 查找字典中对应的标签
 		const dictItem = inspectionTypeDictList.value.find(dict => dict.dictValue == inspectionType)
 		return (dictItem != null ? dictItem.dictLabel : inspectionType) as string
 	}
-  } 
+  }
   // 维修工单显示检修类型
   else if (orderType == "1") {
 	const maintenanceType = getPropertyValue(item, 'maintenanceType')
@@ -669,16 +669,16 @@ function getWorkOrderTypeInfo(item: any | null): string {
 	  if (maintenanceTypeDictList.value.length == 0) {
 		return maintenanceType
 	  }
-	  
+
 		// 查找字典中对应的标签
 		const dictItem = maintenanceTypeDictList.value.find(dict => dict.dictValue == maintenanceType)
 		return (dictItem != null ? dictItem.dictLabel : maintenanceType) as string
 	}
   }
-  
+
   return ""
 }
-	
+
 // 生命周期
 onMounted(() => {
   loadStatusDictList()
@@ -721,7 +721,7 @@ onMounted(() => {
     font-size: 28rpx;
     color: #333333;
   }
-  
+
   .clear-icon {
     margin-left: 12rpx;
     font-size: 28rpx;
@@ -741,7 +741,7 @@ onMounted(() => {
   align-items: center;
   height: 72rpx;
   flex: 1;
-  
+
   .status-txt {
     padding: 8px 12px;
     text-align: center;
@@ -750,7 +750,7 @@ onMounted(() => {
     background-color: #fff;
     font-size: 28rpx;
   }
-  
+
   .stauts-sel {
     background-color: #007AFF;
     color: #fff;
@@ -815,7 +815,7 @@ onMounted(() => {
     display: flex;
     margin-bottom: 8rpx;
   }
-  
+
   .hours-value {
     display: flex;
     font-size: 48rpx;
@@ -843,7 +843,7 @@ onMounted(() => {
     line-height: 1.4;
   }
 
-  .breakdown-value { 
+  .breakdown-value {
     font-size: 28rpx;
     color: #666;
     display: flex;
@@ -888,12 +888,12 @@ onMounted(() => {
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
-  
+
   .info-label {
     font-size: 26rpx;
     color: #666;
   }
-  
+
   .info-value {
     font-size: 26rpx;
     color: #666;
@@ -1031,4 +1031,4 @@ onMounted(() => {
 .list-with-padding {
   padding-bottom: 40rpx;
 }
-</style>
+</style>