Kaynağa Gözat

fix:任务进度页面任务中止状态的主任务添加恢复按钮,去掉代办按钮

luzhixia 1 hafta önce
ebeveyn
işleme
92fa8be2b8

+ 51 - 3
src/views/costAudit/projectInfo/auditTaskManage/taskProgressManage/index.vue

@@ -107,6 +107,13 @@
               中止
             </el-button>
             <el-button
+              v-if="row.status == '300'"
+              type="text"
+              @click="handleHf(row)"
+            >
+              恢复
+            </el-button>
+            <el-button
               v-if="row.status != 400 && row.status != 300"
               size="mini"
               type="text"
@@ -122,14 +129,14 @@
             >
               督办
             </el-button>
-            <el-button
+            <!-- <el-button
               v-if="row.status != 400 && row.status != 300"
               size="mini"
               type="text"
               @click="handleToDo(row)"
             >
               代办
-            </el-button>
+            </el-button> -->
           </template>
         </template>
         <template slot="empty">
@@ -499,7 +506,7 @@
           {
             prop: 'action',
             label: '操作',
-            width: 260,
+            width: 240,
             align: 'center',
             slotName: 'action',
           },
@@ -791,6 +798,47 @@
             this.$message.error('操作失败')
           })
       },
+      // 恢复任务
+      async handleHf(row) {
+        if (!row || !row.id) {
+          this.$message.error('缺少任务ID')
+          return
+        }
+
+        // 弹出确认对话框
+        this.$confirm('确定要恢复此任务吗?', '恢复任务', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(async () => {
+            try {
+              const params = {
+                taskId: row.id,
+                key: 2,
+                status: 200,
+                processNodeKey: row.currentNode,
+              }
+
+              const response = await doProcessBtn(params)
+
+              if (response && response.code === 200) {
+                this.$message.success('恢复任务成功')
+                // 刷新列表
+                this.generateTableData()
+              } else {
+                this.$message.error(response?.message || '恢复任务失败')
+              }
+            } catch (error) {
+              // this.$message.error('恢复任务失败')
+              console.error('恢复任务失败:', error)
+            }
+          })
+          .catch(() => {
+            // 用户取消操作
+            this.$message.info('已取消恢复任务')
+          })
+      },
       // 任务督办相关方法
       handleUrge(row) {
         console.log('任务督办:', row)