xujing vor 5 Jahren
Ursprung
Commit
6a6b8cb2ed

+ 2
- 1
config/config.js Datei anzeigen

@@ -133,7 +133,8 @@ export default {
133 133
 
134 134
   proxy: {
135 135
     '/api': {
136
-      target: 'http://127.0.0.1:8080/',
136
+      target: 'https://dev.fangdeal.cn',
137
+      // target: 'http://192.168.0.195:8080/',
137 138
       changeOrigin: true,
138 139
       // pathRewrite: { '^/server': '' },
139 140
     },

+ 44
- 1
config/routes.js Datei anzeigen

@@ -66,6 +66,49 @@ export default [
66 66
                 hideInMenu: true,
67 67
                 component: './sample/demand/edit',
68 68
               },
69
+              {
70
+                path: '/sample/h5/h5Sample',
71
+                name: 'H5模板',
72
+                component: './sample/h5/h5Sample',
73
+              },
74
+            ],
75
+          },
76
+          {
77
+            path: '/fundManagement',
78
+            name: '资金管理',
79
+            component: '../layouts/BlankLayout',
80
+            routes: [
81
+              {
82
+                path: '/fundManagement/RechargeOrder',
83
+                name: '充值订单',
84
+                component: './fundManagement/RechargeOrder',
85
+              },
86
+              {
87
+                path: '/fundManagement/ConsumeOrder',
88
+                name: '消费订单',
89
+                component: './fundManagement/ConsumeOrder',
90
+              },
91
+              {
92
+                path: '/fundManagement/RefundOrder',
93
+                name: '退款订单',
94
+                component: './fundManagement/RefundOrder',
95
+              },
96
+              {
97
+                path: '/fundManagement/AccountManagement',
98
+                name: '账户管理',
99
+                component: './fundManagement/AccountManagement',
100
+              },
101
+              {
102
+                path: '/fundManagement/AccountDetail',
103
+                name: '账户详情',
104
+                hideInMenu: true,
105
+                component: './fundManagement/AccountDetail',
106
+              },
107
+              {
108
+                path: '/fundManagement/Finance',
109
+                name: '财务联系人',
110
+                component: './fundManagement/Finance',
111
+              },
69 112
             ],
70 113
           },
71 114
           {
@@ -167,7 +210,7 @@ export default [
167 210
               },
168 211
             ],
169 212
           },
170
-          
213
+
171 214
           {
172 215
             component: './404',
173 216
           },

+ 4
- 4
src/components/XForm/WrapperForm.jsx Datei anzeigen

@@ -60,15 +60,15 @@ class WrapperForm extends React.Component {
60 60
     return FieldSubmit || FieldCancel ? <WrapperItem action render={<>{FieldSubmit}{FieldCancel}</>} /> : null
61 61
   }
62 62
 
