From 0230dbe06ce2bf124b9f1ddc822e97c6cefe96b8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 12 八月 2020 23:19:27 +0800 Subject: [PATCH] 2020-08-12 --- src/tabviews/treepage/index.jsx | 11 + src/templates/zshare/modalform/index.jsx | 31 +++-- src/tabviews/subtable/index.jsx | 9 + src/tabviews/subtabtable/index.jsx | 11 + src/templates/zshare/formconfig.jsx | 1 src/tabviews/commontable/index.jsx | 9 + src/templates/zshare/verifycard/index.jsx | 34 +++--- src/utils/utils.js | 142 ++++++++++++++-------------- src/templates/zshare/verifycard/billcodeform/index.jsx | 6 + 9 files changed, 143 insertions(+), 111 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index cd8e71a..c5c91f9 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -731,10 +731,15 @@ insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } - - param.custom_script = Utils.formatOptions(param.custom_script) } + // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 + if (options.sysType === 'local' && !window.GLOB.systemType) { + LText && console.log(LText) + param.custom_script && console.log(param.custom_script) + } + + param.custom_script = Utils.formatOptions(param.custom_script) param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index a1f212c..210ef59 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -608,10 +608,15 @@ insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } - - param.custom_script = Utils.formatOptions(param.custom_script) } + // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 + if (options.sysType === 'local' && !window.GLOB.systemType) { + LText && console.log(LText) + param.custom_script && console.log(param.custom_script) + } + + param.custom_script = Utils.formatOptions(param.custom_script) param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 53f272b..2a052d4 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -489,10 +489,15 @@ insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } - - param.custom_script = Utils.formatOptions(param.custom_script) } - + + // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 + if (options.sysType === 'local' && !window.GLOB.systemType) { + LText && console.log(LText) + param.custom_script && console.log(param.custom_script) + } + + param.custom_script = Utils.formatOptions(param.custom_script) param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/tabviews/treepage/index.jsx b/src/tabviews/treepage/index.jsx index 9bbceba..2c154ab 100644 --- a/src/tabviews/treepage/index.jsx +++ b/src/tabviews/treepage/index.jsx @@ -529,10 +529,15 @@ insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } - - param.custom_script = Utils.formatOptions(param.custom_script) } - + + // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 + if (options.sysType === 'local' && !window.GLOB.systemType) { + LText && console.log(LText) + param.custom_script && console.log(param.custom_script) + } + + param.custom_script = Utils.formatOptions(param.custom_script) param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index e620eb9..0f3440f 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -690,6 +690,7 @@ type: 'text', key: 'initval', label: Formdict['header.form.initval'], + tooltip: '绫诲瀷涓轰笅鎷夎彍鍗曟椂锛屽垵濮嬪�煎簲涓烘暟鎹殑Value鍊硷紙浣跨敤鏁版嵁婧愭椂锛屽簲涓恒�婂�悸峰瓧娈点�嬬殑鍊硷級', initVal: card.initval, required: false }, diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index e39e374..ea264fd 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -144,6 +144,8 @@ _options.push('supField') } } + + let fieldValue = {} this.setState({ openType: value, @@ -162,31 +164,36 @@ } else { form.type = 'text' } - form.show = false + + if (form.show) { + fieldValue.initval = form.initVal + } } else if (form.key === 'fieldlength') { form.initVal = 50 if (value === 'textarea' || value === 'fileupload' || value === 'multiselect') { form.initVal = 512 } - form.show = false + + if (form.show) { + fieldValue.fieldlength = form.initVal + } } else if (form.key === 'resourceType') { form.initVal = this.state.resourceType + + if (form.show) { + fieldValue.resourceType = form.initVal + } } else if (form.key === 'linkSubField') { form.initVal = this.state.linkSubFields.map(_field => _field.field) + + if (form.show) { + fieldValue.linkSubField = form.initVal + } } return form }) }, () => { - this.setState({ - formlist: this.state.formlist.map(form => { - if (form.key === 'initval' && value !== 'fileupload' && value !== 'funcvar' && value !== 'linkMain') { - form.show = true - } else if (form.key === 'fieldlength' && (value === 'fileupload' || value === 'multiselect' || value === 'text' || value === 'textarea' || value === 'linkMain')) { - form.show = true - } - return form - }) - }) + this.props.form.setFieldsValue(fieldValue) }) } else if (key === 'quick') { let option = this.props.optionLibs.get(value) diff --git a/src/templates/zshare/verifycard/billcodeform/index.jsx b/src/templates/zshare/verifycard/billcodeform/index.jsx index 1c5591a..bdf18fc 100644 --- a/src/templates/zshare/verifycard/billcodeform/index.jsx +++ b/src/templates/zshare/verifycard/billcodeform/index.jsx @@ -349,7 +349,7 @@ </Col> : null} {TypeCharOne === 'Lp' ? <Col span={7}> <Form.Item label={ - <Tooltip placement="topLeft" title="璇ユ爣璇嗙敤浜庣敓鎴愯鍙疯鍒欙紝涓虹┖鏃朵娇鐢ㄦ寜閽甀D"> + <Tooltip placement="topLeft" title="璇ユ爣璇嗙敤浜庣敓鎴愯鍙疯鍒�"> <Icon type="question-circle" /> {'鏍囪瘑'} </Tooltip> @@ -358,6 +358,10 @@ initialValue: '', rules: [ { + required: true, + message: this.props.dict['form.required.input'] + '鏍囪瘑!' + }, + { pattern: /^[a-zA-Z0-9]*$/ig, message: formRule.input.letternummsg } diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 87d2633..38d72fb 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1666,23 +1666,6 @@ pagination={false} /> </TabPane> - <TabPane tab={card.Ot !== 'requiredOnce' ? '鍞竴鎬ч獙璇�' : '鍚岀被鏁版嵁楠岃瘉'} key="2"> - <UniqueForm - btn={card} - fields={card.Ot !== 'requiredOnce' ? fields : columnsFields} - dict={this.props.dict} - uniqueChange={this.uniqueChange} - wrappedComponentRef={(inst) => this.uniqueForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.uniques} - columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} - pagination={false} - /> - </TabPane> <TabPane tab="鑷畾涔夐獙璇�" key="3"> <CustomForm dict={this.props.dict} @@ -1722,6 +1705,23 @@ pagination={false} /> </TabPane> + <TabPane tab={card.Ot !== 'requiredOnce' ? '鍞竴鎬ч獙璇�' : '鍚岀被鏁版嵁楠岃瘉'} key="2"> + <UniqueForm + btn={card} + fields={card.Ot !== 'requiredOnce' ? fields : columnsFields} + dict={this.props.dict} + uniqueChange={this.uniqueChange} + wrappedComponentRef={(inst) => this.uniqueForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.uniques} + columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} + pagination={false} + /> + </TabPane> <TabPane tab="鍒涘缓鍑瘉" key="5"> <VoucherForm dict={this.props.dict} diff --git a/src/utils/utils.js b/src/utils/utils.js index 3fa55b7..7808f1e 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1248,6 +1248,77 @@ ` }) } + + // 鑷畾涔夐獙璇� + verify.customverifys && verify.customverifys.forEach(item => { + _sql += ` + /* 鑷畾涔夐獙璇� */ + select @tbid='', @ErrorCode='',@retmsg='' + select top 1 @tbid='X' from (${item.sql}) a + If @tbid ${item.result === 'true' ? '!=' : '='}'' + Begin + select @ErrorCode='${item.errorCode}',@retmsg='${item.errmsg}' + goto aaa + end + ` + }) + + // 鍗曞彿鐢熸垚锛屼娇鐢ㄤ笂绾d锛圔ID锛夋垨鍒楄〃鏁版嵁锛屽0鏄庡彉閲忥紙妫�楠岋級 + let _billcodesSql = '' + if (verify.billcodes && verify.billcodes.length > 0) { + verify.billcodes.forEach(item => { + let _ModularDetailCode = '' + let _lpline = '' + if (item.TypeCharOne === 'Lp') { + if (item.linkField === 'BID' && BID) { // 鏇挎崲bid + _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` + } else { + _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` + } + _ModularDetailCode = '@ModularDetailCode' + } else if (item.TypeCharOne === 'BN') { + let _val = '' + if (item.linkField === 'BID' && BID) { // 鏇挎崲bid + _val = BID + } else if (data && data.hasOwnProperty(item.linkField)) { + _val = data[item.linkField] + } + _ModularDetailCode = `'${item.TypeCharOne + _val}'` + } else { + _ModularDetailCode = `'${item.ModularDetailCode}'` + } + + let _declare = '' + let _key = item.field.toLowerCase() + + if (!_vars.includes(_key)) { + _declare = `Declare @${_key} nvarchar(50)` + _vars.push(_key) + } + + _billcodesSql += ` + /* 鍗曞彿鐢熸垚 */ + ${_declare} + select @BillCode='', @${_key}='', @ModularDetailCode='' + ${_lpline} + exec s_get_BillCode + @ModularDetailCode=${_ModularDetailCode}, + @Type=${item.Type}, + @TypeCharOne='${item.TypeCharOne}', + @TypeCharTwo ='${item.TypeCharTwo}', + @BillCode =@BillCode output, + @ErrorCode =@ErrorCode output, + @retmsg=@retmsg output + if @ErrorCode!='' + goto aaa + set @${_key}=@BillCode + ` + }) + + if (_actionType !== 'insertOrUpdate') { + _sql += _billcodesSql + } + } // 鍞竴鎬ч獙璇侊紝蹇呴』瀛樺湪琛ㄥ崟锛堣〃鍗曞瓨鍦ㄦ椂锛屼富閿潎涓哄崟鍊硷級,蹇呴』濉啓鏁版嵁婧愶紝澶氳鎷兼帴鏃朵笉鍙敤 if (formdata && verify.uniques && verify.uniques.length > 0 && btn.Ot !== 'requiredOnce') { @@ -1322,77 +1393,6 @@ end ` }) - } - - // 鑷畾涔夐獙璇� - verify.customverifys && verify.customverifys.forEach(item => { - _sql += ` - /* 鑷畾涔夐獙璇� */ - select @tbid='', @ErrorCode='',@retmsg='' - select top 1 @tbid='X' from (${item.sql}) a - If @tbid ${item.result === 'true' ? '!=' : '='}'' - Begin - select @ErrorCode='${item.errorCode}',@retmsg='${item.errmsg}' - goto aaa - end - ` - }) - - // 鍗曞彿鐢熸垚锛屼娇鐢ㄤ笂绾d锛圔ID锛夋垨鍒楄〃鏁版嵁锛屽0鏄庡彉閲忥紙妫�楠岋級 - let _billcodesSql = '' - if (verify.billcodes && verify.billcodes.length > 0) { - verify.billcodes.forEach(item => { - let _ModularDetailCode = '' - let _lpline = '' - if (item.TypeCharOne === 'Lp') { - if (item.linkField === 'BID' && BID) { // 鏇挎崲bid - _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` - } else { - _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` - } - _ModularDetailCode = '@ModularDetailCode' - } else if (item.TypeCharOne === 'BN') { - let _val = '' - if (item.linkField === 'BID' && BID) { // 鏇挎崲bid - _val = BID - } else if (data && data.hasOwnProperty(item.linkField)) { - _val = data[item.linkField] - } - _ModularDetailCode = `'${item.TypeCharOne + _val}'` - } else { - _ModularDetailCode = `'${item.ModularDetailCode}'` - } - - let _declare = '' - let _key = item.field.toLowerCase() - - if (!_vars.includes(_key)) { - _declare = `Declare @${_key} nvarchar(50)` - _vars.push(_key) - } - - _billcodesSql += ` - /* 鍗曞彿鐢熸垚 */ - ${_declare} - select @BillCode='', @${_key}='', @ModularDetailCode='' - ${_lpline} - exec s_get_BillCode - @ModularDetailCode=${_ModularDetailCode}, - @Type=${item.Type}, - @TypeCharOne='${item.TypeCharOne}', - @TypeCharTwo ='${item.TypeCharTwo}', - @BillCode =@BillCode output, - @ErrorCode =@ErrorCode output, - @retmsg=@retmsg output - if @ErrorCode!='' - goto aaa - set @${_key}=@BillCode - ` - }) - - if (_actionType !== 'insertOrUpdate') { - _sql += _billcodesSql - } } let hasvoucher = false -- Gitblit v1.8.0