From 8ba602b2f08724c1b92ef1e90f89a6fa33861577 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 30 八月 2025 11:52:31 +0800
Subject: [PATCH] 锁定加上锁定原因

---
 src/api/flow/todolist.js                   |   11 +++
 src/views/wel/shemi.vue                    |  130 ++++++++++++++++++++++++++++++-------------
 src/views/flow/components/TodolistLeft.vue |   24 +++++++-
 src/views/flowmgr/processQuery1.vue        |    5 +
 src/views/flowmgr/processQuery2.vue        |    7 +-
 5 files changed, 129 insertions(+), 48 deletions(-)

diff --git a/src/api/flow/todolist.js b/src/api/flow/todolist.js
index 0457f0a..2cd7e8e 100644
--- a/src/api/flow/todolist.js
+++ b/src/api/flow/todolist.js
@@ -132,4 +132,15 @@
     method: 'post',
     data: data,
   })
+}
+
+//鑾峰彇閿佸畾鍘熷洜
+export const queryLockRemark = nodeId => {
+  return request({
+    url: '/blade-mdm/program/node/query-lock-remark',
+    method: 'get',
+    params: {
+      id:nodeId
+    },
+  })
 }
\ No newline at end of file
diff --git a/src/views/flow/components/TodolistLeft.vue b/src/views/flow/components/TodolistLeft.vue
index ae2ca24..38ef9eb 100644
--- a/src/views/flow/components/TodolistLeft.vue
+++ b/src/views/flow/components/TodolistLeft.vue
@@ -11,8 +11,9 @@
             <el-button type="primary" plain @click="addApp">娣诲姞鏂囦欢
             </el-button>
         </div>
-         <el-text type="danger"  v-if="row.variables.curedLocked === 'Y'">鍥哄寲绋嬪簭宸插姞閿侊紝璇疯皑鎱庝娇鐢�</el-text>
-         <el-text type="danger"  v-if="row.variables.hasCuredProgram==='Y' && row.variables.isProcessEditionSame=='N' && row.variables.cureProgramUseable==undefined">宸插浐鍖栫▼搴忓伐搴忕増娆′笉涓�鑷达紝娲惧伐鐗堟:{{row.variables.processEdition}},宸插浐鍖栫増娆★細{{row.variables.curedProcessEdition}}</el-text>
+         <el-text type="danger" v-if="row.variables.curedLocked === 'Y'">鍥哄寲绋嬪簭宸查攣瀹氾紝璇疯皑鎱庝娇鐢ㄣ�傞攣瀹氬師鍥狅細{{ remark }}</el-text>
+         <el-text type="danger" v-if="row.processDefinitionKey === 'program-unlock'">绋嬪簭宸查攣瀹氾紝閿佸畾鍘熷洜锛歿{ remark }}</el-text>
+         <el-text type="danger" v-if="row.variables.hasCuredProgram==='Y' && row.variables.isProcessEditionSame=='N' && row.variables.cureProgramUseable==undefined">宸插浐鍖栫▼搴忓伐搴忕増娆′笉涓�鑷达紝娲惧伐鐗堟:{{row.variables.processEdition}},宸插浐鍖栫増娆★細{{row.variables.curedProcessEdition}}</el-text>
         <el-table :data="tableData" border @row-click="showContent" max-height="200" highlight-current-row>
             <!-- <el-table-column prop="machineCode" label="鍔犲伐鏈哄簥">
             </el-table-column> -->
@@ -83,7 +84,7 @@
 </template>
 
 <script>
-import { getAppList,getFileData, getSelectedAppList, getContent, removeAtt } from '@/api/flow/todolist';
+import { getAppList,getFileData, getSelectedAppList, getContent, removeAtt,queryLockRemark } from '@/api/flow/todolist';
 import { exportBlob } from '@/api/common';
 import { getToken } from '@/utils/auth';
 import NProgress from 'nprogress';
@@ -188,11 +189,14 @@
                     // },
                 ],
             },
+
+            remark:'',//閿佸畾鍘熷洜
         }
     },
     mounted() {
         this.getAttList();
         this.getFileData();
+        this.getLockRemark();//鑾峰彇閿佸畾鍘熷洜
         this.onLoad(this.page);
         
     },
