From a6cfaea4cfac187f24cbd56ec07a7cc766a6c9a7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 29 六月 2024 15:31:17 +0800 Subject: [PATCH] 2024-06-29 --- src/tabviews/custom/components/module/invoice/index.jsx | 154 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 147 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/module/invoice/index.jsx b/src/tabviews/custom/components/module/invoice/index.jsx index efe5714..1575193 100644 --- a/src/tabviews/custom/components/module/invoice/index.jsx +++ b/src/tabviews/custom/components/module/invoice/index.jsx @@ -54,7 +54,12 @@ tax_type: '', reqfields: [], requireds: [], - timestamp: new Date().getTime() + '' + invoice_no: '', + invoice_code: '', + invoice_date: '', + read_only: false, + invoice_type_name: '', + timestamp: '' } UNSAFE_componentWillMount () { @@ -228,7 +233,7 @@ item.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 item.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� - item.setting.custompage = /@pageSize@|@orderBy@/i.test(item.setting.dataresource + item.setting.customScript) + item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) return item } @@ -341,6 +346,17 @@ } }) + let invoice_type_name = '' + if (line.read_only === 'true') { + let types = book.invoice_type || [] + types.forEach(item => { + if (item.value === line.invoice_type) { + invoice_type_name = item.label + } + }) + invoice_type_name = invoice_type_name || line.invoice_type + } + this.setState({ ID: line[config.setting.primaryKey] || Utils.getguid(), io: line.io, @@ -366,6 +382,11 @@ reviewer: line.reviewer, drawer: line.drawer, details: details, + invoice_no: line.invoice_no, + invoice_code: line.invoice_code, + invoice_date: line.read_only === 'true' ? line.invoice_date : '', + read_only: line.read_only === 'true', + invoice_type_name: invoice_type_name, oriDetails: fromJS(details).toJS(), timestamp: new Date().getTime() + '', loading: false @@ -489,7 +510,7 @@ }) if (res.status) { if (config.billSaveBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') + MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId) } if (config.billSaveBtn.syncComId) { MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) @@ -519,6 +540,22 @@ outBill = () => { const { config, BID, saveType } = this.state + + if (window.GLOB.storeFiles) { + if (!window.GLOB.storeDate || window.GLOB.storeDate < 0) { + Modal.warning({ + title: `鐢靛瓙妗f瀛樺偍鍖呭凡杩囨湡銆俙, + okText: '鐭ラ亾浜�' + }) + return + } else if (window.GLOB.storeDate < 30) { + notification.warning({ + top: 92, + message: `鐢靛瓙妗f瀛樺偍鍖呰繕鍓�${window.GLOB.storeDate}澶┿�俙, + duration: 5 + }) + } + } if (window.GLOB.systemType === 'production' && !config.billOutBtn.proInterface) { notification.warning({ @@ -677,6 +714,7 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@lang@/ig, `'${sessionStorage.getItem('lang')}'`) sql = sql.replace(/@typename@/ig, `'admin'`) if (window.GLOB.externalDatabase !== null) { @@ -775,6 +813,10 @@ } param.data.invoiceTypeCode = trans[param.data.invoiceTypeCode] || '' + + if (window.GLOB.storeFiles) { + param.store = true + } let url = '' if (window.GLOB.systemType === 'production') { @@ -916,6 +958,7 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@lang@/ig, `'${sessionStorage.getItem('lang')}'`) sql = sql.replace(/@typename@/ig, `'admin'`) if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 @@ -945,7 +988,7 @@ }) if (res.status) { if (config.billOutBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') + MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId) } if (config.billOutBtn.syncComId) { MKEmitter.emit('reloadData', config.billOutBtn.syncComId) @@ -1033,15 +1076,112 @@ // } render() { - const { config, book, loading, invTypes, reqfields, saveType, date, timestamp, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee, details, visible, tax_type } = this.state + const { config, book, loading, invTypes, reqfields, saveType, date, timestamp, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee, details, visible, tax_type, invoice_no, invoice_code, invoice_date, read_only, invoice_type_name } = this.state - if (!book || (config.wrap.datatype === 'dynamic' && !tax_no)) { + if (!book || (config.wrap.datatype === 'dynamic' && !timestamp)) { return <div className="menu-invoice-wrap" style={config.style}> <div className="loading-mask"> <div className="ant-spin-blur"></div> <Spin /> </div> </div> + } + + if (read_only) { + return ( + <div className="menu-invoice-wrap read_only" style={config.style}> + {loading ? + <div className="loading-mask"> + <div className="ant-spin-blur"></div> + <Spin /> + </div> : null + } + <div className="inv-action"> + {config.wrap.backBtn === 'show' ? <Button className="mk-back" onClick={this.goback}><LeftOutlined />杩斿洖</Button> : null} + </div> + <div className="inv-header"> + <div className="inv-type">{invoice_type_name}</div> + <div className="inv-msg"> + {invoice_no ? <div>鍙戠エ鍙风爜锛歿invoice_no}</div> : null} + {invoice_code ? <div>鍙戠エ浠g爜锛歿invoice_code}</div> : null} + {invoice_date ? <div>寮�绁ㄦ棩鏈燂細{invoice_date}</div> : null} + </div> + </div> + <div className="inv-body"> + <div className="inv-main-content"> + <div className="inv-buyer"> + <div className="inv-label">璐拱鏂�</div> + <div className="inv-content"> + <Form.Item className="mk-name" label={<>鍚�<span></span>绉�</>}> + {from_to_name} + </Form.Item> + <Form.Item label="绾崇◣浜鸿瘑鍒彿"> + {from_to_tax_no} + </Form.Item> + <Form.Item label={<>鍦�<span></span>鍧�<span></span>銆�<span></span>鐢�<span></span>璇�</>}> + {from_to_addr + ' ' + from_to_tel} + </Form.Item> + <Form.Item label="寮�鎴疯鍙婅处鍙�"> + {from_to_bank_name + ' ' + from_to_account_no} + </Form.Item> + </div> + </div> + <div className="inv-notice"> + <div className="inv-label">閫氱煡鍒�</div> + <div className="inv-content"> + <Form.Item label={<>鎵�<span></span>鏈�<span></span>鍙�</>}> + {from_to_mob} + </Form.Item> + <Form.Item label={<>閭�<span></span>绠�</>}> + {from_to_email} + </Form.Item> + </div> + </div> + </div> + <div className="inv-details"> + <InvoiceTable data={details} timestamp={timestamp} read_only={true} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/> + </div> + <div className="inv-main-content"> + <div className="inv-buyer"> + <div className="inv-label">閿�鍞柟</div> + <div className="inv-content"> + <Form.Item label={<>鍚�<span></span>绉�</>}> + {orgname} + </Form.Item> + <Form.Item label="绾崇◣浜鸿瘑鍒彿"> + {tax_no} + </Form.Item> + <Form.Item label={<>鍦�<span></span>鍧�<span></span>銆�<span></span>鐢�<span></span>璇�</>}> + {addr + ' ' + tel} + </Form.Item> + <Form.Item label="寮�鎴疯鍙婅处鍙�"> + {bank_name + ' ' + account_no} + </Form.Item> + </div> + </div> + <div className="inv-notice"> + <div className="inv-label">澶囨敞</div> + <div className="inv-content" style={{paddingTop: '30px'}}> + <Form.Item label=""> + {remark} + </Form.Item> + </div> + </div> + </div> + </div> + <div className="inv-tail"> + <Form.Item label="鏀舵浜�"> + {payee} + </Form.Item> + <Form.Item label="澶嶆牳浜�"> + {reviewer} + </Form.Item> + <Form.Item label="寮�绁ㄤ汉"> + {drawer} + </Form.Item> + </div> + </div> + ) } return ( @@ -1105,7 +1245,7 @@ </div> </div> <div className="inv-details"> - <InvoiceTable data={details} timestamp={timestamp} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/> + <InvoiceTable data={details} timestamp={timestamp} read_only={false} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/> </div> <div className="inv-main-content"> <div className="inv-buyer"> -- Gitblit v1.8.0