diff --git a/src/views/zhinengxunjian/baoxiuguanli.vue b/src/views/zhinengxunjian/baoxiuguanli.vue index 30c2306..b37d4e9 100644 --- a/src/views/zhinengxunjian/baoxiuguanli.vue +++ b/src/views/zhinengxunjian/baoxiuguanli.vue @@ -39,7 +39,7 @@
- + @@ -396,7 +396,7 @@ const searchParams = ref({ keyword: '', taskStatus: '', type: '', - executor: '' + sendPerson: '' }); // 执行人列表相关 @@ -469,7 +469,7 @@ async function getTaskList() { pageSize: pageSize.value, status: searchParams.value.taskStatus || undefined, type: searchParams.value.type || undefined, - executor: searchParams.value.executor || undefined, + sendPerson: searchParams.value.sendPerson || undefined, keyword: searchParams.value.keyword }); @@ -646,17 +646,6 @@ const handleSearch = () => { getTaskList(); // 调用接口获取数据 }; -const resetFilters = () => { - searchParams.value = { - keyword: '', - taskStatus: '', - type: '', - executor: '' - }; - currentPage.value = 1; - getTaskList(); -}; - // 创建报修任务弹窗相关 const createTaskDialogVisible = ref(false); const createTaskFormRef = ref(null); diff --git a/src/views/zhinengxunjian/gongdanliebiao.vue b/src/views/zhinengxunjian/gongdanliebiao.vue index d00c748..af6fff4 100644 --- a/src/views/zhinengxunjian/gongdanliebiao.vue +++ b/src/views/zhinengxunjian/gongdanliebiao.vue @@ -37,8 +37,8 @@
- - + + @@ -464,16 +464,6 @@ const workOrderStatus = ref('all'); const priority = ref('all'); const createDate = ref(''); -// 优先级转类名 -const mapPriorityToClass = (priority) => { - const priorityMap = { - 1: 'high', - 2: 'medium', - 3: 'low' - }; - return priorityMap[priority] || 'low'; -}; - // 工单数据 const rawTableData = ref([]); @@ -491,6 +481,9 @@ const fetchWorkOrderList = async () => { pageSize: pageSize.value }; + // 调试输出,检查参数是否正确 + console.log('请求参数:', params); + const response = await gongdanlist(params); if (response.code === 200 && response.rows) { @@ -522,6 +515,38 @@ const fetchWorkOrderList = async () => { } }; +// 类型映射函数 - 页面类型转接口code +const mapTypeToTypeCode = (type) => { + const typeMap = { + 'maintenance': 1, // 维护保养 + 'inspection': 2, // 检查检测 + 'installation': 3, // 安装调试 + 'upgrade': 4 // 升级改造 + }; + return typeMap[type] || null; +}; + +// 状态映射函数 - 页面状态转接口code +const mapStatusToStatusCode = (status) => { + const statusMap = { + 'pending': 1, // 待派单 + 'accepted': 2, // 已派单 + 'executing': 3, // 执行中 + 'completed': 4 // 已完成 + }; + return statusMap[status] || null; +}; + +// 优先级映射函数 - 页面优先级转接口code +const mapPriorityToLevelCode = (priority) => { + const priorityMap = { + 'high': 3, // 高 + 'medium': 2, // 中 + 'low': 1 // 低 + }; + return priorityMap[priority] || null; +}; + // 类型映射函数 - 页面类型转接口code const mapTypeToCode = (type) => { const typeMap = { @@ -647,10 +672,10 @@ const pagedTableData = computed(() => { let statusText = ''; switch (workOrderStatus.value) { case 'accepted': - statusText = '已接单'; + statusText = '已派单'; break; case 'pending': - statusText = '待处理'; + statusText = '待派单'; break; case 'executing': statusText = '执行中'; @@ -768,6 +793,7 @@ const getStepStatusText = (status) => { const handleSearch = () => { currentPage.value = 1; // 重置到第一页 + fetchWorkOrderList(); // 触发API请求获取数据 }; // 重置筛选 diff --git a/src/views/zhinengxunjian/paidanjilu.vue b/src/views/zhinengxunjian/paidanjilu.vue index 5b67d30..02984e0 100644 --- a/src/views/zhinengxunjian/paidanjilu.vue +++ b/src/views/zhinengxunjian/paidanjilu.vue @@ -39,8 +39,8 @@
- - + + @@ -792,10 +792,10 @@ const pagedTableData = computed(() => { let statusText = ''; switch (workOrderStatus.value) { case 'accepted': - statusText = '已接单'; + statusText = '已派单'; break; case 'pending': - statusText = '待处理'; + statusText = '待派单'; break; case 'executing': statusText = '执行中'; diff --git a/src/views/zhinengxunjian/qiangxiuguanli.vue b/src/views/zhinengxunjian/qiangxiuguanli.vue index c99fc6b..2c20fbc 100644 --- a/src/views/zhinengxunjian/qiangxiuguanli.vue +++ b/src/views/zhinengxunjian/qiangxiuguanli.vue @@ -35,7 +35,7 @@
- + @@ -419,7 +419,7 @@ import { qiangxiuDetail, qiangxiulist, addqiangxiu, updateqiangxiu } from '@/api import { xunjianUserlist } from '@/api/zhinengxunjian/xunjian'; const taskStatus = ref(''); const planType = ref('all'); -const executor = ref('all'); +const sendPerson = ref('all'); const keyword = ref(''); // 任务数据 - 添加了更多字段以展示滚动效果 const tasks = ref([]); @@ -457,7 +457,7 @@ const handleSearch = () => { const resetFilters = () => { taskStatus.value = 'all'; planType.value = 'all'; - executor.value = 'all'; + sendPerson.value = 'all'; keyword.value = ''; currentPage.value = 1; getTaskList(); @@ -1074,9 +1074,8 @@ async function getTaskList() { // 构建请求参数,包含筛选条件 const requestParams = { projectId: 1, - pageNum: currentPage.value, - pageSize: pageSize.value - // 严格匹配JSON数据结构 + pageNum: parseInt(currentPage.value, 10), + pageSize: parseInt(pageSize.value, 10) }; // 添加任务状态筛选条件 - 严格匹配JSON数据中的status字段 @@ -1088,7 +1087,7 @@ async function getTaskList() { 'completed': '3', 'delayed': '4' }; - requestParams.status = statusMap[taskStatus.value] || taskStatus.value; + requestParams.status = String(statusMap[taskStatus.value] || taskStatus.value); } // 添加故障类型筛选条件 - 严格匹配JSON数据中的type字段 @@ -1101,13 +1100,13 @@ async function getTaskList() { 'network': '4', 'environment': '5' }; - requestParams.type = typeMap[planType.value] || planType.value; + requestParams.type = String(typeMap[planType.value] || planType.value); } // 添加维修人员筛选条件 - 严格匹配JSON数据中的sendPerson字段 - if (executor.value && executor.value !== 'all') { - // 直接使用用户ID作为sendPerson参数 - requestParams.sendPerson = executor.value; + if (sendPerson.value && sendPerson.value !== 'all' && sendPerson.value !== '') { + // 转换为数字类型以匹配API期望的格式 + requestParams.sendPerson = parseInt(sendPerson.value, 10); } // 添加关键词搜索条件 @@ -1132,7 +1131,7 @@ async function getTaskList() { // 严格匹配JSON数据中的reportName字段 reporter: item.reportName || '未知报修人', // 严格匹配JSON数据中的sendPerson和sendPersonVo字段 - maintainer: item.sendPersonVo?.userName || '未分配', + maintainer: item.sendPersonVo?.userName || (item.sendPerson ? `用户ID: ${item.sendPerson}` : '未分配'), completeTime: item.reportFinishTime ? formatDate(item.reportFinishTime) : '', actionText: getActionText(item.status), @@ -1165,7 +1164,11 @@ async function getTaskList() { : mapped; tasks.value = filtered; - total.value = kw ? filtered.length : res.total || filtered.length; + if (res.total !== undefined) { + total.value = kw ? filtered.length : res.total; + } else { + total.value = filtered.length; + } } else { tasks.value = []; total.value = 0; diff --git a/src/views/zhinengxunjian/qiangxiujilu.vue b/src/views/zhinengxunjian/qiangxiujilu.vue index af1f822..b66cdf9 100644 --- a/src/views/zhinengxunjian/qiangxiujilu.vue +++ b/src/views/zhinengxunjian/qiangxiujilu.vue @@ -19,7 +19,7 @@
- +
@@ -456,8 +456,8 @@ const getTaskList = async () => { // 添加维修人员筛选条件 - 严格匹配JSON数据中的sendPerson字段 if (executor.value && executor.value !== 'all') { - // 直接使用用户ID作为sendPerson参数 - params.sendPerson = executor.value; + // 确保用户ID为字符串类型,与接口期望格式一致 + params.sendPerson = executor.value.toString(); } // 添加时间范围筛选条件 diff --git a/src/views/zhinengxunjian/renyuanzhuangtai.vue b/src/views/zhinengxunjian/renyuanzhuangtai.vue index ce97e86..6e9b97f 100644 --- a/src/views/zhinengxunjian/renyuanzhuangtai.vue +++ b/src/views/zhinengxunjian/renyuanzhuangtai.vue @@ -443,9 +443,6 @@ const handleInspectionManagement3 = () => { margin-bottom: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); } - -/* */ - /* 内容容器样式 */ .content-container { display: flex; diff --git a/src/views/zhinengxunjian/zhixingjilu.vue b/src/views/zhinengxunjian/zhixingjilu.vue index 2e4034a..59c66ea 100644 --- a/src/views/zhinengxunjian/zhixingjilu.vue +++ b/src/views/zhinengxunjian/zhixingjilu.vue @@ -39,8 +39,8 @@
- - + + @@ -1003,10 +1003,10 @@ const pagedTableData = computed(() => { let statusText = ''; switch (workOrderStatus.value) { case 'accepted': - statusText = '已接单'; + statusText = '已派单'; break; case 'pending': - statusText = '待处理'; + statusText = '待派单'; break; case 'executing': statusText = '执行中';