|
@@ -76,12 +76,18 @@ function body(props) {
|
76
|
76
|
if (localStorage.getItem("state")) {
|
77
|
77
|
console.log(localStorage.getItem("state"), 'state')
|
78
|
78
|
if (JSON.parse(localStorage.getItem("state")) == 'private') {
|
79
|
|
- props.form.setFieldsValue(JSON.parse(localStorage.getItem("priPageParams")));
|
80
|
|
- getList({ ...JSON.parse(localStorage.getItem("priPageParams")) })
|
|
79
|
+ const localStorageValue = JSON.parse(localStorage.getItem("priPageParams"))
|
|
80
|
+ localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
|
|
81
|
+ localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
|
|
82
|
+ props.form.setFieldsValue(localStorageValue);
|
|
83
|
+ getList({ pageNumber: 1, pageSize: 10, ...JSON.parse(localStorage.getItem("priPageParams")) })
|
81
|
84
|
} else {
|
82
|
85
|
setCustomerType('public')
|
83
|
|
- props.form.setFieldsValue(JSON.parse(localStorage.getItem("pubPageParams")));
|
84
|
|
- getList({ ...JSON.parse(localStorage.getItem("pubPageParams")) })
|
|
86
|
+ const localStorageValue = JSON.parse(localStorage.getItem("pubPageParams"))
|
|
87
|
+ localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
|
|
88
|
+ localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
|
|
89
|
+ props.form.setFieldsValue(localStorageValue);
|
|
90
|
+ getList({ pageNumber: 1, pageSize: 10, ...JSON.parse(localStorage.getItem("pubPageParams")) })
|
85
|
91
|
}
|
86
|
92
|
|
87
|
93
|
} else {
|
|
@@ -92,6 +98,13 @@ function body(props) {
|
92
|
98
|
|
93
|
99
|
function getList(params) {
|
94
|
100
|
// 网路请求
|
|
101
|
+ console.log(params, '111111111111111')
|
|
102
|
+ if (params.startCreateDate) {
|
|
103
|
+ params.startCreateDate = moment(params.startCreateDate).format('YYYY-MM-DD HH:mm:ss');
|
|
104
|
+ }
|
|
105
|
+ if (params.endCreateDate) {
|
|
106
|
+ params.endCreateDate = moment(params.endCreateDate).format('YYYY-MM-DD HH:mm:ss');
|
|
107
|
+ }
|
95
|
108
|
request({ ...apis.customer.customerRecommend, params: { ...params } }).then(res => {
|
96
|
109
|
if (params.customerType === 'private') {
|
97
|
110
|
setDataSource(res)
|
|
@@ -154,6 +167,8 @@ function body(props) {
|
154
|
167
|
console.log(e)
|
155
|
168
|
}
|
156
|
169
|
|
|
170
|
+ const localStorageDate = (date) => date ? moment(date) : ''
|
|
171
|
+
|
157
|
172
|
// 分页
|
158
|
173
|
function onChange(pageNum) {
|
159
|
174
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -184,8 +199,10 @@ function body(props) {
|
184
|
199
|
localStorage.setItem("state", JSON.stringify(value))
|
185
|
200
|
if (value === 'private') {
|
186
|
201
|
if (localStorage.getItem("priPageParams")) {
|
187
|
|
- props.form.setFieldsValue(JSON.parse(localStorage.getItem("priPageParams")));
|
188
|
|
-
|
|
202
|
+ const localStorageValue = JSON.parse(localStorage.getItem("priPageParams"))
|
|
203
|
+ localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
|
|
204
|
+ localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
|
|
205
|
+ props.form.setFieldsValue(localStorageValue);
|
189
|
206
|
getList(JSON.parse(localStorage.getItem("priPageParams")))
|
190
|
207
|
} else {
|
191
|
208
|
localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: value }))
|
|
@@ -195,9 +212,12 @@ function body(props) {
|
195
|
212
|
} else {
|
196
|
213
|
|
197
|
214
|
if (localStorage.getItem("pubPageParams")) {
|
198
|
|
- props.form.setFieldsValue(JSON.parse(localStorage.getItem("pubPageParams")));
|
199
|
|
- // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
|
200
|
|
- getList({ customerType, ...JSON.parse(localStorage.getItem("pubPageParams")) })
|
|
215
|
+ const localStorageValue = JSON.parse(localStorage.getItem("pubPageParams"))
|
|
216
|
+ localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
|
|
217
|
+ localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
|
|
218
|
+ props.form.setFieldsValue(localStorageValue);
|
|
219
|
+
|
|
220
|
+ getList( {pageNumber: 1, pageSize: 10, customerType, ...JSON.parse(localStorage.getItem("pubPageParams")) })
|
201
|
221
|
} else {
|
202
|
222
|
localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'public' }))
|
203
|
223
|
getList({ pageNumber: 1, pageSize: 10, customerType: 'public' })
|