63
-  render () {
64
-    const {fields, form, children, submitBtn, cancelBtn, ...formProps} = this.props;
63
+  render() {
64
+    const { fields, form, buttonVisible = true, children, submitBtn, cancelBtn, ...formProps } = this.props;
65 65
 
66 66
     const FeildItems = (fields || []).map((props, inx) => (<WrapperItem key={inx} {...props} form={form} />))
67
-    
67
+
68 68
     return (
69 69
       <Form {...formItemLayout} {...formProps} onSubmit={this.handleSubmit}>
70 70
         {FeildItems}
71
-        {this.renderDefaultAction(submitBtn, cancelBtn)}
71
+        {buttonVisible && this.renderDefaultAction(submitBtn, cancelBtn)}
72 72
         {children}
73 73
       </Form>
74 74
     );

+ 14
- 10
src/components/XForm/WrapperItem.jsx Datei anzeigen

@@ -17,6 +17,7 @@ const { MonthPicker, RangePicker } = DatePicker
17 17
 
18 18
 const FieldTypes = {
19 19
   Text: 'Text',
20
+  Message: 'Message',
20 21
   Password: 'Password',
21 22
   Number: 'Number',
22 23
   Switch: 'Switch',
@@ -70,7 +71,7 @@ const WrapperItem = (props, ref) => {
70 71
       valuePropName: 'checked',
71 72
     };
72 73
   }
73
-  
74
+
74 75
   if (type === FieldTypes.ImageUploader) {
75 76
     config = {
76 77
       ...config,
@@ -92,34 +93,37 @@ const WrapperItem = (props, ref) => {
92 93
   } else {
93 94
     switch (type) {
94 95
       case FieldTypes.Text:
95
-        Field = <Input placeholder={placeholder} style={{ width: '100%' }} {...fieldProps}/>;
96
+        Field = <Input placeholder={placeholder} style={{ width: '100%' }} {...fieldProps} />;
97
+        break;
98
+      case FieldTypes.Message:
99
+        Field = <span>{value}</span>;
96 100
         break;
97 101
       case FieldTypes.Password:
98
-        Field = <Input.Password placeholder={placeholder} style={{ width: '100%' }} {...fieldProps}/>;
102
+        Field = <Input.Password placeholder={placeholder} style={{ width: '100%' }} {...fieldProps} />;
99 103
         break;
100 104
       case FieldTypes.Number:
101
-        Field = <InputNumber placeholder={placeholder} style={{ width: '100%' }} {...fieldProps}/>;
105
+        Field = <InputNumber placeholder={placeholder} style={{ width: '100%' }} {...fieldProps} />;
102 106
         break;
103 107
       case FieldTypes.Switch:
104 108
         Field = <Switch {...fieldProps} />;
105 109
         break;
106 110
       case FieldTypes.TimePicker:
107
-        Field = <TimePicker {...fieldProps} style={{ width: '100%' }}/>;
111
+        Field = <TimePicker {...fieldProps} style={{ width: '100%' }} />;
108 112
         break;
109 113
       case FieldTypes.DatePicker:
110
-        Field = <DatePicker {...fieldProps} style={{ width: '100%' }}/>;
114
+        Field = <DatePicker {...fieldProps} style={{ width: '100%' }} />;
111 115
         break;
112 116
       case FieldTypes.RangePicker:
113
-        Field = <RangePicker {...fieldProps} style={{ width: '100%' }}/>;
117
+        Field = <RangePicker {...fieldProps} style={{ width: '100%' }} />;
114 118
         break;
115 119
       case FieldTypes.MonthPicker:
116
-        Field = <MonthPicker {...fieldProps} style={{ width: '100%' }}/>;
120
+        Field = <MonthPicker {...fieldProps} style={{ width: '100%' }} />;
117 121
         break;
118 122
       case FieldTypes.Select:
119 123
         Field = <Select placeholder={placeholder} style={{ width: '100%' }} {...fieldProps}>{SelectOpts}</Select>
120 124
         break;
121 125
       case FieldTypes.ImageUploader:
122
-        Field = <ImageUploader {...fieldProps}/>
126
+        Field = <ImageUploader {...fieldProps} />
123 127
         break;
124 128
       default:
125 129
         throw new Error(`暂时不支持的组件类型: ${type}`)
@@ -127,7 +131,7 @@ const WrapperItem = (props, ref) => {
127 131
   }
128 132
 
129 133
   if (!label && !name && !action) return <Field ref={ref} />;
130
-  
134
+
131 135
   const itemProps = action ? { ...restProps, ...tailFormItemLayout } : restProps
132 136
 
133 137
   return (

+ 108
- 0
src/pages/fundManagement/AccountDetail.jsx Datei anzeigen

@@ -0,0 +1,108 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Button, Icon, message, Modal, Radio } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import styles from './style.less';
8
+import { fetch, apis } from '../../utils/request';
9
+import request from '../../utils/request';
10
+import XForm, { FieldTypes } from '../../components/XForm';
11
+import RechargeOrder from './RechargeOrder';
12
+import ConsumeOrder from './ConsumeOrder';
13
+import RefundOrder from './RefundOrder';
14
+
15
+
16
+function header(props) {
17
+
18
+    const [tab, changeTab] = useState('basic')
19
+
20
+    const fields = [
21
+        {
22
+            label: '小程序名',
23
+            name: 'orgName',
24
+            type: FieldTypes.Message,
25
+            value: '444444444444444',
26
+        },
27
+        {
28
+            label: '公司/组织名称',
29
+            name: 'company',
30
+            type: FieldTypes.Message,
31
+            value: '444444444444444',
32
+        },
33
+        {
34
+            label: '代理商',
35
+            name: 'agent',
36
+            type: FieldTypes.Message,
37
+            value: '444444444444444',
38
+        },
39
+        {
40
+            label: '总充值金额',
41
+            name: 'recharge',
42
+            type: FieldTypes.Message,
43
+            value: '444444444444444元',
44
+            help: '对账请在充值订单中查看充值状态为“已支付”的充值记录',
45
+        },
46
+        {
47
+            label: '已消费金额',
48
+            name: 'consume',
49
+            type: FieldTypes.Message,
50
+            value: '444444444444444元',
51
+            help: '对账请在充值订单中查看充值状态为“成功”的充值记录',
52
+        },
53
+        {
54
+            label: '已退款金额',
55
+            name: 'refund',
56
+            type: FieldTypes.Message,
57
+            value: '444444444444444元',
58
+            help: '对账请在充值订单中查看充值状态为“已退款”的退款记录',
59
+        },
60
+        {
61
+            label: '退款冻结金额',
62
+            name: 'consume',
63
+            type: FieldTypes.Message,
64
+            value: '444444444444444元',
65
+            help: '对账请在充值订单中查看充值状态为“已申请”的退款记录',
66
+        },
67
+        {
68
+            label: '账户余额',
69
+            name: 'consume',
70
+            type: FieldTypes.Message,
71
+            value: '444444444444444元',
72
+            help: '对账户余额=总充值金额-已消费金额-已退款额-退款冻结额',
73
+        },
74
+    ]
75
+
76
+
77
+
78
+
79
+    return (
80
+
81
+        <>
82
+            <div style={{ marginBottom: '16px' }}>
83
+                <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
84
+                    <Radio.Button value="basic">基本信息</Radio.Button>
85
+                    <Radio.Button value="recharge">充值订单</Radio.Button>
86
+                    <Radio.Button value="consume">消费订单</Radio.Button>
87
+                    <Radio.Button value="refund">退款订单</Radio.Button>
88
+                </Radio.Group>
89
+            </div>
90
+            <div>
91
+                {tab === 'basic' &&
92
+                    <div>
93
+                        <XForm buttonVisible={false} fields={fields}></XForm>
94
+                        <div style={{ paddingLeft: '30%', marginTop: '30px' }}>
95
+                            <Button htmlType="submit" type="primary" style={{ marginRight: '10%' }}>充值</Button>
96
+                            <Button >返回</Button>
97
+                        </div>
98
+                    </div>
99
+                }
100
+                {tab === 'recharge' && <RechargeOrder />}
101
+                {tab === 'consume' && <ConsumeOrder />}
102
+                {tab === 'refund' && <RefundOrder />}
103
+            </div>
104
+        </>
105
+    )
106
+}
107
+
108
+export default header

+ 171
- 0
src/pages/fundManagement/AccountManagement.jsx Datei anzeigen

@@ -0,0 +1,171 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Card, Button, Icon, Tooltip, message, notification, Modal, Table, Select, Input, DatePicker } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../utils/request';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+function header(props) {
16
+    // 获取初始化数据
17
+    const [data, setData] = useState({})
18
+    const [demandIdList, setDemandIdList] = useState([])
19
+
20
+    useEffect(() => {
21
+        getList({ pageNum: 1, pageSize: 10 });
22
+    }, [])
23
+
24
+    // 查询列表
25
+    const getList = (params) => {
26
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
27
+            console.log(data)
28
+            setData(data)
29
+        })
30
+    }
31
+
32
+
33
+    // 提交事件
34
+    const handleSubmit = (e, props) => {
35
+        e.preventDefault();
36
+        props.form.validateFields((err, values) => {
37
+            if (!err) {
38
+                let { createDate, ...submitValue } = values
39
+                if (null != createDate && createDate.length > 0) {
40
+                    const [startCreateDate, endCreateDate] = createDate
41
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
42
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
43
+                } else {
44
+                    submitValue.startCreateDate = null
45
+                    submitValue.endCreateDate = null
46
+                }
47
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
48
+            }
49
+        });
50
+    }
51
+
52
+    const changePageNum = (pageNumber) => {
53
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
54
+        if (null != createDate && createDate.length > 0) {
55
+            const [startCreateDate, endCreateDate] = createDate
56
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
57
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
58
+        } else {
59
+            submitValue.startCreateDate = null
60
+            submitValue.endCreateDate = null
61
+        }
62
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
63
+    }
64
+
65
+    /**
66
+     *
67
+     *
68
+     * @param {*} props
69
+     * @returns
70
+     */
71
+    const columns = [
72
+        {
73
+            title: '账户',
74
+            dataIndex: 'sampleName',
75
+            key: 'sampleName',
76
+            align: 'center',
77
+            render: (x, row) => (
78
+                <>
79
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px' }} onClick={() => toDeatil()} >
80
+                        {row.sampleName}
81
+                    </span>
82
+                </>
83
+            ),
84
+        },
85
+        {
86
+            title: '总充值金额',
87
+            dataIndex: 'orgName',
88
+            key: 'orgName',
89
+            align: 'center',
90
+        },
91
+        {
92
+            title: '已消费金额',
93
+            dataIndex: 'orderer',
94
+            key: 'orderer',
95
+            align: 'center',
96
+        },
97
+        {
98
+            title: '已退款金额',
99
+            dataIndex: 'orderer',
100
+            key: 'orderer',
101
+            align: 'center',
102
+        },
103
+        {
104
+            title: '余额',
105
+            dataIndex: 'orderer',
106
+            key: 'orderer',
107
+            align: 'center',
108
+        },
109
+        {
110
+            title: '操作',
111
+            dataIndex: 'createDate',
112
+            key: 'createDate',
113
+            align: 'center',
114
+            width: '120px',
115
+            render: (x, row) => (
116
+                <>
117
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px' }} >
118
+                        充值
119
+                    </span>
120
+                    <span style={{ color: '#FF925C', cursor: 'pointer' }} >
121
+                        退款
122
+                    </span>
123
+                </>
124
+            ),
125
+        },
126
+
127
+    ];
128
+    function handleReset() {
129
+        props.form.resetFields();
130
+        getList({ pageNum: 1, pageSize: 10 })
131
+    }
132
+
133
+    const toDeatil = () => {
134
+        router.push({
135
+            pathname: '/fundManagement/AccountDetail',
136
+        });
137
+    }
138
+
139
+    const { getFieldDecorator } = props.form
140
+    return (
141
+
142
+        <>
143
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ marginBottom: '16px' }}>
144
+                <Form.Item>
145
+                    {getFieldDecorator('orgName')(
146
+                        <Input
147
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
148
+                            placeholder="输入小程序名"
149
+                        />,
150
+                    )}
151
+                </Form.Item>
152
+
153
+                <Form.Item>
154
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
155
+                        搜索
156
+                    </Button>
157
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
158
+                        重置
159
+                    </Button>
160
+                </Form.Item>
161
+            </Form>
162
+            <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
163
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
164
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
165
+            </div>
166
+        </>
167
+    )
168
+}
169
+const WrappedHeader = Form.create({ name: 'header' })(header);
170
+
171
+export default WrappedHeader

