From 407c0f1765c7d085218a91ad8842784977383d05 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 十月 2020 00:18:13 +0800 Subject: [PATCH] 2020-10-23 --- src/templates/zshare/verifycard/index.jsx | 1004 +++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 671 insertions(+), 333 deletions(-) diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 1d453bc..4a557df 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Tabs, Row, Col, Radio, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Tooltip } from 'antd' +import { fromJS } from 'immutable' +import { Form, Tabs, Row, Col, Radio, Button, Table, Select, Popconfirm, Icon, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd' import moment from 'moment' import Api from '@/api' @@ -15,25 +16,31 @@ import './index.scss' const { TabPane } = Tabs +const { confirm } = Modal +const { Paragraph } = Typography class VerifyCard extends Component { static propTpyes = { - floor: PropTypes.any, // 鏄惁涓哄瓙琛� btnTab: PropTypes.any, // 琛ㄥ崟鏍囩椤碉紙鎸夐挳锛夊弬鏁� config: PropTypes.any, // 琛ㄥ崟鏍囩椤靛弬鏁� dict: PropTypes.object, // 瀛楀吀椤� - card: PropTypes.object, + card: PropTypes.object, // 鎸夐挳淇℃伅 columns: PropTypes.array } state = { + initsql: '', // sql楠岃瘉鏃跺彉閲忓0鏄庡強璧嬪�� + notes: [], // 鐭俊妯℃澘 verify: {}, fields: [], usefulfields: '', + defaultsql: '', // 榛樿Sql orderModular: [], orderModularDetail: [], voucher: [], voucherDetail: [], + systemScripts: [], + columnsFields: [], uniqueColumns: [ { title: '瀛楁鍚�', @@ -58,13 +65,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['header.form.status.forbidden']} + {this.props.dict['model.status.forbidden']} <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['header.form.status.open']} + {this.props.dict['model.status.open']} <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> </div> ) @@ -76,14 +83,58 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['header.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} + onConfirm={() => this.handleDelete(record, 'unique') + }> + <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> + </Popconfirm> + </div>) + } + ], + onceUniqueColumns: [ + { + title: '瀛楁鍚�', + dataIndex: 'field', + width: '45%' + }, + { + title: '鐘舵��', + dataIndex: 'status', + width: '30%', + render: (text, record) => record.status === 'false' ? + ( + <div> + {this.props.dict['model.status.forbidden']} + <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> + </div> + ) : + ( + <div> + {this.props.dict['model.status.open']} + <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> + </div> + ) + }, + { + title: '鎿嶄綔', + align: 'center', + width: '25%', + dataIndex: 'operation', + render: (text, record) => + (<div> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> + <Popconfirm + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -124,13 +175,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['header.form.status.forbidden']} + {this.props.dict['model.status.forbidden']} <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['header.form.status.open']} + {this.props.dict['model.status.open']} <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> </div> ) @@ -142,14 +193,13 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'contrast')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'contrast')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'contrast', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'contrast', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'contrast')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['header.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} onConfirm={() => this.handleDelete(record, 'contrast') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -161,7 +211,10 @@ { title: 'SQL', dataIndex: 'sql', - width: '45%' + width: '45%', + render: (text) => ( + <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> + ) }, { title: '缁撴灉澶勭悊', @@ -185,13 +238,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['header.form.status.forbidden']} + {this.props.dict['model.status.forbidden']} <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['header.form.status.open']} + {this.props.dict['model.status.open']} <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> </div> ) @@ -203,14 +256,13 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'customverify')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'customverify')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'customverify', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'customverify', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['header.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} onConfirm={() => this.handleDelete(record, 'customverify') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -222,7 +274,24 @@ { title: 'SQL', dataIndex: 'sql', - width: '70%' + width: '60%', + render: (text) => ( + <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> + ) + }, + { + title: '鎵ц浣嶇疆', + dataIndex: 'position', + width: '10%', + render: (text, record) => { + if (record.position === 'init') { + return '鍒濆鍖�' + } else if (record.position === 'front') { + return 'sql鍓�' + } else { + return 'sql鍚�' + } + } }, { title: '鐘舵��', @@ -231,13 +300,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['header.form.status.forbidden']} + {this.props.dict['model.status.forbidden']} <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['header.form.status.open']} + {this.props.dict['model.status.open']} <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> </div> ) @@ -249,14 +318,13 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['header.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -268,13 +336,13 @@ { title: this.props.dict['header.form.funcvar'], dataIndex: 'fieldName', - width: '13%', + width: '12%', render: (text, record) => (`${record.fieldName || ''}(${record.field})`) }, { title: '绫诲瀷', dataIndex: 'billType', - width: '8%', + width: '6%', }, { title: '鍑瘉绫诲瀷', @@ -289,13 +357,13 @@ { title: '鍏宠仈瀛楁', dataIndex: 'linkFieldName', - width: '12%', + width: '10%', render: (text, record) => (record.linkField ? `${record.linkFieldName || ''}(${record.linkField})` : '') }, { title: '浣嶆暟', dataIndex: 'Type', - width: '8%' + width: '6%' }, { title: '绀轰緥', @@ -324,19 +392,24 @@ } }, { + title: '鏍囪瘑', + dataIndex: 'mark', + width: '8%' + }, + { title: '鐘舵��', dataIndex: 'status', - width: '9%', + width: '8%', render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['header.form.status.forbidden']} + {this.props.dict['model.status.forbidden']} <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['header.form.status.open']} + {this.props.dict['model.status.open']} <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> </div> ) @@ -348,14 +421,13 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'ordercode')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'ordercode')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'ordercode', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'ordercode', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['header.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title={this.props.dict['model.query.delete']} onConfirm={() => this.handleDelete(record, 'ordercode') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -366,16 +438,22 @@ } UNSAFE_componentWillMount() { - const { columns, config, card } = this.props - let _verify = this.props.card.verify || {} + const { columns, config, card, btnTab } = this.props + let _verify = card.verify || {} let _invalid = _verify.invalid if (!_invalid) { // 閫夋嫨琛屾椂锛屽け鏁堥獙璇侀粯璁ゅ紑鍚� _invalid = card.Ot !== 'notRequired' ? 'true' : 'false' } + if (card.sqlType === 'custom') { // 鑷畾涔夐獙璇佹椂锛屼笉浣跨敤榛樿sql + _verify.default = 'false' + } _verify.default = _verify.default || 'true' + _verify.noteEnable = _verify.noteEnable || 'false' // 鐭俊鍙戦�佹槸鍚﹀紑鍚� + _verify.noteType = _verify.noteType || 'N' // 鐭俊鍙戦�佹ā寮忥細Y锛堝疄鏃讹級銆丯锛堝畾鏃讹級 + _verify.noteTemp = _verify.noteTemp || 'Y' // 鐭俊鍙戦�佹ā鏉匡細Y锛堢浉鍚岋級銆丯锛堜笉鍚岋級 _verify.invalid = _invalid _verify.uniques = _verify.uniques || [] _verify.contrasts = _verify.contrasts || [] @@ -389,260 +467,393 @@ verify: _verify }) - if (this.props.card.btnType) { // 鎸夐挳-琛ㄥ崟鏍囩椤� + new Promise(resolve => { let _fields = [] - - config.groups.forEach(group => { - _fields.push(...group.sublist) - }) - - let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] - _fields.forEach(_f => { - if (_f.field) { - _usefulfields.push(_f.field) - } - }) - - if (columns && columns.length > 0 && this.props.btnTab.Ot !== 'notRequired') { - columns.forEach(_f => { - if (_f.field) { - _usefulfields.push(_f.field) - } + if (config.Template === 'FormTab') { + config.groups.forEach(group => { + _fields.push(...group.sublist) }) - } - - _usefulfields = Array.from(new Set(_usefulfields)) - _usefulfields = _usefulfields.join(', ') - - this.setState({ - fields: _fields, - usefulfields: _usefulfields - }) - return - } - if (this.props.card.OpenType === 'pop') { - Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: this.props.card.uuid - }).then(res => { - if (res.status) { - let _LongParam = '' - if (res.LongParam) { - try { - _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - console.warn('Parse Failure') - _LongParam = '' - } - } - - if (!_LongParam) return - - let _fields = [] - if (_LongParam.groups.length > 0) { - _LongParam.groups.forEach(group => { - _fields.push(...group.sublist) - }) - } else { - _fields = _LongParam.fields - } - - let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName'] - let hasBid = false - - _fields.forEach(_f => { - if (_f.field) { - _usefulfields.push(_f.field) - } - if (_f.field && _f.field.toLowerCase() === 'bid') { - hasBid = true - } - }) - - if (this.props.floor === 'subtable' && !hasBid) { // 瀛愯〃琛ㄥ崟涓鍔燘ID - _fields.unshift({ - uuid: 'BID', - field: 'BID', - label: 'BID', - type: 'text' - }) - } - - if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { - columns.forEach(_f => { - if (_f.field) { - _usefulfields.push(_f.field) - } - }) - } - - _usefulfields = Array.from(new Set(_usefulfields)) - _usefulfields = _usefulfields.join(', ') - - - this.setState({ - fields: _fields, - usefulfields: _usefulfields + resolve(_fields) + } else if (card.modal) { + if (card.modal.groups && card.modal.groups.length > 0) { + card.modal.groups.forEach(group => { + _fields.push(...group.sublist) }) } else { - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) + _fields = card.modal.fields || [] + } + resolve(_fields) + } else if (card.OpenType === 'pop') { + Api.getSystemConfig({ + func: 'sPC_Get_LongParam', + MenuID: card.uuid + }).then(res => { + if (res.status) { + let _LongParam = '' + if (res.LongParam) { + try { + _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) + } catch (e) { + console.warn('Parse Failure') + _LongParam = '' + } + } + + if (!_LongParam) { + notification.warning({ + top: 92, + message: '鏈幏鍙栧埌琛ㄥ崟淇℃伅锛岄儴鍒嗛獙璇佸皢鏃犳硶璁剧疆锛�', + duration: 5 + }) + } else { + if (_LongParam.groups.length > 0) { + _LongParam.groups.forEach(group => { + _fields.push(...group.sublist) + }) + } else { + _fields = _LongParam.fields || [] + } + } + } else { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } + resolve(_fields) + }) + } + }).then(_fields => { + let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode'] + let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)'] + let _select = ['@UserName=\'\'', '@FullName=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\''] + let fieldArr = _usefulfields.map(_f => _f.toLowerCase()) + let hasBid = false + + _fields = _fields.filter(_f => _f.field) + _fields.forEach(_f => { + if (fieldArr.includes(_f.field.toLowerCase())) return + + fieldArr.push(_f.field.toLowerCase()) + + _usefulfields.push(_f.field) + + let _fieldlen = _f.fieldlength || 50 + + if (_f.type === 'number') { + _fieldlen = _f.decimal ? _f.decimal : 0 + } + + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + + let _type = `nvarchar(${_fieldlen})` + + if (_f.type.match(/date/ig)) { + _type = 'datetime' + _select.push(`@${_f.field}='1900-01-01'`) + } else if (_f.type === 'number') { + _type = `decimal(18,${_fieldlen})` + _select.push(`@${_f.field}=0`) + } else { + _select.push(`@${_f.field}=''`) + } + + _declare.push(`@${_f.field} ${_type}`) + + if (_f.field.toLowerCase() === 'bid') { + hasBid = true } }) - } else { - let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName'] - if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { - columns.forEach(_f => { - if (_f.field) { - _usefulfields.push(_f.field) + if (!hasBid) { // 琛ㄥ崟涓鍔燘ID + _fields.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) + } + + let hasColumn = false + if (columns && columns.length > 0) { + if (btnTab) { // 琛ㄥ崟鏍囩 + if (btnTab.Ot !== 'notRequired' && btnTab.Ot !== 'requiredOnce') { + hasColumn = true } + } else if (card.Ot !== 'notRequired' && card.Ot !== 'requiredOnce') { + hasColumn = true + } + } + + if (hasColumn) { + columns.forEach(_f => { + if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return + + fieldArr.push(_f.field.toLowerCase()) + + _usefulfields.push(_f.field) + + if (_f.datatype) { // 鑷畾涔夊瓧娈� + if (/decimal/ig.test(_f.datatype)) { + _select.push(`@${_f.field}=0`) + } else { + _select.push(`@${_f.field}=''`) + } + + _declare.push(`@${_f.field} ${_f.datatype}`) + return + } + + let _fieldlen = _f.fieldlength || 50 + + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + + let _type = `nvarchar(${_fieldlen})` + + if (_f.type === 'number') { + _type = `decimal(18,${_f.decimal ? _f.decimal : 0})` + } else if (_f.type === 'picture' || _f.type === 'textarea') { + _type = `nvarchar(${_fieldlen})` + } + + if (_f.type === 'number') { + _select.push(`@${_f.field}=0`) + } else { + _select.push(`@${_f.field}=''`) + } + + _declare.push(`@${_f.field} ${_type}`) }) } - _usefulfields = Array.from(new Set(_usefulfields)) - _usefulfields = _usefulfields.join(', ') + let _sql = `Declare ${_declare.join(', ')} + Select ${_select.join(', ')} + ` + // 榛樿sql + let _defaultsql = '' + let _insertsql = '' + let _updatesql = '' + if (card.sqlType === 'insert' || card.sqlType === 'insertOrUpdate') { + let keys = [] + let values = [] + _fields.forEach(item => { + if (!item.field) return + + keys.push(item.field.toLowerCase()) + values.push('@' + item.field) + }) + + if (config.setting.primaryKey && !keys.includes(config.setting.primaryKey.toLowerCase())) { + keys.push(config.setting.primaryKey.toLowerCase()) + values.push('@ID@') + } + if (!keys.includes('createuserid')) { + keys.push('createuserid') + values.push('@userid@') + } + if (!keys.includes('createuser')) { + keys.push('createuser') + values.push('@username') + } + if (!keys.includes('createstaff')) { + keys.push('createstaff') + values.push('@fullname') + } + if (!keys.includes('bid')) { + keys.push('bid') + values.push('@BID@') + } + + keys = keys.join(', ') + values = values.join(', ') + _insertsql = `insert into ${card.sql} (${keys}) select ${values};` + } + + if (card.sqlType === 'update' || card.sqlType === 'audit' || card.sqlType === 'insertOrUpdate') { + let _form = [] + let _arr = [] + + _fields.forEach(item => { + if (!item.field) return + + _arr.push(item.field.toLowerCase()) + _form.push(item.field + '=@' + item.field) + }) + + if (this.props.card.sqlType === 'audit') { + if (!_arr.includes('submitdate')) { + _form.push('submitdate=getdate()') + } + if (!_arr.includes('submituserid')) { + _form.push('submituserid=@userid@') + } + } else { + if (!_arr.includes('modifydate')) { + _form.push('modifydate=getdate()') + } + if (!_arr.includes('modifyuserid')) { + _form.push('modifyuserid=@userid@') + } + } + + if (_verify.voucher && _verify.voucher.enabled) { + if (!_arr.includes('bvoucher')) { + _form.push('BVoucher=@BVoucher') + } + if (!_arr.includes('fibvoucherdate')) { + _form.push('FIBVoucherDate=@FIBVoucherDate') + } + if (!_arr.includes('fiyear')) { + _form.push('FiYear=@FiYear') + } + } + + _form = _form.join(', ') + _updatesql = `update ${card.sql} set ${_form} where ${config.setting.primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` + } + + if (card.sqlType === 'insert') { + _defaultsql = _insertsql + } else if (card.sqlType === 'update' || card.sqlType === 'audit') { + _defaultsql = _updatesql + } else if (card.sqlType === 'insertOrUpdate') { + _defaultsql += `select @tbid='' + select @tbid='X' from ${card.sql} where ${config.setting.primaryKey}=@ID@ + if @tbid='' + begin + ${_insertsql} + end + else + begin + ${_updatesql} + end + ` + } else if (card.sqlType === 'LogicDelete') { + _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` + } else if (card.sqlType === 'delete') { + let _msg = '' + if (columns && columns.length > 0 && card.Ot !== 'notRequired' && card.Ot !== 'requiredOnce') { + let _index = 0 + columns.forEach(col => { + if (!col.field || col.Hide === 'true' || _index >= 4) return + + _msg += col.label + '=\'\',' + _index++ + }) + } + _defaultsql += `insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('鍒犻櫎琛�:${card.sql} 鏁版嵁: ${_msg}${config.setting.primaryKey}='+@ID@,200),@userid@,@username,@fullname delete ${card.sql} where ${config.setting.primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` + } + + let _columns = [] + if (columns) { + _columns = fromJS(columns).toJS() + let hasbid = false + _columns = _columns.filter(col => { + if (col.field.toLowerCase() === 'bid') { + hasbid = true + } + + return !!col.field + }) + + if (!hasbid) { + _columns.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) + } + } + this.setState({ - usefulfields: _usefulfields + fields: _fields, + columnsFields: _columns, + initsql: _sql, + defaultsql: _defaultsql, + usefulfields: _usefulfields.join(', ') }) - } + }) } componentDidMount() { - // 鑾峰彇鐢熸垚鍗曞彿涓�绾ц彍鍗� - let defer1 = new Promise(resolve => { - let _orderSql = 'select ID,ModularCode+ModularName+ModularNo as NameNO from sModular where deleted=0 order by ID asc' - _orderSql = Utils.formatOptions(_orderSql) - - let orderParam = { - func: 'sPC_Get_SelectedList', - LText: _orderSql, - obj_name: 'data', - arr_field: 'ID,NameNO' + let mutilForms = [ + { + obj_name: 'modular', + arr_field: 'ID,NameNO', + LText: window.btoa(window.encodeURIComponent(`select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO from sModular where deleted=0 and Appkey=case when Appkey='' then '' else @Appkey@ end order by ID asc`)) + }, + { + obj_name: 'modularDetail', + arr_field: 'ModularDetailCode,CodeName,BID,Type', + LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Deleted=0 and Appkey=case when Appkey='' then '' else @Appkey@ end order by ModularDetailCode`)) + }, + { + obj_name: 'voucher', + arr_field: 'ID,NameNO,TypeCharOne', + LText: window.btoa(window.encodeURIComponent('select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0 and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end order by ModularCode')) + }, + { + obj_name: 'voucherDetail', + arr_field: 'ModularDetailCode,CodeName,BID,VoucherTypeTwo,IDefine1', + LText: window.btoa(window.encodeURIComponent('select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!=\'\' and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end order by ModularDetailCode')) + }, + { + obj_name: 'noteCodes', + arr_field: 'templatecode,describe', + LText: window.btoa(window.encodeURIComponent(`select templatecode,'['+SignName+']'+describe as describe from (select * from bd_msn_sms_temp where deleted=0 and TypeDesc='QX' and status=20 ) t inner join (select openid from susers where uid=@userid@) u on t.openid =t.openid`)) + }, + { + obj_name: 'scripts', + arr_field: 'funcname,longparam', + LText: window.btoa(window.encodeURIComponent(`Select distinct func+Remark as funcname,longparam, s.Sort from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort`)) } + ] - orderParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - orderParam.secretkey = Utils.encrypt(orderParam.LText, orderParam.timestamp) - - Api.getSystemConfig(orderParam).then(res => { - if (res.status) { - resolve(res) - } else { - notification.warning({ - top: 92, - message: res.message, - duration: 10 + mutilForms = mutilForms.map(item => `select '${item.obj_name}' as obj_name,'${item.arr_field}' as arr_field,'${item.LText}' as LText`) + + let mutilparam = { + func: 'sPC_Get_SelectedList', + LText: mutilForms.join(' union all '), + obj_name: '', + arr_field: '', + table_type: 'Y' + } + + mutilparam.LText = Utils.formatOptions(mutilparam.LText) + mutilparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + mutilparam.secretkey = Utils.encrypt(mutilparam.LText, mutilparam.timestamp) + mutilparam.open_key = Utils.encryptOpenKey(mutilparam.secretkey, mutilparam.timestamp) + + Api.getCloudCacheConfig(mutilparam).then(res => { + if (res.status) { + this.setState({ + orderModular: res.modular, + orderModularDetail: res.modularDetail, + voucher: res.voucher, + voucherDetail: res.voucherDetail, + notes: res.noteCodes.map(item => { + return { + name: item.describe, + value: item.templatecode + } + }), + systemScripts: res.scripts.map(item => { + return { + name: item.funcname, + value: Utils.UnformatOptions(item.longparam) + } }) - } - }) - }) - - // 鑾峰彇鐢熸垚鍗曞彿浜岀骇鑿滃崟 - let defer2 = new Promise(resolve => { - let _orderDetailSql = 'select ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,BID,Type from sModularDetail where Deleted=0' - _orderDetailSql = Utils.formatOptions(_orderDetailSql) - - let orderDetailParam = { - func: 'sPC_Get_SelectedList', - LText: _orderDetailSql, - obj_name: 'data', - arr_field: 'ModularDetailCode,CodeName,BID,Type' + }) + } else { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) } - - orderDetailParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - orderDetailParam.secretkey = Utils.encrypt(orderDetailParam.LText, orderDetailParam.timestamp) - - Api.getSystemConfig(orderDetailParam).then(res => { - if (res.status) { - resolve(res) - } else { - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) - } - }) - }) - - Promise.all([defer1, defer2]).then(result => { - this.setState({ - orderModular: result[0].data, - orderModularDetail: result[1].data - }) - }) - - // 鑾峰彇鍑瘉浜岀骇鑿滃崟 - let defer3 = new Promise(resolve => { - let _voucherSql = 'select ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0' - _voucherSql = Utils.formatOptions(_voucherSql) - - let voucherParam = { - func: 'sPC_Get_SelectedList', - LText: _voucherSql, - obj_name: 'data', - arr_field: 'ID,NameNO,TypeCharOne' - } - - voucherParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - voucherParam.secretkey = Utils.encrypt(voucherParam.LText, voucherParam.timestamp) - - Api.getSystemConfig(voucherParam).then(res => { - if (res.status) { - resolve(res) - } else { - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) - } - }) - }) - - // 鑾峰彇鍑瘉涓夌骇鑿滃崟 - let defer4 = new Promise(resolve => { - let _voucherDetailSql = 'select ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!=\'\'' - _voucherDetailSql = Utils.formatOptions(_voucherDetailSql) - - let voucherDetailParam = { - func: 'sPC_Get_SelectedList', - LText: _voucherDetailSql, - obj_name: 'data', - arr_field: 'ModularDetailCode,CodeName,BID,VoucherTypeTwo,IDefine1' - } - - voucherDetailParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - voucherDetailParam.secretkey = Utils.encrypt(voucherDetailParam.LText, voucherDetailParam.timestamp) - - Api.getSystemConfig(voucherDetailParam).then(res => { - if (res.status) { - resolve(res) - } else { - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) - } - }) - }) - - Promise.all([defer3, defer4]).then(result => { - this.setState({ - voucher: result[0].data, - voucherDetail: result[1].data - }) }) } uniqueChange = (values) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() if (values.uuid) { verify.uniques = verify.uniques.map(item => { @@ -657,13 +868,11 @@ verify.uniques.push(values) } - this.setState({ - verify: verify - }) + this.setState({ verify }) } contrastChange = (values) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() if (values.uuid) { verify.contrasts = verify.contrasts.map(item => { @@ -678,13 +887,11 @@ verify.contrasts.push(values) } - this.setState({ - verify: verify - }) + this.setState({ verify }) } customChange = (values) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() if (values.uuid) { verify.customverifys = verify.customverifys.map(item => { @@ -699,13 +906,11 @@ verify.customverifys.push(values) } - this.setState({ - verify: verify - }) + this.setState({ verify }) } scriptsChange = (values) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() if (values.uuid) { verify.scripts = verify.scripts.map(item => { @@ -720,13 +925,11 @@ verify.scripts.push(values) } - this.setState({ - verify: verify - }) + this.setState({ verify }) } orderChange = (values) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() if (values.uuid) { verify.billcodes = verify.billcodes.map(item => { @@ -741,8 +944,14 @@ verify.billcodes.push(values) } + this.setState({ verify }) + } + + onNoteCodeChange = (val) => { + const { verify } = this.state + this.setState({ - verify: verify + verify: {...verify, noteCode: val} }) } @@ -770,7 +979,7 @@ verify.contrasts = verify.contrasts.filter(item => item.uuid !== record.uuid) } - this.setState({ verify: verify }) + this.setState({ verify }) } handleEdit = (record, type) => { @@ -803,7 +1012,7 @@ } handleStatus = (record, type) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() record.status = record.status === 'false' ? 'true' : 'false' if (type === 'customverify') { @@ -848,13 +1057,11 @@ }) } - this.setState({ - verify: verify - }) + this.setState({ verify }) } handleUpDown = (record, type, direction) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + let verify = fromJS(this.state.verify).toJS() let index = 0 if (type === 'customverify') { @@ -944,9 +1151,7 @@ } } - this.setState({ - verify: verify - }) + this.setState({ verify }) } voucherChange = (voucher) => { @@ -976,13 +1181,13 @@ className: 'notification-custom-error', top: 92, message: '鎵ц澶辫触锛�', - duration: 15 + duration: 10 }) } else if (errorType === 'N') { notification.error({ top: 92, message: '鎵ц澶辫触锛�', - duration: 15 + duration: 10 }) } else if (errorType === 'E') { Modal.error({ @@ -1001,6 +1206,60 @@ }) } + handleConfirm = () => { + const { card } = this.props + let verify = fromJS(this.state.verify).toJS() + + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + return new Promise((resolve, reject) => { + if (card.sqlType !== 'custom' && verify.default === 'false' && verify.scripts.length === 0) { + notification.warning({ + top: 92, + message: '涓嶆墽琛岄粯璁ql鏃讹紝蹇呴』璁剧疆鑷畾涔夎剼鏈紒', + duration: 5 + }) + return + } + + let _loading = false + if (this.customForm && this.customForm.state.editItem) { + _loading = true + } else if (this.uniqueForm && this.uniqueForm.state.editItem) { + _loading = true + } else if (this.orderForm && this.orderForm.state.editItem) { + _loading = true + } else if (this.scriptsForm && this.scriptsForm.state.editItem) { + _loading = true + } else if (this.contrastForm && this.contrastForm.state.editItem) { + _loading = true + } + + if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + _loading = true + } else if (this.customForm && this.customForm.props.form.getFieldValue('sql')) { + _loading = true + } + + if (verify.noteEnable === 'true' && !verify.noteCode) { // 寮�鍚煭淇℃椂锛岄渶瑕佹ā鏉跨紪鐮� + verify.noteEnable = 'false' + } else if (verify.noteEnable !== 'true' && verify.noteCode) { + verify.noteCode = '' + } + + if (_loading) { + confirm({ + content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, + onOk() { + resolve(verify) + }, + onCancel() {} + }) + } else { + resolve(verify) + } + }) + } + /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ @@ -1011,7 +1270,8 @@ } render() { - const { verify, fields, uniqueColumns, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail } = this.state + const { card } = this.props + const { verify, fields, uniqueColumns, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -1023,18 +1283,13 @@ } } - let display = false - if (this.props.card.intertype === 'inner' && !this.props.card.innerFunc) { - display = true - } - return ( <div id="verify-card-box-tab"> - {display ? <Tabs defaultActiveKey="1" className="verify-card-box"> + {card.intertype === 'system' ? <Tabs defaultActiveKey="1" className="verify-card-box"> <TabPane tab="鍩虹楠岃瘉" key="1"> <Form {...formItemLayout}> <Row gutter={24}> - <Col span={8}> + {this.props.card.sqlType !== 'custom' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={'榛樿sql鎵ц椤哄簭涓鸿嚜瀹氫箟鑴氭湰涔嬪墠'}> <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> @@ -1046,7 +1301,7 @@ <Radio value="false">涓嶆墽琛�</Radio> </Radio.Group> </Form.Item> - </Col> + </Col> : null} <Col span={8}> <Form.Item label={'璐︽湡楠岃瘉'}> <Radio.Group value={verify.accountdate} onChange={(e) => {this.onOptionChange(e, 'accountdate')}}> @@ -1063,10 +1318,60 @@ </Radio.Group> </Form.Item> </Col> + <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title={'閫夋嫨鍙戦�佺煭淇℃椂锛岄渶瀹屽杽鐭俊璁剧疆銆�'}> + <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> + 鍙戦�佺煭淇� + </Tooltip> + }> + <Radio.Group value={verify.noteEnable} onChange={(e) => {this.onOptionChange(e, 'noteEnable')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> + {verify.noteEnable === 'true' ? <Col span={8}> + <Form.Item label="鐭俊妯℃澘"> + <Select value={verify.noteCode} onSelect={this.onNoteCodeChange}> + {notes.map(option => + <Select.Option key={option.value} value={option.value}> + {option.name} + </Select.Option> + )} + </Select> + </Form.Item> + </Col> : null} + {verify.noteEnable === 'true' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title={'瀹炴椂鍙戦�佹渶澶氬悓鏃跺彂閫�5涓敤鎴凤紝瀹氭椂鍙戦�佹渶澶氬悓鏃跺彂閫�100涓敤鎴枫��'}> + <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> + 鍙戦�佹柟寮� + </Tooltip> + }> + <Radio.Group value={verify.noteType} onChange={(e) => {this.onOptionChange(e, 'noteType')}}> + <Radio value="Y">瀹炴椂</Radio> + <Radio value="N">瀹氭椂</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} + {verify.noteEnable === 'true' ? <Col span={8}> + <Form.Item label="鐭俊鍐呭"> + <Radio.Group value={verify.noteTemp} onChange={(e) => {this.onOptionChange(e, 'noteTemp')}}> + <Radio value="Y">鐩稿悓</Radio> + <Radio value="N">涓嶅悓</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} </Row> </Form> </TabPane> - <TabPane tab="姣旇緝楠岃瘉" key="2x"> + <TabPane tab={ + <span> + 姣旇緝楠岃瘉 + {verify.contrasts.length ? <span className="count-tip">{verify.contrasts.length}</span> : null} + </span> + } key="2x"> <ContrastForm dict={this.props.dict} contrastChange={this.contrastChange} @@ -1081,25 +1386,16 @@ pagination={false} /> </TabPane> - <TabPane tab="鍞竴鎬ч獙璇�" key="2"> - <UniqueForm - fields={fields} - dict={this.props.dict} - uniqueChange={this.uniqueChange} - wrappedComponentRef={(inst) => this.uniqueForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.uniques} - columns={uniqueColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="鑷畾涔夐獙璇�" key="3"> + <TabPane tab={ + <span> + 鑷畾涔夐獙璇� + {verify.customverifys.length ? <span className="count-tip">{verify.customverifys.length}</span> : null} + </span> + } key="3"> <CustomForm dict={this.props.dict} + btn={this.props.card} + initsql={this.state.initsql} usefulfields={this.state.usefulfields} customChange={this.customChange} wrappedComponentRef={(inst) => this.customForm = inst} @@ -1113,7 +1409,12 @@ pagination={false} /> </TabPane> - <TabPane tab="鍗曞彿鐢熸垚" key="4"> + <TabPane tab={ + <span> + 鍗曞彿鐢熸垚 + {verify.billcodes.length ? <span className="count-tip">{verify.billcodes.length}</span> : null} + </span> + } key="4"> <BillcodeForm fields={fields} btn={this.props.card} @@ -1134,7 +1435,34 @@ pagination={false} /> </TabPane> - <TabPane tab="鍒涘缓鍑瘉" key="5"> + <TabPane tab={ + <span> + {card.Ot !== 'requiredOnce' ? '鍞竴鎬ч獙璇�' : '鍚岀被鏁版嵁楠岃瘉'} + {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} + </span> + } 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={ + <span> + 鍒涘缓鍑瘉 + {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null} + </span> + } key="5"> <VoucherForm dict={this.props.dict} voucher={voucher} @@ -1145,10 +1473,20 @@ wrappedComponentRef={(inst) => this.voucherForm = inst} /> </TabPane> - <TabPane tab="鑷畾涔夎剼鏈�" key="6"> + <TabPane tab={ + <span> + 鑷畾涔夎剼鏈� + {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} + </span> + } key="6"> <CustomScript usefulfields={this.state.usefulfields} + initsql={this.state.initsql} dict={this.props.dict} + btn={this.props.card} + customScripts={verify.scripts} + defaultsql={this.state.defaultsql} + systemScripts={this.state.systemScripts} scriptsChange={this.scriptsChange} wrappedComponentRef={(inst) => this.scriptsForm = inst} /> @@ -1199,7 +1537,7 @@ </Col> <Col span={8}> <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={verify.ntime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> + <InputNumber defaultValue={verify.ntime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> </Form.Item> </Col> </Row> @@ -1214,7 +1552,7 @@ </Col> <Col span={8}> <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={verify.ftime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> + <InputNumber defaultValue={verify.ftime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> </Form.Item> </Col> </Row> @@ -1249,7 +1587,7 @@ </Form> </TabPane> </Tabs> : null} - {!display ? <Tabs defaultActiveKey="7" className="verify-card-box"> + {card.intertype !== 'system' ? <Tabs defaultActiveKey="7" className="verify-card-box"> <TabPane tab="淇℃伅鎻愮ず" key="7"> <Form {...formItemLayout}> <Row gutter={24}> @@ -1288,7 +1626,7 @@ </Col> <Col span={8}> <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={verify.ntime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> + <InputNumber defaultValue={verify.ntime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> </Form.Item> </Col> </Row> @@ -1303,7 +1641,7 @@ </Col> <Col span={8}> <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={verify.ftime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> + <InputNumber defaultValue={verify.ftime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> </Form.Item> </Col> </Row> -- Gitblit v1.8.0