From 31871ca836e6fcbea9b1c54e2ec15f49667bf093 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 十二月 2022 14:14:04 +0800 Subject: [PATCH] 2022-12-23 --- src/tabviews/custom/components/module/voucher/index.jsx | 57 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index f5a95a1..2fafcd4 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -4,6 +4,7 @@ import { Button, Select, Input, DatePicker } from 'antd' // import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' +import Api from '@/api' import asyncComponent from '@/utils/asyncComponent' // import MKEmitter from '@/utils/events.js' import './index.scss' @@ -12,27 +13,40 @@ class VoucherModule extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 } state = { - BID: '', // 涓昏〃ID - config: null, // 鍥捐〃閰嶇疆淇℃伅 - loading: false, // 鏁版嵁鍔犺浇鐘舵�� - data: null, // 鏁版嵁 - searchkey: null, // 杩囨护鏉′欢 + BID: '', + type: '', + config: null, + loading: false, + data: null, + searchkey: null, disableAdd: true, disableSave: true, typeOptions: [] } UNSAFE_componentWillMount () { - const { config, BID } = this.props + const { config } = this.props + + let BID = '' + let BData = '' + + if (config.wrap.supModule) { + BData = window.GLOB.CacheData.get(config.wrap.supModule) + } else { + BData = window.GLOB.CacheData.get(config.$pageId) + } + if (BData) { + BID = BData.$BID || '' + } this.setState({ config: fromJS(config).toJS(), BID: BID || '', + type: config.wrap.type }, () => { this.loadData() }) @@ -56,7 +70,10 @@ } loadData = () => { - + let param = { + func: 's_get_fcc_account_data' + } + Api.genericInterface(param) } triggeradd = () => { @@ -72,7 +89,7 @@ } render() { - const { config, disableSave, disableAdd, typeOptions, data } = this.state + const { config, disableSave, disableAdd, typeOptions, data, type } = this.state return ( <div className="menu-voucher-wrap" style={config.style}> @@ -80,8 +97,10 @@ <Button className="system-background header-btn" disabled={disableAdd} onClick={this.triggeradd}>鏂板</Button> <Button className="system-background header-btn" disabled={disableSave} onClick={this.triggersave}>淇濆瓨</Button> <Button className="system-background header-btn" disabled={disableSave} onClick={this.triggerprint}>鎵撳嵃</Button> + <Button className="system-background header-btn" disabled={disableSave} onClick={this.triggerprint}>瀵煎叆</Button> + <Button className="system-background header-btn" disabled={disableSave} onClick={this.triggerprint}>瀵煎嚭</Button> </div> - <div className="voucher-body"> + {type === 'edit' ? <div className="voucher-body"> <div className="pre-wrap"> <div className="voucher-code"> <Select> @@ -101,7 +120,23 @@ </div> </div> <VoucherTable config={config} data={data}/> - </div> + </div> : null} + {type === 'check' ? <div className="voucher-body"> + <div className="pre-wrap"> + <div className="voucher-code"> + 璁� 1 鍙� + </div> + <div className="voucher-date"> + 鏃ユ湡锛�2022-02-24 + </div> + <div className="voucher-affix"> + 闄勫崟鎹� 2 寮� + <Button type="link" className="" onClick={this.triggerprint}>闄勪欢</Button> + <Button type="link" className="" onClick={this.triggerprint}>澶囨敞</Button> + </div> + </div> + <VoucherTable config={config} data={data}/> + </div> : null} </div> ) } -- Gitblit v1.8.0