+ 199
- 0
src/pages/fundManagement/ConsumeOrder.jsx Datei anzeigen

@@ -0,0 +1,199 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Card, Button, Icon, Tooltip, message, notification, Modal, Table, Select, Input, DatePicker } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../utils/request';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+function header(props) {
16
+    // 获取初始化数据
17
+    const [data, setData] = useState({})
18
+    const [demandIdList, setDemandIdList] = useState([])
19
+
20
+    useEffect(() => {
21
+        getList({ pageNum: 1, pageSize: 10 });
22
+    }, [])
23
+
24
+    // 查询列表
25
+    const getList = (params) => {
26
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
27
+            console.log(data)
28
+            setData(data)
29
+        })
30
+    }
31
+
32
+
33
+    // 提交事件
34
+    const handleSubmit = (e, props) => {
35
+        e.preventDefault();
36
+        props.form.validateFields((err, values) => {
37
+            if (!err) {
38
+                let { createDate, ...submitValue } = values
39
+                if (null != createDate && createDate.length > 0) {
40
+                    const [startCreateDate, endCreateDate] = createDate
41
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
42
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
43
+                } else {
44
+                    submitValue.startCreateDate = null
45
+                    submitValue.endCreateDate = null
46
+                }
47
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
48
+            }
49
+        });
50
+    }
51
+
52
+    const changePageNum = (pageNumber) => {
53
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
54
+        if (null != createDate && createDate.length > 0) {
55
+            const [startCreateDate, endCreateDate] = createDate
56
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
57
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
58
+        } else {
59
+            submitValue.startCreateDate = null
60
+            submitValue.endCreateDate = null
61
+        }
62
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
63
+    }
64
+
65
+    /**
66
+     *
67
+     *
68
+     * @param {*} props
69
+     * @returns
70
+     */
71
+    const columns = [
72
+        {
73
+            title: '订单编号',
74
+            dataIndex: 'sampleName',
75
+            key: 'sampleName',
76
+            align: 'center',
77
+        },
78
+        {
79
+            title: '消费组织',
80
+            dataIndex: 'orgName',
81
+            key: 'orgName',
82
+            align: 'center',
83
+        },
84
+        {
85
+            title: '消费金额',
86
+            dataIndex: 'orderer',
87
+            key: 'orderer',
88
+            align: 'center',
89
+
90
+        },
91
+        {
92
+            title: '消费方式',
93
+            dataIndex: 'phone',
94
+            key: 'phone',
95
+            align: 'center',
96
+        },
97
+        {
98
+            title: '活动名称',
99
+            dataIndex: 'phone',
100
+            key: 'phone',
101
+            align: 'center',
102
+        },
103
+        {
104
+            title: '消费下单时间',
105
+            dataIndex: 'createDate',
106
+            key: 'createDate',
107
+            align: 'center',
108
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
109
+        },
110
+        {
111
+            title: '接收人手机号',
112
+            dataIndex: 'phone',
113
+            key: 'phone',
114
+            align: 'center',
115
+        },
116
+        {
117
+            title: '消费状态',
118
+            dataIndex: 'orderer',
119
+            key: 'orderer',
120
+            align: 'center',
121
+        },
122
+
123
+    ];
124
+    function handleReset() {
125
+        props.form.resetFields();
126
+        getList({ pageNum: 1, pageSize: 10 })
127
+    }
128
+
129
+    const { getFieldDecorator } = props.form
130
+    return (
131
+
132
+        <>
133
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ marginBottom: '16px' }}>
134
+                <Form.Item>
135
+                    {getFieldDecorator('sampleName')(
136
+                        <Input
137
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
138
+                            placeholder="订单编号"
139
+                        />,
140
+                    )}
141
+                </Form.Item>
142
+                <Form.Item>
143
+                    {getFieldDecorator('orgName')(
144
+                        <Input
145
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
146
+                            placeholder="消费组织"
147
+                        />,
148
+                    )}
149
+                </Form.Item>
150
+                <Form.Item>
151
+                    <span style={{ marginRight: '10px' }}>消费时间段:</span>
152
+                    {getFieldDecorator('createDate')(
153
+                        <RangePicker placeholder={['开始时间', '结束时间']} />
154
+                    )}
155
+                </Form.Item>
156
+                <Form.Item>
157
+                    {getFieldDecorator('payType')(
158
+                        <Select style={{ width: '180px' }} placeholder="消费方式">
159
+                            <Select.Option value="1">全部</Select.Option>
160
+                            <Select.Option value="2">红包</Select.Option>
161
+                        </Select>,
162
+                    )}
163
+                </Form.Item>
164
+                <Form.Item>
165
+                    {getFieldDecorator('payStatus')(
166
+                        <Select style={{ width: '180px' }} placeholder="消费状态">
167
+                            <Select.Option value="1">全部</Select.Option>
168
+                            <Select.Option value="2">成功</Select.Option>
169
+                            <Select.Option value="3">失败</Select.Option>
170
+                        </Select>,
171
+                    )}
172
+                </Form.Item>
173
+                <Form.Item>
174
+                    {getFieldDecorator('phone')(
175
+                        <Input
176
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
177
+                            placeholder="接收人手机号"
178
+                        />,
179
+                    )}
180
+                </Form.Item>
181
+                <Form.Item>
182
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
183
+                        搜索
184
+          </Button>
185
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
186
+                        重置
187
+          </Button>
188
+                </Form.Item>
189
+            </Form>
190
+            <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
191
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
192
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
193
+            </div>
194
+        </>
195
+    )
196
+}
197
+const WrappedHeader = Form.create({ name: 'header' })(header);
198
+
199
+export default WrappedHeader

+ 221
- 0
src/pages/fundManagement/Finance.jsx Datei anzeigen

