From ba4d6e414fbb37121e80815d3f5ab1aca7a60b08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 28 十月 2024 13:59:34 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/views/pcdesign/index.jsx                                          |    2 
 src/tabviews/zshare/topSearch/index.jsx                               |    8 
 src/views/mobdesign/menuform/index.jsx                                |   17 ++
 src/views/pcdesign/menuform/index.jsx                                 |   17 ++
 src/menu/components/share/actioncomponent/formconfig.jsx              |    2 
 src/menu/datasource/verifycard/settingform/index.jsx                  |   13 +
 src/templates/zshare/verifycard/index.jsx                             |   56 +++---
 src/menu/datasource/verifycard/customscript/index.jsx                 |    4 
 src/utils/utils-custom.js                                             |   56 ++++++-
 src/templates/zshare/verifycard/customscript/index.jsx                |   47 +++++
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |    6 
 src/views/menudesign/menuform/index.jsx                               |   17 ++
 src/tabviews/custom/popview/index.jsx                                 |    8 +
 src/tabviews/zshare/mutilform/index.jsx                               |   48 +++--
 src/views/tabledesign/index.jsx                                       |    2 
 src/views/tabledesign/menuform/index.jsx                              |   20 ++
 src/tabviews/basetable/index.jsx                                      |    8 +
 src/tabviews/custom/index.jsx                                         |    8 +
 src/menu/debug/index.jsx                                              |   25 +++
 src/tabviews/zshare/actionList/normalbutton/index.jsx                 |    4 
 src/views/mobdesign/index.jsx                                         |    2 
 src/views/menudesign/index.jsx                                        |    6 
 src/menu/datasource/verifycard/index.jsx                              |    4 
 src/utils/utils.js                                                    |   56 ++++++
 24 files changed, 356 insertions(+), 80 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index e1544de..f9105db 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1459,7 +1459,7 @@
       initVal: card.permission || 'true',
       required: false,
       options: [
-        {value: 'true', text: '缁ф壙鑿滃崟'},
+        {value: 'true', text: '缁ф壙缁勪欢'},
         {value: 'false', text: '绂佺敤'},
       ],
       forbid: viewType === 'popview'
diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx
index 1a6b210..d9e4d04 100644
--- a/src/menu/datasource/verifycard/customscript/index.jsx
+++ b/src/menu/datasource/verifycard/customscript/index.jsx
@@ -142,11 +142,11 @@
     if (value === 'defaultsql') {
       value = this.props.defaultsql
     } else if (value === 'flowstart') {
-      value = `/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.modifydate as modifydate_w  from (select * from ${setting.tableName} where status=0 and deleted=0 $@ and createuserid=@userid@ @$) a
+      value = `/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w  from (select * from ${setting.tableName} where status=0 and deleted=0 $@ and createuserid=@userid@ @$) a
       inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */`
       this.props.addProcess()
     } else if (value === 'flowcheck') {
-      value = `/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.modifydate as modifydate_w  
+      value = `/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w  
       from (select * from ${setting.tableName} where status=0 and deleted=0 ) a
       inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status>0 and status<888 and deleted=0) w 
       on a.id=w.works_flow_id 
diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 500966b..f2aed28 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -1118,6 +1118,10 @@
       fields.push({ uuid: Utils.getuuid(), label: '鐘舵��', field: 'statusname_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' })
       cols.push({ uuid: Utils.getuuid(), Width: 120, label: '鐘舵��', field: 'statusname_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 })
     }
+    if (!_cols.includes('works_flow_detail_id')) {
+      fields.push({ uuid: Utils.getuuid(), label: '娴佺▼鑺傜偣ID', field: 'works_flow_detail_id', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' })
+      cols.push({ uuid: Utils.getuuid(), Width: 120, label: '娴佺▼鑺傜偣ID', field: 'works_flow_detail_id', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 })
+    }
     if (!_cols.includes('works_flow_param')) {
       fields.push({ uuid: Utils.getuuid(), label: '娴佺▼鍙傛暟', field: 'works_flow_param', datatype: 'Nvarchar(512)', fieldlength: 512, type: 'text' })
       cols.push({ uuid: Utils.getuuid(), Width: 120, label: '娴佺▼鍙傛暟', field: 'works_flow_param', type: 'text', Hide: 'true', IsSort: 'false', fieldlength: 512 })
diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index 7e5f409..87940cc 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -148,10 +148,10 @@
     let tableName = this.props.form.getFieldValue('tableName') || '琛ㄥ悕'
 
     if (type === 'flowstart') {
-      _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.modifydate as modifydate_w  from (select * from ${tableName} where status=0 and deleted=0 $@ and createuserid=@userid@ @$) a
+      _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w  from (select * from ${tableName} where status=0 and deleted=0 $@ and createuserid=@userid@ @$) a
     inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */`
     } else if (type === 'flowcheck') {
-      _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.modifydate as modifydate_w  
+      _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w  
     from (select * from ${tableName} where status=0 and deleted=0 ) a
     inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status>0 and status<888 and deleted=0) w 
     on a.id=w.works_flow_id 
