| | |
| | | floor: PropTypes.any, // 是否为子表 |
| | | dict: PropTypes.object, // 字典项 |
| | | fields: PropTypes.array, // 表单 |
| | | billcodes: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | | modular: PropTypes.array, // 表单 |
| | | modularDetail: PropTypes.array, // 表单 |
| | |
| | | } |
| | | } |
| | | |
| | | let _usedfields = this.props.billcodes.map(item => item.field) |
| | | |
| | | this.setState({ |
| | | modularDetail: _modularDetail, |
| | | funFields: this.props.fields.filter(field => field.type === 'funcvar'), |
| | | funFields: this.props.fields.filter(field => field.type === 'funcvar' && !_usedfields.includes(field.field)), |
| | | billFields: _billFields |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | edit = (record) => { |
| | | let _usedfields = this.props.billcodes.map(item => item.field) |
| | | let _funFields = this.props.fields.filter(field => field.type === 'funcvar' && (!_usedfields.includes(field.field) || field.field === record.field)) |
| | | |
| | | if (record.TypeCharOne === 'Y' || record.TypeCharOne === 'n') { |
| | | let _detail = this.props.modularDetail.filter(item => item.BID === record.ModularCode) |
| | | let _modularDetailCode = '' |
| | |
| | | |
| | | this.setState({ |
| | | type: '2', |
| | | funFields: _funFields, |
| | | editItem: record, |
| | | modularDetail: _detail |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field, |
| | | TypeCharOne: record.TypeCharOne, |
| | | ModularCode: record.ModularCode, |
| | | ModularDetailCode: _modularDetailCode, |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field, |
| | | TypeCharOne: record.TypeCharOne, |
| | | ModularCode: record.ModularCode, |
| | | ModularDetailCode: _modularDetailCode, |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | type: '1', |
| | | funFields: _funFields, |
| | | editItem: record, |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field, |
| | | TypeCharOne: record.TypeCharOne, |
| | | Type: record.Type, |
| | | linkField: record.linkField, |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field, |
| | | TypeCharOne: record.TypeCharOne, |
| | | Type: record.Type, |
| | | linkField: record.linkField, |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | |
| | | this.props.orderChange(values) |
| | | this.setState({ |
| | | editItem: null |
| | | }, () => { |
| | | |
| | | let _usedfields = this.props.billcodes.map(item => item.field) |
| | | |
| | | this.setState({ |
| | | funFields: this.props.fields.filter(field => field.type === 'funcvar' && !_usedfields.includes(field.field)), |
| | | }) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | field: '', |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form"> |
| | | <Row gutter={24}> |
| | | <Col span={5}> |
| | | <Col span={10}> |
| | | <Form.Item label={'函数变量'}> |
| | | {getFieldDecorator('field', { |
| | | initialValue: '', |
| | |
| | | })( |
| | | <Select> |
| | | {this.state.funFields.map(option => |
| | | <Select.Option id={option.uuid} key={option.uuid} value={option.field}> |
| | | <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | </Select.Option> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | <Col span={10}> |
| | | <Form.Item label={'类型'}> |
| | | {getFieldDecorator('TypeCharOne', { |
| | | initialValue: 'Lp', |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {type === '1' ? <Col span={5}> |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary"> |
| | | 确定 |
| | | </Button> |
| | | </Col> |
| | | {type === '1' ? <Col span={10}> |
| | | <Form.Item label={'关联字段'}> |
| | | {getFieldDecorator('linkField', { |
| | | initialValue: '', |
| | |
| | | })( |
| | | <Select> |
| | | {this.state.billFields.map(option => |
| | | <Select.Option id={option.uuid} key={option.uuid} value={option.field}> |
| | | <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | </Select.Option> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === '1' ? <Col span={5}> |
| | | {type === '1' ? <Col span={10}> |
| | | <Form.Item label={'位数'}> |
| | | {getFieldDecorator('Type', { |
| | | initialValue: 4, |
| | |
| | | })(<InputNumber min={1} max={10} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === '2' ? <Col span={5}> |
| | | {type === '2' ? <Col span={10}> |
| | | <Form.Item label={'凭证类型'}> |
| | | {getFieldDecorator('ModularCode', { |
| | | initialValue: this.props.modular[0] ? this.props.modular[0].ID : '', |
| | |
| | | onChange={(value) => {this.voucherChange(value)}} |
| | | > |
| | | {this.props.modular.map(option => |
| | | <Select.Option id={option.ID} key={option.ID} value={option.ID}> |
| | | <Select.Option title={option.NameNO} id={option.ID} key={option.ID} value={option.ID}> |
| | | {option.NameNO} |
| | | </Select.Option> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === '2' ? <Col span={5}> |
| | | {type === '2' ? <Col span={10}> |
| | | <Form.Item label={'凭证标识'}> |
| | | {getFieldDecorator('ModularDetailCode', { |
| | | initialValue: this.state.modularDetail[0] ? this.state.modularDetail[0].ModularDetailCode : '', |
| | |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {this.state.modularDetail.map(option => |
| | | <Select.Option id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}> |
| | | <Select.Option title={option.CodeName} id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}> |
| | | {option.CodeName} |
| | | </Select.Option> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary"> |
| | | 确定 |
| | | </Button> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |