| | |
| | | |
| | | setTimeout(() => { |
| | | if (col.field === 'debit' && (line.debit || line.debit === 0)) { |
| | | MKEmitter.emit('nextLine', col, record) |
| | | MKEmitter.emit('nextVoucher', col, record) |
| | | } else if (col.field === 'credit') { |
| | | MKEmitter.emit('nextLine', col, record) |
| | | MKEmitter.emit('nextVoucher', col, record) |
| | | } else { |
| | | let cl = {subject_voucher_text: 'subject_code', subject_code: 'debit', debit: 'credit'} |
| | | MKEmitter.emit('tdFocus', cl[col.uuid] + record.uuid) |
| | |
| | | MKEmitter.emit('plusLine', col.tableId, record) |
| | | } |
| | | |
| | | delRecord = () => { |
| | | delVoucher = () => { |
| | | const { col, record } = this.props |
| | | |
| | | MKEmitter.emit('delRecord', col.tableId, record) |
| | | MKEmitter.emit('delVoucher', col.tableId, record) |
| | | } |
| | | |
| | | onSelectBlur = () => { |
| | |
| | | </div> |
| | | } |
| | | } else if (col.field === 'credit') { |
| | | extra = <CloseOutlined onClick={this.delRecord}/> |
| | | extra = <CloseOutlined onClick={this.delVoucher}/> |
| | | |
| | | if (editing) { |
| | | children = <InputNumber id={col.uuid + record.uuid} precision={2} defaultValue={record.credit} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('nextLine', this.nextLine) |
| | | MKEmitter.addListener('plusLine', this.plusLine) |
| | | MKEmitter.addListener('delRecord', this.delRecord) |
| | | MKEmitter.addListener('delVoucher', this.delVoucher) |
| | | MKEmitter.addListener('cleartable', this.cleartable) |
| | | MKEmitter.addListener('nextVoucher', this.nextVoucher) |
| | | MKEmitter.addListener('changeRecord', this.changeRecord) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('nextLine', this.nextLine) |
| | | MKEmitter.removeListener('plusLine', this.plusLine) |
| | | MKEmitter.removeListener('delRecord', this.delRecord) |
| | | MKEmitter.removeListener('delVoucher', this.delVoucher) |
| | | MKEmitter.removeListener('cleartable', this.cleartable) |
| | | MKEmitter.removeListener('nextVoucher', this.nextVoucher) |
| | | MKEmitter.removeListener('changeRecord', this.changeRecord) |
| | | } |
| | | |
| | |
| | | return ChineseStr |
| | | } |
| | | |
| | | nextLine = (col, record) => { |
| | | nextVoucher = (col, record) => { |
| | | const { edData, tableId } = this.state |
| | | |
| | | if (col.tableId !== tableId) return |
| | |
| | | this.props.onChange(_data) |
| | | } |
| | | |
| | | delRecord = (id, record) => { |
| | | delVoucher = (id, record) => { |
| | | const { tableId, edData } = this.state |
| | | |
| | | if (id !== tableId) return |