@@ -597,8 +597,13 @@
                 )}
               </Form.Item>
             </Col> : null}
-            {window.backend && setting.interType === 'system' ? <Col span={8}>
-              <Form.Item label="浜嬪姟">
+            {setting.interType === 'system' ? <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  浜嬪姟
+                </Tooltip>
+              }>
                 {getFieldDecorator('transact', {
                   initialValue: setting.transact || 'false'
                 })(
diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx
index cdbc753..d9d6921 100644
--- a/src/menu/debug/index.jsx
+++ b/src/menu/debug/index.jsx
@@ -292,6 +292,8 @@
     components.forEach(item => {
       if (item.type === 'tabs') {
         item.subtabs.forEach(tab => {
+          if (tab.hide === 'true') return
+
           let _mainSearch = mainSearch || []
 
           if (appType !== 'mob') {
@@ -845,6 +847,25 @@
         })
       }
     }
+
+    if (formdata && formdata.findIndex(item => item.type === 'vercode') > -1) {
+      formdata.push({
+        type: 'text',
+        fieldlen: 50,
+        writein: false,
+        key: 'mk_timestamp'
+      }, {
+        type: 'text',
+        fieldlen: 50,
+        writein: false,
+        key: 'mk_send_type'
+      }, {
+        type: 'text',
+        fieldlen: 50,
+        writein: false,
+        key: 'mk_n_id'
+      })
+    }
     // 鑾峰彇瀛楁閿�煎
     formdata && formdata.forEach(form => {
       let _key = form.key.toLowerCase()
@@ -877,6 +898,8 @@
         } else if (form.type === 'rate') {
           _type = `decimal(18,2)`
         }
+
+        if (['appkey'].includes(_key)) return
   
         _declarefields.push(`@${_key} ${_type}`)
       }
@@ -900,7 +923,7 @@
           }
         }
         
-        if (!_vars.includes(_key)) {
+        if (!_vars.includes(_key) && !['appkey'].includes(_key)) {
           _vars.push(_key)
           _declarefields.push(`@${_key} ${col.datatype || 'nvarchar(50)'}`)
         }
diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index 9af687c..c1a63d8 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -554,12 +554,20 @@
         }
         if (/#position-inner/.test(script)) {
           cell.$innerScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_' + cell.uuid)
+          }
         }
         if (/#position-outer/.test(script)) {
           cell.$outerScript = script
         }
         if (/#position-callback/.test(script)) {
           cell.$callbackScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_back_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_back_' + cell.uuid)
+          }
         }
       }
     }
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 03add13..c5678a8 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1968,7 +1968,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(param, false).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -2007,7 +2007,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(mainparam, false).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -2102,7 +2102,7 @@
     deffers = deffers.map(item => {
       return new Promise(resolve => {
         Api.getSystemCacheConfig(item, false).then(res => {
-          if (!res.status) {
+          if (!res.status && res.ErrCode !== '-2') {
             notification.warning({
               top: 92,
               message: res.message,
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 8e29805..b11b3f9 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -1020,12 +1020,20 @@
         }
         if (/#position-inner/.test(script)) {
           cell.$innerScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_' + cell.uuid)
+          }
         }
         if (/#position-outer/.test(script)) {
           cell.$outerScript = script
         }
         if (/#position-callback/.test(script)) {
           cell.$callbackScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_back_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_back_' + cell.uuid)
+          }
         }
       }
     }
diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index 71b9453..7e8fca6 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -712,12 +712,20 @@
         }
         if (/#position-inner/.test(script)) {
           cell.$innerScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_' + cell.uuid)
+          }
         }
         if (/#position-outer/.test(script)) {
           cell.$outerScript = script
         }
         if (/#position-callback/.test(script)) {
           cell.$callbackScript = script
+
+          if (window.backend && window.GLOB.CacheData.has('sql_back_' + cell.uuid) && !/\$backend/.test(script)) {
+            window.GLOB.CacheData.delete('sql_back_' + cell.uuid)
+          }
         }
       }
     }
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index aba982e..9be2a57 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1080,6 +1080,10 @@
         error = '琛屼俊鎭腑鏃犲伐浣滄祦鍙傛暟'
       }
 
