| | |
| | | this.loadmenu() |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps () { |
| | | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | } else if (view.type === 'TabForm') { |
| | | return (<Comps.TabForm MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<Comps.FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<Comps.FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} menuType={view.param.menuType} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | | return (<Comps.Iframe key={view.MenuID} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>) |
| | | } else { |
| | |
| | | Comps.RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | } else if (!Comps.TabForm && newtab.type === 'TabForm') { |
| | | Comps.TabForm = asyncComponent(() => import('@/tabviews/tabform')) |
| | | } else if (!Comps.TabForm && newtab.type === 'FormTab') { |
| | | } else if (!Comps.FormTab && newtab.type === 'FormTab') { |
| | | Comps.FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | } |
| | | } |
| | |
| | | type: btn.tabTemplate, |
| | | selected: true, |
| | | param: { |
| | | menuType: 'main', |
| | | parentId: this.props.MenuID, |
| | | btn: btn, |
| | | data: data[0] || null, |
| | |
| | | ref="mainButton" |
| | | BID="" |
| | | type="main" |
| | | menuType="main" |
| | | setting={setting} |
| | | actions={actions} |
| | | dict={this.state.dict} |
| | |
| | | {_tab.type === 'SubTable' ? |
| | | <SubTable |
| | | Tab={_tab} |
| | | menuType="main" |
| | | MenuID={_tab.linkTab} |
| | | SupMenuID={this.props.MenuID} |
| | | refreshtabs={this.state.refreshtabs} |
| | |
| | | > |
| | | {<SubTabTable |
| | | BID={''} |
| | | menuType="main" |
| | | SupMenuID={this.props.MenuID} |
| | | MenuID={this.state.popAction.linkTab} |
| | | BData={this.state.BIDs['mainTabledata'] || ''} |
| | |
| | | </Modal> |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> : null} |
| | | {view === 'formtab' ? <FormTab MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null} |
| | | {view === 'formtab' ? <FormTab menuType="main" MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background"></div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> |
| | | {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null } |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value, option) => {this.selectChange(item, value, option)}} |
| | | disabled={item.readonly === 'true'} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> |
| | |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | disabled={item.readonly === 'true'} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <DatePicker /> |
| | | <DatePicker disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <MonthPicker /> |
| | | <MonthPicker disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <DatePicker showTime /> |
| | | <DatePicker showTime disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | color: #1890ff; |
| | | border-bottom: 1px solid #d9d9d9; |
| | | } |
| | | .ant-input-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-input-number-input { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-select-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | .ant-select-selection--multiple .ant-select-selection__choice { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | type: btn.tabTemplate, |
| | | selected: true, |
| | | param: { |
| | | menuType: 'HS', |
| | | parentId: this.props.MenuID, |
| | | btn: btn, |
| | | data: data[0] || null, |
| | |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin, Modal, Button} from 'antd' |
| | | import { notification, Spin, Modal, Button, Switch} from 'antd' |
| | | import moment from 'moment' |
| | | import Api from '@/api' |
| | | import SubTable from './subTable' |
| | |
| | | configMap: {}, // 页面配置信息:下拉、按钮等 |
| | | popAction: false, // 弹框页面,按钮信息 |
| | | popData: false, // 弹框页面,所选的表格数据 |
| | | visible: false // 弹框显示隐藏控制 |
| | | visible: false, // 弹框显示隐藏控制 |
| | | pickup: false, // 子表数据隐藏显示切换 |
| | | } |
| | | |
| | | /** |
| | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | | pickup: false, |
| | | loading: false |
| | | }) |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 数据展开合并切换 |
| | | */ |
| | | pickupChange = () => { |
| | | const { pickup } = this.state |
| | | |
| | | this.setState({ |
| | | pickup: !pickup |
| | | }) |
| | | } |
| | | |
| | | popclose = () => { |
| | | this.setState({ |
| | | visible: false |
| | |
| | | this.loadconfig() |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | shouldComponentUpdate (nextProps, nextState) { // handleMainTable 函数判断时不相等 |
| | | return !is(fromJS({...this.props, handleMainTable: '', handleTableId: ''}), fromJS({...nextProps, handleMainTable: '', handleTableId: ''})) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting, searchlist, actions, columns, loadingview, viewlost } = this.state |
| | | const { setting, searchlist, actions, columns, loadingview, viewlost, pickup } = this.state |
| | | |
| | | return ( |
| | | <div className="subtable" id={'subtable' + this.props.MenuID}> |
| | |
| | | gettableselected={this.gettableselected} |
| | | /> |
| | | } |
| | | {columns && |
| | | {/* {this.state.data && this.state.data.length > 0 ? |
| | | <Switch title="收起" className="subtable-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null |
| | | } */} |
| | | {columns ? |
| | | <div className="subtable-box"> |
| | | {this.state.data && this.state.data.length > 0 ? |
| | | <Switch title="收起" className="subtable-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null |
| | | } |
| | | <SubTable |
| | | ref="subTable" |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | pickup={pickup} |
| | | setting={setting} |
| | | columns={columns} |
| | | dict={this.state.dict} |
| | | data={this.state.data} |
| | | total={this.state.total} |
| | | MenuID={this.props.MenuID} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | handleTableId={this.handleTableId} |
| | | /> |
| | | </div> : null |
| | | } |
| | | <Modal |
| | | className="popview-modal" |
| | |
| | | left: calc(50% - 22px); |
| | | top: 100px; |
| | | } |
| | | .subtable-box { |
| | | position: relative; |
| | | .subtable-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -25px; |
| | | z-index: 10; |
| | | } |
| | | } |
| | | } |
| | | .popview-modal { |
| | | .ant-modal-body { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, message, Button, Typography } from 'antd' |
| | | import './index.scss' |
| | | |
| | |
| | | loading: PropTypes.bool, // 表格加载中 |
| | | refreshdata: PropTypes.func, // 表格中排序列、页码的变化时刷新 |
| | | buttonTrigger: PropTypes.func, // 表格中按钮触发操作 |
| | | handleTableId: PropTypes.func // 控制表格数据切换时,更新在主表中的id |
| | | handleTableId: PropTypes.func, // 控制表格数据切换时,更新在主表中的id |
| | | pickup: PropTypes.any // 数据展开合并控制 |
| | | } |
| | | |
| | | state = { |
| | |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background"></div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> |
| | | {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null} |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | this.props.handleTableId(_id, _data) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | render() { |
| | | let { selectedRowKeys } = this.state |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let _data = this.props.data ? this.props.data : [] |
| | | if (this.props.pickup) { |
| | | _data = _data.filter((item, index) => selectedRowKeys.includes(index)) |
| | | } |
| | | |
| | | return ( |
| | | <div className="sub-table"> |
| | | <Table |
| | |
| | | bordered={true} |
| | | rowSelection={rowSelection} |
| | | columns={this.state.columns} |
| | | dataSource={this.props.data ? this.props.data : []} |
| | | dataSource={_data} |
| | | loading={this.props.loading} |
| | | scroll={{ x: '100%', y: false }} |
| | | onRow={(record, index) => { |
| | |
| | | |
| | | if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { |
| | | item.initval = BData[item.field] |
| | | } else if (_readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | } else if (item.type !== 'linkMain' && _readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | item.initval = this.props.data[item.field] |
| | | } |
| | | |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value, option) => {this.selectChange(item, value, option)}} |
| | | disabled={item.readonly === 'true'} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> |
| | |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | disabled={item.readonly === 'true'} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <DatePicker /> |
| | | <DatePicker disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <MonthPicker /> |
| | | <MonthPicker disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | ] |
| | | })( |
| | | // <DatePicker showTime getCalendarContainer={() => document.getElementById('form-box')} /> |
| | | <DatePicker showTime /> |
| | | <DatePicker showTime disabled={item.readonly === 'true'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | color: #1890ff; |
| | | border-bottom: 1px solid #d9d9d9; |
| | | } |
| | | .ant-input-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-input-number-input { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-select-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | .ant-select-selection--multiple .ant-select-selection__choice { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['header.form.textarea'], |
| | | subType: 'textarea', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['header.form.colspan'], |
| | | subType: 'colspan', |
| | | url: '' |
| | |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['header.form.textarea'], |
| | | subType: 'textarea', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['header.form.colspan'], |
| | | subType: 'colspan', |
| | | url: '' |
| | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | btn: PropTypes.object, // 按钮信息 |
| | | fields: PropTypes.array, // 表单 |
| | | billcodes: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | |
| | | fieldMap.set(_field.field, true) |
| | | } |
| | | }) |
| | | |
| | | if (this.props.btn.Ot !== 'notRequired') { |
| | | this.props.columns.forEach(_field => { |
| | | if (_field.type === 'text' && !fieldMap.has(_field.field)) { |
| | | _billFields.push(_field) |
| | | fieldMap.set(_field.field, true) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let _usedfields = this.props.billcodes.map(item => item.field) |
| | | |
| | |
| | | <TabPane tab="单号生成" key="4"> |
| | | <BillcodeForm |
| | | fields={fields} |
| | | btn={this.props.card} |
| | | billcodes={verify.billcodes} |
| | | columns={this.props.columns} |
| | | dict={this.props.dict} |
| | |
| | | // 需要声明的变量集 |
| | | // 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', 'id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'] |
| | | let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname'] |
| | | let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode'] |
| | | |
| | | // 主键字段 |
| | | let primaryKey = setting.primaryKey || 'id' |
| | | |
| | | // 系统变量声明与设置初始值 |
| | | let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50) |
| | | let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50) |
| | | ` |
| | | |
| | | // let _initvars = ['ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] // 已赋值字段集 |
| | |
| | | if (verify.billcodes && verify.billcodes.length > 0) { |
| | | verify.billcodes.forEach(item => { |
| | | let _ModularDetailCode = '' |
| | | if (item.TypeCharOne === 'Lp' || item.TypeCharOne === 'BN') { |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (item.linkField === 'BID' && BID) { // 替换bid |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | _ModularDetailCode = '@ModularDetailCode' |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | let _val = '' |
| | | if (item.linkField === 'BID' && BID) { // 替换bid |
| | | _val = BID |
| | | } else if (data && data.hasOwnProperty(item.linkField)) { |
| | | _val = data[item.linkField] |
| | | } |
| | | _ModularDetailCode = item.TypeCharOne + _val |
| | | _ModularDetailCode = `'${item.TypeCharOne + _val}'` |
| | | } else { |
| | | _ModularDetailCode = item.ModularDetailCode |
| | | _ModularDetailCode = `'${item.ModularDetailCode}'` |
| | | } |
| | | |
| | | let _declare = '' |
| | |
| | | } |
| | | |
| | | _sql += `${_declare} |
| | | select @BillCode='', @${_key}='' |
| | | select @BillCode='', @${_key}='', @ModularDetailCode='' |
| | | ${_lpline} |
| | | exec s_get_BillCode |
| | | @ModularDetailCode='${_ModularDetailCode}', |
| | | @ModularDetailCode=${_ModularDetailCode}, |
| | | @Type=${item.Type}, |
| | | @TypeCharOne='${item.TypeCharOne}', |
| | | @TypeCharTwo ='${item.TypeCharTwo}', |