| | |
| | | text: '传输号查询' |
| | | }, { |
| | | src: '', |
| | | systems: ['official'], |
| | | systems: ['official', 'local', 'SSO', 'cloud'], |
| | | PageParam: {OpenType: 'newtab', Template: 'VerupTable'}, |
| | | type: 'VerupTable', |
| | | MenuID: '1583979633842550imkchl4qt4qppsiv', |
| | |
| | | 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)) // 数据源 |
| | |
| | | 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') { |
| | |
| | | |
| | | |
| | | let _callbackparam = {..._outParam, ...response} |
| | | return Api.genericInterface(_callbackparam) |
| | | return Api.getLocalConfig(_callbackparam) |
| | | } else { |
| | | if (response.status) { |
| | | // 一次请求成功,进行下一项请求 |
| | |
| | | |
| | | if (_localParam) { |
| | | |
| | | return Api.genericInterface(_localParam) |
| | | return Api.getLocalConfig(_localParam) |
| | | } else if (res.status) { |
| | | if (params.length === 0) { |
| | | this.execSuccess(btn, res) |
| | |
| | | let param = { |
| | | func: 's_PrintTemplateMGetData', |
| | | Type: 'Y', |
| | | ID: tempId |
| | | // ID: tempId, // 添加模板时,保存及查询使用模板参数 |
| | | PrintTempNO: tempId |
| | | } |
| | | |
| | | if (window.GLOB.mainSystemApi) { // 从单点登录服务器取打印配置信息 |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | 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' |
| | |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | | value: temp.ID, |
| | | value: temp.PrintTempNO, |
| | | text: temp.PN, |
| | | img: temp.Images |
| | | } |
| | |
| | | let BID = param.BID |
| | | let verify = btn.verify || {} |
| | | let _formFieldValue = {} |
| | | let _actionType = null |
| | | |
| | | if (verify.default !== 'false') { // 判断是否使用默认sql |
| | | _actionType = btn.sqlType |
| | | } |
| | | |
| | | // 需要声明的变量集 |
| | | // 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'] |
| | |
| | | } |
| | | |
| | | // 单号生成,使用上级id(BID)或列表数据,声明变量(检验) |
| | | let _billcodesSql = '' |
| | | if (verify.billcodes && verify.billcodes.length > 0) { |
| | | verify.billcodes.forEach(item => { |
| | | let _ModularDetailCode = '' |
| | |
| | | _vars.push(_key) |
| | | } |
| | | |
| | | _sql += `${_declare} |
| | | _billcodesSql += `${_declare} |
| | | select @BillCode='', @${_key}='', @ModularDetailCode='' |
| | | ${_lpline} |
| | | exec s_get_BillCode |
| | |
| | | set @${_key}=@BillCode |
| | | ` |
| | | }) |
| | | |
| | | if (_actionType !== 'insertOrUpdate') { |
| | | _sql += _billcodesSql |
| | | } |
| | | } |
| | | |
| | | let hasvoucher = false |
| | |
| | | |
| | | 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 = [] |
| | |
| | | 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 = [] |
| | | |
| | |
| | | _form.push('FiYear=@FiYear') |
| | | } |
| | | } |
| | | |
| | | _form = _form.join(',') |
| | | _updatesql = `update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKeyName};` |
| | | } |
| | |
| | | _sql += `select @tbid='' |
| | | select @tbid='X' from ${btn.sql} where ${primaryKey}=@ID@ |
| | | if @tbid='' |
| | | begin |
| | | ${_billcodesSql} |
| | | ${_insertsql} |
| | | end |
| | | else |
| | | begin |
| | | ${_updatesql} |
| | | end |
| | | ` |
| | | } |
| | | |
| | |
| | | auth: false |
| | | }) |
| | | } |
| | | } else if (res.ErrCode === 'N') { |
| | | localStorage.removeItem('AuthCode') |
| | | this.setState({ |
| | | auth: false |
| | | }) |
| | | } |
| | | }) |
| | | |