+      if (!error && btn.verify.flowSql !== 'true' && btn.verify.flowType !== 'start' && line && line.approvalMethod === 'countersign') {
+        error = '浼氱娴佺▼闇�瑕佷娇鐢ㄩ粯璁よ剼鏈�'
+      }
+
       if (error) {
         status = 0
         statusName = '寮傚父'
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 53398a4..d39ad0a 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -940,11 +940,13 @@
       return new Promise(resolve => {
         Api.getSystemCacheConfig(item, cache).then(res => {
           if (!res.status) {
-            notification.warning({
-              top: 92,
-              message: res.message,
-              duration: 5
-            })
+            if (res.ErrCode !== '-2') {
+              notification.warning({
+                top: 92,
+                message: res.message,
+                duration: 5
+              })
+            }
             skip = true
           }
           resolve(res)
@@ -1036,11 +1038,13 @@
         new Promise(resolve => {
           Api.getSystemCacheConfig(param, cache).then(res => {
             if (!res.status) {
-              notification.warning({
-                top: 92,
-                message: res.message,
-                duration: 5
-              })
+              if (res.ErrCode !== '-2') {
+                notification.warning({
+                  top: 92,
+                  message: res.message,
+                  duration: 5
+                })
+              }
               skip = true
             }
             resolve(res)
@@ -1078,11 +1082,13 @@
         new Promise(resolve => {
           Api.getSystemCacheConfig(mainparam, cache).then(res => {
             if (!res.status) {
-              notification.warning({
-                top: 92,
-                message: res.message,
-                duration: 5
-              })
+              if (res.ErrCode !== '-2') {
+                notification.warning({
+                  top: 92,
+                  message: res.message,
+                  duration: 5
+                })
+              }
               skip = true
             }
             resolve(res)
@@ -1148,11 +1154,13 @@
           setTimeout(() => {
             Api.getSystemCacheConfig(param, cache).then(res => {
               if (!res.status) {
-                notification.warning({
-                  top: 92,
-                  message: res.message,
-                  duration: 5
-                })
+                if (res.ErrCode !== '-2') {
+                  notification.warning({
+                    top: 92,
+                    message: res.message,
+                    duration: 5
+                  })
+                }
                 skip = true
               }
               resolve(res)
diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index 8d6fe6d..6e31879 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -543,7 +543,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(param).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -588,7 +588,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(mainparam).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -637,7 +637,7 @@
     deffers = deffers.map(item => {
       return new Promise(resolve => {
         Api.getSystemCacheConfig(item).then(res => {
-          if (!res.status) {
+          if (!res.status && res.ErrCode !== '-2') {
             notification.warning({
               top: 92,
               message: res.message,
@@ -692,7 +692,7 @@
         new Promise(resolve => {
           setTimeout(() => {
             Api.getSystemCacheConfig(param).then(res => {
-              if (!res.status) {
+              if (!res.status && res.ErrCode !== '-2') {
                 notification.warning({
                   top: 92,
                   message: res.message,
diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx
index d371c52..9e119a1 100644
--- a/src/templates/zshare/verifycard/customscript/index.jsx
+++ b/src/templates/zshare/verifycard/customscript/index.jsx
@@ -291,7 +291,52 @@
         insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone)
         select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin'`
       } else {
-        value = `update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${flowRemark ? ',remark=@' + flowRemark : ''}
+        value = `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
+
+            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 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_mk:
+
+        set @retmsg=''
+
+        update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${flowRemark ? ',remark=@' + flowRemark : ''}
         where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
         insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${flowRemark ? ',remark' : ''})
         select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${flowRemark ? ',@' + flowRemark : ''}
diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index 9113732..18ded34 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -754,13 +754,14 @@
     let formfields = []
     _fields = _fields.filter(_f => _f.field)
     _fields.forEach(_f => {
-      if (_f.field.toLowerCase() === 'bid') {
+      let key = _f.field.toLowerCase()
+      if (key === 'bid') {
         hasBid = true
       }
 
-      if (fieldArr.includes(_f.field.toLowerCase())) return
+      if (fieldArr.includes(key)) return
 
-      fieldArr.push(_f.field.toLowerCase())
+      fieldArr.push(key)
 
       formfields.push(_f.field)
 
@@ -791,6 +792,8 @@
       } else {
         _select.push(`@${_f.field}=''`)
       }
+
+      if (['appkey'].includes(key)) return
 
       _declare.push(`@${_f.field} ${_type}`)
     })
@@ -831,31 +834,34 @@
             _select.push(`@${_f.field}=''`)
           }
 
+          if (['appkey'].includes(key)) return
+
           _declare.push(`@${_f.field} ${_f.datatype}`)
-          return
-        }
-
-        let _fieldlen = _f.fieldlength || 50
-
-        if (_fieldlen > 4000) {
-          _fieldlen = 'max'
-        }
-
-        let _type = `nvarchar(${_fieldlen})`
-
-        if (_f.type === 'number') {
-          _type = `decimal(18,${_f.decimal ? _f.decimal : 0})`
-        } else if (_f.type === 'picture' || _f.type === 'textarea') {
-          _type = `nvarchar(${_fieldlen})`
-        }
-
-        if (_f.type === 'number') {
-          _select.push(`@${_f.field}=1`)
         } else {
-          _select.push(`@${_f.field}=''`)
-        }
+          let _fieldlen = _f.fieldlength || 50
+  
+          if (_fieldlen > 4000) {
+            _fieldlen = 'max'
+          }
+  
+          let _type = `nvarchar(${_fieldlen})`
+  
+          if (_f.type === 'number') {
+            _type = `decimal(18,${_f.decimal ? _f.decimal : 0})`
+          } else if (_f.type === 'picture' || _f.type === 'textarea') {
+            _type = `nvarchar(${_fieldlen})`
+          }
+  
+          if (_f.type === 'number') {
+            _select.push(`@${_f.field}=1`)
+          } else {
+            _select.push(`@${_f.field}=''`)
+          }
+  
+          if (['appkey'].includes(key)) return
 
-        _declare.push(`@${_f.field} ${_type}`)
+          _declare.push(`@${_f.field} ${_type}`)
+        }
       })
     }
 
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 88c4d03..59a8add 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -4071,6 +4071,33 @@
           if @works_flow_countersign@ = 'Y'
           begin
               /* 宸ヤ綔娴侀粯璁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 @works_flow_statuscharone nvarchar(50),@works_flow_statuschartwo nvarchar(50),@works_flow_statuscharthree nvarchar(50),@works_flow_statuscharfour nvarchar(50),@works_flow_statuscharfive nvarchar(50),@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 @works_flow_statuscharone='',@works_flow_statuschartwo='',@works_flow_statuscharthree='',@works_flow_statuscharfour='',@works_flow_statuscharfive='',@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=''
 
@@ -4127,11 +4154,11 @@
           begin
               /* 宸ヤ綔娴侀粯璁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
@@ -4141,18 +4168,31 @@
 
                   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  
+                    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 works_flow_detail_id =@works_flow_detail_id
 
-                      if @retmsg != ''
+                    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
-                          goto goto_mk
+                          select @retmsg=workerCode+workerName from BD_workers where id=@retmsg 
+                          
+                          select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺锛岃鑱旂郴'+@retmsg+'鎿嶄綔'
+                          goto aaa 
                       end
                   end
-
+                  
                   select @retmsg='椤甸潰鏁版嵁宸叉洿鏂帮紝鎴栨病鏈夊綋鍓嶅崟鎹殑瀹℃壒鏉冮檺'
                   goto aaa 
-              end 
+              end
 
               goto_mk:
 
diff --git a/src/utils/utils.js b/src/utils/utils.js
index cc69ca5..0699bca 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -2624,6 +2624,10 @@
       error = '琛屼俊鎭腑鏃犲伐浣滄祦鍙傛暟'
     }
 
+    if (!error && verify.flowSql !== 'true' && verify.flowType !== 'start' && line && line.approvalMethod === 'countersign') {
+      error = '浼氱娴佺▼闇�瑕佷娇鐢ㄩ粯璁よ剼鏈�'
+    }
+
     if (error) {
       status = 0
       statusName = '寮傚父'
@@ -2672,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=''
 
@@ -2728,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:
 
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index ae6e8cd..83ff054 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -833,6 +833,10 @@
         //     oriIds[item.uuid + item.md5] = item.v_id
         //   })
         // }
+        let perm = true
+        if (config.permission === 'false' || config.sqlperm === 'false') {
+          perm = false
+        }
         
         config.allSqls = sqls.map(item => {
           let v_id = _t + getguid()
@@ -841,7 +845,7 @@
           //   v_id = oriIds[item.uuid + item.md5]
           // }
 
-          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${config.permission === 'false' ? '' : item.roleId || ''}`)
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${perm ? item.roleId || '' : ''}`)
           
           return {
             uuid: item.uuid,
diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx
index 69232e6..ab5ec39 100644
--- a/src/views/menudesign/menuform/index.jsx
+++ b/src/views/menudesign/menuform/index.jsx
@@ -338,6 +338,23 @@
               )}
             </Form.Item>
           </Col>
+          {config.permission !== 'false' ? <Col span={24}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="鏄惁妫�楠屽悗绔痵ql鐨勬潈闄愶紝浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                sql楠岃瘉
+              </Tooltip>
+            }>
+              {getFieldDecorator('sqlperm', {
+                initialValue: config.sqlperm || 'true'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('sqlperm', e.target.value)}}>
+                  <Radio value="true">浣跨敤</Radio>
+                  <Radio value="false">涓嶄娇鐢�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鏁版嵁浼氱紦瀛樺埌鐢ㄦ埛鏈湴锛屾柟渚块〉闈㈠揩閫熷憟鐜般��">
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index b0abea2..fac19ba 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -1512,7 +1512,7 @@
           //   v_id = oriIds[item.uuid + item.md5]
           // }
           
-          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${item.roleId || ''}`)
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${config.sqlperm === 'false' ? '' : item.roleId || ''}`)
           
           return {
             uuid: item.uuid,
diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx
index 00b8042..f7f5f5c 100644
--- a/src/views/mobdesign/menuform/index.jsx
+++ b/src/views/mobdesign/menuform/index.jsx
@@ -96,6 +96,23 @@
           </Col>
           <Col span={24}>
             <Form.Item label={
+              <Tooltip placement="topLeft" title="鏄惁妫�楠屽悗绔痵ql鐨勬潈闄愶紝浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                sql楠岃瘉
+              </Tooltip>
+            }>
+              {getFieldDecorator('sqlperm', {
+                initialValue: config.sqlperm || 'true'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('sqlperm', e.target.value)}}>
+                  <Radio value="true">浣跨敤</Radio>
+                  <Radio value="false">涓嶄娇鐢�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item label={
               <Tooltip placement="topLeft" title="鏁版嵁浼氱紦瀛樺埌鐢ㄦ埛鏈湴锛屾柟渚块〉闈㈠揩閫熷憟鐜般��">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鏈湴缂撳瓨
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index bcfb33b..a0cbab2 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -1238,7 +1238,7 @@
           //   v_id = oriIds[item.uuid + item.md5]
           // }
           
-          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${item.roleId || ''}`)
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${config.sqlperm === 'false' ? '' : item.roleId || ''}`)
           
           return {
             uuid: item.uuid,
diff --git a/src/views/pcdesign/menuform/index.jsx b/src/views/pcdesign/menuform/index.jsx
index 54bfde8..1b5857a 100644
--- a/src/views/pcdesign/menuform/index.jsx
+++ b/src/views/pcdesign/menuform/index.jsx
@@ -73,6 +73,23 @@
           </Col>
           <Col span={24}>
             <Form.Item label={
+              <Tooltip placement="topLeft" title="鏄惁妫�楠屽悗绔痵ql鐨勬潈闄愶紝浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                sql楠岃瘉
+              </Tooltip>
+            }>
+              {getFieldDecorator('sqlperm', {
+                initialValue: config.sqlperm || 'true'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('sqlperm', e.target.value)}}>
+                  <Radio value="true">浣跨敤</Radio>
+                  <Radio value="false">涓嶄娇鐢�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item label={
               <Tooltip placement="topLeft" title="鏁版嵁浼氱紦瀛樺埌鐢ㄦ埛鏈湴锛屾柟渚块〉闈㈠揩閫熷憟鐜般��">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鏈湴缂撳瓨
diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx
index 5a1ca72..ad2c7a6 100644
--- a/src/views/tabledesign/index.jsx
+++ b/src/views/tabledesign/index.jsx
@@ -597,7 +597,7 @@
           //   v_id = oriIds[item.uuid + item.md5]
           // }
           
-          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${item.roleId || ''}`)
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${config.sqlperm === 'false' ? '' : item.roleId || ''}`)
           
           return {
             uuid: item.uuid,
diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx
index e1a70b1..4efb09d 100644
--- a/src/views/tabledesign/menuform/index.jsx
+++ b/src/views/tabledesign/menuform/index.jsx
@@ -1,6 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Select, notification, Switch, Radio } from 'antd'
+import { Form, Row, Col, Input, Select, notification, Switch, Radio, Tooltip } from 'antd'
+import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
 import asyncComponent from '@/utils/asyncComponent'
@@ -340,6 +341,23 @@
             </Form.Item>
           </Col>
           <Col span={24}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="鏄惁妫�楠屽悗绔痵ql鐨勬潈闄愶紝浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                sql楠岃瘉
+              </Tooltip>
+            }>
+              {getFieldDecorator('sqlperm', {
+                initialValue: config.sqlperm || 'true'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('sqlperm', e.target.value)}}>
+                  <Radio value="true">浣跨敤</Radio>
+                  <Radio value="false">涓嶄娇鐢�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col>
+          <Col span={24}>
             <Form.Item label="宸ヤ綔娴�">
               {getFieldDecorator('process', {
                 initialValue: config.process || 'false'

--
Gitblit v1.8.0