Browse Source

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

张延森 3 years ago
parent
commit
a372be672f

+ 1
- 1
config/proxy.js View File

@@ -17,7 +17,7 @@ export default {
17 17
   },
18 18
   test: {
19 19
     '/api/': {
20
-      target: 'https://preview.pro.ant.design',
20
+      target: 'https://xlk.njyz.tech',
21 21
       changeOrigin: true,
22 22
       pathRewrite: {
23 23
         '^': '',

+ 57
- 0
src/components/SelectButton/OrganizationSelect.jsx View File

@@ -0,0 +1,57 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+
9
+/**
10
+ *
11
+ *
12
+ * @param {*} props
13
+ * @returns
14
+ */
15
+const OrganizationSelect = props => {
16
+  const [data, setData] = useState([])
17
+  const [value, setValue] = useState([])
18
+  useEffect(() => {
19
+    getBuildList();
20
+  }, [])
21
+
22
+  const getBuildList = e => {
23
+    request({ ...apis.institution.list, params: { pageNum: 1, pageSize: 999 } }).then(data => {
24
+        setData(data)
25
+        checkValue(data)
26
+        // 默认选中第一个
27
+    })
28
+  }
29
+
30
+
31
+  const checkValue = (data) => {
32
+    if (props.value) {
33
+      const tempData = data.filter(f => f.institutionId == props.value)
34
+      const va = (tempData.length > 0) ? props.value : '项目已下线,请重新选择项目'
35
+      props.onChange(va)
36
+
37
+    }
38
+  }
39
+
40
+  return (
41
+      <Select
42
+      showSearch
43
+      value={props.value}
44
+      style={{ width: '300px' }}
45
+      placeholder="请选择项目"
46
+      onChange={props.onChange}
47
+      filterOption={(input, option) =>
48
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
49
+      }>
50
+          {/* <Option key="" value="">全部项目</Option> */}
51
+          {data.map(building => (
52
+            <Option key={building.institutionId} value={building.institutionId}>{building.institutionName}</Option>
53
+          ))}
54
+      </Select>
55
+  )
56
+}
57
+export default OrganizationSelect

+ 161
- 93
src/pages/carouselFigure/carouselFigureList.jsx View File

@@ -6,39 +6,39 @@ import AuthButton from '@/components/AuthButton';
6 6
 import withActions from '@/components/ActionList';
7 7
 import EditIcon from '@/components/EditIcon';
8 8
 import Navigate from '@/components/Navigate';
9
-import SelectCity from '../../components/SelectButton/CitySelect'
10
-import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+import SelectCity from '../../components/SelectButton/CitySelect';
10
+import BuildSelect from '../../components/SelectButton/BuildSelect';
11 11
 import apis from '../../services/apis';
12 12
 import request from '../../utils/request';
13 13
 import styles from '../style/GoodsList.less';
14
+import {getImgURL} from '../../utils/image';
14 15
 
15 16
 const { Option } = Select;
16 17
 
17
-const header = (props) => {
18
-  const [data, setData] = useState({})
18
+const header = props => {
19
+  const [data, setData] = useState({});
19 20
 
20 21
   useEffect(() => {
21 22
     getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
22
-  }, [])
23
+  }, []);
23 24
 
24 25
   // 查询列表
25
-  const getList = (params) => {
26
-    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
27
-      console.log(data)
28
-      setData(data)
29
-    })
30
-  }
31
-
26
+  const getList = params => {
27
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params } }).then(data => {
28
+      console.log(data);
29
+      setData(data);
30
+    });
31
+  };
32 32
 
33 33
   // 跳转到编辑页面
34
-  const toEditCarouse = (contentId) => () => {
34
+  const toEditCarouse = contentId => () => {
35 35
     router.push({
36 36
       pathname: '/carouselFigure/editCarousel',
37 37
       query: {
38
-        contentId
38
+        contentId,
39 39
       },
40 40
     });
41
-  }
41
+  };
42 42
 