@@ -207,6 +211,20 @@
                 }
             })
         },
+        getLockRemark () {
+            //鑾峰彇閿佸畾鍘熷洜
+            let nodeId = this.row.variables.nodeId;
+            if(!nodeId){
+                nodeId = this.row.variables.curedNodeId;
+            }
+            queryLockRemark(nodeId).then(res => {
+                if (res.data.code == 200) {
+                    this.remark = res.data.data || '';
+                } else {
+                    this.remark = '';
+                }
+            })
+        },
         diffFile(index, row) {
             console.log(row)
             axios({
diff --git a/src/views/flowmgr/processQuery1.vue b/src/views/flowmgr/processQuery1.vue
index 43bf3d3..eb020dd 100644
--- a/src/views/flowmgr/processQuery1.vue
+++ b/src/views/flowmgr/processQuery1.vue
@@ -149,7 +149,7 @@
 					{
                         label: '娴佺▼鍚嶇О',
                         prop: '',
-                        width: 80,
+                        width: 85,
 						render: ({ row }) => {
                             return h('p',
                                 {
@@ -162,7 +162,7 @@
                     {
                         label: '鎵规鍙�',
                         prop: 'variables.craftEdition',
-                        width: 80,
+                        width: 70,
                         render: ({ row }) => {
                             return h('span', {}, row?.variables?.craftEdition || '');
                         }
@@ -336,6 +336,7 @@
                     {
                         label: '鎵规鍙�',
                         prop: 'variables.craftEdition',
+                        
                         render: ({ row }) => {
                             return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || '');
                         }
diff --git a/src/views/flowmgr/processQuery2.vue b/src/views/flowmgr/processQuery2.vue
index 1647e89..12abaec 100644
--- a/src/views/flowmgr/processQuery2.vue
+++ b/src/views/flowmgr/processQuery2.vue
@@ -12,9 +12,7 @@
             @selection-change="selectionChange">
             
             <template #menu-left>
-                <!-- <el-button type="primary" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button> 
-                -->
-             
+                
             </template>
             <template #menu="scope">
                 <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">鏌ョ湅
@@ -22,6 +20,9 @@
                <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'dispatch'"
                     @click.stop="handleApproveTable(scope.row, scope.index)">瀹℃壒琛�
                 </el-button>
+                 <!--
+                  v-if="scope.row.processDefinitionKey === 'program-cure'"
+                -->
                 <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'program-cure'"
                     @click.stop="handleConfirmTable(scope.row, scope.index)">纭琛�
                 </el-button>
diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index 99928f5..c8605ec 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -58,10 +58,10 @@
             icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
           <el-button :size="size" text
             v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
-            icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+            icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
           <el-button :size="size" text
             v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
-            icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+            icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
         </template>
       </avue-crud>
     </div>
@@ -109,24 +109,16 @@
       </template> -->
         <template #name="{ row }">
           <span>{{ row.name }}</span>
-          <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="淇敼" @click="showEdit(row)" title="淇敼"></el-button>
-        <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="鍒犻櫎" title="鍒犻櫎"></el-button>
-        <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="鏂板瀛愮骇" title="鏂板瀛愮骇"></el-button>
-        <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="鏂囦欢涓婁紶" title="鏂囦欢涓婁紶"></el-button> -->
-          <!-- 娑夊瘑缃戞墠鏈� -->
-          <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button> -->
-          <!-- 宸ユ帶缃戞墠鏈� -->
-          <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
-
+          
           <!-- 鏇挎崲  v-if="permission.auto_dispatch"-->
           <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="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
-            icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+            icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
           <el-button :size="size" text
             v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
-            icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+            icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
         </template>
       </avue-crud>
     </div>
@@ -145,6 +137,12 @@
         </template>
       </avue-form>
     </el-dialog>
+
+    <!-- 閿佸畾瀵硅瘽妗� -->
+    <el-dialog title="绋嬪簭閿佸畾" append-to-body v-model="lockBox">
+      <avue-form :option="lockOption" v-model="lockForm" @submit="lockSubmit" @reset-change="lockCancel" />
+    </el-dialog>
+    
     <avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs>
     <avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form>
     <!--<span v-else-if="tabsType == 'tab2'">鐗堟湰淇℃伅</span>-->
@@ -439,6 +437,32 @@
       },
       modalBox: false,
       modalTitle: "",
+
+      lockOption: {
+        submitText: "閿佸畾",
+        emptyText: "鍙栨秷",
+        menuPosition: "right",
+        column: [
+          {
+            label: '绋嬪簭鍖呭悕',
+            prop: 'name',
+            disabled:true,
+            labelWidth: "120",
+          },
+          
+          {
+            label: '閿佸畾鍘熷洜',
+            prop: 'remark',
+            type: "textarea",
+            labelWidth: "120",
+            span: 24,
+            rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+          }
+        ]
+      },
+      lockForm: {},
+      lockBox: false,
+
       id: "",
       parentId: 1,
       loading: true,
@@ -509,22 +533,7 @@
                 return '';
               }
             }
-          },/*
-          {
-            label: '鐗堟',
-            prop: 'processEdition',
-            formatter: (val, value, label) => {
-                if(val.nodeType == '60'){
-                    return value;
-                }else{
-                    return '';
-                }
-            }
           },
-          {
-            label: '鎻忚堪',
-            prop: 'abc'
-          },*/
           {
             label: '绫诲瀷',
             prop: 'nodeTypeName'
@@ -567,11 +576,7 @@
                 }
               }
             },
-          },/*
-          {
-            label: '娴嬭瘯绋嬪簭',
-            prop: 'abc'
-          },*/
+          },
           {
             label: '鍒涘缓浜�',
             prop: 'createUserName',
@@ -765,22 +770,55 @@
         this.drawingNoList = [];
       }
     },
