xujing 5 년 전
부모
커밋
e327ffa8c4

+ 4
- 4
src/pages/fundManagement/AccountDetail.jsx 파일 보기

@@ -11,7 +11,7 @@ import XForm, { FieldTypes } from '../../components/XForm';
11 11
 import RechargeOrder from './RechargeOrder';
12 12
 import ConsumeOrder from './ConsumeOrder';
13 13
 import RefundOrder from './RefundOrder';
14
-
14
+import Recharge from './components/Recharge'
15 15
 
16 16
 function header(props) {
17 17
     const orgId = props.location.query.id || ''
@@ -91,8 +91,6 @@ function header(props) {
91 91
     ]
92 92
 
93 93
 
94
-
95
-
96 94
     return (
97 95
 
98 96
         <>
@@ -109,7 +107,9 @@ function header(props) {
109 107
                     <div>
110 108
                         <XForm buttonVisible={false} fields={fields}></XForm>
111 109
                         <div style={{ paddingLeft: '30%', marginTop: '30px' }}>
112
-                            <Button htmlType="submit" type="primary" style={{ marginRight: '10%' }}>充值</Button>
110
+                            <Button htmlType="submit" type="primary" style={{ marginRight: '10%' }}>
111
+                                <Recharge orgId={newsData.orgId || ''} onClick={() => getDetail(orgId)} accountId={newsData.accountId || ''} />
112
+                            </Button>
113 113
                             <Button >返回</Button>
114 114
                         </div>
115 115
                     </div>

+ 2
- 2
src/pages/fundManagement/AccountManagement.jsx 파일 보기

@@ -102,9 +102,9 @@ function header(props) {
102 102
             width: '120px',
103 103
             render: (x, row) => (
104 104
                 <>
105
-                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px', display: 'inline-block' }}><Recharge orgId={row.orgId} accountId={row.accountId} /></span>
105
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px', display: 'inline-block' }}><Recharge  onClick={() => getList({ pageNum: 1, pageSize: 10 })} orgId={row.orgId} accountId={row.accountId} /></span>
106 106
                     <span style={{ color: '#FF925C', cursor: 'pointer', display: 'inline-block' }} >
107
-                        <Refund orgId={row.orgId} accountId={row.accountId} realBalance={row.realBalance || '0'} />
107
+                        <Refund orgId={row.orgId} accountId={row.accountId} onClick={() => getList({ pageNum: 1, pageSize: 10 })}  realBalance={row.realBalance || '0'} />
108 108
                     </span>
109 109
                 </>
110 110
             ),

+ 28
- 2
src/pages/fundManagement/ConsumeOrder.jsx 파일 보기

@@ -135,7 +135,30 @@ function header(props) {
135 135
         props.form.resetFields();
136 136
         getList({ pageNum: 1, pageSize: 10, orderType: 'redPacket' })
137 137
     }
138
-
138
+    // 导出
139
+    const exportList = () => {
140
+        let { LocalDate, ...submitValue } = props.form.getFieldsValue()
141
+        if (null != LocalDate && LocalDate.length > 0) {
142
+            const [startDate, endDate] = LocalDate
143
+            submitValue.startDate = moment(startDate).format('YYYY-MM-DD');
144
+            submitValue.endDate = moment(endDate).format('YYYY-MM-DD');
145
+        } else {
146
+            submitValue.startDate = null
147
+            submitValue.endDate = null
148
+        }
149
+        request({ ...apis.fund.orderExport, params: { orderType: 'redPacket', orgId, ...submitValue } }).then(data => {
150
+            if (!data) {
151
+                return
152
+            }
153
+            const url = window.URL.createObjectURL(new Blob([data]))
154
+            const link = document.createElement('a')
155
+            link.style.display = 'none'
156
+            link.href = url
157
+            link.setAttribute('download', '消费订单表.xlsx')
158
+            document.body.append(link)
159
+            link.click()
160
+        }).catch()
161
+    }
139 162
     const { getFieldDecorator } = props.form
140 163
     return (
141 164
 
@@ -146,7 +169,7 @@ function header(props) {
146 169
                 onCancel={() => setVisible(false)}
147 170
                 footer={null}
148 171
             >
149
-                <div style={{ paddingLeft:'36%'}}>
172
+                <div style={{ paddingLeft: '36%' }}>
150 173
                     <p>昵称:{personInfo.nickname || ''}</p>
151 174
                     <p>头像:<img src={personInfo.avatarurl || ''} className={styles.touxiang} /></p>
152 175
                     <p>姓名:{personInfo.name || ''}</p>
@@ -211,6 +234,9 @@ function header(props) {
211 234
           </Button>
212 235
                 </Form.Item>
213 236
             </Form>
237
+            <div>
238
+                <Button type="danger" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={() => exportList()} >导出</Button>
239
+            </div>
214 240
             <Table rowKey={r => r.tradeNo} dataSource={data.records} columns={columns} pagination={false} />
215 241
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
216 242
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />

+ 10
- 2
src/pages/fundManagement/RechargeOrder.jsx 파일 보기

@@ -130,8 +130,16 @@ function header(props) {
130 130
     }
131 131
     // 导出
132 132
     const exportList = () => {
133
-
134
-        request({ ...apis.fund.orderExport, params: { orderType: 'recharge', ...props.form.getFieldsValue() } }).then(data => {
133
+        let { LocalDate, ...submitValue } = props.form.getFieldsValue()
134
+        if (null != LocalDate && LocalDate.length > 0) {
135
+            const [startDate, endDate] = LocalDate
136
+            submitValue.startDate = moment(startDate).format('YYYY-MM-DD');
137
+            submitValue.endDate = moment(endDate).format('YYYY-MM-DD');
138
+        } else {
139
+            submitValue.startDate = null
140
+            submitValue.endDate = null
141
+        }
142
+        request({ ...apis.fund.orderExport, params: { orderType: 'recharge', orgId, ...submitValue } }).then(data => {
135 143
             if (!data) {
136 144
                 return
137 145
             }

+ 28
- 0
src/pages/fundManagement/RefundOrder.jsx 파일 보기

@@ -22,6 +22,7 @@ function header(props) {
22 22
     const [refundVisible, setRefundVisible] = useState(false)
23 23
     const [inputValue, setValue] = useState('')
24 24
     const [swiperList, setSwiperList] = useState([])
25
+    console.log(props, "propspropspropspropspropsprops")
25 26
 
26 27
     const orgId = props.orgId || ''
27 28
 
@@ -230,6 +231,30 @@ function header(props) {
230 231
 
231 232
         setRefundVisible(false)
232 233
     }
234
+    // 导出
235
+    const exportList = () => {
236
+        let { LocalDate, ...submitValue } = props.form.getFieldsValue()
237
+        if (null != LocalDate && LocalDate.length > 0) {
238
+            const [startDate, endDate] = LocalDate
239
+            submitValue.startDate = moment(startDate).format('YYYY-MM-DD');
240
+            submitValue.endDate = moment(endDate).format('YYYY-MM-DD');
241
+        } else {
242
+            submitValue.startDate = null
243
+            submitValue.endDate = null
244
+        }
245
+        request({ ...apis.fund.orderExport, params: { orderType: 'refund', orgId, ...submitValue } }).then(data => {
246
+            if (!data) {
247
+                return
248
+            }
249
+            const url = window.URL.createObjectURL(new Blob([data]))
250
+            const link = document.createElement('a')
251
+            link.style.display = 'none'
252
+            link.href = url
253
+            link.setAttribute('download', '退款订单表.xlsx')
254
+            document.body.append(link)
255
+            link.click()
256
+        }).catch()
257
+    }
233 258
 
234 259
     const { getFieldDecorator } = props.form
235 260
     const list = []
@@ -303,6 +328,9 @@ function header(props) {
303 328
                     </Button>
304 329
                 </Form.Item>
305 330
             </Form>
331
+            <div>
332
+                <Button type="danger" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={() => exportList()} >导出</Button>
333
+            </div>
306 334
             <Table rowKey={r => r.tradeNo} dataSource={data.records} columns={columns} pagination={false} />
307 335
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
308 336
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />

+ 1
- 0
src/pages/fundManagement/components/Recharge.jsx 파일 보기

@@ -38,6 +38,7 @@ const SelectContact = props => {
38 38
                 request({ ...apis.fund.recharge, urlData: { id: props.accountId || '' }, data: { ...values, orgId: props.orgId } }).then((data) => {
39 39
                     message.info("操作成功")
40 40
                     setVisible(false)
41
+                    props.onClick()
41 42
                 })
42 43
             }
43 44
         });

+ 2
- 1
src/pages/fundManagement/components/Refund.jsx 파일 보기

@@ -37,6 +37,7 @@ const SelectContact = props => {
37 37
                 request({ ...apis.fund.accoutRefund, urlData: { id: props.accountId || '' }, data: { ...values, orgId: props.orgId } }).then((data) => {
38 38
                     message.info("操作成功")
39 39
                     setVisible(false)
40
+                    props.onClick()
40 41
                 })
41 42
             }
42 43
         });
@@ -69,7 +70,7 @@ const SelectContact = props => {
69 70
                                 { max: 20 }],
70 71
                             })(<Input type='number' placeholder="支持2位小数" addonAfter="元" />)}
71 72
                         </Form.Item>
72
-                        <div style={{marginBottom:'25px'}}><span style={{ width: '25%', display: 'inline-block', textAlign: 'right' }}>余额:</span>{props.realBalance}元</div>
73
+                        <div style={{ marginBottom: '25px' }}><span style={{ width: '25%', display: 'inline-block', textAlign: 'right' }}>余额:</span>{props.realBalance}元</div>
73 74
                         <Form.Item label="退款凭证" help="可上传银行转账截图、微信退款订单等截图作为查账线索">
74 75
                             {getFieldDecorator('certificateList', {
75 76
                                 rules: [{ required: false }],