| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | } else { |
| | | let works_flow_countersign = '' |
| | | let works_flow_sign_values = '' |
| | | let works_flow_sign_field = '' |
| | | let works_flow_sign_field = 'statuscharone' |
| | | let works_flow_sign_label = '' |
| | | let works_begin_branch = '' |
| | | if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) { |
| | |
| | | getSysDeclareSql = (btn, formdata, data, columns, BID = '') => { |
| | | const { submitType } = this.state |
| | | |
| | | let datavars = {} // 声明的变量,表单及显示列 |
| | | // 需要声明的变量集 |
| | | 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'] |
| | | |
| | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | let _key = form.key.toLowerCase() |
| | | datavars[_key] = form.value |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {..._data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | | if (!col.field) return |
| | | 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' |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | } |
| | | |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | */ |
| | | getModels = () => { |
| | | const { BID, btn, BData } = this.props |
| | | const { btnconfig, visible, dict, confirmLoading, submitType } = this.state |
| | | const { btnconfig, visible, dict, confirmLoading, submitType, loadingNumber, loadingTotal } = this.state |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | | |
| | | let title = btn.label |
| | | let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw' |
| | | let clickouter = btnconfig.setting.clickouter === 'close' |
| | | let num = loadingNumber && !loadingTotal ? `(${loadingNumber}) ` : '' |
| | | |
| | | if (btnconfig.setting.display === 'drawer') { |
| | | let height = '100vh' |
| | |
| | | onCancel={this.handleCancel} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.handleCancel}>{dict['cancel'] || '取消'}</Button>, |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{submitType === btn.extValue ? num : ''}{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{submitType === '' ? num : ''}{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{num}{dict['ok'] || '确定'}</Button> : null |
| | | ]} |
| | | destroyOnClose |
| | | > |