king
2023-08-14 f078c137d61270d243cd8e03077fa9cf000e276b
src/templates/zshare/verifycard/baseform/index.jsx
@@ -15,6 +15,7 @@
    verify: PropTypes.object,
    unionFields: PropTypes.array,
    notes: PropTypes.array,
    appType: PropTypes.any,
    onChange: PropTypes.func
  }
@@ -22,6 +23,7 @@
    wxTemps: [],
    selectTemp: null,
    miniTemps: [],
    printTemps: []
  }
  componentDidMount() {
@@ -76,6 +78,11 @@
      this.resetTemps(wxTemps)
    }
    let printTemps = sessionStorage.getItem('printTemps')
    printTemps = printTemps ? JSON.parse(printTemps) : []
    this.setState({printTemps})
  }
  resetTemps = (wxTemps) => {
@@ -126,6 +133,8 @@
    let error = ''
    if (verify.noteEnable === 'true' && !verify.noteCode) { // 开启短信时,需要模板编码
      error = '开启短信时,需要选择短信模板!'
    } else if (verify.printEnable === 'true' && !verify.printTempId) {
      error = '使用单据打印时,需要选择打印模板!'
    } else if (verify.accountdate === 'true' && !verify.accountfield) {
      error = '开启账期时,需要选择验证公司!'
    } else if (verify.wxNote === 'true') {
@@ -148,6 +157,9 @@
    if (_verify.noteEnable !== 'true') {
      _verify.noteCode = ''
    }
    if (_verify.printEnable !== 'true') {
      _verify.printTempId = ''
    }
    if (_verify.accountdate !== 'true') {
      _verify.accountfield = ''
@@ -184,6 +196,14 @@
    const { verify } = this.props
    let _verify = {...verify, noteCode: val, noteId: option.props.id}
    this.props.onChange(_verify)
  }
  onPrintIdChange = (val) => {
    const { verify } = this.props
    let _verify = {...verify, printTempId: val}
    this.props.onChange(_verify)
  }
@@ -264,8 +284,8 @@
  }
  render() {
    const { unionFields, verify, notes, card } = this.props
    const { wxTemps, selectTemp } = this.state
    const { unionFields, verify, notes, card, appType } = this.props
    const { wxTemps, selectTemp, printTemps } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -393,6 +413,31 @@
            </Form.Item>
          </Col> : null}
          <Col span={24}></Col>
          {appType !== 'mob' ? <Col span={8}>
            <Form.Item label={
              <Tooltip placement="bottomLeft" title="使用单据打印时需选择打印模板,跳转打印界面时ID优先从返回值中获取,返回值没有时从行里获取。">
                <QuestionCircleOutlined className="mk-form-tip" />
                单据打印
              </Tooltip>
            }>
              <Radio.Group value={verify.printEnable} onChange={(e) => {this.onOptionChange(e.target.value, 'printEnable')}}>
                <Radio value="true">开启</Radio>
                <Radio value="false">不开启</Radio>
              </Radio.Group>
            </Form.Item>
          </Col> : null}
          {verify.printEnable === 'true' ? <Col span={8}>
            <Form.Item label="打印模板" required>
              <Select value={verify.printTempId} onSelect={this.onPrintIdChange}>
                {printTemps.map(option =>
                  <Select.Option key={option.value} value={option.value}>
                    {option.text}
                  </Select.Option>
                )}
              </Select>
            </Form.Item>
          </Col> : null}
          <Col span={24}></Col>
          <Col span={8}>
            <Form.Item label={
              <Tooltip placement="bottomLeft" title={'请在服务器完成公众号配置。'}>