diff --git a/src/api/ticket.js b/src/api/ticket.js index 7ea0668..5f2c459 100644 --- a/src/api/ticket.js +++ b/src/api/ticket.js @@ -5,11 +5,12 @@ import request from "@/utils/request.js"; * @returns {Promise} */ -export function getTickerList(count, page, status, orderBy, order) { +export function getTickerList(count, page, status, orderBy, order, userId) { const params = { count, page } if (status !== undefined && status !== '') params.status = status if (orderBy) params.orderBy = orderBy if (order) params.order = order + if (userId) params.user_id = userId console.log('工单列表请求参数:', params) // 调试日志 return request.get('/api/v1/admin/work_order/list', params) } diff --git a/src/views/ticket/TicketDetail.vue b/src/views/ticket/TicketDetail.vue index ce79c8c..a1e2b86 100644 --- a/src/views/ticket/TicketDetail.vue +++ b/src/views/ticket/TicketDetail.vue @@ -892,7 +892,8 @@ const goToUserDetail = () => { // 定时刷新 const startAutoRefresh = () => { refreshTimer.value = setInterval(() => { - if (ticketInfo.value?.status !== 'completed') { + // 只有当前路由仍在工单详情页且工单未完成时才刷新 + if (route.path === '/ticket/detail' && route.query.id && ticketInfo.value?.status !== 'completed') { fetchTicketDetail(false) // 定时刷新时不显示 loading } }, 10000) diff --git a/src/views/ticket/TicketList.vue b/src/views/ticket/TicketList.vue index 64fd0d9..bcb3956 100644 --- a/src/views/ticket/TicketList.vue +++ b/src/views/ticket/TicketList.vue @@ -31,14 +31,21 @@ + + :model-value="selectedUser ? selectedUser.user_name : ''" + placeholder="点击选择用户筛选" + readonly + style="width: 180px; cursor: pointer" + @click="showUserDialog = true" + > + + + 刷新 @@ -99,18 +106,74 @@ @current-change="handlePageChange" /> + + + +
+ + + + +
+ +
+ 搜索关键词: {{ userSearchKeyword }} | 用户数量: {{ userList.length }} +
+ +
+ 请输入关键词搜索用户 +
+
+ 未找到匹配的用户 +
+
+
+ {{ user.user_name?.charAt(0) }} +
+
{{ user.user_name }}
+
+ 手机: {{ user.phone }} + 邮箱: {{ user.email }} + UID: {{ user.user_id }} +
+
+ +
+
+
+
+
@@ -365,6 +539,68 @@ onActivated(() => { gap: 8px; } +.user-dialog-content { + display: flex; + flex-direction: column; + gap: 16px; +} + +.user-list-container { + min-height: 300px; + max-height: 400px; + overflow-y: auto; + border: 1px solid #dcdfe6; + border-radius: 4px; +} + +.empty-hint { + display: flex; + align-items: center; + justify-content: center; + height: 300px; + color: #909399; + font-size: 14px; +} + +.user-list { + padding: 8px 0; +} + +.user-list-item { + display: flex; + align-items: center; + gap: 12px; + padding: 12px 16px; + cursor: pointer; + transition: background 0.2s; +} + +.user-list-item:hover { + background: #f5f7fa; +} + +.user-list-info { + flex: 1; + min-width: 0; +} + +.user-list-name { + font-size: 14px; + font-weight: 500; + color: #303133; + margin-bottom: 4px; +} + +.user-list-sub { + font-size: 12px; + color: #909399; +} + +.user-list-arrow { + color: #c0c4cc; + font-size: 16px; +} + .user-info { display: flex; align-items: center;