From c96108bd84050feb01b47db3f5cae96670fda435 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 30 十月 2024 12:54:24 +0800
Subject: [PATCH] 2024-10-30

---
 src/utils/utils.js |   82 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index d63640a..a93c540 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -71,6 +71,7 @@
       uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
     }
     uuid = timestamp + uuid.join('')
+    uuid = uuid.replace(/minke/ig, 'mnkie')
     return uuid
   }
 
@@ -416,7 +417,11 @@
           item.$first = true
         }
       }
-      
+
+      if (window.backend && ['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type) && item.resourceType === '1') {
+        item.uuid = md5(config.uuid + item.uuid)
+      }
+
       item.oriInitval = item.initval
 
       if (values) {
@@ -714,6 +719,15 @@
 
   static getSearchkeys (searches) {
     let searchText = []
+    let matchs = {
+      'like': '01',
+      'not like': '02',
+      '=': '03',
+      '>': '04',
+      '<': '05',
+      '>=': '06',
+      '<=': '07',
+    }
 
     searches.forEach(item => {
       if (item.forbid || !item.value) return
@@ -834,17 +848,21 @@
         searchText.push({
           key: item.key,
           match: '>=',
-          type: 'number',
+          type: 'text',
           value: val[0] || -999999999
         }, {
           key: item.key,
           match: '<=',
-          type: 'number',
+          type: 'text',
           value: val[1] || 999999999
         })
       } else {
         searchText.push(cell)
       }
+    })
+
+    searchText.forEach(item => {
+      item.match = matchs[item.match] || '01'
     })
 
     return searchText
@@ -2606,6 +2624,10 @@
       error = '琛屼俊鎭腑鏃犲伐浣滄祦鍙傛暟'
     }
 
+    if (!error && verify.flowSql !== 'true' && verify.flowType !== 'start' && line && line.approvalMethod === 'countersign') {
+      error = '浼氱娴佺▼闇�瑕佷娇鐢ㄩ粯璁よ剼鏈�'
+    }
+
     if (error) {
       status = 0
       statusName = '寮傚父'
@@ -2654,6 +2676,33 @@
 
         _sql += `
       /* 宸ヤ綔娴侀粯璁ql */
+      set @retmsg =''
+      select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id
+
+      if @retmsg =''
+      begin
+          select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id
+          if @retmsg !=''
+          begin
+              select @ErrorCode='E', @retmsg='褰撳墠鍗曟嵁宸插鏍革紝璇峰埛鏂板悗閲嶈瘯'
+              goto aaa
+          end
+
+          set @retmsg =''
+          select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id
+
+          if @retmsg !=''
+          begin
+              select @retmsg=workerCode+workerName from BD_workers where id=@retmsg 
+
+              select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺锛岃鑱旂郴'+@retmsg+'鎿嶄綔'
+              goto aaa
+          end
+
+          select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺'
+          goto aaa
+      end
+
       declare ${_declare},@works_flow_key_id nvarchar(50),@works_flow_key_status nvarchar(20),@s_my_works_flow_log_param  nvarchar(max),@s_my_works_flow_log_status int,@s_my_works_flow_log_statusname nvarchar(50),@s_my_works_flow_log_detail_id  nvarchar(50)
       select ${_select},@works_flow_key_id='',@works_flow_key_status ='',@s_my_works_flow_log_param='',@s_my_works_flow_log_status=0,@s_my_works_flow_log_statusname='',@s_my_works_flow_log_detail_id=''
 
@@ -2710,32 +2759,45 @@
         _sql += `
       /* 宸ヤ綔娴侀粯璁ql */
       set @retmsg =''
-      select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@
+      select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id
 
       if @retmsg =''
       begin
-          select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@
+          select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id
 
           if @retmsg !=''
           begin
               select @ErrorCode='E', @retmsg='褰撳墠鍗曟嵁宸插鏍革紝璇峰埛鏂板悗閲嶈瘯'
-            goto aaa
+              goto aaa
           end
 
           if @dataM@ !='' 
           begin
             set @retmsg =''
-            select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0  
+            select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id
 
             if @retmsg != ''
             begin
                 goto goto_mk
             end
           end
+          else
+          begin
+              set @retmsg =''
+              select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id
+              
+              if @retmsg !=''
+              begin
+                  select @retmsg=workerCode+workerName from BD_workers where id=@retmsg 
+                  
+                  select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺锛岃鑱旂郴'+@retmsg+'鎿嶄綔'
+                  goto aaa 
+              end
+          end
 
           select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺'
-            goto aaa 
-      end 
+          goto aaa 
+      end
 
       goto_mk:
 
@@ -2749,7 +2811,7 @@
       update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname 
       where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
 
-      ${line.mknode === 'startEdge' ? `update s_my_works_flow_role set deleted=0,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname 
+      ${line.mknode === 'startEdge' ? `update s_my_works_flow_role set deleted=0,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname,works_flow_detail_id=@works_flow_detail_id@ 
       where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and typecharone='begin'` : ''}
 
       if @check_userids@ != ''

--
Gitblit v1.8.0