|
@@ -1,6 +1,6 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
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';
|
|
3
|
+import { Form, Pagination, Card, Button, Icon, Tooltip, message, notification, Modal, Table, Select,Input, DatePicker,Row, Col } from 'antd';
|
4
|
4
|
import router from 'umi/router';
|
5
|
5
|
import moment from 'moment';
|
6
|
6
|
import className from 'classnames';
|
|
@@ -35,6 +35,15 @@ function header(props) {
|
35
|
35
|
e.preventDefault();
|
36
|
36
|
props.form.validateFields((err, values) => {
|
37
|
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
|
+ }
|
38
|
47
|
getList({ pageNum: 1, pageSize: 10, ...values })
|
39
|
48
|
}
|
40
|
49
|
});
|
|
@@ -104,43 +113,25 @@ function header(props) {
|
104
|
113
|
)}
|
105
|
114
|
</Form.Item>
|
106
|
115
|
<Form.Item>
|
107
|
|
- {getFieldDecorator('orgName')(
|
108
|
|
- <Input
|
109
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
110
|
|
- placeholder="下单组织"
|
111
|
|
- />,
|
112
|
|
- )}
|
113
|
|
- </Form.Item>
|
114
|
|
- <Form.Item>
|
115
|
|
- {getFieldDecorator('orderer')(
|
116
|
|
- <Input
|
117
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
118
|
|
- placeholder="下单人"
|
119
|
|
- />,
|
120
|
|
- )}
|
121
|
|
- </Form.Item>
|
122
|
|
- <Form.Item>
|
123
|
|
- {getFieldDecorator('phone')(
|
124
|
|
- <Input
|
125
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
126
|
|
- placeholder="联系方式"
|
127
|
|
- />,
|
|
116
|
+ {getFieldDecorator('status')(
|
|
117
|
+ <Select style={{ width: '180px' }} placeholder="发布状态">
|
|
118
|
+ <Select.Option value="1">是</Select.Option>
|
|
119
|
+ <Select.Option value="0">否</Select.Option>
|
|
120
|
+ </Select>,
|
128
|
121
|
)}
|
129
|
122
|
</Form.Item>
|
130
|
123
|
<Form.Item>
|
131
|
|
- <span style={{marginRight:'10px'}}>下单时间段:</span>
|
|
124
|
+ <span style={{marginRight:'10px'}}>新增时间段:</span>
|
132
|
125
|
{getFieldDecorator('createDate')(
|
133
|
126
|
<RangePicker placeholder={['开始时间','结束时间']} />
|
134
|
127
|
)}
|
135
|
128
|
</Form.Item>
|
136
|
129
|
<Form.Item>
|
137
|
|
- {getFieldDecorator('demandStatus')(
|
138
|
|
- <Select style={{ width: '180px' }} placeholder="需求单状态">
|
139
|
|
- <Select.Option value="1">已提交</Select.Option>
|
140
|
|
- <Select.Option value="2">处理中</Select.Option>
|
141
|
|
- <Select.Option value="3">已交付</Select.Option>
|
142
|
|
- <Select.Option value="4">作废</Select.Option>
|
143
|
|
- </Select>,
|
|
130
|
+ {getFieldDecorator('tag')(
|
|
131
|
+ <Input
|
|
132
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
133
|
+ placeholder="标签"
|
|
134
|
+ />,
|
144
|
135
|
)}
|
145
|
136
|
</Form.Item>
|
146
|
137
|
<Form.Item>
|
|
@@ -154,10 +145,13 @@ function header(props) {
|
154
|
145
|
</Form>
|
155
|
146
|
|
156
|
147
|
<Button type="danger" className={styles.addBtn} onClick={toEditH5()}>新增</Button>
|
157
|
|
-
|
158
|
|
- {(data.records || []).map(x => (
|
159
|
|
- <H5Card />
|
160
|
|
- ))}
|
|
148
|
+ <Row>
|
|
149
|
+ {(data.records || []).map(x => (
|
|
150
|
+ <Col span={6}>
|
|
151
|
+ <H5Card h5Data={x} onChange={handleReset}/>
|
|
152
|
+ </Col>
|
|
153
|
+ ))}
|
|
154
|
+ </Row>
|
161
|
155
|
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
162
|
156
|
<Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
|
163
|
157
|
</div>
|