From 02a05c4e82e74c290e80ae7710fbb394ed7cac7a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 15 四月 2020 12:51:04 +0800 Subject: [PATCH] 2020-04-15 --- src/tabviews/formtab/index.jsx | 2 src/tabviews/zshare/actionList/index.jsx | 75 +++++++++--------------- src/templates/zshare/verifycardprint/index.jsx | 20 +++--- src/tabviews/formtab/actionList/index.jsx | 7 ++ src/tabviews/verupmanage/actionList/index.jsx | 4 src/components/sidemenu/config.js | 2 src/utils/utils.js | 31 +++++++--- src/views/login/index.jsx | 5 + 8 files changed, 76 insertions(+), 70 deletions(-) diff --git a/src/components/sidemenu/config.js b/src/components/sidemenu/config.js index a5e15ec..694ed29 100644 --- a/src/components/sidemenu/config.js +++ b/src/components/sidemenu/config.js @@ -30,7 +30,7 @@ text: '浼犺緭鍙锋煡璇�' }, { src: '', - systems: ['official'], + systems: ['official', 'local', 'SSO', 'cloud'], PageParam: {OpenType: 'newtab', Template: 'VerupTable'}, type: 'VerupTable', MenuID: '1583979633842550imkchl4qt4qppsiv', diff --git a/src/tabviews/formtab/actionList/index.jsx b/src/tabviews/formtab/actionList/index.jsx index 595e2fa..e2160c7 100644 --- a/src/tabviews/formtab/actionList/index.jsx +++ b/src/tabviews/formtab/actionList/index.jsx @@ -116,6 +116,13 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) _primaryId = param.ID + } else if (btn.sql && btn.sqlType === 'insertOrUpdate') { // 绯荤粺鍑芥暟娣诲姞鎴栦慨鏀规椂 + param.ID = primaryId || Utils.getguid() + param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns)) // 鏁版嵁婧� + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + + _primaryId = param.ID } else if (btn.sql) { param.ID = primaryId param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns)) // 鏁版嵁婧� diff --git a/src/tabviews/formtab/index.jsx b/src/tabviews/formtab/index.jsx index b577bb7..17e08c6 100644 --- a/src/tabviews/formtab/index.jsx +++ b/src/tabviews/formtab/index.jsx @@ -488,7 +488,7 @@ this.props.modifyTabview(tabs) } } else if (type === 'error' && btn.afterExecError === 'notclose') { - if (btn.execSuccess === 'refresh') { + if (btn.execError === 'refresh') { this.loadmaindata() } } else if (type === 'error' && btn.afterExecError === 'close') { diff --git a/src/tabviews/verupmanage/actionList/index.jsx b/src/tabviews/verupmanage/actionList/index.jsx index 7e5ae84..466a3ad 100644 --- a/src/tabviews/verupmanage/actionList/index.jsx +++ b/src/tabviews/verupmanage/actionList/index.jsx @@ -482,7 +482,7 @@ let _callbackparam = {..._outParam, ...response} - return Api.genericInterface(_callbackparam) + return Api.getLocalConfig(_callbackparam) } else { if (response.status) { // 涓�娆¤姹傛垚鍔燂紝杩涜涓嬩竴椤硅姹� @@ -503,7 +503,7 @@ if (_localParam) { - return Api.genericInterface(_localParam) + return Api.getLocalConfig(_localParam) } else if (res.status) { if (params.length === 0) { this.execSuccess(btn, res) diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx index ab71c63..533eb25 100644 --- a/src/tabviews/zshare/actionList/index.jsx +++ b/src/tabviews/zshare/actionList/index.jsx @@ -357,7 +357,8 @@ let param = { func: 's_PrintTemplateMGetData', Type: 'Y', - ID: tempId + // ID: tempId, // 娣诲姞妯℃澘鏃讹紝淇濆瓨鍙婃煡璇娇鐢ㄦā鏉垮弬鏁� + PrintTempNO: tempId } if (window.GLOB.mainSystemApi) { // 浠庡崟鐐圭櫥褰曟湇鍔″櫒鍙栨墦鍗伴厤缃俊鎭� @@ -2535,56 +2536,38 @@ render() { const { loadingUuid, btnloading, loadingNumber } = this.state - if (this.props.setting.actionfixed && this.props.type === 'main') { // 鎸夐挳鏄惁鍥哄畾鍦ㄥご閮� + let fixed = this.props.setting.actionfixed && this.props.type === 'main' // 鎸夐挳鏄惁鍥哄畾鍦ㄥご閮� + + let actionlist = <div className="button-list toolbar-button" id={fixed ? this.props.MenuID + 'mainaction' : ''}> + {this.props.actions.map((item, index) => { + let label = item.label + if (loadingUuid === item.uuid && loadingNumber !== '') { + label = label + '(' + loadingNumber + ')' + } + + return ( + <Button + className={'mk-btn mk-' + item.class} + icon={item.icon} + key={'action' + index} + onClick={() => {this.actionTrigger(item)}} + loading={loadingUuid === item.uuid} + >{label}</Button> + ) + })} + {this.getModels()} + {btnloading && <Spin size="large" />} + <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" /> + </div> + + if (fixed) { return ( <Affix offsetTop={48}> - <div className="button-list toolbar-button" id={this.props.MenuID + 'mainaction'}> - {this.props.actions.map((item, index) => { - let label = item.label - if (loadingUuid === item.uuid && loadingNumber !== '') { - label = label + '(' + loadingNumber + ')' - } - - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - loading={loadingUuid === item.uuid} - >{label}</Button> - ) - })} - {this.getModels()} - {btnloading && <Spin size="large" />} - <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" /> - </div> + {actionlist} </Affix> ) } else { - return ( - <div className="button-list toolbar-button"> - {this.props.actions.map((item, index) => { - let label = item.label - if (loadingUuid === item.uuid && loadingNumber !== '') { - label = label + '(' + loadingNumber + ')' - } - - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - loading={loadingUuid === item.uuid} - >{label}</Button> - ) - })} - {this.getModels()} - {btnloading && <Spin size="large" />} - <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" /> - </div> - ) + return actionlist } } } diff --git a/src/templates/zshare/verifycardprint/index.jsx b/src/templates/zshare/verifycardprint/index.jsx index 9c9cb76..24242c7 100644 --- a/src/templates/zshare/verifycardprint/index.jsx +++ b/src/templates/zshare/verifycardprint/index.jsx @@ -54,20 +54,20 @@ } componentDidMount() { - let _sql = `select ID,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate - where appkey= @appkey@ and Deleted=0 - union select ID,Images,a.PrintTempNO+PrintTempName as PN - from (select * from sPrintTemplate where appkey= '' and Deleted=0 ) a - left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b - on a.PrintTempNO=b.PrintTempNO - left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c - on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null` + let _sql = `select PrintTempNO,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate + where appkey= @appkey@ and Deleted=0 + union select ID,Images,a.PrintTempNO+PrintTempName as PN + from (select * from sPrintTemplate where appkey= '' and Deleted=0 ) a + left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b + on a.PrintTempNO=b.PrintTempNO + left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c + on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null` let param = { func: 'sPC_Get_SelectedList', LText: Utils.formatOptions(_sql), obj_name: 'data', - arr_field: 'PN,ID,Images' + arr_field: 'PN,PrintTempNO,Images' } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' @@ -77,7 +77,7 @@ if (res.status) { let temps = res.data.map(temp => { return { - value: temp.ID, + value: temp.PrintTempNO, text: temp.PN, img: temp.Images } diff --git a/src/utils/utils.js b/src/utils/utils.js index bef3bb4..4b68be0 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -672,6 +672,12 @@ let BID = param.BID let verify = btn.verify || {} let _formFieldValue = {} + let _actionType = null + + if (verify.default !== 'false') { // 鍒ゆ柇鏄惁浣跨敤榛樿sql + _actionType = btn.sqlType + } + // 闇�瑕佸0鏄庣殑鍙橀噺闆� // let _vars = ['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'UserName', 'FullName', 'ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode'] @@ -901,6 +907,7 @@ } // 鍗曞彿鐢熸垚锛屼娇鐢ㄤ笂绾d锛圔ID锛夋垨鍒楄〃鏁版嵁锛屽0鏄庡彉閲忥紙妫�楠岋級 + let _billcodesSql = '' if (verify.billcodes && verify.billcodes.length > 0) { verify.billcodes.forEach(item => { let _ModularDetailCode = '' @@ -932,7 +939,7 @@ _vars.push(_key) } - _sql += `${_declare} + _billcodesSql += `${_declare} select @BillCode='', @${_key}='', @ModularDetailCode='' ${_lpline} exec s_get_BillCode @@ -948,6 +955,10 @@ set @${_key}=@BillCode ` }) + + if (_actionType !== 'insertOrUpdate') { + _sql += _billcodesSql + } } let hasvoucher = false @@ -979,14 +990,7 @@ let primaryKeyName = ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(primaryKey.toLowerCase()) ? primaryKey + '@' : primaryKey - let _actionType = null - - if (verify.default !== 'false') { // 鍒ゆ柇鏄惁浣跨敤榛樿sql - _actionType = btn.sqlType - } - let _insertsql = '' - let _updatesql = '' if (_actionType === 'insert' || _actionType === 'insertOrUpdate') { // 娣诲姞璇彞 let keys = [] let values = [] @@ -1032,7 +1036,10 @@ keys = keys.join(',') values = values.join(',') _insertsql = `insert into ${btn.sql} (${keys}) select ${values};` - } else if (_actionType === 'update' || _actionType === 'insertOrUpdate') { // 淇敼璇彞 + } + + let _updatesql = '' + if (_actionType === 'update' || _actionType === 'insertOrUpdate') { // 淇敼璇彞 let _form = [] let _arr = [] @@ -1065,7 +1072,6 @@ _form.push('FiYear=@FiYear') } } - _form = _form.join(',') _updatesql = `update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKeyName};` } @@ -1094,9 +1100,14 @@ _sql += `select @tbid='' select @tbid='X' from ${btn.sql} where ${primaryKey}=@ID@ if @tbid='' + begin + ${_billcodesSql} ${_insertsql} + end else + begin ${_updatesql} + end ` } diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index d478948..fd6343b 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -136,6 +136,11 @@ auth: false }) } + } else if (res.ErrCode === 'N') { + localStorage.removeItem('AuthCode') + this.setState({ + auth: false + }) } }) -- Gitblit v1.8.0