43 43
   const columns = [
44 44
     {
@@ -46,7 +46,20 @@ const header = (props) => {
46 46
       dataIndex: 'image',
47 47
       key: 'image',
48 48
       align: 'center',
49
-      render: (x, row) => <Navigate onClick={toEditCarouse(row.contentId)} ><img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} /></Navigate>,
49
+      render: (x, row) => (
50
+        <Navigate onClick={toEditCarouse(row.contentId)}>
51
+          <img
52
+            src={getImgURL(row.image)}
53
+            className={
54
+              row.showPosition === 'index'
55
+                ? styles.imgIndex
56
+                : row.showPosition === 'mall'
57
+                ? styles.imgPerfect
58
+                : ''
59
+            }
60
+          />
61
+        </Navigate>
62
+      ),
50 63
     },
51 64
     {
52 65
       title: '发布城市',
@@ -59,36 +72,67 @@ const header = (props) => {
59 72
       dataIndex: 'buildingName',
60 73
       key: 'buildingName',
61 74
       align: 'center',
62
-      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
75
+      render: buildingName => <span>{buildingName === null ? '无' : buildingName}</span>,
63 76
     },
64 77
     {
65 78
       title: '关联内容类型',
66 79
       dataIndex: 'contentType',
67 80
       key: 'contentType',
68 81
       align: 'center',
69
-      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
70
-        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
82
+      render: contentType => (
83
+        <span>
84
+          {contentType === 'project'
85
+            ? '项目'
86
+            : contentType === 'activity'
87
+            ? '活动'
88
+            : contentType === 'news'
89
+            ? '资讯'
90
+            : contentType === 'other'
91
+            ? '其他'
92
+            : contentType === 'help'
93
+            ? '助力'
94
+            : contentType === 'group'
95
+            ? '拼团'
96
+            : contentType === 'h5'
97
+            ? 'H5活动'
98
+            : contentType === 'salesBatch'
99
+            ? '销售批次详情'
100
+            : contentType === 'live'
101
+            ? '直播活动详情'
102
+            : '无'}
103
+        </span>
104
+      ),
71 105
     },
72 106
     {
73 107
       title: '发布位置',
74 108
       dataIndex: 'showPosition',
75 109
       key: 'showPosition',
76 110
       align: 'center',
77
-      render: (showPosition) => <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
111
+      render: showPosition => (
112
+        <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
113
+      ),
78 114
     },
79 115
     {
80 116
       title: '发布时间',
81 117
       dataIndex: 'createDate',
82 118
       key: 'createDate',
83 119
       align: 'center',
84
-      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
120
+      render: (x, row) => (
121
+        <>
122
+          <span>{moment(row.createDate).format('YYYY-MM-DD')}</span>
123
+        </>
124
+      ),
85 125
     },
86 126
     {
87 127
       title: '状态',
88 128
       dataIndex: 'status',
89 129
       key: 'status',
90 130
       align: 'center',
91
-      render: (status) => <><span>{status == 1 ? '已上架' : '已下架'}</span></>
131
+      render: status => (
132
+        <>
133
+          <span>{status == 1 ? '已上架' : '已下架'}</span>
134
+        </>
135
+      ),
92 136
     },
93 137
     {
94 138
       title: '操作',
@@ -97,7 +141,11 @@ const header = (props) => {
97 141
       align: 'center',
98 142
       render: withActions((x, row) => [
99 143
         <AuthButton name="admin.extendContent.publish" noRight={null}>
100
-          <EditIcon type={row.status === 1 ? 'down' : 'up'} text={row.status === 1 ? '下架' : '上架'} onClick={changeStatus(row)} />
144
+          <EditIcon
145
+            type={row.status === 1 ? 'down' : 'up'}
146
+            text={row.status === 1 ? '下架' : '上架'}
147
+            onClick={changeStatus(row)}
148
+          />
101 149
         </AuthButton>,
102 150
 
103 151
         <AuthButton name="admin.extendContent.id.put" noRight={null}>
@@ -107,103 +155,121 @@ const header = (props) => {
107 155
         <AuthButton name="admin.extendContent.delete" noRight={null}>
108 156
           <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)} />
109 157
         </AuthButton>,
110
-      ])
158
+      ]),
111 159
     },
112 160
   ];
113 161
 
114
-  const finishDynamic = (row) => {
162
+  const finishDynamic = row => {
115 163
     Modal.confirm({
116 164
       title: '结束以后将无法编辑, 是否继续?',
117 165
       okText: '确定',
118 166
       cancelText: '取消',
119 167
       onOk() {
120
-        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
121
-          console.log(data)
122
-          message.info('操作成功!')
123
-          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
124
-        }).catch((err) => {
125
-          console.log(err)
126
-          message.info(err.msg || err.message)
127
-        })
168
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: '' } })
169
+          .then(data => {
170
+            console.log(data);
171
+            message.info('操作成功!');
172
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
173
+          })
174
+          .catch(err => {
175
+            console.log(err);
176
+            message.info(err.msg || err.message);
177
+          });
128 178
       },
129 179
     });
130
-  }
180
+  };
131 181
 
132 182
   //删除
133
-  const deleteCarouse = (contentId) => () => {
183
+  const deleteCarouse = contentId => () => {
134 184
     Modal.confirm({
135 185
       title: '确认删除此数据?',
136 186
       okText: '确定',
137 187
       cancelText: '取消',
138 188
       onOk() {
139
-        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
140
-          message.info('操作成功!')
141
-          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
142
-        }).catch((err) => {
143
-          console.log(err)
144
-          message.info(err.msg || err.message)
145
-        })
189
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } })
190
+          .then(data => {
191
+            message.info('操作成功!');
192
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
193
+          })
194
+          .catch(err => {
195
+            console.log(err);
196
+            message.info(err.msg || err.message);
197
+          });
146 198
       },
147 199
     });
148
-  }
200
+  };
149 201
 
150 202
   //   停用启用
151
-  const changeStatus = (row) => () => {
152
-    console.log(row)
203
+  const changeStatus = row => () => {
204
+    console.log(row);
153 205
     if (row.status === 0) {
154
-
155 206
       Modal.confirm({
156 207
         title: '确认发布此数据?',
157 208
         okText: '确定',
158 209
         cancelText: '取消',
159 210
         onOk() {
160
-          row.status = 1
161
-          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
162
-            message.info('操作成功!')
163
-            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
164
-          }).catch((err) => {
165
-            console.log(err)
166
-            row.status = 0
167
-            message.info(err.msg || err.message)
211
+          row.status = 1;
212
+          request({
213
+            ...apis.carsuseFigure.updataExtendContent,
214
+            urlData: { id: row.contentId },
215
+            data: row,
168 216
           })
217
+            .then(data => {
218
+              message.info('操作成功!');
219
+              getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
220
+            })
221
+            .catch(err => {
222
+              console.log(err);
223
+              row.status = 0;
224
+              message.info(err.msg || err.message);
225
+            });
169 226
         },
170 227
       });
171 228
     } else if (row.status === 1) {
172
-
173 229
       Modal.confirm({
174 230
         title: '停用后不会再显示在小程序端',
175 231
         okText: '确定',
176 232
         cancelText: '取消',
177 233
         onOk() {
178
-          row.status = 0
179
-          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
180
-            message.info('操作成功!')
181
-            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
182
-          }).catch((err) => {
183
-            console.log(err)
184
-            row.status = 1
185
-            message.info(err.msg || err.message)
234
+          row.status = 0;
235
+          request({
236
+            ...apis.carsuseFigure.updataExtendContent,
237
+            urlData: { id: row.contentId },
238
+            data: row,
186 239
           })
240
+            .then(data => {
241
+              message.info('操作成功!');
242
+              getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
243
+            })
244
+            .catch(err => {
245
+              console.log(err);
246
+              row.status = 1;
247
+              message.info(err.msg || err.message);
248
+            });
187 249
         },
188 250
       });
189 251
     }
252
+  };
190 253
 
191
-  }
192
-
193
-  const changePageNum = (pageNumber) => {
194
-    getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner', ...props.form.getFieldsValue() })
195
-  }
254
+  const changePageNum = pageNumber => {
255
+    getList({
256
+      pageNum: pageNumber,
257
+      pageSize: 10,
258
+      showType: 'banner',
259
+      ...props.form.getFieldsValue(),
260
+    });
261
+  };
196 262
 