@@ -0,0 +1,221 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Card, Button, Icon, Tooltip, message, notification, Modal, Table, Select, Input, DatePicker } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../utils/request';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+import SelectContact from './components/SelectContact';
13
+
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+function header(props) {
17
+    // 获取初始化数据
18
+    const [data, setData] = useState({})
19
+    const [contactList, setContactList] = useState([])
20
+    const [contactVisible, setContactVisible] = useState(false)
21
+
22
+    useEffect(() => {
23
+        getList({ pageNum: 1, pageSize: 10 });
24
+    }, [])
25
+
26
+    // 查询列表
27
+    const getList = (params) => {
28
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
29
+            console.log(data)
30
+            setData(data)
31
+        })
32
+    }
33
+
34
+
35
+    // 提交事件
36
+    const handleSubmit = (e, props) => {
37
+        e.preventDefault();
38
+        props.form.validateFields((err, values) => {
39
+            if (!err) {
40
+                let { createDate, ...submitValue } = values
41
+                if (null != createDate && createDate.length > 0) {
42
+                    const [startCreateDate, endCreateDate] = createDate
43
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
44
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
45
+                } else {
46
+                    submitValue.startCreateDate = null
47
+                    submitValue.endCreateDate = null
48
+                }
49
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
50
+            }
51
+        });
52
+    }
53
+
54
+    const changePageNum = (pageNumber) => {
55
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
56
+        if (null != createDate && createDate.length > 0) {
57
+            const [startCreateDate, endCreateDate] = createDate
58
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
59
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
60
+        } else {
61
+            submitValue.startCreateDate = null
62
+            submitValue.endCreateDate = null
63
+        }
64
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
65
+    }
66
+
67
+    /**
68
+     *
69
+     *
70
+     * @param {*} props
71
+     * @returns
72
+     */
73
+    const columns = [
74
+        {
75
+            title: '姓名',
76
+            dataIndex: 'sampleName',
77
+            key: 'sampleName',
78
+            align: 'center',
79
+        },
80
+        {
81
+            title: '性别',
82
+            dataIndex: 'orgName',
83
+            key: 'orgName',
84
+            align: 'center',
85
+        },
86
+        {
87
+            title: '头像',
88
+            dataIndex: 'avatar',
89
+            key: 'avatar',
90
+            align: 'center',
91
+            render: (text, record) => <img src={record.avatar} className={styles.touxiang} />,
92
+        },
93
+        {
94
+            title: '固话',
95
+            dataIndex: 'orderer',
96
+            key: 'orderer4',
97
+            align: 'center',
98
+        },
99
+        {
100
+            title: '手机号',
101
+            dataIndex: 'orderer',
102
+            key: 'orderer3',
103
+            align: 'center',
104
+        },
105
+        {
106
+            title: '对外头衔',
107
+            dataIndex: 'orderer',
108
+            key: 'orderer2',
109
+            align: 'center',
110
+        },
111
+        {
112
+            title: '权重',
113
+            dataIndex: 'orderer',
114
+            key: 'orderer1',
115
+            align: 'center',
116
+        },
117
+
118
+    ];
119
+    function handleReset() {
120
+        props.form.resetFields();
121
+        getList({ pageNum: 1, pageSize: 10 })
122
+    }
123
+
124
+    const toDeatil = () => {
125
+        router.push({
126
+            pathname: '/fundManagement/AccountDetail',
127
+        });
128
+    }
129
+
130
+    const rowSelection = {
131
+        onChange: (selectedRowKeys, selectedRows) => {
132
+            console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
133
+            setContactList(selectedRows)
134
+        },
135
+    };
136
+    const toAdd = (id) => () => {
137
+        console.log('hhhhhhhhhhhhhhh')
138
+        setContactVisible(true)
139
+    }
140
+    const toDel = rowData => () => {
141
+        if (contactList.length < 1) {
142
+            message.info('请至少选择一条数据')
143
+            return
144
+        }
145
+
146
+        Modal.confirm({
147
+            title: '确定删除联系人信息吗',
148
+            okText: '确定',
149
+            cancelText: '取消',
150
+            onOk() {
151
+                request({ ...apis.contact.batchDeleteContact, data: contactList, }).then((data) => {
152
+                    message.info("操作成功")
153
+                    getList({ pageNum: 1, pageSize: 10 });
154
+                }).catch((err) => {
155
+
156
+                })
157
+            },
158
+            onCancel() { },
159
+        });
160
+    }
161
+    const { getFieldDecorator } = props.form
162
+    return (
163
+
164
+        <>
165
+            {/* {contactVisible && <SelectContact />} */}
166
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} >
167
+                <Form.Item>
168
+                    {getFieldDecorator('name')(
169
+                        <Input
170
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
171
+                            placeholder="姓名"
172
+                        />,
173
+                    )}
174
+                </Form.Item>
175
+                <Form.Item>
176
+                    {getFieldDecorator('Telephone')(
177
+                        <Input
178
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
179
+                            placeholder="固话"
180
+                        />,
181
+                    )}
182
+                </Form.Item>
183
+                <Form.Item>
184
+                    {getFieldDecorator('phone')(
185
+                        <Input
186
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
187
+                            placeholder="手机号"
188
+                        />,
189
+                    )}
190
+                </Form.Item>
191
+                <Form.Item>
192
+                    {getFieldDecorator('title')(
193
+                        <Input
194
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
195
+                            placeholder="对外头衔"
196
+                        />,
197
+                    )}
198
+                </Form.Item>
199
+                <Form.Item>
200
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
201
+                        搜索
202
+                    </Button>
203
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
204
+                        重置
205
+                    </Button>
206
+                </Form.Item>
207
+            </Form>
208
+            <div style={{ margin: '10px 0 16px 0' }}>
209
+                <Button type="danger" className={styles.addBtn} onClick={toAdd()}><SelectContact /></Button>
210
+                <Button type="primary" className={styles.addBtn} onClick={toDel()} style={{ marginLeft: '30px' }} >删除</Button>
211
+            </div>
212
+            <Table rowSelection={rowSelection} rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
213
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
214
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
215
+            </div>
216
+        </>
217
+    )
218
+}
219
+const WrappedHeader = Form.create({ name: 'header' })(header);
220
+
221
+export default WrappedHeader

+ 194
- 0
src/pages/fundManagement/RechargeOrder.jsx Datei anzeigen

