From 87ec88423e4cd55f202755f7427e269c242189ff Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期一, 18 八月 2025 12:09:08 +0800
Subject: [PATCH] 增加替换上传异常处理

---
 src/views/wel/shemi.vue |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index ad9344b..6ec8895 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -46,8 +46,8 @@
         <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
         <!-- 鏇挎崲 -->
         <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,')>-1" icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
-        <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,2')>-1" icon="el-icon-lock" type="primary" @click="locked(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
-        <!-- <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,2')>-1" icon="el-icon-unlock" type="primary" @click="locked(row)" placeholder="瑙i攣" title="瑙i攣"></el-button> -->
+        <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,2')>-1 && !row.isLocked" icon="el-icon-lock" type="primary" @click="locked(row,true)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+        <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,2')>-1 && row.isLocked" icon="el-icon-unlock" type="primary" @click="locked(row,false)" placeholder="瑙i攣" title="瑙i攣"></el-button>
       </template>
     </avue-crud>
     <!-- 鏂板鑺傜偣 -->
@@ -630,16 +630,18 @@
     
   },
   methods: {
-    locked(row) {
-      this.$confirm('鏄惁閿佸畾鍚�?', {
+    locked(row, isLock) {
+      row.isLocked == isLock
+      this.$confirm(`鏄惁${isLock ? '閿佸畾' : '瑙i攣'}`, {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
         type: 'warning',
       }).then(() => {
+
         axios({
-          url: '/blade-mdm/program/node/lock',
+          url: isLock ? '/blade-mdm/program/node/lock' : '/blade-mdm/flow/lock/start-unlock',
           method: 'post',
-          params: {id: row.id}
+          params: {id: row.id,nodeId: row.id}
         }).then(res => {
           if(res.data.code == 200) {
             this.$message({type: 'success',message: '鎿嶄綔鎴愬姛!'});
@@ -655,7 +657,7 @@
         title: this.formApprove.title,
         nodeId: this.id,
         tempInstanceId: this.replaceDataId,
-		comment: this.formApprove.comment,
+		    comment: this.formApprove.comment,
         assignee: this.formApprove.assignee
       }
       axios({
@@ -663,14 +665,17 @@
         method: 'post',
         data: obj
       }).then(
-      resp => {
-        this.$message({
-          type: 'success',
-          message: '鎿嶄綔鎴愬姛!',
+        resp => {
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!',
+          });
+          done();
+          this.todolistModel = false;
+        }).catch(error =>{
+          window.console.log('haha',error);
+          done();
         });
-        done();
-        this.todolistModel = false;
-      });
       // if(this.row.taskDefinitionKey === 'programmingTask') {
       //     // if(this.applist.length !== 1) {
       //     //     done();

--
Gitblit v1.9.3