| | |
| | | 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, Popconfirm, Icon, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | import BillcodeForm from './billcodeform' |
| | | import VoucherForm from './voucherform' |
| | | import './index.scss' |
| | | import { fromJS } from 'immutable'; |
| | | |
| | | const { TabPane } = Tabs |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | |
| | | { |
| | | title: 'SQL', |
| | | dataIndex: 'sql', |
| | | width: '45%' |
| | | width: '45%', |
| | | render: (text) => ( |
| | | <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> |
| | | ) |
| | | }, |
| | | { |
| | | title: '结果处理', |
| | |
| | | { |
| | | title: 'SQL', |
| | | dataIndex: 'sql', |
| | | width: '60%' |
| | | width: '60%', |
| | | render: (text) => ( |
| | | <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> |
| | | ) |
| | | }, |
| | | { |
| | | title: '执行位置', |
| | |
| | | |
| | | if (config.setting.primaryKey && !keys.includes(config.setting.primaryKey.toLowerCase())) { |
| | | keys.push(config.setting.primaryKey.toLowerCase()) |
| | | values.push('\'\'') |
| | | values.push('@ID@') |
| | | } |
| | | if (!keys.includes('createuserid')) { |
| | | keys.push('createuserid') |
| | |
| | | values.push('@BID@') |
| | | } |
| | | |
| | | keys = keys.join(',') |
| | | values = values.join(',') |
| | | keys = keys.join(', ') |
| | | values = values.join(', ') |
| | | _insertsql = `insert into ${this.props.card.sql} (${keys}) select ${values};` |
| | | } |
| | | |
| | |
| | | _form.push('FiYear=@FiYear') |
| | | } |
| | | } |
| | | |
| | | let primaryKeyName = config.setting.primaryKey |
| | | if (primaryKeyName && ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(primaryKeyName.toLowerCase())) { |
| | | primaryKeyName = primaryKeyName + '@' |
| | | } |
| | | |
| | | _form = _form.join(',') |
| | | _updatesql = `update ${this.props.card.sql} set ${_form} where ${config.setting.primaryKey}=@${primaryKeyName};` |
| | | _form = _form.join(', ') |
| | | _updatesql = `update ${this.props.card.sql} set ${_form} where ${config.setting.primaryKey}=@ID@;` |
| | | } |
| | | |
| | | let _defaultsql = '' |
| | |
| | | |
| | | if (config.setting.primaryKey && !keys.includes(config.setting.primaryKey.toLowerCase())) { |
| | | keys.push(config.setting.primaryKey.toLowerCase()) |
| | | values.push('\'\'') |
| | | values.push('@ID@') |
| | | } |
| | | if (!keys.includes('createuserid')) { |
| | | keys.push('createuserid') |
| | |
| | | values.push('@BID@') |
| | | } |
| | | |
| | | keys = keys.join(',') |
| | | values = values.join(',') |
| | | keys = keys.join(', ') |
| | | values = values.join(', ') |
| | | _defaultsql = `insert into ${this.props.card.sql} (${keys}) select ${values};` |
| | | } else if (this.props.card.sqlType === 'update') { |
| | | } else if (this.props.card.sqlType === 'update' || this.props.card.sqlType === 'audit') { |
| | | let _form = [] |
| | | let _arr = [] |
| | | |
| | |
| | | _form.push(item.field + '=@' + item.field) |
| | | }) |
| | | |
| | | if (!_arr.includes('modifydate')) { |
| | | _form.push('modifydate=getdate()') |
| | | } |
| | | if (!_arr.includes('modifyuserid')) { |
| | | _form.push('modifyuserid=@userid@') |
| | | 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) { |
| | |
| | | _form.push('FiYear=@FiYear') |
| | | } |
| | | } |
| | | |
| | | let primaryKeyName = config.setting.primaryKey |
| | | if (primaryKeyName && ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(primaryKeyName.toLowerCase())) { |
| | | primaryKeyName = primaryKeyName + '@' |
| | | } |
| | | |
| | | _form = _form.join(',') |
| | | _defaultsql = `update ${this.props.card.sql} set ${_form} where ${config.setting.primaryKey}=@${primaryKeyName};` |
| | | _form = _form.join(', ') |
| | | _defaultsql = `update ${this.props.card.sql} set ${_form} where ${config.setting.primaryKey}=@ID@;` |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | // 默认sql |
| | | let _defaultsql = '' |
| | | let primaryKeyName = config.setting.primaryKey |
| | | |
| | | if (primaryKeyName && ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(primaryKeyName.toLowerCase())) { |
| | | primaryKeyName = primaryKeyName + '@' |
| | | } |
| | | |
| | | if (this.props.card.sqlType === 'LogicDelete') { |
| | | _defaultsql = `update ${this.props.card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}=@${primaryKeyName};` |
| | | _defaultsql = `update ${this.props.card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}=@ID@;` |
| | | } else if (this.props.card.sqlType === 'delete') { |
| | | let _msg = '' |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { |
| | |
| | | } |
| | | }) |
| | | } |
| | | _defaultsql += `insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('删除表:${this.props.card.sql} 数据: ${_msg}${config.setting.primaryKey}='+@${primaryKeyName},200),@userid@,@username,@fullname delete ${this.props.card.sql} where ${config.setting.primaryKey}=@${primaryKeyName};` |
| | | _defaultsql += `insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('删除表:${this.props.card.sql} 数据: ${_msg}${config.setting.primaryKey}='+@ID@,200),@userid@,@username,@fullname delete ${this.props.card.sql} where ${config.setting.primaryKey}=@ID@;` |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, fields, uniqueColumns, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | |
| | | let display = false |
| | | if (this.props.card.intertype === 'inner' && !this.props.card.innerFunc) { |
| | | if (card.intertype === 'inner' && !card.innerFunc) { |
| | | display = true |
| | | } |
| | | |
| | |
| | | pagination={false} |
| | | /> |
| | | </TabPane> |
| | | <TabPane tab="唯一性验证" key="2"> |
| | | <TabPane tab={card.Ot !== 'requiredOnce' ? '唯一性验证' : '同类数据验证'} key="2"> |
| | | <UniqueForm |
| | | fields={fields} |
| | | dict={this.props.dict} |