@@ -0,0 +1,194 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Button, Icon, message,  Modal, Table, Select, Input, DatePicker } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../utils/request';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+function header(props) {
16
+    // 获取初始化数据
17
+    const [data, setData] = useState({})
18
+    const [demandIdList, setDemandIdList] = useState([])
19
+
20
+    useEffect(() => {
21
+        getList({ pageNum: 1, pageSize: 10 });
22
+    }, [])
23
+
24
+    // 查询列表
25
+    const getList = (params) => {
26
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
27
+            console.log(data)
28
+            setData(data)
29
+        })
30
+    }
31
+
32
+
33
+    // 提交事件
34
+    const handleSubmit = (e, props) => {
35
+        e.preventDefault();
36
+        props.form.validateFields((err, values) => {
37
+            if (!err) {
38
+                let { createDate, ...submitValue } = values
39
+                if (null != createDate && createDate.length > 0) {
40
+                    const [startCreateDate, endCreateDate] = createDate
41
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
42
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
43
+                } else {
44
+                    submitValue.startCreateDate = null
45
+                    submitValue.endCreateDate = null
46
+                }
47
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
48
+            }
49
+        });
50
+    }
51
+
52
+    const changePageNum = (pageNumber) => {
53
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
54
+        if (null != createDate && createDate.length > 0) {
55
+            const [startCreateDate, endCreateDate] = createDate
56
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
57
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
58
+        } else {
59
+            submitValue.startCreateDate = null
60
+            submitValue.endCreateDate = null
61
+        }
62
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
63
+    }
64
+
65
+    /**
66
+     *
67
+     *
68
+     * @param {*} props
69
+     * @returns
70
+     */
71
+    const columns = [
72
+        {
73
+            title: '订单编号',
74
+            dataIndex: 'sampleName',
75
+            key: 'sampleName',
76
+            align: 'center',
77
+        },
78
+        {
79
+            title: '充值组织',
80
+            dataIndex: 'orgName',
81
+            key: 'orgName',
82
+            align: 'center',
83
+        },
84
+        {
85
+            title: '充值金额',
86
+            dataIndex: 'orderer',
87
+            key: 'orderer',
88
+            align: 'center',
89
+
90
+        },
91
+        {
92
+            title: '充值方式',
93
+            dataIndex: 'phone',
94
+            key: 'phone',
95
+            align: 'center',
96
+        },
97
+        {
98
+            title: '下单时间',
99
+            dataIndex: 'createDate',
100
+            key: 'createDate',
101
+            align: 'center',
102
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
103
+        },
104
+        {
105
+            title: '充值凭证',
106
+            dataIndex: 'orgName',
107
+            key: 'orgName',
108
+            align: 'center',
109
+        },
110
+        {
111
+            title: '充值状态',
112
+            dataIndex: 'orderer',
113
+            key: 'orderer',
114
+            align: 'center',
115
+        },
116
+        {
117
+            title: '支付时间',
118
+            dataIndex: 'createDate',
119
+            key: 'createDate',
120
+            align: 'center',
121
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
122
+        },
123
+
124
+    ];
125
+    function handleReset() {
126
+        props.form.resetFields();
127
+        getList({ pageNum: 1, pageSize: 10 })
128
+    }
129
+
130
+    const { getFieldDecorator } = props.form
131
+    return (
132
+
133
+        <>
134
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{marginBottom:'16px'}}>
135
+                <Form.Item>
136
+                    {getFieldDecorator('sampleName')(
137
+                        <Input
138
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
139
+                            placeholder="订单编号"
140
+                        />,
141
+                    )}
142
+                </Form.Item>
143
+                <Form.Item>
144
+                    {getFieldDecorator('orgName')(
145
+                        <Input
146
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+                            placeholder="充值组织"
148
+                        />,
149
+                    )}
150
+                </Form.Item>
151
+                <Form.Item>
152
+                    <span style={{ marginRight: '10px' }}>支付时间段:</span>
153
+                    {getFieldDecorator('createDate')(
154
+                        <RangePicker placeholder={['开始时间', '结束时间']} />
155
+                    )}
156
+                </Form.Item>
157
+                <Form.Item>
158
+                    {getFieldDecorator('payType')(
159
+                        <Select style={{ width: '180px' }} placeholder="充值方式">
160
+                            <Select.Option value="1">全部</Select.Option>
161
+                            <Select.Option value="2">业务线上充值</Select.Option>
162
+                            <Select.Option value="3">运营手动充值</Select.Option>
163
+                        </Select>,
164
+                    )}
165
+                </Form.Item>
166
+                <Form.Item>
167
+                    {getFieldDecorator('payStatus')(
168
+                        <Select style={{ width: '180px' }} placeholder="充值状态">
169
+                            <Select.Option value="1">全部</Select.Option>
170
+                            <Select.Option value="2">待支付</Select.Option>
171
+                            <Select.Option value="3">已交付</Select.Option>
172
+                            <Select.Option value="4">已超时</Select.Option>
173
+                        </Select>,
174
+                    )}
175
+                </Form.Item>
176
+                <Form.Item>
177
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
178
+                        搜索
179
+          </Button>
180
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
181
+                        重置
182
+          </Button>
183
+                </Form.Item>
184
+            </Form>
185
+            <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
186
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
187
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
188
+            </div>
189
+        </>
190
+    )
191
+}
192
+const WrappedHeader = Form.create({ name: 'header' })(header);
193
+
194
+export default WrappedHeader

+ 207
- 0
src/pages/fundManagement/RefundOrder.jsx Datei anzeigen

@@ -0,0 +1,207 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Button, Icon, message, Modal, Table, Select, Input, DatePicker } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../utils/request';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+function header(props) {
16
+    // 获取初始化数据
17
+    const [data, setData] = useState({})
18
+    const [demandIdList, setDemandIdList] = useState([])
19
+    const [visible, setVisible] = useState(false)
20
+
21
+    useEffect(() => {
22
+        getList({ pageNum: 1, pageSize: 10 });
23
+    }, [])
24
+
25
+    // 查询列表
26
+    const getList = (params) => {
27
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
28
+            console.log(data)
29
+            setData(data)
30
+        })
31
+    }
32
+
33
+
34
+    // 提交事件
35
+    const handleSubmit = (e, props) => {
36
+        e.preventDefault();
37
+        props.form.validateFields((err, values) => {
38
+            if (!err) {
39
+                let { createDate, ...submitValue } = values
40
+                if (null != createDate && createDate.length > 0) {
41
+                    const [startCreateDate, endCreateDate] = createDate
42
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
43
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
44
+                } else {
45
+                    submitValue.startCreateDate = null
46
+                    submitValue.endCreateDate = null
47
+                }
48
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
49
+            }
50
+        });
51
+    }
52
+
53
+    const changePageNum = (pageNumber) => {
54
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
55
+        if (null != createDate && createDate.length > 0) {
56
+            const [startCreateDate, endCreateDate] = createDate
57
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
58
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
59
+        } else {
60
+            submitValue.startCreateDate = null
61
+            submitValue.endCreateDate = null
62
+        }
63
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
64
+    }
65
+
66
+    /**
67
+     *
68
+     *
69
+     * @param {*} props
70
+     * @returns
71
+     */
72
+    const columns = [
73
+        {
74
+            title: '订单编号',
75
+            dataIndex: 'sampleName',
76
+            key: 'sampleName',
77
+            align: 'center',
78
+        },
79
+        {
80
+            title: '退款组织',
81
+            dataIndex: 'orgName',
82
+            key: 'orgName',
83
+            align: 'center',
84
+        },
85
+        {
86
+            title: '退款金额',
87
+            dataIndex: 'orderer',
88
+            key: 'orderer',
89
+            align: 'center',
90
+        },
91
+        {
92
+            title: '退款创建时间',
93
+            dataIndex: 'createDate',
94
+            key: 'createDate',
95
+            align: 'center',
96
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
97
+        },
98
+        {
99
+            title: '退款状态',
100
+            dataIndex: 'orderer',
101
+            key: 'orderer1',
102
+            align: 'center',
103
+        },
104
+        {
105
+            title: '驳回原因',
106
+            dataIndex: 'orderer',
107
+            key: 'ordere2r',
108
+            align: 'center',
109
+        },
110
+        {
111
+            title: '退款凭证',
112
+            dataIndex: 'orderer',
113
+            key: 'o2rderer',
114
+            align: 'center',
115
+        },
116
+        {
117
+            title: '操作',
118
+            dataIndex: 'createDate',
119
+            key: 'crea2teDate',
120
+            align: 'center',
121
+            width: '120px',
122
+            render: (x, row) => (
123
+                <>
124
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px' }} >
125
+                        退款
126
+                    </span>
127
+                    <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={() => setVisible(true)}>
128
+                        驳回
129
+                    </span>
130
+                </>
131
+            ),
132
+        },
133
+
134
+    ];
135
+    function handleReset() {
136
+        props.form.resetFields();
137
+        getList({ pageNum: 1, pageSize: 10 })
138
+    }
139
+    const handleOk = () => {
140
+
141
+        setVisible(false)
142
+
143
+    }
144
+    const handleCancel = () => {
145
+        setVisible(false)
146
+    }
147
+
148
+    const { getFieldDecorator } = props.form
149
+    return (
150
+
151
+        <>
152
+            <Modal
153
+                visible={visible}
154
+                title="驳回退款"
155
+                onOk={() => handleOk()}
156
+                onCancel={() => handleCancel()}
157
+                footer={[
158
+                    <Button key="back" size="large" onClick={() => handleCancel()}>取消</Button>,
159
+                    <Button key="submit" type="primary" size="large" onClick={() => handleOk()}>确认</Button>,
160
+                ]}
161
+            >
162
+                <div style={{ display: 'flex', alignItems: 'center', margin: '30px 0' }}>驳回原因
163
+                <span style={{ color: 'red' }}>*</span><Input style={{ marginLeft: '10px', width: '80%' }} placeholder="请输入驳回原因" />
164
+                </div>
165
+            </Modal>
166
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ marginBottom: '16px' }}>
167
+                <Form.Item>
168
+                    {getFieldDecorator('sampleName')(
169
+                        <Input
170
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
171
+                            placeholder="订单编号"
172
+                        />,
173
+                    )}
174
+                </Form.Item>
175
+                <Form.Item>
176
+                    {getFieldDecorator('orgName')(
177
+                        <Input
178
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
179
+                            placeholder="退款组织"
180
+                        />,
181
+                    )}
182
+                </Form.Item>
183
+                <Form.Item>
184
+                    <span style={{ marginRight: '10px' }}>退款时间段:</span>
185
+                    {getFieldDecorator('createDate')(
186
+                        <RangePicker placeholder={['开始时间', '结束时间']} />
187
+                    )}
188
+                </Form.Item>
189
+                <Form.Item>
190
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
191
+                        搜索
192
+                    </Button>
193
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
194
+                        重置
195
+                    </Button>
196
+                </Form.Item>
197
+            </Form>
198
+            <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
199
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
200
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
201
+            </div>
202
+        </>
203
+    )
204
+}
205
+const WrappedHeader = Form.create({ name: 'header' })(header);
206
+
207
+export default WrappedHeader

