| | |
| | | |
| | | class BillCodeForm extends Component { |
| | | static propTpyes = { |
| | | btn: PropTypes.object, // 按钮信息 |
| | | fields: PropTypes.array, // 表单 |
| | | billcodes: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | | modular: PropTypes.array, // 表单 |
| | | modularDetail: PropTypes.array, // 表单 |
| | | orderChange: PropTypes.func // 表单 |
| | | btn: PropTypes.object, |
| | | fields: PropTypes.array, |
| | | billcodes: PropTypes.array, |
| | | columns: PropTypes.array, |
| | | modular: PropTypes.array, |
| | | modularDetail: PropTypes.array, |
| | | orderChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field, |
| | | Type: record.Type || 4, |
| | | TypeCharOne: record.TypeCharOne, |
| | | ModularCode: record.ModularCode, |
| | | ModularDetailCode: _modularDetailCode, |
| | |
| | | |
| | | // 设置流水号位数 |
| | | let _detail = this.state.modularDetail.filter(item => item.ModularDetailCode === values.ModularDetailCode)[0] |
| | | values.Type = _detail.Type |
| | | values.Type = values.Type || _detail.Type |
| | | } else { |
| | | let _billField = billFields.filter(item => item.field === values.linkField)[0] |
| | | values.linkFieldName = _billField ? _billField.label : '' |
| | |
| | | })( |
| | | <Select> |
| | | {this.state.funFields.map(option => |
| | | <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | <Select.Option key={option.uuid} value={option.field}> |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={7}> |
| | | <Form.Item label={'类型'}> |
| | | <Form.Item label="类型"> |
| | | {getFieldDecorator('TypeCharOne', { |
| | | initialValue: 'Lp', |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {type === '1' ? <Col span={7}> |
| | | <Form.Item label={'关联字段'}> |
| | | <Form.Item label="关联字段"> |
| | | {getFieldDecorator('linkField', { |
| | | initialValue: '', |
| | | rules: [ |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select> |
| | | <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> |
| | | {this.state.billFields.map(option => |
| | | <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | <Select.Option key={option.uuid} value={option.field}> |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === '2' ? <Col span={7}> |
| | | <Form.Item label={'凭证类型'}> |
| | | <Form.Item label="凭证类型"> |
| | | {getFieldDecorator('ModularCode', { |
| | | initialValue: this.props.modular[0] ? this.props.modular[0].ID : '', |
| | | rules: [ |
| | |
| | | onChange={(value) => {this.voucherChange(value)}} |
| | | > |
| | | {this.props.modular.map(option => |
| | | <Select.Option title={option.NameNO} id={option.ID} key={option.ID} value={option.ID}> |
| | | <Select.Option key={option.ID} value={option.ID}> |
| | | {option.NameNO} |
| | | </Select.Option> |
| | | )} |
| | |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | {type === '1' ? <Col span={7}> |
| | | <Col span={7}> |
| | | <Form.Item label="位数"> |
| | | {getFieldDecorator('Type', { |
| | | initialValue: 4, |
| | |
| | | ] |
| | | })(<InputNumber min={1} max={10} precision={0} onPressEnter={this.handleConfirm}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Col> |
| | | {type === '2' ? <Col span={7}> |
| | | <Form.Item label="凭证标识"> |
| | | {getFieldDecorator('ModularDetailCode', { |
| | |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {this.state.modularDetail.map(option => |
| | | <Select.Option style={{whiteSpace: 'unset'}} title={option.CodeName} id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}> |
| | | <Select.Option style={{whiteSpace: 'unset'}} key={option.ModularDetailCode} value={option.ModularDetailCode}> |
| | | {option.CodeName} |
| | | </Select.Option> |
| | | )} |