Your Name 3 år sedan
förälder
incheckning
ece538c134

+ 36
- 19
src/components/XForm/ImageListUpload.jsx Visa fil

@@ -15,55 +15,68 @@ class ImageListUpload extends React.Component {
15 15
   };
16 16
 
17 17
   getFileList = () => {
18
-    return (this.props.value || []).map((img, inx) => ({ uid: inx, url: getImgURL(img), status: 'done' }))
19
-  }
18
+    return (this.props.value || []).map((img, inx) => ({
19
+      uid: inx,
20
+      url: getImgURL(img),
21
+      status: 'done',
22
+    }));
23
+  };
20 24
 
21 25
   handleCancel = () => this.setState({ previewVisible: false });
22 26
 
23 27
   handlePreview = async file => {
24 28
     this.setState({
25
-      previewImage: file.url ,
29
+      previewImage: file.url,
26 30
       previewVisible: true,
27 31
     });
28 32
   };
29 33
 
30
-  handleChange = (e) => {
31
-    if (e.file.status === "uploading") {
34
+  handleChange = e => {
35
+    if (e.file.status === 'uploading') {
32 36
       this.setState({ loading: true });
33 37
       return;
34 38
     }
35
-console.log(e,'handleChange')
39
+    console.log(e, 'handleChange');
36 40
     // const fileList = (this.props.value || []).filter(x => x != e.file.url);
37 41
     // this.props.onChange(fileList);
38 42
 
39 43
     // console.log('删除图片触发了', e.file)
40 44
     if (e.file.status === 'removed') {
41
-      console.log(e,'handleChange22')
42
-      const fileList = (this.props.value || []).filter(x => getImgURL(x) != e.file.url);
43
-      this.props.onChange(fileList);
45
+      console.log(e, 'handleChange22');
46
+
47
+      Modal.confirm({
48
+        title: '确认要删除该图片吗?',
49
+        okText: '确认',
50
+        okType: 'danger',
51
+        cancelText: '取消',
52
+        onOk() {
53
+          const fileList = (this.props.value || []).filter(x => getImgURL(x) != e.file.url);
54
+          this.props.onChange(fileList);
55
+        },
56
+      });
44 57
     }
45 58
 
46
-    if (e.file.status === "done") {
59
+    if (e.file.status === 'done') {
47 60
       this.setState({
48 61
         loading: false,
49
-      })
62
+      });
50 63
 
51 64
       if (e.file.response && e.file.response.url) {
52 65
         if (typeof this.props.onChange === 'function') {
53
-          const fileList = this.getFileList()
54
-          this.props.onChange([...fileList || [], e.file.response.url]);
66
+          const fileList = this.getFileList();
67
+          this.props.onChange([...(fileList || []), e.file.response.url]);
55 68
         }
56 69
       }
57 70
     }
58 71
   };
59 72
 
60
-  handleUploadSucess = (url) => {
73
+  handleUploadSucess = url => {
61 74
     this.setState({ loading: false });
62 75
     if (typeof this.props.onChange === 'function') {
63 76
       const fileList = this.props.value || [];
64 77
       this.props.onChange([...fileList, url]);
65 78
     }
66
-  }
79
+  };
67 80
 
68 81
   render() {
69 82
     const { previewVisible, previewImage } = this.state;
@@ -71,7 +84,10 @@ console.log(e,'handleChange')
71 84
 
72 85
     const uploadButton = (
73 86
       <div>
74
-        <Icon style={{ fontSize: '2em', color: '#aaa' }} type={this.state.loading ? "loading" : "plus"}  />
87
+        <Icon
88
+          style={{ fontSize: '2em', color: '#aaa' }}
89
+          type={this.state.loading ? 'loading' : 'plus'}
90
+        />
75 91
       </div>
76 92
     );
77 93
     return (
@@ -82,13 +98,14 @@ console.log(e,'handleChange')
82 98
           fileList={fileList}
83 99
           onPreview={this.handlePreview}
84 100
           onChange={this.handleChange}
85
-          { ...uploaderProps }
101
+          {...uploaderProps}
86 102
           onSuccess={this.handleUploadSucess}
87 103
         >
88 104
           {/* unlimited 表示上传无限制数量 */}
89
-          {(this.props.unlimited && uploadButton) || ((fileList || images).length >= 8 ? null : uploadButton)}
105
+          {(this.props.unlimited && uploadButton) ||
106
+            ((fileList || images).length >= 8 ? null : uploadButton)}
90 107
         </Upload>
91
-        <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
108
+        <Modal id={'ImageListUpload-preview'} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
92 109
           <img alt="example" style={{ width: '100%' }} src={getImgURL(previewImage)} />
93 110
         </Modal>
94 111
       </div>

+ 1
- 1
src/pages/activity/groupRoomActivity/detail.jsx Visa fil

@@ -31,7 +31,7 @@ const cancelPage = () => {
31 31
 
32 32
 const getSignList = dynamicId => {
33 33
   router.push({
34
-    pathname: '/activity/SignupActivity/registrationRecord',
34
+    pathname: '/activity/groupRoomActivity/registrationRecord',
35 35
     query: {
36 36
       dynamicId,
37 37
     },

+ 1
- 1
src/pages/activity/lookHouseActivity/detail.jsx Visa fil

@@ -31,7 +31,7 @@ const cancelPage = () => {
31 31
 
32 32
 const getSignList = dynamicId => {
33 33
   router.push({
34
-    pathname: '/activity/SignupActivity/registrationRecord',
34
+    pathname: '/activity/lookHouseActivity/registrationRecord',
35 35
     query: {
36 36
       dynamicId,
37 37
     },

+ 2
- 2
src/pages/building/Edit/Apartment/Form.jsx Visa fil

@@ -148,11 +148,11 @@ const AMForm = props => {
148 148
           rules: [{ validator: validMinNum }],
149 149
         })(<InputNumber precision={2} min={0} step={0.01} addonAfter="㎡" />)}
150 150
       </Form.Item>
151
-      <Form.Item label="使用面积">
151
+      {/* <Form.Item label="使用面积">
152 152
         {getFieldDecorator('insideArea', {
153 153
           rules: [{ validator: validMinNum }],
154 154
         })(<InputNumber precision={2} min={0} step={0.01} addonAfter="㎡" />)}
155
-      </Form.Item>
155
+      </Form.Item> */}
156 156
       <Form.Item label="权重" help="数值越大越靠前">
157 157
         {getFieldDecorator('orderNo', {
158 158
           rules: [{ validator: validMinNum }],

+ 1
- 1
src/pages/building/Edit/Basic/form.js Visa fil

@@ -72,7 +72,7 @@ export function saveData(formData) {
72 72
   //
73 73
   data.videoImage = videoImage ? [{ imgType: 'videoImage', url: data.videoImage, orderNo: 1 }] : []
74 74
   // 项目标签
75
-  data.tag = tag.map((item, _) => ({ tagName: item }))
75
+  data.tag = (tag || []).map((item, _) => ({ tagName: item }))
76 76
 
77 77
   const request = fetch(data.buildingId ? apis.building.updateBuilding : apis.building.addBuilding)
78 78
   return request({ data })

+ 25
- 13
src/pages/building/Edit/Basic/index.jsx Visa fil

@@ -173,28 +173,30 @@ const BuildingBasic = React.forwardRef((props, ref) => {
173 173
         </Form.Item>
174 174
         <FormGroupItem>
175 175
           <Form.Item label="文旅商办" help="是否将本项目归纳在【首页-文旅商办】中"  {...gourpItemLayout.ab.a}>
176
-            {getFieldDecorator('isCommerce')(<Switch />)}
176
+            {getFieldDecorator('isCommerce', { valuePropName: 'checked' })(<Switch />)}
177 177
           </Form.Item>
178 178
           <Form.Item label="近期开盘" help="本项目是否近期开盘" {...gourpItemLayout.ab.b}>
179
-            {getFieldDecorator('isRecentOpening')(<Switch />)}
179
+            {getFieldDecorator('isRecentOpening', { valuePropName: 'checked' })(<Switch />)}
180 180
           </Form.Item>
181 181
         </FormGroupItem>
182 182
         <Form.Item label="列表均价" help="项目列表展示价格,示例:约10000元/㎡、约1000万元/套起">
183
-          {getFieldDecorator('price')(<Input />)}
183
+          {getFieldDecorator('price', {
184
+              rules: [{ required: true, message: '请输入列表均价' }],
185
+          })(<Input />)}
184 186
         </Form.Item>
185 187
         <FormGroupItem>
186
-          <Form.Item label="开盘时间" {...gourpItemLayout.ab.a} >
188
+          <Form.Item label="开盘日期" {...gourpItemLayout.ab.a} >
187 189
             {getFieldDecorator('openingDate')(
188
-              <OpenTimePicker placeholder="请选择开盘时间" style={fullWidth} />
190
+              <OpenTimePicker placeholder="请选择开盘日期" style={fullWidth} />
189 191
             )}
190 192
           </Form.Item>
191 193
           <Form.Item label="电话" {...gourpItemLayout.ab.b } >
192 194
             {getFieldDecorator('tel')(<Input placeholder="手机或者座机号码" />)}
193 195
           </Form.Item>
194 196
         </FormGroupItem>
195
-        <Form.Item label="项目说明" >
197
+        {/* <Form.Item label="项目说明" >
196 198
           {getFieldDecorator('dynamic')(<Input placeholder="项目标签补充,不超过30个字" maxLength={30}/>)}
197
-        </Form.Item>
199
+        </Form.Item> */}
198 200
         {/* <Form.Item label="物业类型" >
199 201
           {getFieldDecorator('propertyType')(<Input />)}
200 202
         </Form.Item> */}
@@ -212,7 +214,17 @@ const BuildingBasic = React.forwardRef((props, ref) => {
212 214
         </Form.Item>
213 215
         <Form.Item label="项目标签" >
214 216
           {getFieldDecorator('tag')(
215
-            <Select mode="tags" placeholder="输入后选中" style={fullWidth} />
217
+            <Select mode='multiple' placeholder="项目标签" style={fullWidth}>
218
+            <Select.Option value="临地铁">临地铁</Select.Option>
219
+            <Select.Option value="改善盘">改善盘</Select.Option>
220
+            <Select.Option value="刚需盘">刚需盘</Select.Option>
221
+            <Select.Option value="配套成熟">配套成熟</Select.Option>
222
+            <Select.Option value="人车分流">人车分流</Select.Option>
223
+            <Select.Option value="康养社区">康养社区</Select.Option>
224
+            <Select.Option value="旅游地产">旅游地产</Select.Option>
225
+            <Select.Option value="品牌房企">品牌房企</Select.Option>
226
+            <Select.Option value="海外地产">海外地产</Select.Option>
227
+          </Select>,
216 228
           )}
217 229
         </Form.Item>
218 230
 
@@ -457,11 +469,11 @@ const BuildingBasic = React.forwardRef((props, ref) => {
457 469
             rules: [{ max: 30, message: '不超过30个字' }]
458 470
           })(<Input placeholder="不超过30个字" />)}
459 471
         </Form.Item>
460
-        {/* <Form.Item label="预售许可证" >
461
-          {getFieldDecorator('preSalePermit')(
462
-            <ImageUpload />,
463
-          )}
464
-        </Form.Item> */}
472
+        <Form.Item label="预售许可证" >
473
+          {getFieldDecorator('preSalePermit',{
474
+            rules: [{ max: 30, message: '不超过30个字' }]
475
+          })(<Input placeholder="不超过30个字" />)}
476
+        </Form.Item>
465 477
 
466 478
         <Form.Item label=" " colon={false}>
467 479
           <AuthButton name="building.detail.save">

+ 2
- 2
src/pages/building/Edit/components/BuildingTypeDetail.jsx Visa fil

@@ -20,7 +20,7 @@ const noBorderInput = {
20 20
 
21 21
 const BuildingTypeDetail = (props) => {
22 22
   const { title, dataset, form, visible, onClose, onSubmit } = props
23
-  const { getFieldDecorator, validateFieldsAndScroll } = form
23
+  const { getFieldDecorator, validateFieldsAndScroll,getFieldValue } = form
24 24
   const [priceType, setPriceType] = useState()
25 25
 
26 26
   const handleSubmit = () => {
@@ -78,7 +78,7 @@ const BuildingTypeDetail = (props) => {
78 78
             {getFieldDecorator('endPrice')(
79 79
               <Input placeholder="最高价" style={{width: 'calc(50% - 60px)', borderLeft: 0, borderRight: 0}} />
80 80
               )}
81
-            {<Input style={{...noBorderInput, width: '80px', textAlign: 'right'}} placeholder={priceUnit[priceType]} disabled />}
81
+            {<Input style={{...noBorderInput, width: '80px', textAlign: 'right'}} placeholder={priceUnit[getFieldValue('priceType')]} disabled  />}
82 82
           </Input.Group>
83 83
         </Item>
84 84
         <Item label="销售状态" {...formItemLayout}>

+ 4
- 4
src/pages/building/Edit/components/OpenTimePicker.jsx Visa fil

@@ -8,20 +8,20 @@ import { DatePicker } from 'antd';
8 8
  */
9 9
 export default (props) => {
10 10
   const { value, onChange, ...leftProps } = props;
11
-  const [val, setVal] = useState(value ? moment(value, 'YYYY-MM-DD HH:mm') : undefined);
11
+  const [val, setVal] = useState(value ? moment(value, 'YYYY-MM-DD') : undefined);
12 12
 
13 13
   const handelChange = (e) => {
14 14
     if (onChange) {
15
-      onChange(e ? e.format('YYYY-MM-DD HH:mm') : undefined);
15
+      onChange(e ? e.format('YYYY-MM-DD') : undefined);
16 16
     }
17 17
   }
18 18
 
19 19
   useEffect(() => {
20
-    setVal(value ? moment(value, 'YYYY-MM-DD HH:mm') : undefined);
20
+    setVal(value ? moment(value, 'YYYY-MM-DD') : undefined);
21 21
   }, [value])
22 22
 
23 23
   return (
24
-    <DatePicker value={val} showTime={{ format: 'HH:mm' }} format="YYYY-MM-DD HH:mm"  {...leftProps} onChange={handelChange} />
24
+    <DatePicker value={val} format="YYYY-MM-DD"  {...leftProps} onChange={handelChange} />
25 25
   )
26 26
 }
27 27
 

+ 4
- 4
src/pages/channel/Channel/List/index.jsx Visa fil

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useRef } from 'react';
2
-import { Button, message, Table, Card } from 'antd';
2
+import { Button, message, Table, Popconfirm } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import QueryTable from '@/components/QueryTable';
5 5
 import AuthButton from '@/components/AuthButton';
@@ -154,9 +154,9 @@ export default function ChannelList(props) {
154 154
       align: 'center',
155 155
       render: (text, record) => (
156 156
         <AuthButton name="channel.delete" noRight={null}>
157
-          <Button type="link" onClick={() => onDelete(record)}>
158
-            删除
159
-          </Button>
157
+          <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => onDelete(record)}>
158
+            <Button type="link">删除</Button>
159
+          </Popconfirm>
160 160
         </AuthButton>
161 161
       ),
162 162
     },

+ 6
- 6
src/pages/channel/independentList/index.jsx Visa fil

@@ -523,9 +523,9 @@ function body(props) {
523 523
                 </Button>
524 524
               </AuthButton>
525 525
               <AuthButton name="channel.disable" noRight={null}>
526
-                <Button type="link" onClick={() => onDelete(record)}>
527
-                  删除
528
-                </Button>
526
+                <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => onDelete(record)}>
527
+                  <Button type="link">删除</Button>
528
+                </Popconfirm>
529 529
               </AuthButton>
530 530
             </>
531 531
           }
@@ -583,9 +583,9 @@ function body(props) {
583 583
         </Form.Item>
584 584
         <Form.Item style={{ position: 'absolute', right: '38px' }}>
585 585
           {/* <AuthButton name="admin.major.search" noRight={null}> */}
586
-            <Button type="primary" htmlType="submit">
587
-              搜索
588
-            </Button>
586
+          <Button type="primary" htmlType="submit">
587
+            搜索
588
+          </Button>
589 589
           {/* </AuthButton> */}
590 590
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
591 591
             重置

+ 1
- 1
src/pages/customer/Customer/PublicCustomer/AssistConsultant/AssistConsultant.jsx Visa fil

@@ -67,7 +67,7 @@ const AssistConsultant = props => {
67 67
     request({
68 68
       ...apis.customer.consultantAssist,
69 69
       urlData: { id: data.customerId },
70
-      data: { userId: record.userId, buildingId: data.buildingName || data.buildingId },
70
+      data: { userId: record.userId, buildingId:  data.buildingName || data.buildingId },
71 71
     })
72 72
       .then(res => {
73 73
         // eslint-disable-next-line no-unused-expressions

+ 6
- 4
src/pages/customer/Customer/PublicCustomer/components/AssistConsultant.jsx Visa fil

@@ -16,7 +16,8 @@ const AssistConsultant = props => {
16 16
 
17 17
   const [tableData, setTableData] = useState({});
18 18
   const [loading, setLoading] = useState(false);
19
-
19
+  const [buildingId, setBuildingId] = useState();
20
+  
20 21
   const openNotificationWithIcon = (type, message) => {
21 22
     notification[type]({
22 23
       message,
@@ -52,11 +53,12 @@ const AssistConsultant = props => {
52 53
 
53 54
   // 分页
54 55
   function onChange(pageNum) {
55
-    getList({ pageNumber: pageNum, pageSize: 5 });
56
+    getList({ pageNumber: pageNum, pageSize: 5,buildingId: buildingId||data.buildingId });
56 57
   }
57 58
 
58 59
   function changBuilding(buildingId) {
59 60
     if (buildingId) {
61
+      setBuildingId(buildingId)
60 62
       getList({ pageNumber: 1, pageSize: 5, buildingId: buildingId });
61 63
     }
62 64
   }
@@ -67,7 +69,7 @@ const AssistConsultant = props => {
67 69
     request({
68 70
       ...apis.customer.consultantAssist,
69 71
       urlData: { id: data.customerId },
70
-      data: { userId: record.userId, buildingId: data.buildingName || data.buildingId },
72
+      data: { userId: record.userId, buildingId: buildingId || data.buildingId },
71 73
     })
72 74
       .then(res => {
73 75
         // eslint-disable-next-line no-unused-expressions
@@ -141,7 +143,7 @@ const AssistConsultant = props => {
141 143
               </>
142 144
             )} */}
143 145
             {data?.buildingId == null && (
144
-              <BuildSelect onChange={e => changBuilding(e)} value={data?.buildingName} />
146
+              <BuildSelect onChange={e => changBuilding(e)} value={buildingId||data?.buildingId} />
145 147
             )}
146 148
             <Table
147 149
               dataSource={tableData.records}

+ 5
- 5
src/pages/customer/Customer/PublicCustomer/index.jsx Visa fil

@@ -201,11 +201,11 @@ const PublicCustomer = () => {
201 201
             </Button>
202 202
           </AuthButton>,
203 203
 
204
-          // <AuthButton name="customer.consultant.dispatch" noRight={null}>
205
-          //   <Button type="link" onClick={() => handShowModel(record, actionList.assistConsultant)}>
206
-          //     分配置业顾问
207
-          //   </Button>
208
-          // </AuthButton>,
204
+          <AuthButton name="customer.consultant.dispatch" noRight={null}>
205
+            <Button type="link" onClick={() => handShowModel(record, actionList.assistConsultant)}>
206
+              分配置业顾问
207
+            </Button>
208
+          </AuthButton>,
209 209
         ]),
210 210
       },
211 211
     ];

+ 3
- 3
src/pages/news/list/List.jsx Visa fil

@@ -18,8 +18,8 @@ export default props => {
18 18
   const [loading, setLoading] = useState(false);
19 19
   const [page, setPage] = useState({ current: 1, pageSize: 10 });
20 20
   const onPublish = useCallback(row => {
21
-    const buidingStatus = row.status === 1 ? 2 : 1;
22
-    request({ ...apis.building.updateStatus, data: { id: row.buildingId, status: buidingStatus } })
21
+    const newsStatus = row.newsStatus === 1 ? 0 : 1;
22
+    request({ ...apis.news.put, urlData: { id: row.newsId }, data: { ...row, newsStatus } })
23 23
       .then(() => {
24 24
         notification.success({ message: '操作成功' });
25 25
         setLoading(false);
@@ -43,7 +43,7 @@ export default props => {
43 43
 
44 44
   const onDelete = useCallback(row => {
45 45
     setLoading(true);
46
-    request({ ...apis.building.deleteBuilding, urlData: { id: row.buildingId } })
46
+    request({ ...apis.news.delete, urlData: { id: row.newsId } })
47 47
       .then(() => {
48 48
         notification.success({ message: '操作成功' });
49 49
         setLoading(false);

+ 1
- 1
src/pages/staff/staff/Edit/index.jsx Visa fil

@@ -74,7 +74,7 @@ const StaffEdit = props => {
74 74
     console.log(val, userId, '----------111------------');
75 75
     // val.institutionIdLis =  val?.institutionIdLis?.split(',')
76 76
     // console.log(val,userId,'----------------------')
77
-    if (val.loginName) {
77
+    if (!val.loginName) {
78 78
       val.loginName = val.phone;
79 79
     }
80 80