+ 190
- 0
src/pages/fundManagement/components/SelectContact.jsx Datei anzeigen

@@ -0,0 +1,190 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input, Row, Col, Icon, Pagination } from 'antd';
3
+import request from '../../../utils/request';
4
+import apis from '../../../services/apis';
5
+import router from 'umi/router';
6
+
7
+const { Column, ColumnGroup } = Table;
8
+const SelectContact = props => {
9
+
10
+    const [data, setData] = useState([]);
11
+    const [visible, setVisible] = useState(false);
12
+    const [group, setGroup] = useState({ groupId: undefined, groupName: '新增' })
13
+
14
+    useEffect(() => {
15
+
16
+    }, [props.value])
17
+
18
+    // 查询列表
19
+    const getList = (params) => {
20
+        request({ ...apis.contact.list, params: { ...params } }).then((data) => {
21
+            console.log(data)
22
+            setData(data)
23
+        })
24
+    }
25
+
26
+    useEffect(() => {
27
+        getList({ pageNum: 1, pageSize: 10, })
28
+    }, []);
29
+
30
+
31
+
32
+    const handleChange = val => {
33
+    }
34
+
35
+
36
+
37
+
38
+    // 提交事件
39
+    const handleSubmit = (e, props) => {
40
+        e.preventDefault();
41
+        e.stopPropagation();
42
+        props.form.validateFields((err, values) => {
43
+            if (!err) {
44
+                getList({ pageNum: 1, pageSize: 10, ...values })
45
+            }
46
+        });
47
+    }
48
+
49
+    function handleReset() {
50
+        props.form.resetFields();
51
+        getList({ pageNum: 1, pageSize: 10 })
52
+    }
53
+
54
+    const changePageNum = (pageNumber) => {
55
+        getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
56
+    }
57
+
58
+    const toAdd = () => {
59
+        router.push({
60
+            pathname: '/contact/contact/add',
61
+        });
62
+    }
63
+
64
+
65
+
66
+    const columns = [
67
+        {
68
+            title: '姓名',
69
+            dataIndex: 'contactName',
70
+            key: 'contactName',
71
+            align: 'center',
72
+            ellipsis: true,
73
+        },
74
+        {
75
+            title: '性别',
76
+            dataIndex: 'sex',
77
+            key: 'sex',
78
+            align: 'center',
79
+            ellipsis: true,
80
+            render: text => <span>{text == 1 ? '男' : text == 2 ? '女' : ''}</span>,
81
+        },
82
+        {
83
+            title: '头像',
84
+            dataIndex: 'avatar',
85
+            key: 'avatar',
86
+            align: 'center',
87
+            ellipsis: true,
88
+            render: text => <img src={text} width="40px" height="40px" />,
89
+        },
90
+        {
91
+            title: '固话',
92
+            dataIndex: 'telephone',
93
+            key: 'telephone',
94
+            align: 'center',
95
+            ellipsis: true,
96
+        },
97
+        {
98
+            title: '手机号',
99
+            dataIndex: 'phone',
100
+            key: 'phone',
101
+            align: 'center',
102
+            ellipsis: true,
103
+        },
104
+        {
105
+            title: '对外头衔',
106
+            dataIndex: 'job',
107
+            key: 'job',
108
+            align: 'center',
109
+            ellipsis: true,
110
+        },
111
+        {
112
+            title: '操作',
113
+            align: 'center',
114
+            width: '20%',
115
+            render: (text, record) => (
116
+                <span>
117
+                    <a onClick={() => selectData(record)} style={{ color: 'blue' }}>选择</a>
118
+                </span>
119
+            ),
120
+        },
121
+    ];
122
+
123
+    const { getFieldDecorator } = props.form
124
+
125
+    return (
126
+        <div>
127
+            <span style={{ color: '#fff' }} onClick={() => setVisible(true)}>{group.groupName}</span>
128
+
129
+            <Modal
130
+                title="选择联系人"
131
+                width="1200px"
132
+                visible={visible}
133
+                onCancel={() => setVisible(false)}
134
+                footer={[]}
135
+            >
136
+
137
+                <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ marginBottom: '16px' }}>
138
+                    <Form.Item>
139
+                        {getFieldDecorator('contactName')(
140
+                            <Input
141
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
142
+                                placeholder="姓名"
143
+                            />,
144
+                        )}
145
+                    </Form.Item>
146
+                    <Form.Item>
147
+                        {getFieldDecorator('telephone')(
148
+                            <Input
149
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
150
+                                placeholder="固话"
151
+                            />,
152
+                        )}
153
+                    </Form.Item>
154
+                    <Form.Item>
155
+                        {getFieldDecorator('phone')(
156
+                            <Input
157
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
158
+                                placeholder="手机号"
159
+                            />,
160
+                        )}
161
+                    </Form.Item>
162
+                    <Form.Item>
163
+                        {getFieldDecorator('job')(
164
+                            <Input
165
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
166
+                                placeholder="对外头衔"
167
+                            />,
168
+                        )}
169
+                    </Form.Item>
170
+                    <Form.Item>
171
+                        <Button type="primary" htmlType="submit" >
172
+                            搜索
173
+              </Button>
174
+                        <Button style={{ marginLeft: 8 }} onClick={handleReset}>
175
+                            重置
176
+              </Button>
177
+                    </Form.Item>
178
+                </Form>
179
+                <div style={{ marginBottom: '20px', textAlign: 'right' }}>没有想要的联系人? <a onClick={() => toAdd()}>去新增</a> </div>
180
+                <Table dataSource={data.records || []} columns={columns} pagination={false} />
181
+                <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
182
+                    <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
183
+                </div>
184
+            </Modal>
185
+        </div>
186
+    )
187
+}
188
+
189
+const WrappedRegistrationForm = Form.create()(SelectContact);
190
+export default WrappedRegistrationForm;

