From 7607c05859288dc92e459c54166ca0b37a810a79 Mon Sep 17 00:00:00 2001
From: rjg <746338628@qq.com>
Date: Sat, 12 Apr 2025 15:54:49 +0800
Subject: [PATCH] fix:修改状态值

---
 src/views/tickets/ticket.vue |   48 ++++++++++++++++++++++++------------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 413e516..ed62c78 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -392,13 +392,13 @@
 
         <!-- 操作按钮 -->
         <div class="dialog-footer">
-          <template v-if="currentDetail.status === 1">
+          <template v-if="currentDetail.status === 2">
             <!-- 待审核 -->
             <el-button type="primary" @click="approveTicket">通过</el-button>
             <el-button type="danger" @click="rejectTicket">不通过</el-button>
             <el-button @click="detailVisible = false">取消</el-button>
           </template>
-          <template v-else-if="currentDetail.status === 2">
+          <template v-else-if="currentDetail.status === 0">
 
             <el-button type="primary" @click="approveAndDispatch">通过并派发</el-button>
             <el-button type="danger" @click="rejectTicket">不通过</el-button>
@@ -458,8 +458,8 @@
       activeTab: "all",
       tabs: [
         { label: "全部工单", name: "all", value: null, count: 0 },
-        { label: "待审核", name: "pending", value: 1, count: 0 },
-        { label: "待处理", name: "processing", value: 2, count: 0 },
+        { label: "待审核", name: "pending", value: 2, count: 0 },
+        { label: "待处理", name: "processing", value: 0, count: 0 },
         { label: "处理中", name: "inProgress", value: 3, count: 0 },
         { label: "已完成", name: "completed", value: 4, count: 0 },
         { label: "已完结", name: "closed", value: 5, count: 0 },
@@ -482,8 +482,8 @@
 
       algorithms: [],
       statuses: [
-        { label: "待审核", value: "1" },
-        { label: "待处理", value: "2" },
+        { label: "待审核", value: "2" },
+        { label: "待处理", value: "0" },
         { label: "处理中", value: "3" },
         { label: "已完成", value: "4" },
         { label: "已完结", value: "5" },
@@ -589,7 +589,7 @@
         {
           label: "工单名称",
           value: this.currentDetail.orderName,
-          editable: this.currentDetail.status === 2,
+          editable: this.currentDetail.status === 0,
           type: "input",
         },
         {
@@ -615,7 +615,7 @@
         {
           label: "工单类型",
           value: this.currentDetail.type,
-          editable: this.currentDetail.status === 2,
+          editable: this.currentDetail.status === 0,
           type: "select",
           options: this.types,
         },
@@ -637,23 +637,23 @@
         {
           label: "工单内容",
           value: this.currentDetail.remarkContent,
-          editable: this.currentDetail.status === 2,
+          editable: this.currentDetail.status === 0,
           type: "textarea",
         },
       ];
     },
     detailFields() {
       return [
-        { label: "工单名称", value: this.currentDetail.orderName, editable: this.currentDetail.status === 2, type: "input" },
+        { label: "工单名称", value: this.currentDetail.orderName, editable: this.currentDetail.status === 0, type: "input" },
         { label: "关键任务", value: this.currentDetail.keyData, editable: false },
         { label: "任务发起人", value: this.currentDetail.creator, editable: false },
         { label: "当前状态", value: this.mapStatus(this.currentDetail.status), editable: false },
         { label: "事件地址", value: this.currentDetail.address, editable: false },
-        { label: "工单类型", value: this.currentDetail.type, editable: this.currentDetail.status === 2, type: "select", options: this.types },
+        { label: "工单类型", value: this.currentDetail.type, editable: this.currentDetail.status === 0, type: "select", options: this.types },
         { label: "关联算法", value: this.currentDetail.content, editable: false },
         { label: "任务接收单位", value: this.currentDetail.department, editable: false },
         { label: "发起任务时间", value: this.currentDetail.startTime, editable: false },
-        { label: "工单内容", value: this.currentDetail.remarkContent, editable: this.currentDetail.status === 2, type: "textarea" },
+        { label: "工单内容", value: this.currentDetail.remarkContent, editable: this.currentDetail.status === 0, type: "textarea" },
       ];
     },
     formattedDetailFields() {
@@ -978,24 +978,24 @@
 
     mapStatus(status) {
       const statusTextMap = {
-        0: "草稿",  // 添加草稿状态
-        1: "待审核",
-        2: "待处理",
-        3: "处理中",
-        4: "已完成",
-        5: "已完结"
+        "-1": "草稿",  // 添加草稿状态
+        "2": "待审核",
+        "0": "待处理",
+        "3": "处理中",
+        "4": "已完成",
+        "5": "已完结"
       };
       return statusTextMap[status] || "未知状态";
     },
 
     getStatusTagType(status) {
       const statusMap = {
-        0: "info",    // 为草稿状态添加样式
-        1: "warning",
-        2: "info",
-        3: "primary",
-        4: "success",
-        5: "danger",
+        "-1": "info",    // 为草稿状态添加样式
+        "2": "warning",
+        "0": "info",
+        "3": "primary",
+        "4": "success",
+        "5": "danger",
       };
       return statusMap[status] || "info";
     },

--
Gitblit v1.9.3