-    locked(row, isLockP) {
-      //row.isLocked == isLock
-      var isLock = row.isLocked == 1;
-      console.log('isLock', isLock)
-      this.$confirm(`鏄惁${isLock ? '瑙i攣' : '閿佸畾'}`, {
+    showLockDlg(row){
+      this.lockForm = row;
+     //this.lockForm.name = row.name;
+     // this.lockForm.id = row.id;
+      this.lockForm.remark = '';
+      this.lockBox = true;
+    },
+    lockCancel() {
+      this.lockBox = false;
+      this.lockForm = {};
+    },
+    lockSubmit() {  
+      //閿佸畾鎻愪氦
+      this.$confirm('鏄惁閿佸畾', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
         type: 'warning',
       }).then(() => {
         axios({
-          url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock',
+          url: '/blade-mdm/program/node/lock',
           method: 'post',
-          params: { id: row.id, nodeId: row.id }
+          params: this.lockForm
         }).then(res => {
           if (res.data.code == 200) {
             this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' });
+            this.addLocalTreeNode(this.lockForm.parentId);
+            this.lockBox = false;
+          } else {
+            this.$message({ type: 'success', message: res.data.msg });
+          }
+        });
+      }).catch(action => {
+        console.log('cancel')
+      });
+    },
+    startUnlock(row) {
+      //鍚姩瑙i攣娴佺▼
+      this.$confirm(`鏄惁瑙i攣`, {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning',
+      }).then(() => {
+        axios({
+          url: '/blade-mdm/flow/lock/start-unlock',
+          method: 'post',
+          params: {nodeId: row.id }
+        }).then(res => {
+          if (res.data.code == 200) {
+            this.$message({ type: 'success', message: '瑙i攣娴佺▼宸插惎鍔�!' });
             this.addLocalTreeNode(row.parentId);
           } else {
             this.$message({ type: 'success', message: res.data.msg });
@@ -843,6 +881,18 @@
     todoSelectionChange(applist) {
       this.applist = applist;
     },
+    showReplaceDlg(row) {  //鏇挎崲瀵硅瘽妗�
+      
+      if (row.nodeType == 60) { //绋嬪簭鍖�
+        return;
+      }
+      //111
+      this.modalTitle = "鏂板瀛愯妭鐐�";
+      this.selectedColumn.parentId = row.id;
+      this.modalForm = this.selectedColumn;
+      
+      this.modalBox = true;
+    },
     replacement(row) {  //鏇挎崲
       this.id = row.id;
       this.formApprove = {

--
Gitblit v1.9.3