| | |
| | | if (item.signType && item.signType[0] === 'icon') { |
| | | item.signType = [item.signType[0] + item.signType[1], item.signType[2], item.signType[3]] |
| | | } |
| | | if (!item.uuid) { |
| | | item.uuid = Utils.getuuid() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const { TextArea } = Input |
| | | const VoucherTable = asyncComponent(() => import('./voucherTable')) |
| | | const ResetRemark = asyncComponent(() => import('./resetRemark')) |
| | | const ResetAttach = asyncComponent(() => import('./resetAttach')) |
| | | |
| | | class VoucherModule extends Component { |
| | | static propTpyes = { |
| | |
| | | book: null, |
| | | username: sessionStorage.getItem('User_Name'), |
| | | remark: '', |
| | | remarkVisible: false, |
| | | attachments: 0, |
| | | attachlist: [], |
| | | title: '', |
| | | orgcode: '', |
| | | orgname: '', |
| | |
| | | } |
| | | |
| | | triggerprint = () => { |
| | | this.setState({remarkVisible: true}) |
| | | } |
| | | |
| | | remarkSubmit = () => { |
| | | const { config } = this.state |
| | | let node = document.getElementById(config.uuid + 'remark') |
| | | let val = node.value |
| | | |
| | | if (val && val.length > 512) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前内容超长,备注最多512个字符。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({remark: val, remarkVisible: false}) |
| | | } |
| | | |
| | | dataChange = (data) => { |
| | |
| | | } |
| | | |
| | | updateVoucherChar = (val) => { |
| | | const {book} = this.state |
| | | const { book, config } = this.state |
| | | |
| | | if (!book) return |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | // let typeOptions = res.char || [] |
| | | // let charInt = typeOptions[0] ? typeOptions[0].voucher_char_int + 1 : 1 |
| | | let typeOptions = res.char || [] |
| | | |
| | | // this.setState({ |
| | | // typeOptions: typeOptions, |
| | | // charType: typeOptions[0] ? typeOptions[0].voucher_class : '', |
| | | // charName: typeOptions[0] ? typeOptions[0].voucher_char : '', |
| | | // charInt: charInt, |
| | | // orgcode: res.orgcode, |
| | | // orgname: res.orgname, |
| | | // }) |
| | | if (typeOptions.length > 0) { |
| | | let charType = this.state.charType |
| | | let charName = this.state.charName |
| | | let charInt = this.state.charInt |
| | | |
| | | if (charType && typeOptions.filter(n => n.voucher_class === charType) > 0) { |
| | | typeOptions.forEach(n => { |
| | | if (n.voucher_class === charType) { |
| | | charName = n.voucher_char |
| | | charInt = n.voucher_char_int + 1 |
| | | } |
| | | }) |
| | | } else { |
| | | charType = typeOptions[0].voucher_class |
| | | charName = typeOptions[0].voucher_char |
| | | charInt = typeOptions[0].voucher_char_int + 1 |
| | | } |
| | | |
| | | this.setState({ |
| | | typeOptions: typeOptions, |
| | | charType: charType, |
| | | charName: charName, |
| | | charInt: charInt |
| | | }) |
| | | } |
| | | |
| | | let msg = window.GLOB.CacheVoucher.get(config.uuid) || {} |
| | | msg.currency = res.currency || [] |
| | | |
| | | window.GLOB.CacheVoucher.set(config.uuid, msg) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | triggerAttach = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username, remark, remarkVisible, attachments, title } = this.state |
| | | const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | |
| | | </div> |
| | | <div className="voucher-affix"> |
| | | 附单据 <InputNumber precision={0} value={attachments || 0} autoComplete="off" onChange={this.changeAttach}/> 张 |
| | | <Button type="link" className="" onClick={this.triggerAttach}>附件</Button> |
| | | <Button type="link" className="" onClick={this.triggerprint}>备注</Button> |
| | | <ResetAttach attachlist={attachlist} onChange={(vals) => this.setState({attachlist: vals})}/> |
| | | <ResetRemark remark={remark} ID={config.uuid + 'remark'} onChange={(val) => this.setState({remark: val})}/> |
| | | </div> |
| | | </div> : null} |
| | | <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/> |
| | | </div> |
| | | <div className="user">制单人:{username}</div> |
| | | <Modal |
| | | title="备注" |
| | | visible={remarkVisible} |
| | | width={700} |
| | | maskClosable={false} |
| | | onOk={this.remarkSubmit} |
| | | onCancel={() => { this.setState({ remarkVisible: false })}} |
| | | destroyOnClose |
| | | > |
| | | <TextArea id={config.uuid + 'remark'} defaultValue={remark} rows={6}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Button, Modal } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class ResetAttach extends Component { |
| | | state = { |
| | | visible: false, |
| | | list: '' |
| | | } |
| | | |
| | | submit = () => { |
| | | this.setState({remark: '', visible: false}) |
| | | this.props.onChange() |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { attachlist } = this.props |
| | | |
| | | this.setState({visible: true, list: fromJS(attachlist).toJS()}) |
| | | } |
| | | |
| | | render() { |
| | | const { visible } = this.state |
| | | |
| | | return ( |
| | | <> |
| | | <Button type="link" onClick={this.trigger}>附件</Button> |
| | | <Modal |
| | | title="添加附件" |
| | | wrapClassName="voucher-attach-wrap" |
| | | visible={visible} |
| | | width={700} |
| | | maskClosable={false} |
| | | onOk={this.submit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | cancelText="" |
| | | destroyOnClose |
| | | > |
| | | <Button type="link" className="attach-type-btn" onClick={this.trigger}>上传新文件</Button> |
| | | <Button type="link" className="attach-type-btn" onClick={this.trigger}>从会计电子档案选择</Button> |
| | | <div className="attach-selected-list"> |
| | | |
| | | |
| | | </div> |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ResetAttach |
New file |
| | |
| | | .voucher-attach-wrap { |
| | | .ant-modal-body { |
| | | padding: 15px; |
| | | |
| | | .attach-type-btn { |
| | | border-width: 1px; |
| | | color: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | margin-right: 15px; |
| | | } |
| | | |
| | | .attach-selected-list { |
| | | height: 300px; |
| | | overflow-y: auto; |
| | | border: 1px solid #d8d8d8; |
| | | margin-top: 10px; |
| | | } |
| | | .attach-selected-list::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .attach-selected-list::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .attach-selected-list::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { Button, Modal, Input, notification } from 'antd' |
| | | |
| | | // import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class ResetRemark extends Component { |
| | | state = { |
| | | visible: false, |
| | | remark: '' |
| | | } |
| | | |
| | | submit = () => { |
| | | const { ID } = this.props |
| | | |
| | | let node = document.getElementById(ID) |
| | | let val = node.value |
| | | |
| | | if (val && val.length > 512) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前内容超长,备注最多512个字符。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({remark: '', visible: false}) |
| | | this.props.onChange(val) |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { remark } = this.props |
| | | |
| | | this.setState({visible: true, remark: remark}) |
| | | } |
| | | |
| | | render() { |
| | | const { ID } = this.props |
| | | const { visible, remark } = this.state |
| | | |
| | | return ( |
| | | <> |
| | | <Button type="link" onClick={this.trigger}>备注</Button> |
| | | <Modal |
| | | title="备注" |
| | | visible={visible} |
| | | width={700} |
| | | maskClosable={false} |
| | | onOk={this.submit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | destroyOnClose |
| | | > |
| | | <TextArea id={ID} defaultValue={remark} rows={6}/> |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ResetRemark |
| | |
| | | if (m.signType === 'line') { |
| | | lineMarks.push({ |
| | | $index: lineMarks.length + 1, |
| | | uuid: Utils.getuuid(), |
| | | field: field, |
| | | color: color, |
| | | contrastValue: m.contrastValue || '', |
| | |
| | | } else { |
| | | _col.marks.push({ |
| | | $index: _col.marks.length + 1, |
| | | uuid: Utils.getuuid(), |
| | | field: field, |
| | | color: color, |
| | | contrastValue: m.contrastValue || '', |