张延森 2 yıl önce
ebeveyn
işleme
d31466bd7e

+ 2
- 2
config/routes.js Dosyayı Görüntüle

@@ -73,14 +73,14 @@ export default [
73 73
   },
74 74
   {
75 75
     path: '/customer',
76
-    name: '户管理',
76
+    name: '户管理',
77 77
     icon: 'IdcardOutlined',
78 78
     access: 'customer',
79 79
     component: '../layouts/BasicLayout',
80 80
     routes: [
81 81
       {
82 82
         path: '/customer/index.jsx',
83
-        name: '户列表',
83
+        name: '户列表',
84 84
         access: 'customerList',
85 85
         icon: 'smile',
86 86
         component: './customer',

+ 84
- 55
src/pages/Machinery/Person/index.jsx Dosyayı Görüntüle

@@ -93,22 +93,28 @@ export default (props) => {
93 93
       setLoading(false);
94 94
       return false;
95 95
     }
96
-    if (!/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(newData.idCard)) {
96
+    if (
97
+      !/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(
98
+        newData.idCard,
99
+      )
100
+    ) {
97 101
       message.warning('请输入正确的身份证号');
98 102
       setLoading(false);
99 103
       return false;
100 104
     }
101 105
 
102 106
     if (userId) {
103
-      updateUser(userId, newData).then(() => {
104
-        setLoading(false);
105
-        message.success(`修改成功`);
106
-        onCancel();
107
-        actionRef.current.reload();
108
-      }).catch((err) => {
109
-        setLoading(false);
110
-        console.log(err.message)
111
-      });
107
+      updateUser(userId, newData)
108
+        .then(() => {
109
+          setLoading(false);
110
+          message.success(`修改成功`);
111
+          onCancel();
112
+          actionRef.current.reload();
113
+        })
114
+        .catch((err) => {
115
+          setLoading(false);
116
+          console.log(err.message);
117
+        });
112 118
     } else {
113 119
       addUser(newData)
114 120
         .then(() => {
@@ -122,7 +128,6 @@ export default (props) => {
122 128
           message.error(err.message || err);
123 129
         });
124 130
     }
125
-
126 131
   };
127 132
   //表单点击取消按钮
128 133
   const onCancel = () => {
@@ -131,7 +136,7 @@ export default (props) => {
131 136
     setEditModal(false);
132 137
   };
133 138
   // 弹窗表单中合作社搜索框改变事件目前没用
134
-  const handelChange = () => { };
139
+  const handelChange = () => {};
135 140
 
136 141
   // 列表点击编辑按钮
137 142
   const handleEdit = (val) => {
@@ -146,7 +151,7 @@ export default (props) => {
146 151
         actionRef.current.reload();
147 152
       })
148 153
       .catch((err) => {
149
-        console.log(err.message)
154
+        console.log(err.message);
150 155
       });
151 156
   };
152 157
   //列表切换人员状态方法
@@ -165,7 +170,7 @@ export default (props) => {
165 170
             actionRef.current.reload();
166 171
           })
167 172
           .catch((err) => {
168
-            console.log(err.message)
173
+            console.log(err.message);
169 174
           });
170 175
       },
171 176
     });
@@ -173,13 +178,15 @@ export default (props) => {
173 178
 
174 179
   const handleRole = (val) => {
175 180
     setRUserId(val.userId);
176
-    getUserRoleList({ user_id: val.userId }).then((res) => {
177
-      if (res.length !== 0) {
178
-        setCurrentCheckbox(res.map((item) => item.roleId));
179
-      }
180
-    }).catch((err) => {
181
-      console.log(err.message)
182
-    });
181
+    getUserRoleList({ user_id: val.userId })
182
+      .then((res) => {
183
+        if (res.length !== 0) {
184
+          setCurrentCheckbox(res.map((item) => item.roleId));
185
+        }
186
+      })
187
+      .catch((err) => {
188
+        console.log(err.message);
189
+      });
183 190
     setEditRoleModal(true);
184 191
   };
185 192
   //授权弹窗点击取消按钮
@@ -203,7 +210,7 @@ export default (props) => {
203 210
           onRoleCancel();
204 211
         })
205 212
         .catch((err) => {
206
-          console.log(err.message)
213
+          console.log(err.message);
207 214
           setRLoading(false);
208 215
         });
209 216
     } else {
@@ -219,7 +226,7 @@ export default (props) => {
219 226
           onRoleCancel();
220 227
         })
