From 61ab22d7b6be46c00e8813b00b2352a52cc252f3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 01 二月 2023 15:43:35 +0800 Subject: [PATCH] 2023-02-01 --- src/tabviews/custom/components/module/voucher/index.jsx | 87 ++++++++++++++++++++++++++++++------------- 1 files changed, 61 insertions(+), 26 deletions(-) diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index ca3cc7b..aeafbc9 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -10,6 +10,7 @@ import './index.scss' const { confirm } = Modal +const { TextArea } = Input const VoucherTable = asyncComponent(() => import('./voucherTable')) class VoucherModule extends Component { @@ -30,6 +31,8 @@ vouDate: null, book: null, username: sessionStorage.getItem('User_Name'), + remark: '', + remarkVisible: false, status: '' // 鏂板缓鏃讹紝empty銆乧hange銆乻aved } @@ -310,7 +313,7 @@ } voucherSave = (list, t) => { - const { BID, config, charInt, charType, book } = this.state + const { BID, config, charInt, charType, vouDate, book, remark } = this.state if (!book) { notification.warning({ @@ -326,7 +329,7 @@ BID: BID, voucher_code: '', voucher_text: '', - remark: '', + remark: remark, account_year_code: '', voucher_type: '', voucher_type_text: '', @@ -339,40 +342,61 @@ voucher_char: charType, voucher_char_int: charInt, account_code: book.account_code || '', - fibvoucherdate: '', + fibvoucherdate: vouDate, UserName: sessionStorage.getItem('User_Name') || '', FullName: sessionStorage.getItem('Full_Name') || '', sup_data: '', subject_data: '' } - Api.genericInterface(param).then(res => { - if (!res.status) { - notification.warning({ - top: 92, - message: res.message, - duration: 5 - }) - return - } + console.log(list) + console.log(param) + console.log(config) - if (t === 'add') { - this.setState({ - status: 'empty', - tbdata: [], - charInt: charInt + 1 - }) - MKEmitter.emit('cleartable', config.uuid) - } else { - this.setState({ - status: 'saved' - }) - } - }) + // Api.genericInterface(param).then(res => { + // if (!res.status) { + // notification.warning({ + // top: 92, + // message: res.message, + // duration: 5 + // }) + // return + // } + + // if (t === 'add') { + // this.setState({ + // status: 'empty', + // remark: '', + // tbdata: [], + // charInt: charInt + 1 + // }) + // MKEmitter.emit('cleartable', config.uuid) + // } else { + // this.setState({ + // status: 'saved' + // }) + // } + // }) } 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) => { @@ -383,7 +407,7 @@ } render() { - const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username } = this.state + const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username, remark, remarkVisible } = this.state return ( <div className="menu-voucher-wrap" style={config.style}> @@ -415,6 +439,17 @@ <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> ) } -- Gitblit v1.8.0