+ 26
- 0
src/pages/fundManagement/style.less Datei anzeigen

@@ -0,0 +1,26 @@
1
+.flex-box {
2
+    display: flex;
3
+    flex-wrap: wrap;
4
+  
5
+    .flex-item {
6
+      flex: none;
7
+    }
8
+  
9
+    .flex-auto {
10
+      flex: auto;
11
+    }
12
+  }
13
+  
14
+  .member {
15
+    margin-bottom: 36px;
16
+    margin-right: 24px;
17
+  }
18
+  
19
+  .square {
20
+    height: 0;
21
+    padding-bottom : 80%;
22
+  }
23
+  .touxiang {
24
+    width: 93px;
25
+    height: 93px;
26
+  }

+ 161
- 0
src/pages/sample/h5/components/H5Sample.jsx Datei anzeigen

@@ -0,0 +1,161 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input, Row, Col, Icon, Pagination } from 'antd';
3
+import request from '../../../../utils/request';
4
+import apis from '../../../../services/apis';
5
+import styles from '../style.less';
6
+
7
+const { Column, ColumnGroup } = Table;
8
+const SelectContact = props => {
9
+
10
+    const [data, setData] = useState([]);
11
+    const [visible, setVisible] = useState(false);
12
+    const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
13
+    const [selectedData, setSelectedData] = useState([]);
14
+
15
+    useEffect(() => {
16
+        if (props.value && props.value != selectedData) {
17
+            setSelectedData(props.value)
18
+        }
19
+    }, [props.value])
20
+
21
+    // 查询列表
22
+    const getList = (params) => {
23
+        request({ ...apis.contact.list, params: { ...params } }).then((data) => {
24
+            console.log(data)
25
+            setData(data)
26
+        })
27
+    }
28
+
29
+    useEffect(() => {
30
+        getList({ pageNum: 1, pageSize: 10, })
31
+    }, []);
32
+
33
+
34
+
35
+    const handleChange = val => {
36
+    }
37
+
38
+    const selectData = val => {
39
+        const list = selectedData.filter(x => x.contactId !== val.contactId).concat(val)
40
+        setSelectedData(list)
41
+        props.onSelected(list)
42
+        setVisible(false)
43
+    }
44
+
45
+
46
+    // 提交事件
47
+    const handleSubmit = (e, props) => {
48
+        e.preventDefault();
49
+        e.stopPropagation();
50
+        props.form.validateFields((err, values) => {
51
+            if (!err) {
52
+                getList({ pageNum: 1, pageSize: 10, ...values })
53
+            }
54
+        });
55
+    }
56
+
57
+    function handleReset() {
58
+        props.form.resetFields();
59
+        getList({ pageNum: 1, pageSize: 10 })
60
+    }
61
+
62
+    const changePageNum = (pageNumber) => {
63
+        getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
64
+    }
65
+
66
+    const removeSelected = (val) => {
67
+        const list = selectedData.filter(x => x.contactId !== val.contactId)
68
+        setSelectedData(list)
69
+        props.onSelected(list)
70
+    }
71
+
72
+    const columns = [
73
+        {
74
+            title: '模板编号',
75
+            dataIndex: 'contactName',
76
+            key: 'drainageId',
77
+            align: 'center',
78
+            ellipsis: true,
79
+            width: '20%',
80
+        },
81
+        {
82
+            title: '模板名称',
83
+            dataIndex: 'sex',
84
+            key: 'drainageId',
85
+            align: 'center',
86
+            ellipsis: true,
87
+            width: '60%',
88
+            render: text => <span>{text == 1 ? '男' : text == 2 ? '女' : ''}</span>,
89
+        },
90
+        {
91
+            title: '操作',
92
+            align: 'center',
93
+            width: '20%',
94
+            render: (text, record) => (
95
+                <span>
96
+                    <a onClick={() => selectData(record)} style={{ color: 'blue' }}>选择</a>
97
+                </span>
98
+            ),
99
+        },
100
+    ];
101
+
102
+    const { getFieldDecorator } = props.form
103
+
104
+    return (
105
+        <div>
106
+            <Row gutter={24}>
107
+                <Col span={2}><div onClick={() => setVisible(true)}><a>{group.groupName}</a></div></Col>
108
+                <Col span={16}><div>
109
+                    {selectedData.map(x => {
110
+                        return <Tag size="large" key={x.contactId} closable onClose={() => removeSelected(x)}>{x.contactName}</Tag>
111
+                    })}
112
+                </div></Col>
113
+            </Row>
114
+
115
+            <Modal
116
+                title="请选择"
117
+                width="1200px"
118
+                visible={visible}
119
+                onCancel={() => setVisible(false)}
120
+                footer={[]}
121
+            >
122
+
123
+                <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{marginBottom:'16px'}}>
124
+                    <Form.Item>
125
+                        {getFieldDecorator('telephone')(
126
+                            <Input
127
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
128
+                                placeholder="模板编号"
129
+                            />,
130
+                        )}
131
+                    </Form.Item>
132
+                    <Form.Item>
133
+                        {getFieldDecorator('contactName')(
134
+                            <Input
135
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
136
+                                placeholder="模板名称"
137
+                            />,
138
+                        )}
139
+                    </Form.Item>
140
+                    <Form.Item>
141
+                        <Button type="primary" htmlType="submit" className={styles.searchBtn}>
142
+                            搜索
143
+                        </Button>
144
+                        <Button style={{ marginLeft: 8 }} onClick={handleReset}>
145
+                            重置
146
+                        </Button>
147
+                    </Form.Item>
148
+                </Form>
149
+
150
+                <Table dataSource={data.records || []} columns={columns} pagination={false} />
151
+                <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
152
+                    <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
153
+                </div>
154
+
155
+            </Modal>
156
+        </div>
157
+    )
158
+}
159
+
160
+const WrappedRegistrationForm = Form.create()(SelectContact);
161
+export default WrappedRegistrationForm;

+ 7
- 7
src/pages/sample/h5/components/SelectContact.jsx Datei anzeigen

