From a5bc394eceeaae5923057f1fd919968fd234af23 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 27 五月 2025 17:59:57 +0800
Subject: [PATCH] 2025-05-27

---
 src/utils/utils.js |  211 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 164 insertions(+), 47 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index fb3ef57..d9502c6 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -192,8 +192,10 @@
    * @param {Array}   searches     鎼滅储鏉′欢
    */
   static initSearchVal (config) {
-    if (!config.search) {
+    if (!config.search || config.search.length === 0) {
       config.search = []
+      config.$s_keys = []
+      config.$s_req = false
       return
     }
 
@@ -247,9 +249,6 @@
 
               config.checkBid = true
               item.checkShift = true
-              if (config.setting) {
-                config.setting.checkBid = true
-              }
             }
 
             item.initval = ''
@@ -265,7 +264,7 @@
             }
 
             if (d) {
-              item.initval = moment(d).subtract(item.initval, 'month').format('YYYY-MM')
+              item.initval = moment(d).subtract(item.$initval, 'month').format('YYYY-MM')
             }
           }
         }
@@ -294,6 +293,10 @@
               item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',')
             } else if (item.initval === 'lastMonth') {
               item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',')
+            } else if (item.initval === 'year') {
+              item.initval = [moment().startOf('year').format(format), moment().endOf('year').format(format)].join(',')
+            } else if (item.initval === 'lastYear') {
+              item.initval = [moment().subtract(1, 'years').startOf('year').format(format), moment().subtract(1, 'years').endOf('year').format(format)].join(',')
             } else if (item.initval) {
               try {
                 let _initval = JSON.parse(item.initval)
@@ -311,9 +314,6 @@
 
               config.checkBid = true
               item.checkShift = true
-              if (config.setting) {
-                config.setting.checkBid = true
-              }
             }
 
             item.initval = ''
@@ -335,6 +335,10 @@
                 item.initval = [moment(d).startOf('month').format(format), moment(d).endOf('month').format(format)].join(',')
               } else if (item.$initval === 'lastMonth') {
                 item.initval = [moment(d).subtract(1, 'months').startOf('month').format(format), moment(d).subtract(1, 'months').endOf('month').format(format)].join(',')
+              } else if (item.$initval === 'year') {
+                item.initval = [moment(d).startOf('year').format(format), moment(d).endOf('year').format(format)].join(',')
+              } else if (item.$initval === 'lastYear') {
+                item.initval = [moment(d).subtract(1, 'years').startOf('year').format(format), moment(d).subtract(1, 'years').endOf('year').format(format)].join(',')
               } else {
                 try {
                   let _initval = JSON.parse(item.$initval)
@@ -408,9 +412,6 @@
         if (/@BID@/ig.test(item.dataSource) && supModule) {
           config.checkBid = true
           item.checkBid = true
-          if (config.setting) {
-            config.setting.checkBid = true
-          }
         }
         if (item.initval === '$first') {
           item.initval = ''
@@ -458,6 +459,15 @@
 
       return item
     })
+
+    if (config.checkBid) {
+      if (config.setting) {
+        config.setting.checkBid = true
+      }
+      if (config.type !== 'search') {
+        config.$checkBid = true
+      }
+    }
 
     config.$s_keys = keys
     config.$s_req = required
@@ -1132,16 +1142,34 @@
     cols.push('A' + cols[i])
   }
 
