Pārlūkot izejas kodu

Merge branch 'v3.5.1' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into v3.5.1

周立森 5 gadus atpakaļ
vecāks
revīzija
1d3880ed4a

+ 9
- 3
src/pages/activity/editActivity.jsx Parādīt failu

@@ -85,6 +85,12 @@ const BasicForm = props => {
85 85
         } else {
86 86
           request({ ...apis.activity.add, data: { ...values } }).then((data) => {
87 87
             message.info('保存成功')
88
+            router.push({
89
+              pathname: '/activity/editActivity',
90
+              query: {
91
+                dynamicId: data.dynamicId,
92
+              },
93
+            });
88 94
             // router.go(-1)
89 95
           }).catch((err) => {
90 96
             message.info(err.msg || err.message)
@@ -108,12 +114,12 @@ const BasicForm = props => {
108 114
           ],
109 115
         })(<BuildSelect disabled={disable}/>)}
110 116
         </Form.Item>
111
-        <Form.Item label="活动封面图" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于活动列表">
117
+        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于活动列表">
112 118
           {getFieldDecorator('listImgUrl', {
113 119
           rules: [
114 120
             {
115 121
               required: true,
116
-              message: '请选择活动封面图',
122
+              message: '请选择活动封面图1',
117 123
             },
118 124
           ],
119 125
         })(<ImageUploader />)}
@@ -199,7 +205,7 @@ const BasicForm = props => {
199 205
               message: '请输入权重',
200 206
             },
201 207
           ],
202
-        })(<Input type="number" style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
208
+        })(<Input type="number" disabled={activityStatus===0 ? true : false} style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
203 209
         </Form.Item>
204 210
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
205 211
           <Button type="primary" htmlType="submit">

+ 5
- 1
src/pages/building/list/add/components/base.jsx Parādīt failu

@@ -67,8 +67,12 @@ function AddBuilding(props) {
67 67
    
68 68
       
69 69
       poi.map(x => {
70
+        const ty = Object.prototype.toString
70 71
         // console.log('x.data: ', JSON.parse(x.data))
71
-        setFormMapScopeTagValue(x.key, { data: JSON.parse(x.data) })
72
+        // console.log('x.data: ', typeof x.data, x.data instanceof String, ty.call(x.data))
73
+        if (ty.call(x.data) === '[object String]') {
74
+          setFormMapScopeTagValue(x.key, { data: JSON.parse(x.data) })
75
+        }
72 76
       })
73 77
     }
74 78
   }

+ 1
- 1
src/pages/building/list/add/components/imageSet.jsx Parādīt failu