221 228
         .catch((err) => {
222
-          console.log(err.message)
229
+          console.log(err.message);
223 230
           setRLoading(false);
224 231
         });
225 232
     }
@@ -229,39 +236,47 @@ export default (props) => {
229 236
   };
230 237
   useEffect(() => {
231 238
     //获取账号默认密码
232
-    getDefaultPassword().then((res) => {
233
-      setPassWord(res);
234
-    }).catch((err) => {
235
-      console.log(err.message)
236
-    });
239
+    getDefaultPassword()
240
+      .then((res) => {
241
+        setPassWord(res);
242
+      })
243
+      .catch((err) => {
244
+        console.log(err.message);
245
+      });
237 246
     //获取合作社列表数据
238
-    getCooperativeList({ pageSize: 999 }).then((res) => {
239
-      setCooperativeList(res.records);
240
-      const list = res.records?.map((item) => {
241
-        return { title: item.name, key: item.orgId };
247
+    getCooperativeList({ pageSize: 999 })
248
+      .then((res) => {
249
+        setCooperativeList(res.records);
250
+        const list = res.records?.map((item) => {
251
+          return { title: item.name, key: item.orgId };
252
+        });
253
+        setData(list);
254
+      })
255
+      .catch((err) => {
256
+        console.log(err.message);
242 257
       });
243
-      setData(list);
244
-    }).catch((err) => {
245
-      console.log(err.message)
246
-    });
247 258
     //获取角色列表数据
248
-    getRoleList({ pageSize: 999 }).then((res) => {
249
-      setRoleList(res.records);
250
-    }).catch((err) => {
251
-      console.log(err.message)
252
-    });
259
+    getRoleList({ pageSize: 999 })
260
+      .then((res) => {
261
+        setRoleList(res.records);
262
+      })
263
+      .catch((err) => {
264
+        console.log(err.message);
265
+      });
253 266
   }, []);
254 267
   useEffect(() => {
255 268
     if (userId) {
256
-      getUserDetail(userId).then((res) => {
257
-        if (res.orgId === '-1') {
258
-          form.setFieldsValue({ ...res, orgId: cooperativeList[0].orgId });
259
-        } else {
260
-          form.setFieldsValue(res);
261
-        }
262
-      }).catch((err) => {
263
-        console.log(err.message)
264
-      });
269
+      getUserDetail(userId)
270
+        .then((res) => {
271
+          if (res.orgId === '-1') {
272
+            form.setFieldsValue({ ...res, orgId: cooperativeList[0].orgId });
273
+          } else {
274
+            form.setFieldsValue(res);
275
+          }
276
+        })
277
+        .catch((err) => {
278
+          console.log(err.message);
279
+        });
265 280
     } else {
266 281
       form.resetFields();
267 282
     }
@@ -274,10 +289,16 @@ export default (props) => {
274 289
   ];
275 290
   const columns = [
276 291
     {
277
-      title: '用户名',
292
+      title: '名',
278 293
       dataIndex: 'userName',
279 294
       key: 'userName',
280 295
     },
296
+    {
297
+      title: '昵称',
298
+      dataIndex: 'nickName',
299
+      key: 'nickName',
300
+      search: false,
301
+    },
281 302
     {
282 303
       title: '性别',
283 304
       dataIndex: 'sex',
@@ -404,7 +425,11 @@ export default (props) => {
404 425
           <FormItem label="身份证" name="idCard" rules={[{ required: true, message: '请输入' }]}>
405 426
             <Input placeholder="请输入" />
406 427
           </FormItem>
407
-          <FormItem label="登录账号" name="loginName" rules={[{ required: true, message: '请输入登录账号' }]}>
428
+          <FormItem
429
+            label="登录账号"
430
+            name="loginName"
431
+            rules={[{ required: true, message: '请输入登录账号' }]}
432
+          >
408 433
             <Input placeholder="请输入" />
409 434
           </FormItem>
410 435
           <FormItem label=" " colon={false} style={{ height: '4px', marginTop: '-28px' }}>
@@ -413,14 +438,18 @@ export default (props) => {
413 438
           <FormItem label="所属合作社" name="orgId" rules={[{ required: true, message: '请输入' }]}>
414 439
             <Search placeholder="请输入合作社" onChange={handelChange} />
415 440
           </FormItem>
416
-          {
417
-            userId && <FormItem label="合作社管理员" name="isOrgManager" rules={[{ required: true, message: '请选择' }]}>
441
+          {userId && (
442
+            <FormItem
443
+              label="合作社管理员"
444
+              name="isOrgManager"
445
+              rules={[{ required: true, message: '请选择' }]}
446
+            >
418 447
               <Select placeholder="请选择是否启用">
419 448
                 <Option value={false}>否</Option>
420 449
                 <Option value={true}>是</Option>
421 450
               </Select>
422 451
             </FormItem>
423
-          }
452
+          )}
424 453
           <FormItem label="状态" name="status" rules={[{ required: true, message: '请选择' }]}>
425 454
             <Select placeholder="请选择是否启用">
426 455
               <Option value={1}>启用</Option>

+ 18
- 34
src/pages/OrderManage/JobWarning/detail.jsx Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Card, Form, Button } from 'antd';
3 3
 import ProCard from '@ant-design/pro-card';
4
-import { getOrderDetail } from '@/services/order'
4
+import { getOrderDetail } from '@/services/order';
5 5
 import { history } from 'umi';
6 6
 
7 7
 const FormItem = Form.Item;
@@ -15,44 +15,28 @@ export default (props) => {
15 15
   const [dispatch, setDispatch] = useState();
16 16
 
17 17
   useEffect(() => {
18
-    getOrderDetail(id).then((res) => {
19
-      setDispatch(res)
20
-    }).catch((err) => {
21
-      console.log(err.message)
22
-    });
23
-  }, [id])
18
+    getOrderDetail(id)
19
+      .then((res) => {
20
+        setDispatch(res);
21
+      })
22
+      .catch((err) => {
23
+        console.log(err.message);
24
+      });
25
+  }, [id]);
24 26
   return (
25 27
     <Card>
26 28
       <ProCard tabs={{ type: 'card' }}>
27 29
         <ProCard.TabPane key={1} tab="订单详情">
28 30
           <Form {...formItemLayout}>
29
-            <FormItem label="订单号">
30
-              {dispatch?.orderNo}
31
-            </FormItem>
32
-            <FormItem label="客户姓名">
33
-              {dispatch?.personName}
34
-            </FormItem>
35
-            <FormItem label="联系电话">
36
-              {dispatch?.phone}
37
-            </FormItem>
38
-            <FormItem label="预约地址">
39
-              {dispatch?.address}
40
-            </FormItem>
41
-            <FormItem label="预约时间">
42
-              {dispatch?.appointmentDate}
43
-            </FormItem>
44
-            <FormItem label="合作社名">
45
-              {dispatch?.orgName}
46
-            </FormItem>
47
-            <FormItem label="农机类型">
48
-              {dispatch?.typeName}
49
-            </FormItem>
50
-            <FormItem label="农机">
51
-              {dispatch?.machineryName}
52
-            </FormItem>
53
-            <FormItem label="农机手">
54
-              {dispatch?.workName}
55
-            </FormItem>
31
+            <FormItem label="订单号">{dispatch?.orderNo}</FormItem>
32
+            <FormItem label="农户姓名">{dispatch?.personName}</FormItem>
33
+            <FormItem label="联系电话">{dispatch?.phone}</FormItem>
34
+            <FormItem label="预约地址">{dispatch?.address}</FormItem>
35
+            <FormItem label="预约时间">{dispatch?.appointmentDate}</FormItem>
36
+            <FormItem label="合作社名">{dispatch?.orgName}</FormItem>
37
+            <FormItem label="农机类型">{dispatch?.typeName}</FormItem>
38
+            <FormItem label="农机">{dispatch?.machineryName}</FormItem>
39
+            <FormItem label="农机手">{dispatch?.workName}</FormItem>
56 40
             <FormItem label=" " colon={false}>
57 41
               <Button type="default" onClick={() => goBack()}>
58 42
                 返回

+ 109
- 91
src/pages/OrderManage/dispatch.jsx Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Card, Form, Button, Select, message, Modal } from 'antd';
3 3
 import ProCard from '@ant-design/pro-card';
4
-import { getOrderDetail } from '@/services/order'
4
+import { getOrderDetail } from '@/services/order';
5 5
 import { getMachineryList, getduty } from '@/services/machinery';
6 6
 import { history } from 'umi';
7 7
 import { getUserList } from '@/services/user';
@@ -18,116 +18,123 @@ export default (props) => {
18 18
   const { id } = location.query;
19 19
   const [dispatch, setDispatch] = useState();
20 20
   const [loading, setLoading] = useState(false);
21
-  const [dispatchId, setDispatchId] = useState()
21
+  const [dispatchId, setDispatchId] = useState();
22 22
   const [machineryList, setMachineryList] = useState([]);
23
-  const [userList, setUserList] = useState([])
23
+  const [userList, setUserList] = useState([]);
24 24
 
25 25
   const [cancelLoading, setCancelLoading] = useState(false);
26 26
 
27 27
   const submit = () => {
28 28
     if (!dispatch.machineryId) {
29 29
       message.warning('请选择调度的农机');
30
-      return
30
+      return;
31 31
     }
32 32
     if (!dispatch.workerId) {
33 33
       message.warning('请选择农机手');
34
-      return
34
+      return;
35 35
     }
36
-    setLoading(true)
37
-    addDispatch(dispatch).then(res => {
38
-      message.success('调度成功');
39
-      setLoading(false);
40
-      goBack()
41
-    }).catch((err) => {
42
-      setLoading(false);
43
-      message.error(err.message || err);
44
-    });
36
+    setLoading(true);
37
+    addDispatch(dispatch)
38
+      .then((res) => {
39
+        message.success('调度成功');
40
+        setLoading(false);
41
+        goBack();
42
+      })
43
+      .catch((err) => {
44
+        setLoading(false);
45
+        message.error(err.message || err);
46
+      });
45 47
   };
46 48
   const changeMachinery = (e) => {
47
-    getduty(e, { date: dispatch.appointmentDate.substr(0, 10) }).then((res => {
48
-      if (res.length != 0) {
49
-        message.info('该农机当天已有' + res.length + '条调度信息');
50
-      }
51
-      setDispatch({ ...dispatch, machineryId: e })
52
-    })).catch((err) => {
53
-      console.log(err.message)
54
-    });
55
-  }
49
+    getduty(e, { date: dispatch.appointmentDate.substr(0, 10) })
50
+      .then((res) => {
51
+        if (res.length != 0) {
52
+          message.info('该农机当天已有' + res.length + '条调度信息');
53
+        }
54
+        setDispatch({ ...dispatch, machineryId: e });
55
+      })
56
+      .catch((err) => {
57
+        console.log(err.message);
58
+      });
59
+  };
56 60
   const changeUser = (e) => {
57
-    setDispatch({ ...dispatch, workerId: e })
58
-  }
61
+    setDispatch({ ...dispatch, workerId: e });
62
+  };
59 63
   const onCancel = () => {
60 64
     Modal.confirm({
61 65
       title: '确认取消?',
62 66
       okText: '确认',
63 67
       cancelText: '取消',
64 68
       onOk() {
65
-        setCancelLoading(true)
66
-        cancelDispatch(dispatchId).then(() => {
67
-          setCancelLoading(false)
68
-          setDispatchId()
69
-          setDispatch({ ...dispatch, machineryId: null, workerId: null })
70
-          message.success('取消成功');
71
-        }).catch((err) => {
72
-          setCancelLoading(false);
73
-          message.error(err.message || err);
74
-        });
69
+        setCancelLoading(true);
70
+        cancelDispatch(dispatchId)
71
+          .then(() => {
72
+            setCancelLoading(false);
73
+            setDispatchId();
74
+            setDispatch({ ...dispatch, machineryId: null, workerId: null });
75
+            message.success('取消成功');
76
+          })
77
+          .catch((err) => {
78
+            setCancelLoading(false);
79
+            message.error(err.message || err);
80
+          });
75 81
       },
76 82
     });
77
-  }
83
+  };
78 84
   useEffect(() => {
79
-
80
-    getOrderDetail(id).then((res) => {
81
-      res.machineryId = null
82
-      res.typeId = res.machineryType
83
-      setDispatch(res)
84
-      getMachineryList({ orgId: res.orgId, status: 1, typeId: res.typeId, pageSize: 999 }).then((res2) => {
85
-        setMachineryList(res2.records)
86
-      }).catch((err) => {
87
-        console.log(err.message)
85
+    getOrderDetail(id)
86
+      .then((res) => {
87
+        res.machineryId = null;
88
+        res.typeId = res.machineryType;
89
+        setDispatch(res);
90
+        getMachineryList({ orgId: res.orgId, status: 1, typeId: res.typeId, pageSize: 999 })
91
+          .then((res2) => {
92
+            setMachineryList(res2.records);
93
+          })
94
+          .catch((err) => {
95
+            console.log(err.message);
96
+          });
97
+        getUserList({ org_id: res.orgId, pageSize: 999 })
98
+          .then((res3) => {
99
+            setUserList(res3.records);
100
+          })
101
+          .catch((err) => {
102
+            console.log(err.message);
103
+          });
104
+        if (res.dispatchStatus == 1) {
105
+          getdispatchId(id)
106
+            .then((res4) => {
107
+              setDispatchId(res4.dispatchId);
108
+              setDispatch({ ...res, machineryId: res4.machineryId, workerId: res4.workerId });
109
+            })
110
+            .catch((err) => {
111
+              console.log(err.message);
112
+            });
113
+        }
114
+      })
115
+      .catch((err) => {
116
+        console.log(err.message);
88 117
       });
89
-      getUserList({ org_id: res.orgId, pageSize: 999 }).then(res3 => {
90
-        setUserList(res3.records)
91
-      }).catch((err) => {
92
-        console.log(err.message)
93
-      });
94
-      if (res.dispatchStatus == 1) {
95
-        getdispatchId(id).then(res4 => {
96
-          setDispatchId(res4.dispatchId)
97
-          setDispatch({ ...res, machineryId: res4.machineryId, workerId: res4.workerId })
98
-        }).catch((err) => {
99
-          console.log(err.message)
100
-        });
101
-      }
102
-    }).catch((err) => {
103
-      console.log(err.message)
104
-    });
105
-  }, [id])
118
+  }, [id]);
106 119
   return (
107 120
     <Card>
108 121
       <ProCard tabs={{ type: 'card' }}>
109 122
         <ProCard.TabPane key={1} tab="订单调度">
110 123
           <Form {...formItemLayout}>
111
-            <FormItem label="客户姓名">
112
-              {dispatch?.personName}
113
-            </FormItem>
114
-            <FormItem label="联系电话">
115
-              {dispatch?.phone}
116
-            </FormItem>
117
-            <FormItem label="预约地址">
118
-              {dispatch?.address}
119
-            </FormItem>
120
-            <FormItem label="预约时间">
121
-              {dispatch?.appointmentDate}
122
-            </FormItem>
123
-            <FormItem label="合作社名">
124
-              {dispatch?.orgName}
125
-            </FormItem>
126
-            <FormItem label="农机类型">
127
-              {dispatch?.typeName}
128
-            </FormItem>
124
+            <FormItem label="农户姓名">{dispatch?.personName}</FormItem>
125
+            <FormItem label="联系电话">{dispatch?.phone}</FormItem>
126
+            <FormItem label="预约地址">{dispatch?.address}</FormItem>
127
+            <FormItem label="预约时间">{dispatch?.appointmentDate}</FormItem>
128
+            <FormItem label="合作社名">{dispatch?.orgName}</FormItem>
129
+            <FormItem label="农机类型">{dispatch?.typeName}</FormItem>
129 130
             <FormItem label="农机">
130
-              <Select placeholder="请选择" value={dispatch?.machineryId} onChange={changeMachinery} allowClear style={{ width: '350px' }}>
131
+              <Select
132
+                placeholder="请选择"
133
+                value={dispatch?.machineryId}
134
+                onChange={changeMachinery}
135
+                allowClear
136
+                style={{ width: '350px' }}
137
+              >
131 138
                 {machineryList.map((item) => (
132 139
                   <Option value={item.machineryId} key={item.machineryId}>
133 140
                     {item.name}
@@ -136,7 +143,13 @@ export default (props) => {
136 143
               </Select>
137 144
             </FormItem>
138 145
             <FormItem label="农机手">
139
-              <Select placeholder="请选择" value={dispatch?.workerId} onChange={changeUser} allowClear style={{ width: '350px' }}>
146
+              <Select
147
+                placeholder="请选择"
148
+                value={dispatch?.workerId}
149
+                onChange={changeUser}
150
+                allowClear
151
+                style={{ width: '350px' }}
152
+              >
140 153
                 {userList.map((item) => (
141 154
                   <Option value={item.userId} key={item.userId}>
142 155
                     {item.userName}
@@ -148,15 +161,20 @@ export default (props) => {
148 161
               <Button type="default" onClick={() => goBack()}>
149 162
                 返回
150 163
               </Button>
151
-              {
152
-                dispatchId ?
153
-                  <Button loading={cancelLoading} onClick={onCancel} style={{ marginLeft: '4em' }}>
154
-                    取消调度
155
-                  </Button> :
156
-                  <Button type="primary" loading={loading} onClick={submit} style={{ marginLeft: '4em' }}>
157
-                    保存
158
-                  </Button>
159
-              }
164
+              {dispatchId ? (
165
+                <Button loading={cancelLoading} onClick={onCancel} style={{ marginLeft: '4em' }}>
166
+                  取消调度
167
+                </Button>
168
+              ) : (
169
+                <Button
170
+                  type="primary"
171
+                  loading={loading}
172
+                  onClick={submit}
173
+                  style={{ marginLeft: '4em' }}
174
+                >
175
+                  保存
176
+                </Button>
177
+              )}
160 178
             </FormItem>
161 179
           </Form>
162 180
         </ProCard.TabPane>

+ 15
- 38
src/pages/customer/index.jsx Dosyayı Görüntüle

@@ -3,69 +3,46 @@ import { DatePicker } from 'antd';
3 3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4 4
 import moment from 'moment';
5 5
 import PageTable from '@/components/PageTable';
6
-import { getUserList } from '@/services/user'
6
+import { getPersonList } from '@/services/person';
7 7
 
8 8
 const formatterTime = (val) => {
9 9
   return val ? moment(val).format('YYYY-MM-DD HH:mm') : '';
10 10
 };
11
-const { RangePicker } = DatePicker;
12 11
 
13 12
 export default (props) => {
14
-  const [start, setStartDate] = useState()
15
-  const [end, setEndDate] = useState()
16
-
17
-  const handelChange = (date, dateStrings) => {
18
-    setStartDate(dateStrings[0])
19
-    setEndDate(dateStrings[1])
20
-  }
21 13
   const ref = useRef();
14
+
22 15
   const Reset = () => {
23
-    setStartDate()
24
-    setEndDate()
25 16
     ref.current.reload();
26
-  }
17
+  };
27 18
 
28 19
   const columns = [
29 20
     {
30
-      title: '姓名',
31
-      dataIndex: 'name',
32
-      key: 'name',
21
+      title: '昵称',
22
+      dataIndex: 'nickName',
23
+      key: 'nickName',
33 24
     },
34 25
     {
35 26
       title: '头像',
36 27
       dataIndex: 'avatar',
37 28
       key: 'avatar',
38
-      search: false
29
+      render: (src) =>
30
+        src != '-' && (
31
+          <img src={src} alt="" style={{ width: '64px', height: '64px', borderRadius: '4px' }} />
32
+        ),
33
+      search: false,
39 34
     },
40 35
     {
41 36
       title: '手机号',
42 37
       dataIndex: 'phone',
43 38
       key: 'phone',
44 39
     },
45
-    {
46
-      title: '身份',
47
-      dataIndex: 'type',
48
-      key: 'type',
49
-      dataIndex: 'position',
50
-      render: (_, record) => {
51
-        return record.position === 'farmer'
52
-          ? '农户'
53
-          : record.position === 'worker'
54
-            ? '农机手' : ''
55
-      },
56
-      valueType: 'select',
57
-      valueEnum: {
58
-        'farmer': { text: '农户' },
59
-        'worker': { text: '农机手' },
60
-      },
61
-    },
62
-
63 40
     {
64 41
       title: '注册时间',
65 42
       dataIndex: 'createDate',
66 43
       key: 'createDate',
67 44
       render: (t, render) => formatterTime(render.createDate),
68
-      renderFormItem: (_, record) => <RangePicker placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' onChange={handelChange} />
45
+      search: false,
69 46
     },
70 47
   ];
71 48
 
@@ -73,11 +50,11 @@ export default (props) => {
73 50
     <PageHeaderWrapper>
74 51
       <PageTable
75 52
         actionRef={ref}
76
-        request={getUserList}
53
+        request={getPersonList}
77 54
         // expfunc={exportPersonList}
78 55
         columns={columns}
79
-        rowKey="userId"
80
-        params={{ start, end }}
56
+        rowKey="personId"
57
+        params={{ identity: 'farmer' }}
81 58
         onReset={Reset}
82 59
         options={false}
83 60
       />

+ 8
- 0
src/services/person.js Dosyayı Görüntüle

@@ -0,0 +1,8 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 查询用户列表
5
+ * @param {*} params
6
+ * @returns
7
+ */
8
+export const getPersonList = (params) => request('/person', { params });