king
2023-01-07 5b66fe77e55767eabbf1df66a026157356dd807d
src/tabviews/custom/components/module/voucher/index.jsx
@@ -24,6 +24,9 @@
    disableAdd: false,
    disableSave: false,
    typeOptions: [],
    charType: '',
    charInt: '',
    vouDate: null,
    book: null
  }
@@ -109,7 +112,13 @@
        return
      }
      let typeOptions = res.char || []
      
      this.setState({
        typeOptions: typeOptions,
        charType: typeOptions[0] ? typeOptions[0].voucher_class : '',
        charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '',
      })
    })
  }
@@ -125,8 +134,12 @@
  }
  changeVoucherDate = () => {
  }
  render() {
    const { config, disableSave, disableAdd, typeOptions, data } = this.state
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
@@ -140,15 +153,15 @@
        {config.wrap.type === 'edit' ? <div className="voucher-body">
          <div className="pre-wrap">
            <div className="voucher-code">
              <Select dropdownClassName="mk-vcode-dropdown">
              <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({charType: val, charInt: option.props.charInt})}>
                {typeOptions.map(option =>
                  <Select.Option value={option.value}>{option.label}</Select.Option>
                  <Select.Option value={option.voucher_class} charInt={option.voucher_char_int}>{option.voucher_char}</Select.Option>
                )}
              </Select>
              <Input autoComplete="off" /> 号
              <Input value={charInt} autoComplete="off" onChange={(e) => this.setState({charInt: e.target.value})}/> 号
            </div>
            <div className="voucher-date">
              日期:<DatePicker onChange={this.onChange}/>
              日期:<DatePicker onChange={this.changeVoucherDate}/>
            </div>
            <div className="voucher-affix">
              附单据 <Input autoComplete="off" /> 张