From db731b1d8b3ed1fcce588307b8bd5eccc4f805b2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 五月 2024 11:30:39 +0800 Subject: [PATCH] 2024-05-08 --- src/tabviews/custom/components/module/invoice/index.jsx | 147 +++++++++++++++++++++++------------------------- 1 files changed, 71 insertions(+), 76 deletions(-) diff --git a/src/tabviews/custom/components/module/invoice/index.jsx b/src/tabviews/custom/components/module/invoice/index.jsx index def7f66..a6c61d6 100644 --- a/src/tabviews/custom/components/module/invoice/index.jsx +++ b/src/tabviews/custom/components/module/invoice/index.jsx @@ -14,8 +14,6 @@ import SubTable from './subTable' import './index.scss' -const { confirm } = Modal - class InvoiceModule extends Component { static propTpyes = { config: PropTypes.object @@ -81,6 +79,7 @@ _config.buyer = this.formatSetting(_config.buyer, 'buyer') _config.detail = this.formatSetting(_config.detail, 'detail') + _config.detail.uuid = _config.uuid let book = null let pas = {} @@ -145,6 +144,8 @@ cell.Hide = 'true' } else if (['from_to_email', 'from_to_mob'].includes(cell.field)) { cell.Width = 80 + } else if (['from_to_name'].includes(cell.field)) { + cell.Width = 140 } return cell }) @@ -154,7 +155,7 @@ cell.field = 'tax_rate' cell.label = '绋庣巼' } - if (['Description', 'id', 'small_tax_rate', 'free_tax_mark', 'vat_special_management'].includes(cell.field)) { + if (['Description', 'id', 'small_tax_rate', 'free_tax_mark', 'vat_special_management', 'tax_item', 'tax_method'].includes(cell.field)) { cell.Hide = 'true' } else if (['spec'].includes(cell.field)) { cell.Width = 150 @@ -384,25 +385,22 @@ } clearData = () => { - const { from_to_tax_no, oriDetails, details } = this.state - - if (from_to_tax_no || oriDetails.length || details.length) { - this.setState({ - 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: '', - from_to_code: '', - business_type: '', - details: [], - oriDetails: [], - timestamp: new Date().getTime() + '', - }) - } + this.setState({ + ID: Utils.getguid(), + 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: '', + from_to_code: '', + business_type: '', + details: [], + oriDetails: [], + timestamp: new Date().getTime() + '', + }) } changeType = (val) => { @@ -490,30 +488,16 @@ saveType: '' }) if (res.status) { - const that = this - - confirm({ - title: '淇濆瓨鎴愬姛銆�', - okText: '缁х画濉紑', - cancelText: '鍏抽棴', - onOk() { - if (config.billSaveBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') - } - if (config.billSaveBtn.syncComId) { - MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) - } - that.clearData() - }, - onCancel() { - if (config.billSaveBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') - } - if (config.billSaveBtn.syncComId) { - MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) - } - MKEmitter.emit('closeTabView', config.$pageId) - } + if (config.billSaveBtn.reTabId) { + MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') + } + if (config.billSaveBtn.syncComId) { + MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) + } + notification.success({ + top: 92, + message: '淇濆瓨鎴愬姛銆�', + duration: 5 }) } else { notification.warning({ @@ -854,11 +838,12 @@ }) keys = keys.join(',') + vals = vals.join(',') lines.push({ table: md5(tb + keys), - insert: `Insert into ${tbName} (${keys},[mk_level],[mk_id],[mk_bid])`, - select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` + insert: `Insert into ${tbName} (${keys ? keys + ',' : ''}[mk_level],[mk_id],[mk_bid])`, + select: `Select ${keys ? vals + ',' : ''}'${level}','${id}','${bid}'` }) subObjs.forEach(item => { @@ -952,40 +937,28 @@ } Api.genericInterface(param).then(res => { + this.setState({ + saveType: '' + }) if (res.status) { - const that = this + if (config.billOutBtn.reTabId) { + MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') + } + if (config.billOutBtn.syncComId) { + MKEmitter.emit('reloadData', config.billOutBtn.syncComId) + } + this.clearData() - confirm({ - title: '淇濆瓨鎴愬姛銆�', - okText: '缁х画濉紑', - cancelText: '鍏抽棴', - onOk() { - if (config.billOutBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') - } - if (config.billOutBtn.syncComId) { - MKEmitter.emit('reloadData', config.billOutBtn.syncComId) - } - that.clearData() - }, - onCancel() { - if (config.billOutBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') - } - if (config.billOutBtn.syncComId) { - MKEmitter.emit('reloadData', config.billOutBtn.syncComId) - } - MKEmitter.emit('closeTabView', config.$pageId) - } + notification.success({ + top: 92, + message: '寮�绁ㄦ垚鍔熴��', + duration: 5 }) } else { notification.warning({ top: 92, message: res.message, duration: 5 - }) - this.setState({ - saveType: '' }) } }) @@ -1031,6 +1004,27 @@ }) } + addInvice = () => { + const { saveType } = this.state + + if (saveType) { + notification.warning({ + top: 92, + message: saveType === 'bill' ? '鍗曟嵁淇濆瓨涓紝璇风◢鍚庛��' : '寮�绁ㄤ腑锛岃绋嶅悗銆�', + duration: 3 + }) + return + } + + this.clearData() + + notification.success({ + top: 92, + message: '鍗曟嵁宸叉洿鏂般��', + duration: 3 + }) + } + 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 @@ -1053,6 +1047,7 @@ } <div className="inv-action"> {config.wrap.backBtn === 'show' ? <Button className="mk-back" onClick={this.goback}><LeftOutlined />杩斿洖</Button> : null} + <Button className="mk-addinv" onClick={this.addInvice}>鏂板鍙戠エ</Button> <Button className="mk-bill" loading={saveType === 'bill'} onClick={this.saveBill}>淇濆瓨鍗曟嵁</Button> <Button className="mk-submit" loading={saveType === 'out'} onClick={this.outBill}>鎻愪氦寮�绁�</Button> </div> @@ -1073,7 +1068,7 @@ <div className="inv-buyer"> <div className="inv-label">璐拱鏂�</div> <div className="inv-content"> - <Form.Item required={reqfields.includes('from_to_name')} label={<>鍚�<span></span>绉�</>} extra={<EllipsisOutlined onClick={() => this.setState({visible: true})}/>}> + <Form.Item className="mk-name" required={reqfields.includes('from_to_name')} label={<>鍚�<span></span>绉�</>} extra={<EllipsisOutlined onClick={() => this.setState({visible: true})}/>}> <Input placeholder="璇疯緭鍏ヨ喘涔版柟鍚嶇О" allowClear value={from_to_name} autoComplete="off" onChange={(e) => this.setState({from_to_name: e.target.value})}/> </Form.Item> <Form.Item required={reqfields.includes('from_to_tax_no')} label="绾崇◣浜鸿瘑鍒彿"> @@ -1148,7 +1143,7 @@ <Modal title="瀹㈡埛淇℃伅" visible={visible} - width="70vw" + width="75vw" maskClosable={false} onCancel={() => { this.setState({ visible: false }) }} footer={null} -- Gitblit v1.8.0