@@ -73,14 +73,14 @@ const SelectContact = props => {
73 73
     {
74 74
       title: '姓名',
75 75
       dataIndex: 'contactName',
76
-      key: 'drainageId',
76
+      key: 'contactName',
77 77
       align: 'center',
78 78
       ellipsis: true,
79 79
     },
80 80
     {
81 81
       title: '性别',
82 82
       dataIndex: 'sex',
83
-      key: 'drainageId',
83
+      key: 'sex',
84 84
       align: 'center',
85 85
       ellipsis: true,
86 86
     render: text => <span>{text == 1 ? '男' : text == 2 ? '女' : '' }</span>,
@@ -88,7 +88,7 @@ const SelectContact = props => {
88 88
     {
89 89
       title: '头像',
90 90
       dataIndex: 'avatar',
91
-      key: 'drainageId',
91
+      key: 'avatar',
92 92
       align: 'center',
93 93
       ellipsis: true,
94 94
       render: text => <img src={text} width="40px" height="40px"/>,
@@ -96,21 +96,21 @@ const SelectContact = props => {
96 96
     {
97 97
       title: '固话',
98 98
       dataIndex: 'telephone',
99
-      key: 'drainageId',
99
+      key: 'telephone',
100 100
       align: 'center',
101 101
       ellipsis: true,
102 102
     },
103 103
     {
104 104
       title: '手机号',
105 105
       dataIndex: 'phone',
106
-      key: 'drainageId',
106
+      key: 'phone',
107 107
       align: 'center',
108 108
       ellipsis: true,
109 109
     },
110 110
     {
111 111
       title: '内部岗位',
112 112
       dataIndex: 'job',
113
-      key: 'drainageId',
113
+      key: 'job',
114 114
       align: 'center',
115 115
       ellipsis: true,
116 116
     },
@@ -147,7 +147,7 @@ const SelectContact = props => {
147 147
         footer={[]}
148 148
       >
149 149
       
150
-        <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
150
+        <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{marginBottom:'16px'}}>
151 151
             <Form.Item>
152 152
               {getFieldDecorator('contactName')(
153 153
                 <Input

+ 6
- 0
src/pages/sample/h5/edit.jsx Datei anzeigen

@@ -8,6 +8,7 @@ import request from '../../../utils/request';
8 8
 import Wangedit from '../../../components/Wangedit/Wangedit'
9 9
 import ImageUpload from '../../../components/uploadImage/ImageUpload'
10 10
 import SelectContact from './components/SelectContact';
11
+import H5Sample from './components/H5Sample';
11 12
 import moment from 'moment';
12 13
 
13 14
 const formItemLayout = {
@@ -97,6 +98,11 @@ const header = props => {
97 98
               rules: [{ max: 300, message: '样例体验链接不超过300个字符' }],
98 99
             })(<Input placeholder="若样例暂未发布到小程序,可直接粘贴网页链接"/>)}
99 100
           </Form.Item>
101
+          <Form.Item label="H5模板" >
102
+            {getFieldDecorator('taContactList',{
103
+              trigger: 'onSelected'
104
+            })(<H5Sample />)}
105
+          </Form.Item>
100 106
           <Form.Item label="样例体验二维码/小程序码" >
101 107
             {getFieldDecorator('sampleTryCode')(
102 108
               <ImageUpload />,

+ 129
- 0
src/pages/sample/h5/h5Sample.jsx Datei anzeigen

@@ -0,0 +1,129 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Pagination, Button, Icon, message, Modal, Table, Input, } from 'antd';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import className from 'classnames';
7
+import Cell from '../../../components/Cell';
8
+import styles from './style.less';
9
+import { fetch, apis } from '../../../utils/request';
10
+import request from '../../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+
14
+function header(props) {
15
+    // 获取初始化数据
16
+    const [data, setData] = useState({})
17
+    const [demandIdList, setDemandIdList] = useState([])
18
+
19
+    useEffect(() => {
20
+        getList({ pageNum: 1, pageSize: 10 });
21
+    }, [])
22
+
23
+    // 查询列表
24
+    const getList = (params) => {
25
+        request({ ...apis.sample.list, params: { ...params } }).then((data) => {
26
+            console.log(data)
27
+            setData(data)
28
+        })
29
+    }
30
+
31
+
32
+    // 提交事件
33
+    const handleSubmit = (e, props) => {
34
+        e.preventDefault();
35
+        props.form.validateFields((err, values) => {
36
+            if (!err) {
37
+                let { createDate, ...submitValue } = values
38
+                if (null != createDate && createDate.length > 0) {
39
+                    const [startCreateDate, endCreateDate] = createDate
40
+                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
41
+                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
42
+                } else {
43
+                    submitValue.startCreateDate = null
44
+                    submitValue.endCreateDate = null
45
+                }
46
+                getList({ pageNum: 1, pageSize: 10, ...submitValue })
47
+            }
48
+        });
49
+    }
50
+
51
+    const changePageNum = (pageNumber) => {
52
+        let { createDate, ...submitValue } = props.form.getFieldsValue()
53
+        if (null != createDate && createDate.length > 0) {
54
+            const [startCreateDate, endCreateDate] = createDate
55
+            submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
56
+            submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
57
+        } else {
58
+            submitValue.startCreateDate = null
59
+            submitValue.endCreateDate = null
60
+        }
61
+        getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
62
+    }
63
+
64
+
65
+
66
+    /**
67
+     *
68
+     *
69
+     * @param {*} props
70
+     * @returns
71
+     */
72
+    const columns = [
73
+        {
74
+            title: '模板编号',
75
+            dataIndex: 'sampleName',
76
+            key: 'sampleName',
77
+            align: 'center',
78
+        },
79
+        {
80
+            title: '模板名称',
81
+            dataIndex: 'orgName',
82
+            key: 'orgName',
83
+            align: 'center',
84
+        },
85
+        {
86
+            title: '创建时间',
87
+            dataIndex: 'createDate',
88
+            key: 'createDate',
89
+            align: 'center',
90
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
91
+        },
92
+    ];
93
+    function handleReset() {
94
+        props.form.resetFields();
95
+        getList({ pageNum: 1, pageSize: 10 })
96
+    }
97
+
98
+    const { getFieldDecorator } = props.form
99
+    return (
100
+
101
+        <>
102
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{marginBottom:'16px'}}>
103
+                <Form.Item>
104
+                    {getFieldDecorator('sampleName')(
105
+                        <Input
106
+                            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
107
+                            placeholder="样例名"
108
+                        />,
109
+                    )}
110
+                </Form.Item>
111
+                <Form.Item>
112
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>
113
+                        搜索
114
+          </Button>
115
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>
116
+                        重置
117
+          </Button>
118
+                </Form.Item>
119
+            </Form>
120
+            <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
121
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
122
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
123
+            </div>
124
+        </>
125
+    )
126
+}
127
+const WrappedHeader = Form.create({ name: 'header' })(header);
128
+
129
+export default WrappedHeader

+ 3
- 1
src/pages/sample/h5/style.less Datei anzeigen

@@ -10,7 +10,9 @@
10 10
     flex: auto;
11 11
   }
12 12
 }
13
-
13
+.addBtn{
14
+  margin: 10px 0 12px 0;
15
+}
14 16
 .member {
15 17
   margin-bottom: 36px;
16 18
   margin-right: 24px;