From 5b66fe77e55767eabbf1df66a026157356dd807d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 07 一月 2023 17:28:28 +0800 Subject: [PATCH] 2023-01-07 --- src/tabviews/custom/components/module/voucher/index.jsx | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index e423749..2eb3f9c 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/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" /> 寮� -- Gitblit v1.8.0