197 263
   // 提交事件
198 264
   const handleSubmit = (e, props) => {
199 265
     e.preventDefault();
200 266
     props.form.validateFields((err, values) => {
201 267
       if (!err) {
202
-        console.log('提交数据: ', values)
203
-        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'banner' })
268
+        console.log('提交数据: ', values);
269
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'banner' });
204 270
       }
205 271
     });
206
-  }
272
+  };
207 273
 
208 274
   //重置搜索
209 275
   function handleReset() {
@@ -211,21 +277,12 @@ const header = (props) => {
211 277
     getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
212 278
   }
213 279
 
214
-  const { getFieldDecorator } = props.form
280
+  const { getFieldDecorator } = props.form;
215 281
   return (
216
-
217 282
     <Card>
218 283
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
219
-        <Form.Item>
220
-          {getFieldDecorator('cityId')(
221
-            <SelectCity />,
222
-          )}
223
-        </Form.Item>
224
-        <Form.Item>
225
-          {getFieldDecorator('buildingId')(
226
-            <BuildSelect />,
227
-          )}
228
-        </Form.Item>
284
+        <Form.Item>{getFieldDecorator('cityId')(<SelectCity />)}</Form.Item>
285
+        <Form.Item>{getFieldDecorator('buildingId')(<BuildSelect />)}</Form.Item>
229 286
         <Form.Item>
230 287
           {getFieldDecorator('contentType')(
231 288
             <Select style={{ width: '180px' }} placeholder="类型">
@@ -258,25 +315,36 @@ const header = (props) => {
258 315
         </Form.Item>
259 316
         <Form.Item>
260 317
           <AuthButton name="admin.extendContent.search" noRight={null}>
261
-            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
318
+            <Button type="primary" htmlType="submit" >
262 319
               搜索
263
-          </Button>
320
+            </Button>
264 321
           </AuthButton>
265 322
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
266 323
             重置
267
-            </Button>
324
+          </Button>
268 325
         </Form.Item>
269 326
       </Form>
270
-      <AuthButton name="admin.extendContent.post" noRight={null}>
271
-        <Button type='primary' onClick={toEditCarouse()} style={{margin:'20px 0'}}>新增</Button>
272
-      </AuthButton>
327
+      <div style={{textAlign:'right'}}>
328
+        <AuthButton name="admin.extendContent.post" noRight={null}>
329
+          <Button type="primary" onClick={toEditCarouse()} style={{ margin: '20px 0' }}>
330
+            新增
331
+          </Button>
332
+        </AuthButton>
333
+      </div>
334
+
273 335
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="contentId" />
274 336
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
275
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
337
+        <Pagination
338
+          showQuickJumper
339
+          defaultCurrent={1}
340
+          total={data.total}
341
+          onChange={changePageNum}
342
+          current={data.current}
343
+        />
276 344
       </div>
277 345
     </Card>
278
-  )
279
-}
346
+  );
347
+};
280 348
 const WrappedHeader = Form.create({ name: 'header' })(header);
281 349
 
282
-export default WrappedHeader
350
+export default WrappedHeader;

+ 20
- 19
src/pages/carouselFigure/editCarousel.jsx View File

@@ -94,30 +94,27 @@ const Edit = props => {
94 94
   const XForm = createForm({ onValuesChange: handleFormValueChange });
95 95
 
96 96
   return props => {
97
-    const [tab, changeTab] = useState('basic');
98 97
     const { contentId } = props.location.query;
99 98
     const [data, setData] = useState({});
99
+    useEffect(() => {
100
+      if (contentId) {
101
+        isCanChoose = false;
102
+        // eslint-disable-next-line react-hooks/rules-of-hooks
100 103
 
101
-    if (contentId) {
102
-      isCanChoose = false;
103
-      // eslint-disable-next-line react-hooks/rules-of-hooks
104
-      useEffect(() => {
105 104
         getDetail(contentId);
106
-      }, []);
105
+      } else {
106
+        isCanChoose = true;
107
+      }
108
+    }, []);
107 109
 
108
-      // 查询列表
109
-      const getDetail = contentId => {
110
-        request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(
111
-          data => {
112
-            console.log(data);
113
-            setExtraData1(data);
114
-            setData(data);
115
-          },
116
-        );
117
-      };
118
-    } else {
119
-      isCanChoose = true;
120
-    }
110
+    // 查询列表
111
+    const getDetail = contentId => {
112
+      request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(data => {
113
+        console.log(data);
114
+        setExtraData1(data);
115
+        setData(data);
116
+      });
117
+    };
121 118
 
122 119
     const cancelPage = () => {
123 120
       router.push({
@@ -192,6 +189,10 @@ const Edit = props => {
192 189
             label: '直播活动详情',
193 190
             value: 'live',
194 191
           },
192
+          {
193
+            label: '无',
194
+            value: 'nothing',
195
+          },
195 196
         ],
196 197
         value: data.contentType,
197 198
         rules: [{ required: true, message: '请选择类型' }],

+ 8
- 238
src/pages/staff/Organization/index.jsx View File

@@ -219,13 +219,12 @@ const FormItem = Form.Item;
219 219
 
220 220
 const userTree = React.forwardRef((props, ref) => {
221 221
   const [loading, setLoading] = useState(false);//防止多次点击 定义loadind
222
-  const [formData, setFormData] = useState();//提交表单的数据
222
+  // const [formData, setFormData] = useState();//提交表单的数据
223 223
   const [contentType, setContentType] = useState(1);//单选。初始默认显示1 富文本框。点击视频, 渲染2
224 224
   const { form, history } = props;
225 225
   const { getFieldDecorator, setFieldsValue, validateFields } = form;
226
+  const {RangePicker} = DatePicker;
226 227
   const { curriculumId } = history.location.query || {}
227
-
228
-
229 228
   const formItemLayout = {
230 229
     //布局
231 230
     labelCol: { span: 6 },
@@ -241,12 +240,12 @@ const userTree = React.forwardRef((props, ref) => {
241 240
             <Button type='danger' style={{ marginLeft: '2em' }} >
242 241
               删除
243 242
             </Button>
244
-            <DirectoryTree multiple>
245
-              <TreeNode title="parent 0" key="0-0">
246
-                <TreeNode title="leaf 0-0" key="0-0-0" isLeaf />
247
-                <TreeNode title="leaf 0-1" key="0-0-1" isLeaf />
243
+            <DirectoryTree >
244
+              <TreeNode title="厂长管理" key="0-0">
245
+                <TreeNode  title="刘张" value='刘帐' key="0-0-0" isLeaf />
246
+                <TreeNode title="李徐" key="0-0-1" isLeaf />
248 247
               </TreeNode>
249
-              <TreeNode title="parent 1" key="0-1">
248
+              <TreeNode title="员工管理" key="0-1">
250 249
                 <TreeNode title="leaf 1-0" key="0-1-0" isLeaf />
251 250
                 <TreeNode title="leaf 1-1" key="0-1-1" isLeaf />
252 251
                 <TreeNode title="leaf 1-1" key="0-1-2" isLeaf />
@@ -260,70 +259,7 @@ const userTree = React.forwardRef((props, ref) => {
260 259
         {/* FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF>Form表单 */}
261 260
         <Col xs={{ span: 10, offset: 10 }} lg={{ span: 10, offset: 4 }}>
262 261
           <Card>
263
-            <Form {...formItemLayout} >
264
-              <FormItem label="照片" help="建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情">
265
-                {
266
-                  getFieldDecorator('curriculumImg', {
267
-                    rules: [
268
-                      { required: true, message: '请上传照片' }
269
-                    ]
270
-                  })(
271
-                    <ImageUpload />
272
-                  )
273
-                }
274
-              </FormItem>
275
-              <FormItem label="姓名">
276
-                {
277
-                  getFieldDecorator('name', {
278
-                    rules: [
279
-                      { required: true, message: '请输入姓名' }
280
-                    ]
281
-                  })(
282
-                    <Input style={{ width: '88px' }} />
283
-                  )
284
-                }
285
-              </FormItem>
286
-              <FormItem label="年龄" >
287
-                {
288
-                  getFieldDecorator('weight', {
289
-                    rules: [{ required: true, message: '请输入年龄' }]
290
-                  })(
291
-                    <InputNumber min='18' />
292
-                  )
293
-                }
294
-              </FormItem>
295
-
296
-              <FormItem label="性别">
297
-                {
298
-                  getFieldDecorator('type', {
299
-                    rules: [
300
-                      { required: true, message: '请选择性别' }
301
-                    ]
302
-                  })(
303
-                    <Radio.Group value={contentType} style={{ width: '500px' }} defaultValue={1}>
304
-                      {/* onChange={e => setContentType(e.target.value)} */}
305
-                      <Radio value={1}>男</Radio>
306
-                      <Radio value={2}>女</Radio>
307
-                    </Radio.Group>
308
-                  )
309
-                }
310
-              </FormItem>
311
-              <Form.Item label="工作总时间" style={{ marginBottom: 0 }} help="如未离职,第二个日期则不用输入">
312
-                <Form.Item style={{ display: 'inline-block' }} >
313
-                  <DatePicker />
314
-                </Form.Item>
315
-                <span style={{ display: 'inline-block', width: '20px', textAlign: 'center' }}>至</span>
316
-                <Form.Item style={{ display: 'inline-block' }}>
317
-                  <DatePicker />
318
-                </Form.Item>
319
-              </Form.Item>
320
-
321
-              <FormItem wrapperCol={{ span: 12, offset: 6 }}>
322
-                <Button loading={loading} type="primary" htmlType="">
323
-                  确认修改
324
-                </Button>
325
-              </FormItem>
326
-            </Form>
262
+            
327 263
           </Card>
328 264
         </Col>
329 265
       </Row>
@@ -333,170 +269,4 @@ const userTree = React.forwardRef((props, ref) => {
333 269
 })
334 270
 
335 271
 
336
-
337
-// import React, { useEffect, useState, useCallback } from 'react';
338
-// import { Button, Form, Select, Input, InputNumber, Radio, message, DatePicker, Card } from 'antd';
339
-// import ImageUpload from '@/components/XForm/ImageUpload';
340
-// import FileUpload from '@/components/XForm/FileUpload';
341
-// import Wangedit from '@/components/Wangedit/Wangedit';
342
-// import router from 'umi/router';
343
-// import { fetch, apis } from '@/utils/request';
344
-
345
-// const FormItem = Form.Item;
346
-// const Option = Select.Option;
347
-// // const getCurriculumData = fetch(apis.course.searchCourse);
348
-// // const saveCurriculumData = fetch(apis.course.addCourse);
349
-// // const updateCurriculumData = fetch(apis.course.alterCourse);
350
-// const goBack = () => router.goBack(-1);
351
-
352
-// const userTree = React.forwardRef((props, ref) => {
353
-//   const [loading, setLoading] = useState(false);//防止多次点击 定义loadind
354
-//   const [formData, setFormData] = useState();//提交表单的数据
355
-//   const [contentType, setContentType] = useState(1);//单选。初始默认显示1 富文本框。点击视频, 渲染2
356
-//   const { form, history } = props;
357
-//   const { getFieldDecorator, setFieldsValue, validateFields } = form;
358
-//   const { curriculumId } = history.location.query || {}
359
-
360
-//   const formItemLayout = {
361
-//     //布局
362
-//     labelCol: { span: 6 },
363
-//     wrapperCol: { span: 14 },
364
-
365
-//   };
366
-
367
-//   const handleSubmit = (e) => {
368
-//     e.preventDefault();
369
-//     validateFields((err, values) => {
370
-//       if (err) {
371
-//         return;
372
-//         //字符验证未填写---返回
373
-//       }
374
-
375
-//       setLoading(true);//loading开始
376
-
377
-//       if (curriculumId) {
378
-//         //如果有这个id拿。没有就,拿返回的curriculumId
379
-//         updateCurriculumData({
380
-//           data: {
381
-//             ...values,
382
-//             curriculumId
383
-//           },
384
-//           urlData: { id: curriculumId }
385
-//         }).then(() => {
386
-//           setLoading(false);
387
-//           message.success('数据更新成功');
388
-//           goBack()
389
-//         }).catch((err) => {
390
-//           setLoading(false);//loading消失
391
-//           message.error(err.message || err);
392
-//         })
393
-//       } else {
394
-//         saveCurriculumData({ data: values }).then(() => {
395
-//           setLoading(false);
396
-//           message.success('数据保存成功');
397
-//           goBack()
398
-//         }).catch((err) => {
399
-//           setLoading(false);//loading消失
400
-//           message.error(err.message || err);
401
-//         })
402
-//       }
403
-//     });
404
-//   }
405
-
406
-//   const getCourseData = useCallback(({ curriculumId }) => {//函数结果存 初始化运行一次,等待调用。
407
-//     getCurriculumData({ urlData: { id: curriculumId } }).then((res) => {
408
-//       setFormData(res)
409
-//     })
410
-//   }, [])
411
-
412
-//   useEffect(() => {
413
-//     if (curriculumId) {
414
-//       getCourseData({ curriculumId })//第一次渲染前//获取id
415
-//     }
416
-//   }, [curriculumId])//第二次id一样不执行
417
-
418
-//   useEffect(() => {
419
-//     if (formData) {//1.form表单数据{2} 执行。无变更不执行
420
-//       setFieldsValue(formData)
421
-//     }
422
-//   }, [formData])//2.有变更跟的话
423
-
424
-
425
-//   return (
426
-//     <Card>
427
-//       <Form {...formItemLayout} onSubmit={handleSubmit}>
428
-//         <FormItem label="照片" help="建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情">
429
-//           {
430
-//             getFieldDecorator('curriculumImg', {
431
-//               rules: [
432
-//                 { required: true, message: '请上传照片' }
433
-//               ]
434
-//             })(
435
-//               <ImageUpload />
436
-//             )
437
-//           }
438
-//         </FormItem>
439
-//         <FormItem label="姓名">
440
-//           {
441
-//             getFieldDecorator('name', {
442
-//               rules: [
443
-//                 { required: true, message: '请输入姓名' }
444
-//               ]
445
-//             })(
446
-//               <Input style={{ width: '88px' }} />
447
-//             )
448
-//           }
449
-//         </FormItem>
450
-//         <FormItem label="年龄" >
451
-//           {
452
-//             getFieldDecorator('weight', {
453
-//               rules: [{ required: true, message: '请输入年龄' }]
454
-//             })(
455
-//               <InputNumber min='18' />
456
-//             )
457
-//           }
458
-//         </FormItem>
459
-
460
-//         <FormItem label="性别">
461
-//           {
462
-//             getFieldDecorator('type', {
463
-//               rules: [
464
-//                 { required: true, message: '请选择性别' }
465
-//               ]
466
-//             })(
467
-//               <Radio.Group value={contentType} style={{ width: '500px' }} defaultValue={1}>
468
-//                 {/* onChange={e => setContentType(e.target.value)} */}
469
-//                 <Radio value={1}>男</Radio>
470
-//                 <Radio value={2}>女</Radio>
471
-//               </Radio.Group>
472
-//             )
473
-//           }
474
-//         </FormItem>
475
-//         <Form.Item label="工作总时间" style={{ marginBottom: 0 }} help="如未离职,第二个日期则不用输入">
476
-//           <Form.Item style={{ display: 'inline-block' }} >
477
-//             <DatePicker />
478
-//           </Form.Item>
479
-//           <span style={{ display: 'inline-block', width: '20px', textAlign: 'center' }}>至</span>
480
-//           <Form.Item style={{ display: 'inline-block' }}>
481
-//             <DatePicker />
482
-//           </Form.Item>
483
-//         </Form.Item>
484
-
485
-//         <FormItem wrapperCol={{ span: 12, offset: 6 }}>
486
-//           <Button loading={loading} type="primary" htmlType="">
487
-//             保存
488
-//           </Button>
489
-//           <Button style={{ marginLeft: '2em' }} onClick={goBack}>
490
-//             返回
491
-//           </Button>
492
-//           <Button type='danger' style={{ marginLeft: '2em' }} >
493
-//             删除
494
-//           </Button>
495
-//         </FormItem>
496
-//       </Form>
497
-//     </Card>
498
-
499
-//   )
500
-// })
501
-
502 272
 export default Form.create({})(userTree);

+ 161
- 212
src/pages/staff/staff/Edit/index.jsx View File

@@ -1,30 +1,15 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-
3
-import { Input, Card, message, Radio, Select, Modal } from 'antd';
4
-import { FormattedMessage } from 'umi-plugin-react/locale';
5
-import BuildSelect from '@/components/SelectButton/BuildSelect'
2
+import { Input, Card, message, Select } from 'antd';
3
+import OrganizationSelect from '@/components/SelectButton/OrganizationSelect';
6 4
 import router from 'umi/router';
7 5
 import { FieldTypes, createForm } from '@/components/XForm';
8
-import Wangedit from '@/components/Wangedit/Wangedit'
9
-// import channels from './channelList.less';
10
-// import Tagss from '../components/Tagss.jsx';
11 6
 import apis from '@/services/apis';
12
-import request from '@/utils/request'
13
-import BuildingSelection from '../components/BuildingSelection'
7
+import request from '@/utils/request';
8
+import BuildingSelection from '../components/BuildingSelection';
14 9
 
15 10
 const { TextArea } = Input;
16
-const { Option } = Select;
17
-let consultantChecked = false;
18
-
19
-const setExtraData = (data) => {
20
-  consultantChecked = data.isConsultant
21
-}
22
-
23
-const handleFormValueChange = (props, changedValues, allValues) => {
24
-    setExtraData(allValues)
25
-}
26 11
 
27
-const XForm = createForm({ onValuesChange: handleFormValueChange })
12
+const XForm = createForm();
28 13
 
29 14
 /**
30 15
  *
@@ -32,283 +17,247 @@ const XForm = createForm({ onValuesChange: handleFormValueChange })
32 17
  * @param {*} props
33 18
  * @returns
34 19
  */
35
-const StaffEdit = (props) => {
36
-  const userId = props.location.query.userId
37
-  const [userData, setUserData] = useState({})
38
-  const [tagData, setTagData] = useState([])
39
-  const [roleData, setRoleData] = useState([])
40
-  const [buildData, setBuildData] = useState([])
41
-  const [visible, setVisible] = useState(false)
42
-
43
-  const getTagList = () => {
44
-    request({ ...apis.staff.taTags, params: { pageNum: 1, pageSize: 999 } }).then((data) => {
45
-      setTagData(data.records)
46
-    })
47
-  }
20
+const StaffEdit = props => {
21
+  const userId = props.location.query.userId;
22
+  const [userData, setUserData] = useState({});
23
+  const [roleData, setRoleData] = useState([]);
24
+  const [buildData, setBuildData] = useState([]);
25
+  const [isConsultant, setIsConsultant] = useState(false);
48 26
 
49 27
   const getRoleList = () => {
50
-    request({ ...apis.role.getRoleList, params: { pageNum: 1, pageSize: 999 } }).then((data) => {
51
-      console.log(data)
52
-      setRoleData(data.records)
53
-    })
54
-  }
28
+    request({ ...apis.role.getRoleList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
29
+      console.log(data);
30
+      setRoleData(data.records);
31
+    });
32
+  };
55 33
 
56 34
   //获取项目列表
57 35
   const getBuildList = e => {
58
-    request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(data => {
59
-        setBuildData(data)
60
-    })
61
-  }
36
+    request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(
37
+      data => {
38
+        setBuildData(data);
39
+      },
40
+    );
41
+  };
62 42
 
63 43
   // 查询列表
64
-  const getUserData = (userId) => {
65
-    request({ ...apis.staff.getTaUser, urlData: { id: userId } }).then((data) => {
66
-      consultantChecked = data.isConsultant
67
-      setUserData(data)
68
-    })
69
-  }
44
+  const getUserData = userId => {
45
+    request({ ...apis.staff.getTaUser, urlData: { id: userId } }).then(data => {
46
+      // consultantChecked =;
47
+      setIsConsultant(data.isConsultant);
48
+      setUserData(data);
49
+    });
50
+  };
70 51
 
71
-  if(userData.buildingIds && buildData.length > 0 && !consultantChecked){
72
-      const newBuildings = userData.buildingIds.filter(x => buildData.filter(it => it.buildingId === x)[0])
73
-      userData.buildingIds = newBuildings
52
+  if (userData.buildingIds && buildData.length > 0 && !isConsultant) {
53
+    const newBuildings = userData.buildingIds.filter(
54
+      x => buildData.filter(it => it.buildingId === x)[0],
55
+    );
56
+    userData.buildingIds = newBuildings;
74 57
   }
75 58
 
76
-  if(userData.roleIds && roleData.length > 0){
77
-    const newRoleIds = userData.roleIds.filter(x => roleData.filter(it => it.roleId === x)[0])
78
-      userData.roleIds = newRoleIds
59
+  if (userData.roleIds && roleData.length > 0) {
60
+    const newRoleIds = userData.roleIds.filter(x => roleData.filter(it => it.roleId === x)[0]);
61
+    userData.roleIds = newRoleIds;
79 62
   }
80 63
 
81 64
   useEffect(() => {
82
-    getTagList();
83 65
     getRoleList();
84 66
     getBuildList();
85 67
     if (userId) {
86 68
       getUserData(userId);
87 69
     }
88
-  }, [])
89
-
90
-  const tagsChange = (value) => {
91
-    console.log(`selected ${value}`);
92
-  }
70
+  }, []);
93 71
 
94 72
   const handleSubmit = val => {
95 73
     if (userId) {
96
-      request({ ...apis.staff.updateTaUser, urlData: { id: userId }, data: val, }).then((data) => {
97
-        console.log(data, "tauser")
98
-        message.info("保存成功")
99
-        router.go(-1)
100
-      }).catch(error => {
101
-        // message.info(error.message)
102
-      })
74
+      request({ ...apis.staff.updateTaUser, urlData: { id: userId }, data: val })
75
+        .then(data => {
76
+          console.log(data, 'tauser');
77
+          message.info('保存成功');
78
+          router.go(-1);
79
+        })
80
+        .catch(error => {
81
+          // message.info(error.message)
82
+        });
103 83
     } else {
104
-      request({ ...apis.staff.addTaUser, data: val, }).then((data) => {
105
-        console.log(data, "tauser")
106
-        message.info("保存成功")
107
-        router.go(-1)
108
-      }).catch(error => {
109
-        // message.info(error.message)
110
-      })
84
+      request({ ...apis.staff.addTaUser, data: val })
85
+        .then(data => {
86
+          console.log(data, 'tauser');
87
+          message.info('保存成功');
88
+          router.go(-1);
89
+        })
90
+        .catch(error => {
91
+          // message.info(error.message)
92
+        });
111 93
     }
112
-  }
94
+  };
113 95
 
114
-  const photoBeforeUpload = (file) => {
96
+  const photoBeforeUpload = file => {
115 97
     // const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
116 98
     // if (!isJpgOrPng) {
117 99
     //   message.error('请上传 JPG/PNG 格式的图片!');
118 100
     // }
119
-    console.log(file.size, file.size / 1024)
120
-    const isLt100k = (file.size / 1024) < 100;
101
+    console.log(file.size, file.size / 1024);
102
+    const isLt100k = file.size / 1024 < 100;
121 103
     if (!isLt100k) {
122 104
       message.error('请上传小于100k的图片!');
123 105
     }
124 106
     return isLt100k;
125
-  }
126
-
127
-  //授权项目改变
128
-  const consultantBuildingChange =(e) => {
129
-    if(userData.isConsultant){
130
-      request({ ...apis.staff.check, params: { userId: userData.userId, personId: userData.consultantPersonId, buildingId: userData.buildingId } }).then(res => {
131
-        if(res.length > 0){
132
-          Modal.confirm({
133
-            title: '此置业顾问下有私客,是否转移私客?',
134
-            okText: '确认',
135
-            cancelText: '取消',
136
-            onOk () {
137
-              setVisible(true)
138
-            },
139
-          });
140
-        }
141
-     })
142
-    }
143
-  }
144
-
145
-   //迁移私客成功回调
146
-   const moveSuccess = (e) => {
147
-    setVisible(false)
148
-  }
107
+  };
149 108
 
150 109
   const fields = [
151 110
     {
152
-      label: '姓名',
153
-      name: 'userName',
111
+      label: '头像',
112
+      name: 'avatar',
113
+      type: FieldTypes.ImageUploader,
114
+      extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像,限制大小:100k',
115
+      value: userData.avatar,
116
+      beforeUpload: e => photoBeforeUpload(e),
117
+      rules: [{ required: true, message: '请选择头像' }],
118
+    },
119
+
120
+    {
121
+      label: '工号',
122
+      name: 'jobNumber',
154 123
       type: FieldTypes.Text,
155
-      value: userData.userName,
156
-      rules: [
157
-        { required: true, message: '请输入姓名' },
158
-      ]
124
+      value: userData.jobNumber,
125
+      rules: [{ required: true, message: '请输入工号' }],
159 126
     },
160 127
     {
161
-      label: '公司',
162
-      name: 'orgName',
128
+      label: '姓名',
129
+      name: 'userName',
163 130
       type: FieldTypes.Text,
164
-      placeholder: '请输入公司名称',
165
-      value: userData.orgName,
166
-      rules: [
167
-        { required: true, message: '请输入公司名称' },
168
-      ]
131
+      value: userData.userName,
132
+      rules: [{ required: true, message: '请输入姓名' }],
169 133
     },
170 134
     {
171
-      label: '部门',
172
-      name: 'department',
135
+      label: '登录名',
136
+      name: 'loginName',
173 137
       type: FieldTypes.Text,
174
-      placeholder: '请输入部门',
175
-      value: userData.department,
176
-      rules: [
177
-        { required: true, message: '请输入部门' },
178
-      ]
138
+      placeholder: '请输入登录名',
139
+      value: userData.loginName,
179 140
     },
180 141
     {
181
-      label: '职位',
182
-      name: 'position',
142
+      label: '电话',
143
+      name: 'phone',
183 144
       type: FieldTypes.Text,
184
-      placeholder: '请输入职位',
185
-      value: userData.position,
145
+      placeholder: '请输入电话号码',
146
+      value: userData.phone,
186 147
       rules: [
187
-        { required: true, message: '请输入职位' },
188
-      ]
148
+        {
149
+          required: true,
150
+          pattern: new RegExp('^1[0-9]{10}$'),
151
+          message: '请输入正确的电话号码',
152
+        },
153
+      ],
154
+      help: '登录账号为手机号  默认密码:12345',
189 155
     },
156
+
190 157
     {
191 158
       label: '是否置业顾问',
192 159
       name: 'isConsultant',
193 160
       type: FieldTypes.Switch,
194 161
       value: userData.isConsultant,
195
-      props: {disabled: userData.isConsultant},
162
+      props: {
163
+        disabled: userData.isConsultant,
164
+        onChange: e => {
165
+          console.log(e, '------');
166
+          setIsConsultant(e);
167
+        },
168
+      },
196 169
     },
197 170
     {
198
-      label: '电话',
199
-      name: 'phone',
171
+      label: '部门',
172
+      name: 'department',
200 173
       type: FieldTypes.Text,
201
-      placeholder: '请输入电话号码',
202
-      value: userData.phone,
203
-      rules: [
204
-        {
205
-            required: true,
206
-            pattern: new RegExp('^1[0-9]{10}$'),
207
-            message: '请输入正确的电话号码',
208
-        },
209
-      ]
174
+      placeholder: '请输入部门',
175
+      value: userData.department,
176
+      rules: [{ required: true, message: '请输入部门' }],
210 177
     },
211 178
     {
212
-      label: '登录名',
213
-      name: 'loginName',
179
+      label: '岗位类别',
180
+      name: 'position',
214 181
       type: FieldTypes.Text,
215
-      placeholder: '请输入登录名',
216
-      value: userData.loginName,
217
-      // hidden: () => consultantChecked,
218
-      help: '默认密码:123456',
182
+      placeholder: '请输入岗位类别',
183
+      value: userData.position,
184
+      rules: [{ required: true, message: '请输入岗位类别' }],
219 185
     },
186
+
220 187
     {
221 188
       label: '角色',
222 189
       name: 'roleIds',
223
-      render: <Select
224
-        mode="multiple"
225
-        style={{ width: '100%' }}
226
-        placeholder="请选择标签"
227
-        onChange={tagsChange} >
228
-        {roleData.map(item => (
229
-          <Select.Option key={item.roleId} value={item.roleId}>
230
-            {item.roleName}
231
-          </Select.Option>
232
-        ))}
233
-      </Select>,
190
+      render: (
191
+        <Select mode="multiple" style={{ width: '100%' }} placeholder="请选择标签">
192
+          {roleData.map(item => (
193
+            <Select.Option key={item.roleId} value={item.roleId}>
194
+              {item.roleName}
195
+            </Select.Option>
196
+          ))}
197
+        </Select>
198
+      ),
234 199
       value: userData.roleIds,
235 200
     },
236 201
     {
237
-      label: '授权项目', //改成组织机构
238
-      name: 'buildingId',
239
-      render: <BuildingSelection userData={userData} />,
240
-      value: userData.buildingId,
241
-      hidden: () => !consultantChecked,
242
-      rules: [
243
-        { required: true, message: '请选择授权项目' },
244
-      ]
202
+      label: '组织机构',
203
+      name: 'institutionId',
204
+      render: <OrganizationSelect />,
205
+      value: userData.institutionId,
206
+      rules: [{ required: true, message: '组织机构' }],
245 207
     },
246 208
     {
247 209
       label: '授权项目',
248
-      name: 'buildingIds',
249
-      render: <Select
250
-        mode="multiple"
251
-        showSearch
252
-        style={{ width: '100%' }}
253
-        placeholder="请选择授权项目"
254
-        filterOption={(input, option) =>
255
-          option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
256
-        }
257
-        >
258
-        {buildData.map(item => (
259
-          <Select.Option key={item.buildingId} value={item.buildingId}>
260
-            {item.buildingName}
261
-          </Select.Option>
262
-        ))}
263
-      </Select>,
264
-      value: userData.buildingIds,
265
-      hidden: () => consultantChecked,
266
-      rules: [
267
-        { required: true, message: '请选择授权项目' },
268
-      ]
210
+      name: 'buildingId',
211
+      render: <BuildingSelection userData={userData} />,
212
+      value: userData.buildingId,
213
+      hidden: () => !isConsultant,
214
+      rules: [{ required: true, message: '请选择授权项目' }],
269 215
     },
216
+
270 217
     {
271
-      label: '置业顾问头像',
218
+      label: '背景图',
272 219
       name: 'photo',
273 220
       type: FieldTypes.ImageUploader,
274
-      extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像,限制大小:100k',
221
+      // extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像,限制大小:100k',
275 222
       value: userData.photo,
276
-      beforeUpload: (e) => photoBeforeUpload(e),
277
-      rules: [
278
-        { required: true, message: '请选择头像' },
279
-      ]
223
+      // beforeUpload: e => photoBeforeUpload(e),
224
+      rules: [{ required: true, message: '请选择图片' }],
280 225
     },
281 226
     {
282 227
       label: '简介',
283 228
       name: 'description',
284
-      render: <TextArea  ></TextArea>,
285
-      value: userData.description
229
+      render: <TextArea></TextArea>,
230
+      value: userData.description,
286 231
       // className={channels.inpuitTxt}
287 232
     },
288
-    {
289
-      label: '状态',
290
-      name: 'status',
291
-      render: <Radio.Group initialValue="1" buttonStyle="solid">
292
-        <Radio.Button value="9">禁用</Radio.Button>
293
-        <Radio.Button value="1">启用</Radio.Button>
294
-      </Radio.Group>,
295
-      value: userData.status != null ? userData.status.toString() : "1"
296
-    },
233
+    //   {
234
+    //     label: '状态',
235
+    //     name: 'status',
236
+    //     render: <Radio.Group initialValue="1" buttonStyle="solid">
237
+    //       <Radio.Button value="9">禁用</Radio.Button>
238
+    //       <Radio.Button value="1">启用</Radio.Button>
239
+    //     </Radio.Group>,
240
+    //     value: userData.status != null ? userData.status.toString() : "1"
241
+    //   },
297 242
     {
298 243
       label: '权重',
299 244
       name: 'weight',
300 245
       type: FieldTypes.Number,
301
-      render: <Input type="number" style={{ width: 150}} />,
246
+      render: <Input type="number" style={{ width: 150 }} />,
302 247
       value: userData.weight,
303 248
       help: '数字越大越靠前',
304 249
     },
305
-  ]
306
-
307
-
308
-  return <Card>
309
-            <XForm  onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
250
+  ];
310 251
 
311
-        </Card>
312
-}
252
+  return (
253
+    <Card>
254
+      <XForm
255
+        onSubmit={handleSubmit}
256
+        fields={fields.filter(Boolean)}
257
+        onCancel={() => router.go(-1)}
258
+      ></XForm>
259
+    </Card>
260
+  );
261
+};
313 262
 
314
-export default StaffEdit
263
+export default StaffEdit;

+ 3
- 3
src/pages/staff/staff/list/index.jsx View File

@@ -118,7 +118,7 @@ export default props => {
118 118
       render: () => <BuildingSelect style={{ width: 160 }} />,
119 119
     },
120 120
     {
121
-      name: 'code',
121
+      name: 'jobNumber',
122 122
       label: '工号',
123 123
       placeholder: '请输入工号',
124 124
     },
@@ -154,8 +154,8 @@ export default props => {
154 154
   const tableColumns = [
155 155
     {
156 156
       title: '工号',
157
-      key: 'code',
158
-      dataIndex: 'code',
157
+      key: 'jobNumber',
158
+      dataIndex: 'jobNumber',
159 159
       align: 'center',
160 160
     },
161 161
     {

+ 10
- 0
src/services/apis.js View File

@@ -2100,4 +2100,14 @@ export default {
2100 2100
     },
2101 2101
   },
2102 2102
   // admin/redPacket/money/{id}
2103
+  institution: {
2104
+
2105
+    list: {
2106
+      method: 'GET',
2107
+      url: `${prefix}/institution/list`,
2108
+      action: 'admin.institution.list.get',
2109
+    },
2110
+   
2111
+  },
2112
+
2103 2113
 }