+  let columns = JSON.parse(JSON.stringify(btn.columns))
+  columns = columns.filter((col, index) => {
+    col.colIndex = cols[index] || (index + 1)
+    if (col.import !== 'init' && (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type))) {
+      col.declen = 0
+      if (/^Decimal/ig.test(col.type)) {
+        col.declen = +col.type.match(/\d+/g)[1]
+      }
+      col.declen = col.declen || 0
+    }
+    if (col.required === 'false') {
+      delete col.min
+      delete col.max
+    }
+
+    return col.import !== 'false'
+  })
+
   let _Ltext = data.map((item, lindex) => {
     let vals = []
-    btn.columns.forEach((col, cindex) => {
-      if (col.import === 'false') return
-
+    columns.forEach(col => {
       let val = item[col.Column] !== undefined ? item[col.Column] : ''
-      let _colindex = cols[cindex] || (cindex + 1)
-      let _position = (_topline + lindex + 1) + '琛� ' + _colindex + '鍒� '
+      let _position = (_topline + lindex + 1) + '琛� ' + col.colIndex + '鍒� '
+      let eLen = errors.length
 
-      if (col.import === 'init') {
+      if (col.$error) {
+
+      } else if (col.import === 'init') {
         if (/^Nvarchar/ig.test(col.type)) {
           val = ''
         } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
@@ -1160,6 +1188,10 @@
 
         val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
 
+        if (col.interception !== 'false') {
+          val = val.replace(/^\s+|\s+$/g, '')
+        }
+
         if (!val && col.required === 'true') {            // 蹇呭~鏍¢獙
           errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else if (col.limit && val.length > col.limit) { // 闀垮害鏍¢獙
@@ -1177,14 +1209,24 @@
           if (!val || isNaN(val)) {
             val = 0
           }
-        } else if (!val && val !== 0) {
+        }
+        if (!val && val !== 0) {
           errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else if (isNaN(val)) {                                  // 妫�楠屾槸鍚︿负鏁板��
           errors.push(_position + '鍐呭搴斾负鏁板��')
-        } else if ((col.min || col.min === 0) && val < col.min) { // 鏈�灏忓�兼楠�
+        } else if (typeof(col.min) === 'number' && val < col.min) { // 鏈�灏忓�兼楠�
           errors.push(_position + '灏忎簬鏈�灏忓��')
-        } else if ((col.max || col.max === 0) && val > col.max) { // 鏈�澶у�兼楠�
+        } else if (typeof(col.max) === 'number' && val > col.max) { // 鏈�澶у�兼楠�
           errors.push(_position + '澶т簬鏈�澶у��')
+        } else {
+          let _float = (val + '').split('.')[1]
+          if (_float && _float.length > col.declen) {
+            if (col.declen) {
+              errors.push(_position + `鏁板�间笉鍙ぇ浜�${col.declen}浣嶅皬鏁癭)
+            } else {
+              errors.push(_position + '鏁板�煎簲涓烘暣鏁�')
+            }
+          }
         }
       } else if (col.type === 'date' || col.type === 'datetime') {
         if (typeof(val) === 'number') {
@@ -1219,6 +1261,10 @@
         } else {                                    // 鏃堕棿鏍煎紡閿欒
           errors.push(_position + '鏃堕棿鏍煎紡閿欒')
         }
+      }
+
+      if (errors.length > eLen) {
+        col.$error = true
       }
 
       vals.push(`'${val}'`)
@@ -1522,7 +1568,7 @@
  * @return {Object} item   鎸夐挳淇℃伅
  * @return {Array}  data   excel鏁版嵁
  */
-export function getEditTableSql (verify, data, columns) {
+export function getEditTableSql (verify, data, columns, setting) {
   let btn = verify
   let userName = sessionStorage.getItem('User_Name') || ''
   let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -1641,6 +1687,7 @@
         let _fields = unique.field.split(',')
         let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`)
         _fields_ = _fields_.join(' and ')
+        _fields_ += ` and a.jskey != b.${setting.primaryKey || 'id'}`
 
         let _where = []
         _fields.forEach(f => {
@@ -1697,6 +1744,7 @@
 
     let declarefields = []
     let fields = []
+    let upFields = []
 
     columns.forEach(col => {
       let key = col.field.toLowerCase()
@@ -1704,15 +1752,27 @@
 
       declarefields.push(`${col.field} ${col.datatype}`)
       fields.push(col.field)
+      upFields.push(`${col.field}=t.${col.field}`)
     })
 
     fields = fields.join(',')
+    upFields = upFields.join(',')
 
     let _insert = ''
     if (btn.default !== 'false') {
       _insert = `
       /* 榛樿sql */
-      Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) 
+      update a set ${upFields},modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname,deleted=0
+      from (select * from #${sheet} where data_type='upt') t
+      inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'}
+
+      update a set deleted=1,modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname 
+      from (select * from #${sheet} where data_type='del') t
+      inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'}
+
+      delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'}
+
+      Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid)
       Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet}
       `
     }
@@ -1771,11 +1831,10 @@
  * @return {Array}   columns   鏄剧ず鍒�
  * @return {Boolean} retmsg    鏄惁闇�瑕佹暟鎹繑鍥�
  */
-export function getSysDefaultSql (btn, setting, formdata, param, data, columns, retmsg = false) {
+export function getSysDefaultSql (btn, setting, formdata, param, data, columns, retmsg = false, submitType = '') {
   let primaryId = param.ID
   let BID = param.BID || ''
   let verify = btn.verify || {}
-  let datavars = {}                 // 澹版槑鐨勫彉閲忥紝琛ㄥ崟鍙婃樉绀哄垪
   let _actionType = null
   let _callbacksql = ''
 
@@ -1809,7 +1868,7 @@
   })
 
   // 闇�瑕佸0鏄庣殑鍙橀噺闆�
-  let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid']
+  let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid', 'mk_submit_type']
 
   // 涓婚敭瀛楁
   let primaryKey = setting.primaryKey || 'id'
@@ -1821,9 +1880,21 @@
   let _initFormfields = []
   let _initColfields = []
   let _declarefields = []
+  let verifyValSql = ''
+  let datavars = {}
 
   // 鑾峰彇瀛楁閿�煎
   formdata && formdata.forEach(form => {
+    if (form.$verify) {
+      verifyValSql += `
+      if @${form.key}=${form.type === 'number' ? 0 : `''`}
+      begin
+        select @errorcode='E',@retmsg='${form.label}锛屽叧鑱斾富琛ㄥけ鏁�'
+        goto aaa
+      end
+      `
+    }
+
     let _key = form.key.toLowerCase()
     datavars[_key] = form.value
 
@@ -1832,7 +1903,7 @@
       let val = form.value
 
       if (form.type === 'number' || form.type === 'rate') {
-        if (isNaN(val)) {
+        if (isNaN(val) || val === '') {
           val = 0
         }
         _initFormfields.push(`@${_key}=${val}`)
@@ -1887,7 +1958,7 @@
       let _key = col.field.toLowerCase()
 
       if (!_initvars.includes(_key)) {
-        let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : ''
+        let _val = _data.hasOwnProperty(_key) ? _data[_key] : ''
 
         if (col.datatype && /^date/ig.test(col.datatype) && !_val) {
           _val = '1949-10-01'
@@ -1942,7 +2013,7 @@
     _declarefields = ',' + _declarefields
   }
   _sql = `/* 绯荤粺鐢熸垚 */
-      Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@mk_deleted int,@bid nvarchar(50)${_declarefields}
+      Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@mk_deleted int,@bid nvarchar(50),@mk_submit_type nvarchar(50)${_declarefields}
     `
 
   let userName = sessionStorage.getItem('User_Name') || '' 
@@ -1960,7 +2031,7 @@
   // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁
   _sql += `
       /* 鍑瘉鍙婄敤鎴蜂俊鎭垵濮嬪寲璧嬪�� */
-      select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @mk_deleted=1, @bid='${BID}', @BillCode='', @ModularDetailCode=''
+      select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @mk_deleted=1, @bid='${BID}', @mk_submit_type='${submitType}', @BillCode='', @ModularDetailCode=''
       `
 
   // 琛ㄥ崟鍙橀噺璧嬪��
@@ -2115,22 +2186,21 @@
 
     verify.billcodes.forEach(item => {
       let _key = item.field.toLowerCase()
-      let _linkKey = item.linkField ? item.linkField.toLowerCase() : ''
 
       if (!keys.includes(_key)) return // 琛ㄥ崟涓笉鍚崟鍙风敓鎴愬瓧娈�
 
       let _lpline = ''
       if (item.TypeCharOne === 'Lp') {
-        if (_linkKey === 'bid' && BID) { // 鏇挎崲bid
+        if (/^BID$/ig.test(item.linkField)) {
           _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)`
         } else {
-          _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)`
+          _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)`
         }
       } else if (item.TypeCharOne === 'BN') {
-        if (_linkKey === 'bid' && BID) { // 鏇挎崲bid
+        if (/^BID$/ig.test(item.linkField)) {
           _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)`
         } else {
-          _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)`
+          _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)`
         }
       } else {
         _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)`
@@ -2176,18 +2246,25 @@
 
       item.field.split(',').forEach((_field, index) => {
         let _key = _field.toLowerCase()
-        let _val = datavars[_key] !== undefined ? datavars[_key] : ''
+        let _val = ''
+        let _val2 = datavars[_key] !== undefined ? datavars[_key] : ''
 
         arr.push(_key)
-        if (_key === 'bid' && !_val) { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺
-          _val = BID
+        if (_key === 'bid') {
+          _val = `'${BID}'`
+        } else {
+          _val = `@${_field}`
         }
-
-        _fieldValue.push(`${_key}='${_val}'`)
-        _value.push(`${_labels[index] || ''}锛�${_val || ''}`)
+        
+        if (_key === 'bid') {
+          _val2 = BID
+        }
+        
+        _fieldValue.push(`${_key}=${_val}`)
+        _value.push(`${_labels[index] || ''}锛�${_val2}`)
       })
 
-      if (!arr.includes(primaryKey.toLowerCase())) {
+      if (!arr.includes(primaryKey.toLowerCase()) && btn.Ot !== 'notRequired') {
         _fieldValue.push(`${primaryKey} !='${primaryId}'`)
       }
 
@@ -2240,13 +2317,18 @@
   // 鍑瘉-鏄剧ず鍒椾腑閫夊彇,蹇呴』閫夎
   if (verify.voucher && verify.voucher.enabled) {
     let _voucher = verify.voucher
+    let linkField = `@${_voucher.linkField}`
+  
+    if (/^BID$/ig.test(_voucher.linkField)) {
+      linkField = `'${BID}'`
+    }
 
     hasvoucher = true
 
     _sql += `
       /* 鍒涘缓鍑瘉 */
       exec s_BVoucher_Create
-        @Bill ='${_data[_voucher.linkField.toLowerCase()] || ''}',
+        @Bill = ${linkField},
         @BVoucherType ='${_voucher.BVoucherType}',
         @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
         @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',
@@ -2624,6 +2706,10 @@
       error = '琛屼俊鎭腑鏃犲伐浣滄祦鍙傛暟'
     }
 
+    if (!error && verify.flowSql !== 'true' && verify.flowType !== 'start' && line && line.approvalMethod === 'countersign') {
+      error = '浼氱娴佺▼闇�瑕佷娇鐢ㄩ粯璁よ剼鏈�'
+    }
+
     if (error) {
       status = 0
       statusName = '寮傚父'
@@ -2672,6 +2758,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,11 +2841,11 @@
         _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@
+      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@
+          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
@@ -2743,7 +2856,7 @@
           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@
+            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
@@ -2753,7 +2866,7 @@
           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@
+              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
@@ -2780,7 +2893,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@ != ''
@@ -2839,6 +2952,10 @@
     _sql += _backCustomScript
   }
 
+  if (verifyValSql) {
+    _sql += verifyValSql
+  }
+
   if (window.GLOB.breakpoint) {
     let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig')
     let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig')

--
Gitblit v1.8.0