@@ -13,7 +13,7 @@ const { confirm } = Modal;
13 13
 const saleType = [
14 14
   {
15 15
     id: 1,
16
-    name: '待',
16
+    name: '待',
17 17
   },
18 18
   {
19 19
     id: 2,

+ 21
- 6
src/pages/building/list/add/components/modalImage.jsx Parādīt failu

@@ -88,8 +88,11 @@ class ModalImage extends React.Component {
88 88
 
89 89
     // 网路请求
90 90
     request({ ...apis.building.buildingApartmentGetById, urlData: { id: apartmentId }, params: { ...params } }).then(res => {
91
-      // res.img = res.buildingImgList.map((item, _) => item.url)
92
-      res.img = res.buildingImgList.map(item => item.url)
91
+      // res.img = res.buildingImgList.map(item => item.url)
92
+      if (res.buildingImgList) {
93
+        res.img = res.buildingImgList[0].url
94
+      }
95
+      
93 96
       this.props.form.setFieldsValue(res)
94 97
     }).catch(err => {
95 98
      this.openNotificationWithIcon('error', err)
@@ -116,7 +119,8 @@ class ModalImage extends React.Component {
116 119
 
117 120
   submitData(data) {
118 121
     // TODO 这里应该是要支持多图,但是封装的控件没有
119
-    data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
122
+    // data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
123
+    data.img = [{ imgType: 'aparment', url: data.img, orderNo: 0 }]
120 124
     data.buildingId = this.props.visibleData.buildingId;
121 125
     data.apartmentType = 'apart'
122 126
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
@@ -186,17 +190,28 @@ class ModalImage extends React.Component {
186 190
               {getFieldDecorator('img', {
187 191
                   rules: [{ required: true, message: '请上传户型图片' }],
188 192
               })(
189
-                <ImageListUpload />,
193
+                // <ImageListUpload />,
194
+                <ImageUpload />,
190 195
               )}
191 196
               </Form.Item>
192 197
               <Form.Item label="面积" help="单位 ㎡">
193 198
                 {getFieldDecorator('buildingArea', {
194
-                  rules: [{ required: true, message: '请填写面积' }],
199
+                  rules: [{ required: true, message: '请填写面积' },
200
+                          {
201
+                            pattern: new RegExp('^[0-9]*$'),
202
+                            message: '只允许输入数字',
203
+                          },
204
+                  ],
195 205
                 })(<Input type="number" />)}
196 206
               </Form.Item>
197 207
               <Form.Item label="套内面积" help="单位 ㎡">
198 208
                 {getFieldDecorator('insideArea', {
199
-                  rules: [{ required: true, message: '请填写套内面积' }],
209
+                  rules: [{ required: true, message: '请填写套内面积' },
210
+                          {
211
+                            pattern: new RegExp('^[0-9]*$'),
212
+                            message: '只允许输入数字',
213
+                          },
214
+                  ],
200 215
                 })(<Input type="number" />)}
201 216
               </Form.Item>
202 217
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>

+ 15
- 1
src/pages/building/list/index.jsx Parādīt failu

@@ -230,7 +230,21 @@ function body(props) {
230 230
 
231 231
 
232 232
   function toAdd() {
233
-    router.push({ pathname: '/building/list/add' })
233
+    // 判断楼盘是否最可以添加
234
+    request({ ...apis.building.verifyMax}).then(res => {
235
+      router.push({ pathname: '/building/list/add' })
236
+    }).catch(err => {
237
+      // eslint-disable-next-line no-unused-expressions
238
+      <Alert
239
+        style={{
240
+          marginBottom: 24,
241
+        }}
242
+        message={err}
243
+        type="error"
244
+        showIcon
245
+      />
246
+      return
247
+    })
234 248
   }
235 249
 
236 250
   /**

+ 1
- 1
src/pages/carouselFigure/advertisingList.jsx Parādīt failu

@@ -46,7 +46,7 @@ const toEdit = (contentId) => () => {
46 46
       dataIndex: 'image',
47 47
       key: 'image',
48 48
       align: 'center',
49
-      render: (image) => <img src={image} className={styles.touxiang} />,
49
+      render: (image) => <img src={image} className={styles.imgSmall} />,
50 50
     },
51 51
     {
52 52
       title: '类型',

+ 1
- 1
src/pages/carouselFigure/carouselFigureList.jsx Parādīt failu

@@ -46,7 +46,7 @@ const toEditCarouse = (contentId) => () => {
46 46
       dataIndex: 'image',
47 47
       key: 'image',
48 48
       align: 'center',
49
-      render: (image) => <img src={image} className={styles.touxiang} />,
49
+      render: (image) => <img src={image} className={styles.imgPerfect} />,
50 50
     },
51 51
     {
52 52
       title: '类型',

+ 1
- 1
src/pages/channel/recommendClients.jsx Parādīt failu

@@ -95,7 +95,7 @@ const columns = [
95 95
     // eslint-disable-next-line consistent-return
96 96
     render: (text, records) => {
97 97
       if (records.status === 1) { return '报备' }
98
-      if (records.status === 2) { return 'admin.taNews.weight' }
98
+      if (records.status === 2) { return '推荐' }
99 99
       if (records.status === 3) { return '认购' }
100 100
       if (records.status === 4) { return '签约' }
101 101
       if (records.verifyStatus === 1) { return '待审核' }

+ 17
- 12
src/pages/customer/customerlist/components/integralRecord.jsx Parādīt failu

@@ -27,7 +27,7 @@ class ModalIntegralRecord extends React.Component {
27 27
 
28 28
   // 挂载之后
29 29
   componentDidMount() {
30
-    // this.getList({ pageNumber: 1, pageSize: 5 })
30
+    this.getList({ pageNumber: 1, pageSize: 5 })
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
@@ -76,8 +76,7 @@ class ModalIntegralRecord extends React.Component {
76 76
   }
77 77
 
78 78
   // 积分类型
79
-  showChangeType(str) { 
80
-
79
+  showChangeType(str) {
81 80
     switch (str) {
82 81
       case 'goods':
83 82
         return '兑换商品'
@@ -89,58 +88,64 @@ class ModalIntegralRecord extends React.Component {
89 88
         return '注册经纪人'
90 89
       case 'recommend-customer':
91 90
         return '推荐客户'
91
+        case 'group':
92
+        return '拼团'
93
+        case 'recommend-customer':
94
+        return '推荐客户'
92 95
       default:
93 96
         return '未知类型'
94 97
     }
95 98
   }
96
-  
99
+
97 100
   // 判断是否是 - 开头
98
-  subPoints(points) { 
99
-    let subStr = points.toString().substring(0, 1)
101
+  subPoints(points) {
102
+    const subStr = points.toString().substring(0, 1)
100 103
     if (subStr === '-') {
101 104
       return true
102 105
     }
103 106
     return false
104 107
   }
105 108
 
109
+// eslint-disable-next-line class-methods-use-this
106 110
   render() {
107 111
     const columns = [
108 112
       {
109 113
         title: '序号',
110 114
         dataIndex: 'index',
111 115
         key: 'index',
116
+        render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
112 117
       },
113 118
       {
114 119
         title: '积分类型',
115 120
         dataIndex: 'changeType',
116 121
         key: 'changeType',
117
-        render: (_, record) => { this.showChangeType(record.changeType) },
122
+        render: (_, record) => <span>{this.showChangeType(record.changeType) }</span>,
118 123
       },
119 124
       {
120 125
         title: '积分变化',
121 126
         dataIndex: 'pointsAmount',
122 127
         key: 'pointsAmount',
123
-        render: (_, record) => { <span style={this.subPoints(record.pointsAmount) && {color: 'red'}}>{ record.pointsAmount }</span> },
128
+        // render: (pointsAmount, record) => { <span style={this.subPoints(pointsAmount) && {color: 'red'}}>{ pointsAmount }</span> },
124 129
       },
125 130
       {
126 131
         title: '发生时间',
127 132
         dataIndex: 'createDate',
128 133
         key: 'createDate',
129
-        render: (_, record) => { moment(record.createDate).format('YYYY-MM-DD') },
134
+        render: (createDate, records) => <span> {moment(createDate).format('YYYY-MM-DD')}</span>,
130 135
       },
131 136
     ]
132 137
     return (
133 138
       <>
134 139
         <Modal
135
-            title={ "当前可用积分:" + this.state.dataSource.totalPoints }
140
+            title={ '当前可用积分:' + this.state.dataSource.totalPoints }
136 141
             width={800}
137 142
             destroyOnClose="true"
138 143
             footer={null}
139 144
             visible={this.state.visibleData.visible}
140 145
             // onOk={() => this.handleOk()}
141
-            onCancel={(e) => this.handleCancel(e)}
146
+            onCancel={e => this.handleCancel(e)}
142 147
           >
143
-            <Table dataSource={this.state.dataSource.result.records} rowKey="integralrecord" columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
148
+            <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
144 149
           </Modal>
145 150
       </>
146 151
     );

+ 7
- 6
src/pages/customer/customerlist/components/recommend.jsx Parādīt failu

@@ -109,17 +109,18 @@ class ModalRecommendRecord extends React.Component {
109 109
         title: '推荐时间',
110 110
         dataIndex: 'createDate',
111 111
         key: 'createDate',
112
-        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
112
+        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss') }</span></>,
113 113
       },
114 114
       {
115 115
         title: '状态',
116 116
         // eslint-disable-next-line consistent-return
117 117
         render: (text, records) => {
118
-          if (records.status === 1) { return '报备' }
119
-          if (records.status === 2) { return '到访' }
120
-          if (records.status === 3) { return '认筹' }
121
-          if (records.status === 4) { return '签约' }
122
-          // reportRecommendStatus
118
+          if (records.verifyStatus === 0) { return '未审核' }
119
+          if (records.verifyStatus === 1) {
120
+            if (records.reportRecommendStatus === 1) { return '报备' }
121
+            if (records.reportRecommendStatus === 2) { return '推荐' }
122
+           }
123
+          if (records.verifyStatus === 2) { return '审核不通过' }
123 124
         },
124 125
       },
125 126
     ]

+ 4
- 4
src/pages/customer/customerlist/customerDetail.jsx Parādīt failu

@@ -83,7 +83,7 @@ function onChange(number) {
83 83
       dataIndex: 'visitTime',
84 84
       key: 'visitTime',
85 85
       align: 'center',
86
-      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>,
86
+      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD HH:mm:ss') }</span>,
87 87
     },
88 88
     {
89 89
       title: '停留时间',
@@ -98,8 +98,8 @@ function onChange(number) {
98 98
     {
99 99
       title: 'Name',
100 100
       dataIndex: 'name',
101
-      width:500,
102
-    render: (_, record) => <span stytle={{width:'450px'}} >{record.buildingName}</span>,
101
+      width: 500,
102
+    render: (_, record) => <span>{record.buildingName}</span>,
103 103
     },
104 104
     {
105 105
       title: 'Address',
@@ -169,7 +169,7 @@ function onChange(number) {
169 169
         <div className={styles.leftBoxCentre}>
170 170
           <div className={styles.tit}>
171 171
                 <span>项目名称</span>
172
-                <span style={{ marginLeft: '47%' }}>意向值</span>
172
+                <span style={{ marginLeft: '50%' }}>意向值</span>
173 173
           </div>
174 174
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
175 175
           <div className={styles.infoItem}>

+ 2
- 1
src/pages/customer/customerlist/index.jsx Parādīt failu

@@ -135,7 +135,7 @@ function body(props) {
135 135
   }
136 136
 
137 137
   function showRecord(record) {
138
-    setRecordVisibleData({ visible: true, customerId: record.customerId })
138
+    setRecordVisibleData({ visible: true, customerId: record.personId })
139 139
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
140 140
     setStatusVisibleData({ visible: false, customerId: '' })
141 141
     setRecommendVisibleData({ visible: false, customerId: '' })
@@ -207,6 +207,7 @@ function body(props) {
207 207
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
208 208
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
209 209
     setRecommendVisibleData({ visible: false, customerId: '' })
210
+    getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
210 211
   }
211 212
 
212 213
   const publicColumns = [

+ 1
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx Parādīt failu

@@ -84,7 +84,7 @@ function onChange(number) {
84 84
       dataIndex: 'visitTime',
85 85
       key: 'visitTime',
86 86
       align: 'center',
87
-      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>,
87
+      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD HH:mm:ss') }</span>,
88 88
     },
89 89
     {
90 90
       title: '停留时间',

+ 10
- 0
src/pages/style/GoodsList.less Parādīt failu

@@ -9,6 +9,16 @@
9 9
   height: 93px;
10 10
 }
11 11
 
12
+.imgPerfect {
13
+  width: 120px;
14
+  height: 67.5px;
15
+}
16
+
17
+.imgSmall {
18
+  width: 90px;
19
+  height: 135px;
20
+}
21
+
12 22
 .ant-table-column-title {
13 23
   font-weight: 600;
14 24
 }

+ 30
- 0
src/pages/system/editPolicy.jsx Parādīt failu

@@ -46,6 +46,12 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
46 46
         name: 'cityId',
47 47
         render: <SelectCity />,
48 48
         value: policyData.cityId,
49
+        rules: [
50
+          {
51
+            required: true,
52
+            message: '请选择城市',
53
+          },
54
+        ],
49 55
       },
50 56
       {
51 57
         label: '购房政策封面图',
@@ -53,18 +59,36 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
53 59
         type: FieldTypes.ImageUploader,
54 60
         value: policyData.policyImg,
55 61
         help: '建议图片尺寸:220*176px,比例5:4,格式:jpg,用于购房百科列表',
62
+        rules: [
63
+          {
64
+            required: true,
65
+            message: '请选择购房政策封面图',
66
+          },
67
+        ],
56 68
       },
57 69
       {
58 70
         label: '政策标题',
59 71
         name: 'title',
60 72
         type: FieldTypes.Text,
61 73
         value: policyData.title,
74
+        rules: [
75
+          {
76
+            required: true,
77
+            message: '请输入政策标题',
78
+          },
79
+        ],
62 80
       },
63 81
       {
64 82
         label: '政策详情',
65 83
         name: 'body',
66 84
         render: <Wangedit />,
67 85
         value: policyData.body,
86
+        rules: [
87
+          {
88
+            required: true,
89
+            message: '请输入政策标题',
90
+          },
91
+        ],
68 92
       },
69 93
       {
70 94
         label: '状态',
@@ -77,6 +101,12 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
77 101
   
78 102
     const handleSubmit = val => { 
79 103
       console.log('submit data --->', val)
104
+      console.log(val.body, 'val.body')
105
+      if (val.body == '<p><br></p>'){
106
+        message.info("政策详情必填")
107
+        return
108
+      }
109
+      
80 110
       if(policyId){
81 111
         val.policyId = policyId
82 112
         request({ ...apis.system.updateTaPolicy, urlData: {id: policyId},data: val, }).then((data) => {

+ 5
- 0
src/services/apis.js Parādīt failu

@@ -45,6 +45,11 @@ export default {
45 45
       url: `${prefix}/buildinglist`,
46 46
       action: 'admin.buildinglist.get',
47 47
     },
48
+    verifyMax: {
49
+      method: 'GET',
50
+      url: `${prefix}/verifyMax`,
51
+      action: 'admin.verifyMax.get',
52
+    },
48 53
     updateStatus: {
49 54
       method: 'PUT',
50 55
       url: `${prefix}/building/update/status`,