king
2025-01-01 85e61862fb25e9aa39c7e267f29e78a7cd98220f
src/templates/zshare/verifycard/voucherform/index.jsx
@@ -1,13 +1,11 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Select, Switch } from 'antd'
import './index.scss'
import { Form, Row, Col, Select, Switch, notification } from 'antd'
// import './index.scss'
class UniqueForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    voucherobj: PropTypes.object,   // 凭证信息
    voucher: PropTypes.array,       // 表单
    columns: PropTypes.array,       // 表单
@@ -126,6 +124,15 @@
      if (!err) {
        values.enabled = true
        let _detail = this.state.voucherDetail.filter(item => item.ModularDetailCode === values.VoucherTypeOne)[0]
        if (!_detail) {
          notification.warning({
            top: 92,
            message: '凭证类型或凭证标识不存在!',
            duration: 5
          })
          return
        }
        values.VoucherTypeTwo = _detail.VoucherTypeTwo
        values.Type = _detail.IDefine1
@@ -159,7 +166,7 @@
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.select'] + '主类型!'
                    message: '请选择主类型!'
                  }
                ]
              })(
@@ -173,13 +180,13 @@
            </Form.Item>
          </Col>
          <Col span={11}>
            <Form.Item label={'凭证类型'}>
            <Form.Item label="凭证类型">
              {getFieldDecorator('VoucherType', {
                initialValue: voucherobj.VoucherType || (this.state.voucher[0] && this.state.voucher[0].ID) || '',
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '凭证类型!'
                    message: '请选择凭证类型!'
                  }
                ]
              })(
@@ -198,13 +205,13 @@
            </Form.Item>
          </Col>
          <Col span={11}>
            <Form.Item label={'凭证标识'}>
            <Form.Item label="凭证标识">
              {getFieldDecorator('VoucherTypeOne', {
                initialValue: voucherobj.VoucherTypeOne || (this.state.voucherDetail[0] && this.state.voucherDetail[0].ModularDetailCode) || '',
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '凭证标识!'
                    message: '请选择凭证标识!'
                  }
                ]
              })(
@@ -223,13 +230,13 @@
            </Form.Item>
          </Col>
          <Col span={11}>
            <Form.Item label={'关联字段'}>
            <Form.Item label="关联字段">
              {getFieldDecorator('linkField', {
                initialValue: voucherobj.linkField || (columns[0] && columns[0].field) || '',
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '关联字段!'
                    message: '请选择关联字段!'
                  }
                ]
              })(
@@ -240,7 +247,7 @@
                >
                  {columns.map((option, index) =>
                    <Select.Option title={option.label} id={index + option.uuid} key={index + option.uuid} value={option.field}>
                      {option.label}
                      {`${option.label}(${option.field})`}
                    </Select.Option>
                  )}
                </Select>