-
-
+
+
@@ -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 @@
-
+