1002884655 před 3 roky
rodič
revize
a9b2cad57d

+ 5
- 0
src/constants/api.js Zobrazit soubor

@@ -18,6 +18,11 @@ export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下
18 18
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
19 19
 export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo/') // 查询客户信息
20 20
 
21
+// 驻场
22
+export const API_SURE_CHIP = resolvePath('marking/preparatory') // 确认认筹
23
+export const API_SURE_BUY = resolvePath('marking/commission') // 确认结佣
24
+export const API_SURE_SIGN = resolvePath('marking/signatory') // 确认签约
25
+
21 26
 // 获取经纪人绑定楼盘列表
22 27
 export const API_GET_AGENT_BUILDINGS = resolvePath('buildingChannel/buildings')
23 28
 

+ 103
- 35
src/pages/mine/changeVisit/index.jsx Zobrazit soubor

@@ -1,21 +1,44 @@
1
-import React, { useState, useEffect } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3
-import './index.scss'
4
-import { ScrollView, Input, Image } from '@tarojs/components'
3
+import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
5 4
 import '@/assets/css/iconfont.css'
5
+import { getCardList } from '@/services/card'
6
+import './index.scss'
6 7
 
7 8
 export default withLayout((props) => {
8 9
 
9
-  // const [PageProps] = useState(props)
10
+  const { router } = props
11
+  const { name, buildingId, type } = router.params
12
+
13
+  const RenChouData = {
14
+    name,
15
+    realtyConsultant: '',
16
+    remark: ''
17
+  }
18
+
19
+  const QianYueData = {
20
+    name,
21
+    realtyConsultant: '',
22
+    remark: ''
23
+  }
24
+
25
+  const JieYongData = {
26
+    name,
27
+    realtyConsultant: '',
28
+    remark: ''
29
+  }
30
+
31
+  const [FormData, setFormData] = useState({ ...RenChouData })
32
+
33
+  const [ConsultantList, setConsultantList] = useState([])
34
+  const [CurrnetConsultant, setCurrnetConsultant] = useState({})
35
+
10 36
   const [StatusList] = useState([
11
-    { name: '认筹', id: 1 },
12
-    { name: '认购', id: 2 },
13
-    { name: '签约', id: 3 },
14
-    { name: '待结佣', id: 4 },
15
-    { name: '已结佣', id: 5 },
16
-    { name: '作废', id: 6 }
37
+    { name: '认筹', id: 3 },
38
+    { name: '签约', id: 4 },
39
+    { name: '结佣', id: 5 },
17 40
   ])
18
-  const [CurrentStatusId, setCurrentStatusId] = useState(null)
41
+  const [CurrentStatusId, setCurrentStatusId] = useState(3)
19 42
 
20 43
   const [RoomTypeList] = useState([
21 44
     { name: '二室一厅', id: 1 },
@@ -25,9 +48,23 @@ export default withLayout((props) => {
25 48
   ])
26 49
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
27 50
 
51
+  useEffect(() => {
52
+    if (buildingId) {
53
+      const params = {
54
+        pageNumber: 1,
55
+        pageSize: 50,
56
+        buildingId,
57
+      }
58
+      getCardList(params).then((res) => {
59
+        const { records } = res
60
+        setConsultantList(records || [])
61
+      })
62
+    }
63
+  }, [buildingId])
64
+
28 65
   const CutStatus = (item) => {
29 66
     return () => {
30
-      setCurrentStatusId(item.id === CurrentStatusId ? null : item.id)
67
+      setCurrentStatusId(item.id)
31 68
     }
32 69
   }
33 70
 
@@ -37,10 +74,26 @@ export default withLayout((props) => {
37 74
     }
38 75
   }
39 76
 
77
+  const InputChange = (key, e) => {
78
+    let resData = FormData
79
+    resData[key] = e.detail.value
80
+    setFormData(resData)
81
+  }
82
+
83
+  const PickerChange = (key, e) => {
84
+    let resData = FormData
85
+    if (key === 'realtyConsultant') {
86
+      resData[key] = ConsultantList[e.detail.value].id
87
+      resData.realtyConsultantName = ConsultantList[e.detail.value].name
88
+      setCurrnetConsultant(ConsultantList[e.detail.value])
89
+    }
90
+    setFormData(resData)
91
+  }
92
+
40 93
   return (
41 94
     <view className='Page changeVisit'>
42 95
 
43
-      <ScrollView scroll-y={true} refresher-enabled={false} refresher-background='#fff'>
96
+      <ScrollView scroll-y>
44 97
         <view className='PageContent'>
45 98
 
46 99
           <text className='required'>变更状态</text>
@@ -53,7 +106,7 @@ export default withLayout((props) => {
53 106
                       <text>{item.name}</text>
54 107
                       {
55 108
                         CurrentStatusId === item.id &&
56
-                        <Image mode='widthFix' src={require('../../../assets/findHouse-icon1.png')}></Image>
109
+                        <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
57 110
                       }
58 111
                     </view>
59 112
                   ))
@@ -62,26 +115,41 @@ export default withLayout((props) => {
62 115
             </view>
63 116
           </view>
64 117
 
65
-          <text className='required'>客户姓名</text>
66
-          <view className='FormLine flex-h'>
67
-            <view className='flex-item'>
68
-              <Input placeholder='请输入姓名'></Input>
69
-            </view>
70
-          </view>
71
-
72
-          <text>归属渠道</text>
73
-          <view className='FormLine flex-h'>
74
-            <view className='flex-item'>
75
-              <Input placeholder='请输入渠道'></Input>
76
-            </view>
77
-          </view>
78
-
79
-          <text className='required'>内场接待</text>
80
-          <view className='FormLine flex-h'>
81
-            <view className='flex-item'>
82
-              <Input placeholder='请输入内场接待'></Input>
83
-            </view>
84
-          </view>
118
+          {
119
+            CurrentStatusId === 3 &&
120
+            <Block>
121
+              <text className='required'>客户姓名</text>
122
+              <view className='FormLine flex-h'>
123
+                <view className='flex-item'>
124
+                  <Input placeholder='请输入姓名' value={FormData.name} onInput={InputChange.bind(this, 'name')}></Input>
125
+                </view>
126
+              </view>
127
+            </Block>
128
+          }
129
+
130
+          {
131
+            CurrentStatusId === 3 &&
132
+            <Block>
133
+              <text>归属渠道</text>
134
+              <view className='FormLine flex-h'>
135
+                <view className='flex-item'>
136
+                  <Input placeholder='请输入渠道' disabled value={type === 'customer' ? '-' : ''}></Input>
137
+                </view>
138
+              </view>
139
+            </Block>
140
+          }
141
+
142
+          {
143
+            CurrentStatusId === 3 &&
144
+            <Block>
145
+              <text className='required'>内场接待</text>
146
+              <view className='FormLine flex-h'>
147
+                <view className='flex-item'>
148
+                  <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
149
+                </view>
150
+              </view>
151
+            </Block>
152
+          }
85 153
 
86 154
           <text className='required'>业绩分成人|占比/%</text>
87 155
           <view className='FormLine flex-h'>
@@ -93,7 +161,7 @@ export default withLayout((props) => {
93 161
           <text className='required'>户型</text>
94 162
           <view className='FormLine flex-h'>
95 163
             <view className='flex-item'>
96
-            <view className='CheckBoxList'>
164
+              <view className='CheckBoxList'>
97 165
                 {
98 166
                   RoomTypeList.map((item, index) => (
99 167
                     <view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>

+ 40
- 13
src/pages/mine/components/ResidentListItem/index.jsx Zobrazit soubor

@@ -1,48 +1,75 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { Image } from '@tarojs/components'
4
+import { formatDate } from '@/utils/chatDate'
4 5
 import './index.scss'
5 6
 
6 7
 export default function ResidentListItem (props) {
7 8
   const { data = {} } = props
8 9
   return (
9 10
     <view className='components ResidentListItem'>
10
-      <view className='flex-h'>
11
-        <text>最新报备:</text>
12
-        <view className='flex-item'>
13
-          <text>1710300417793</text>
14
-        </view>
15
-        <text className='Status'>到访确认</text>
16
-      </view>
17 11
       <view className='flex-h'>
18 12
         <text>客户姓名:</text>
19 13
         <view className='flex-item'>
20 14
           <text>{data.name}</text>
21 15
         </view>
16
+        {
17
+          data.customerStatus - 0 === 1 &&
18
+          <text className='Status'>已报备</text>
19
+        }
20
+        {
21
+          data.customerStatus - 0 === 2 && !(data.type === 'report' && data.channelStatus === 3) &&
22
+          <text className='Status' onClick={() => { Taro.navigateTo({ url: `/pages/mine/sureVisit/index?id=${data.id}` }) }}>到访确认</text>
23
+        }
22 24
       </view>
23 25
       <view className='flex-h'>
24 26
         <text>手机号码:</text>
25 27
         <view className='flex-item'>
26 28
           <text>{data.phone}</text>
27 29
         </view>
28
-        <Image mode='heightFix' src={require('@/assets/mine-icon27.png')}></Image>
29
-        <text className='Type'>结佣</text>
30
+        {
31
+          data.customerStatus - 0 === 1 &&
32
+          <text className='Type'>报备</text>
33
+        }
34
+        {
35
+          data.customerStatus - 0 === 2 &&
36
+          <text className='Type'>到访</text>
37
+        }
38
+        {
39
+          data.customerStatus - 0 === 3 &&
40
+          <text className='Type'>认筹</text>
41
+        }
42
+        {
43
+          data.customerStatus - 0 === 4 &&
44
+          <text className='Type'>签约</text>
45
+        }
46
+        {
47
+          data.customerStatus - 0 === 5 &&
48
+          <text className='Type'>结佣</text>
49
+        }
50
+        {/* <Image mode='heightFix' src={require('@/assets/mine-icon27.png')}></Image> */}
30 51
       </view>
31 52
       <view className='flex-h'>
32 53
         <text>报备经纪:</text>
33 54
         <view className='flex-item'>
34
-          <text>成凤  15005184629</text>
55
+          <text>{data.recommendPersonName}  {data.recommendPersonPhone}</text>
35 56
         </view>
36 57
       </view>
37 58
       <view className='flex-h'>
38 59
         <text>报备时间:</text>
39 60
         <view className='flex-item'>
40
-          <text>2017/10/30 15:25</text>
61
+          <text>{formatDate(data.createDate, 'yyyy/M/d')}</text>
41 62
         </view>
42 63
       </view>
43 64
       <view className='Opt'>
44
-        <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/mine/changeVisit/index?id=${Data.id}` }) }}>更新交易</text>
45
-        <text>无效</text>
65
+        {
66
+          !(data.type === 'report' && data.channelStatus === 3) &&
67
+          <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/mine/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}` }) }}>更新交易</text>
68
+        }
69
+        {
70
+          data.type === 'report' && data.channelStatus === 3 &&
71
+          <text>无效</text>
72
+        }
46 73
       </view>
47 74
     </view>
48 75
   )