| | |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | |
| | | } |
| | | } else if (openType === 'excelOut') { |
| | | reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredOnce'].includes(op.value)) |
| | | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc') |
| | |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | if (this.record.Ot !== 'notRequired' && this.record.Ot !== 'requiredOnce') { |
| | | this.record.Ot = 'notRequired' |
| | | } |
| | | } else if (openType === 'popview') { |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | |
| | | } |
| | | |
| | | if (appType === 'mob') { |
| | | if (Ot !== 'notRequired') { |
| | | if (Ot !== 'notRequired' && openType !== 'excelOut') { |
| | | shows.push('control') |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (Ot !== 'notRequired') { |
| | | if (Ot !== 'notRequired' && openType !== 'excelOut') { |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | | { value: 'disabled', text: '禁用' }, |
| | |
| | | _fieldval.label = '导出Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.execSuccess = 'never' |
| | | _fieldval.Ot = 'notRequired' |
| | | this.record.Ot = 'notRequired' |
| | | this.record.label = '导出Excel' |
| | | this.record.class = 'dgreen' |
| | |
| | | values.icon = 'scan' |
| | | } |
| | | } else if (values.OpenType === 'excelOut') { |
| | | values.Ot = 'notRequired' |
| | | values.Ot = values.Ot || 'notRequired' |
| | | } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) { |
| | | if ((values.Ot === 'requiredOnce' || card.Ot === 'requiredOnce') && card.Ot !== values.Ot) { |
| | | values.verify.uniques = [] |
| | |
| | | charType: '', |
| | | charInt: '', |
| | | vouDate: null, |
| | | book: null |
| | | book: null, |
| | | username: sessionStorage.getItem('User_Name'), |
| | | change: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 124, creditor: ''}, |
| | | {remark: '购入固定资产', subjectscode: '1001', subjectsname: '库存现金', debtor: '', creditor: 124}, |
| | | {remark: '转结销售成本', subjectscode: '1001', subjectsname: '库存现金', debtor: -524, creditor: ''}, |
| | | {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: ''}, |
| | | {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: '', i: Math.random()}, |
| | | ] |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate } = this.state |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, username } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | |
| | | </div> |
| | | <VoucherTable config={config} data={data}/> |
| | | </div> : null} |
| | | <div className="user">制单人:{username}</div> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | border-color: var(--mk-sys-color); |
| | | color: #ffffff; |
| | | } |
| | | .user { |
| | | padding: 15px 30px 0px; |
| | | } |
| | | } |
| | | |
| | | .mk-vcode-dropdown { |
| | |
| | | state = { |
| | | editing: false, |
| | | visible: false, |
| | | counting: false, |
| | | priceing: false |
| | | } |
| | | |
| | | componentDidMount () { |
| | |
| | | setTimeout(() => { |
| | | this.setState({visible: true}) |
| | | }, 100) |
| | | } else if (line.count_type === 'Y') { |
| | | this.setState({counting: true, value: line.count || 0}, () => { |
| | | let node = document.getElementById(col.uuid + record.uuid + 'count') |
| | | node && node.select() |
| | | }) |
| | | } else { |
| | | this.setState({editing: false}) |
| | | this.setState({editing: false, visible: false, counting: false, priceing: false}) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('tdFocus', 'debtor' + record.uuid) |
| | | }, 50) |
| | |
| | | MKEmitter.emit('changeRecord', col.tableId, fromJS(res).toJS()) |
| | | |
| | | this.setState({editing: false, visible: false}) |
| | | |
| | | if (res.count_type === 'Y') { |
| | | this.setState({counting: true, value: res.count || 0}, () => { |
| | | let node = document.getElementById(col.uuid + res.uuid + 'count') |
| | | node && node.select() |
| | | }) |
| | | } else { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('tdFocus', 'debtor' + res.uuid) |
| | | }, 50) |
| | | } |
| | | } |
| | | |
| | | cancel = () => { |
| | |
| | | this.setState({editing: false, visible: false}) |
| | | } |
| | | |
| | | editCount = (e) => { |
| | | const { col, record } = this.props |
| | | e.stopPropagation() |
| | | |
| | | this.setState({counting: true, value: record.count || 0}, () => { |
| | | let node = document.getElementById(col.uuid + record.uuid + 'count') |
| | | node && node.select() |
| | | }) |
| | | } |
| | | |
| | | editPrice = (e) => { |
| | | const { col, record } = this.props |
| | | e.stopPropagation() |
| | | |
| | | this.setState({priceing: true, value: record.price || 0}, () => { |
| | | let node = document.getElementById(col.uuid + record.uuid + 'price') |
| | | node && node.select() |
| | | }) |
| | | } |
| | | |
| | | countPress = () => { |
| | | const { col, record } = this.props |
| | | const { value } = this.state |
| | | |
| | | let line = {...record} |
| | | line.count = value || 0 |
| | | |
| | | if (isNaN(line.count)) { |
| | | line.count = 0 |
| | | } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | |
| | | this.setState({counting: false, priceing: true, value: line.price || 0}, () => { |
| | | let node = document.getElementById(col.uuid + record.uuid + 'price') |
| | | node && node.select() |
| | | }) |
| | | } |
| | | |
| | | countBlur = () => { |
| | | const { col, record } = this.props |
| | | const { value } = this.state |
| | | |
| | | this.setState({counting: false}) |
| | | |
| | | let line = {...record} |
| | | line.count = value || 0 |
| | | |
| | | if (isNaN(line.count)) { |
| | | line.count = 0 |
| | | } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | } |
| | | |
| | | pricePress = () => { |
| | | const { col, record } = this.props |
| | | const { value } = this.state |
| | | |
| | | let line = {...record} |
| | | line.price = value || 0 |
| | | |
| | | if (isNaN(line.price)) { |
| | | line.price = 0 |
| | | } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | |
| | | this.setState({priceing: false}) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('tdFocus', 'debtor' + record.uuid) |
| | | }, 50) |
| | | } |
| | | |
| | | priceBlur = () => { |
| | | const { col, record } = this.props |
| | | const { value } = this.state |
| | | |
| | | this.setState({priceing: false}) |
| | | |
| | | let line = {...record} |
| | | line.price = value || 0 |
| | | |
| | | if (isNaN(line.price)) { |
| | | line.price = 0 |
| | | } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | } |
| | | |
| | | render() { |
| | | let { col, record, className } = this.props |
| | | const { editing, visible } = this.state |
| | | const { editing, visible, counting, priceing } = this.state |
| | | |
| | | let children = null |
| | | let colSpan = 1 |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (record.count_type === 'Y') { |
| | | if (counting) { |
| | | children = <div className="content-wrap" onClick={this.focus}> |
| | | <div>{val}</div> |
| | | <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}}> |
| | | <span>数量:</span> |
| | | <span><InputNumber className="inner-input" id={col.uuid + record.uuid + 'count'} defaultValue={record.count || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.countPress} onBlur={this.countBlur}/></span> |
| | | </span> |
| | | <span onClick={this.editPrice}> |
| | | <span>单价:</span> |
| | | <span>{record.price || 0}</span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | } else if (priceing) { |
| | | children = <div className="content-wrap" onClick={this.focus}> |
| | | <div>{val}</div> |
| | | <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}} onClick={this.editCount}> |
| | | <span>数量:</span> |
| | | <span>{record.count || 0}</span> |
| | | </span> |
| | | <span> |
| | | <span>单价:</span> |
| | | <span><InputNumber className="inner-input" id={col.uuid + record.uuid + 'price'} defaultValue={record.price || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.pricePress} onBlur={this.priceBlur}/></span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | } else { |
| | | children = <div className="content-wrap" onClick={this.focus}> |
| | | <div>{val}</div> |
| | | <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}} onClick={this.editCount}> |
| | | <span>数量:</span> |
| | | <span>{record.count || 0}</span> |
| | | </span> |
| | | <span onClick={this.editPrice}> |
| | | <span>单价:</span> |
| | | <span>{record.price || 0}</span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | } |
| | | } else { |
| | | children = <div className="content-wrap" onClick={this.focus}>{val}</div> |
| | | } |
| | | } |
| | | } |
| | | } else if (col.field === 'debtor') { |
| | |
| | | data.push(this.getTotalLine(data)) |
| | | |
| | | this.setState({ |
| | | edData: [] |
| | | }, () => { |
| | | this.setState({ |
| | | edData: data |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | initData = (data) => { |
| | |
| | | height: 100%; |
| | | font-size: 13px; |
| | | font-weight: bold; |
| | | |
| | | .count-wrap { |
| | | text-align: right; |
| | | } |
| | | } |
| | | .money-uint { |
| | | height: 100%; |
| | |
| | | border-radius: 0; |
| | | resize: none; |
| | | } |
| | | .ant-input-number { |
| | | .ant-input-number:not(.inner-input) { |
| | | height: 60px; |
| | | border-radius: 0; |
| | | |
| | |
| | | height: 60px; |
| | | } |
| | | } |
| | | .ant-input-number.inner-input { |
| | | display: inline-block; |
| | | width: 40px; |
| | | border-radius: 0; |
| | | height: 24px; |
| | | |
| | | .ant-input-number-handler-wrap { |
| | | display: none; |
| | | } |
| | | .ant-input-number-input { |
| | | border-radius: 0; |
| | | height: 22px; |
| | | padding: 0 5px; |
| | | } |
| | | } |
| | | .ant-select { |
| | | padding: 0px; |
| | | position: absolute; |
| | |
| | | static propTpyes = { |
| | | BID: PropTypes.string, // 主表ID |
| | | BData: PropTypes.any, // 主表数据 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | updateStatus: PropTypes.func, // 按钮状态更新 |
| | |
| | | * @description 获取用户自定义存储过程传参 |
| | | */ |
| | | getExcelCustomParam = (orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | const { btn, selectedData } = this.props |
| | | let _search = Utils.formatCustomMainSearch(search) |
| | | |
| | | let param = { |
| | |
| | | // 数据管理权限 |
| | | if (sessionStorage.getItem('dataM') === 'true') { |
| | | param.dataM = 'Y' |
| | | } |
| | | |
| | | if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { |
| | | let primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') |
| | | if (primaryId) { |
| | | param.ID = primaryId |
| | | } |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | |
| | | * @description 获取默认存储过程请求参数 |
| | | */ |
| | | getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | const { setting, btn } = this.props |
| | | const { setting, btn, selectedData, BID } = this.props |
| | | |
| | | let defaultSql = setting.execute || setting.default || 'true' |
| | | let customScript = setting.customScript || '' |
| | | let _dataresource = setting.dataresource || '' |
| | | let queryType = setting.queryType |
| | | let primaryKey = setting.primaryKey || 'ID' |
| | | |
| | | if (btn.verify.dataType === 'custom') { |
| | | defaultSql = btn.verify.defaultSql || 'true' |
| | | _dataresource = btn.verify.dataresource || '' |
| | | queryType = btn.verify.queryType |
| | | primaryKey = btn.verify.primaryKey || 'ID' |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | |
| | | param.dataM = 'Y' |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | if (BID) { |
| | | param.BID = BID |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | |
| | | _search = '' |
| | | } |
| | | |
| | | let primaryId = '' |
| | | if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { |
| | | primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') |
| | | if (_search && primaryId) { |
| | | _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` |
| | | } else if (primaryId) { |
| | | _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` |
| | | } |
| | | } |
| | | |
| | | let LText = '' |
| | | |
| | | if (defaultSql !== 'false' && !pagination) { |
| | |
| | | ` |
| | | } |
| | | |
| | | LText = LText.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | LText = LText.replace(/@BID@/ig, `'${BID}'`) |
| | | param.custom_script = param.custom_script.replace(/@BID@/ig, `'${BID}'`) |
| | | LText = LText.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | LText = LText.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | LText = LText.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | LText = LText.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | LText = LText.replace(/@typename@/ig, `'admin'`) |
| | | param.custom_script = param.custom_script.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { |
| | | param.custom_script && console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${param.custom_script}`) |
| | |
| | | btn={item} |
| | | BData={BData} |
| | | setting={setting} |
| | | selectedData={selectedData} |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'popview') { |
| | |
| | | prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'], |
| | | exec: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'hidden'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'hidden'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search', 'hidden'], |
| | | excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose', 'display', 'ratio', 'clickouter', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'linkmenu', 'hidden'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position', 'hidden'], |
| | |
| | | } |
| | | } else if (openType === 'excelOut') { |
| | | reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredOnce'].includes(op.value)) |
| | | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc') |
| | |
| | | } else if (this.record.intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | | reRequired.innerFunc = true |
| | | } |
| | | if (this.record.Ot !== 'notRequired' && this.record.Ot !== 'requiredOnce') { |
| | | this.record.Ot = 'notRequired' |
| | | } |
| | | } else if (openType === 'popview') { |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | |
| | | reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') |
| | | } |
| | | |
| | | if (Ot !== 'notRequired') { |
| | | if (Ot !== 'notRequired' && openType !== 'excelOut') { |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | | { value: 'disabled', text: '禁用' }, |
| | |
| | | _fieldval.label = '导出Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.execSuccess = 'never' |
| | | _fieldval.Ot = 'notRequired' |
| | | this.record.Ot = 'notRequired' |
| | | this.record.label = '导出Excel' |
| | | this.record.class = 'dgreen' |
| | |
| | | values.position = values.position || 'toolbar' |
| | | |
| | | if (values.OpenType === 'excelOut') { |
| | | values.Ot = 'notRequired' |
| | | values.Ot = values.Ot || 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | | values.linkTab = Utils.getuuid() |
| | | } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) { |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> |
| | | <Form.Item label="主键"> |
| | | {getFieldDecorator('primaryKey', { |
| | | initialValue: setting.primaryKey || 'ID', |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> |
| | | <Form.Item label="排序方式"> |
| | | {getFieldDecorator('order', { |
| | | initialValue: setting.order || '', |