| | |
| | | BID: '', |
| | | config: null, |
| | | loading: false, |
| | | data: null, |
| | | data: [], |
| | | disableAdd: false, |
| | | disableSave: false, |
| | | typeOptions: [], |
| | | subjects: [], |
| | | charType: '', |
| | | charInt: '', |
| | | vouDate: null, |
| | |
| | | const { config } = this.state |
| | | |
| | | if (config.wrap.supBook === MenuID) { |
| | | this.setState({ book: data }, () => { |
| | | let month = data.months |
| | | let vouDate = moment() |
| | | |
| | | if (month && month < moment().format('YYYY-MM')) { |
| | | vouDate = moment(month, 'YYYY-MM').endOf('month') |
| | | } |
| | | |
| | | this.setState({ book: data, vouDate }, () => { |
| | | this.loadData() |
| | | }) |
| | | return |
| | |
| | | typeOptions: typeOptions, |
| | | charType: typeOptions[0] ? typeOptions[0].voucher_class : '', |
| | | charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '', |
| | | subjects: res.subjects || [], |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | this.getVoucher() |
| | | }, 200) |
| | | }) |
| | | } |
| | | |
| | | |
| | | getVoucher = () => { |
| | | let data = [ |
| | | {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 124, creditor: ''}, |
| | | {remark: '购入固定资产', subjectscode: '1001', subjectsname: '库存现金', debtor: '', creditor: 124}, |
| | | {remark: '转结销售成本', subjectscode: '1001', subjectsname: '库存现金', debtor: -524, creditor: ''}, |
| | | {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: ''}, |
| | | ] |
| | | |
| | | this.setState({ |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | changeVoucherDate = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data } = this.state |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, subjects } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | |
| | | {config.wrap.type === 'edit' ? <div className="voucher-body"> |
| | | <div className="pre-wrap"> |
| | | <div className="voucher-code"> |
| | | <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({charType: val, charInt: option.props.charInt})}> |
| | | <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.voucher_class} charInt={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | <Select.Option key={option.voucher_char_int} value={option.voucher_class} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | )} |
| | | </Select> |
| | | <Input value={charInt} autoComplete="off" onChange={(e) => this.setState({charInt: e.target.value})}/> 号 |
| | | </div> |
| | | <div className="voucher-date"> |
| | | 日期:<DatePicker onChange={this.changeVoucherDate}/> |
| | | 日期:<DatePicker value={vouDate} onChange={(val) => this.setState({vouDate: val})}/> |
| | | </div> |
| | | <div className="voucher-affix"> |
| | | 附单据 <Input autoComplete="off" /> 张 |
| | |
| | | <Button type="link" className="" onClick={this.triggerprint}>备注</Button> |
| | | </div> |
| | | </div> |
| | | <VoucherTable config={config} data={data}/> |
| | | <VoucherTable config={config} subjects={subjects} data={data}/> |
| | | </div> : null} |
| | | {config.wrap.type === 'check' ? <div className="voucher-body"> |
| | | <div className="pre-wrap"> |