|
@@ -6,6 +6,7 @@ import { useSelector } from 'react-redux'
|
6
|
6
|
import { fetch } from '@/utils/request'
|
7
|
7
|
import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
|
8
|
8
|
import Taro from '@tarojs/taro'
|
|
9
|
+import { ROLE_CODE } from '@/constants/user'
|
9
|
10
|
import './index.scss'
|
10
|
11
|
|
11
|
12
|
const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
|
|
@@ -48,20 +49,20 @@ export default withLayout((props) => {
|
48
|
49
|
useEffect(() => {
|
49
|
50
|
if (CanSubmit) {
|
50
|
51
|
let url = null
|
51
|
|
- if (type === 'consultant') { // 置业顾问
|
|
52
|
+ if (type === ROLE_CODE.CONSULTANT) { // 置业顾问
|
52
|
53
|
url = API_REPORT_CUETOMER
|
53
|
|
- } else if (type === 'customer') { // 普通客户
|
|
54
|
+ } else if (type === ROLE_CODE.CUSTOMER) { // 普通客户
|
54
|
55
|
url = API_USER_ADD_CUSTOMER
|
55
|
56
|
} else { // 经纪人
|
56
|
57
|
url = API_CHANNEL_REPORT
|
57
|
58
|
}
|
58
|
59
|
let params = {}
|
59
|
|
- if (type === 'consultant') {
|
|
60
|
+ if (type === ROLE_CODE.CONSULTANT) {
|
60
|
61
|
params = { name: FormData.name, phone: FormData.phone, sex: SexId }
|
61
|
62
|
} else {
|
62
|
63
|
params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
|
63
|
64
|
}
|
64
|
|
- if (type === 'estateAgent') {
|
|
65
|
+ if (type === ROLE_CODE.CHANNEL_AGENT) {
|
65
|
66
|
params.channelCustomerId = PersonId
|
66
|
67
|
params.channelId = user.userInfo.person.channelId
|
67
|
68
|
params.buildingId = BuildingId
|
|
@@ -144,14 +145,10 @@ export default withLayout((props) => {
|
144
|
145
|
Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
|
145
|
146
|
return false
|
146
|
147
|
}
|
147
|
|
- if (BuildingId === null) {
|
|
148
|
+ if (BuildingId === null && type !== ROLE_CODE.CONSULTANT) {
|
148
|
149
|
Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
|
149
|
150
|
return false
|
150
|
151
|
}
|
151
|
|
- if (CardId === null) {
|
152
|
|
- Taro.showToast({ title: '请选择内场接待', icon: 'none' })
|
153
|
|
- return false
|
154
|
|
- }
|
155
|
152
|
if (!CanSubmit) {
|
156
|
153
|
setCanSubmit(true)
|
157
|
154
|
}
|
|
@@ -180,37 +177,36 @@ export default withLayout((props) => {
|
180
|
177
|
<text>性别</text>
|
181
|
178
|
<view className='FormLine flex-h'>
|
182
|
179
|
<view className='flex-item'>
|
183
|
|
- <Picker range-key='name' onChange={SexPickerChange} value={0} range={SexList}>
|
|
180
|
+ <Picker range-key='name' onChange={SexPickerChange} value={null} range={SexList}>
|
184
|
181
|
<text>{SexName || '请选择'}</text>
|
185
|
182
|
</Picker>
|
186
|
183
|
</view>
|
187
|
184
|
<text className='iconfont icon-jiantoudown'></text>
|
188
|
185
|
</view>
|
189
|
186
|
|
190
|
|
-
|
191
|
|
- <text>意向楼盘</text>
|
192
|
|
- <view className='FormLine flex-h'>
|
193
|
|
- <view className='flex-item'>
|
194
|
|
- <Picker range-key='name' onChange={PickerChange} value={0} range={BuildingList}>
|
195
|
|
- <text>{BuildingName || '请选择'}</text>
|
196
|
|
- </Picker>
|
197
|
|
- </view>
|
198
|
|
- </view>
|
199
|
|
-
|
200
|
|
- <text>内场接待(选填)</text>
|
201
|
|
- <view className='FormLine flex-h'>
|
202
|
|
- <view className='flex-item'>
|
203
|
|
- <Picker range-key='name' onChange={CardPickerChange} value={0} range={CardList}>
|
204
|
|
- <text>{CardName || '请选择'}</text>
|
205
|
|
- </Picker>
|
206
|
|
- </view>
|
207
|
|
- <Image mode='heightFix' src={defaultSpecialImage}></Image>
|
208
|
|
- <text>选择</text>
|
209
|
|
- </view>
|
210
|
|
-
|
211
|
187
|
{
|
212
|
|
- type !== 'consultant' &&
|
|
188
|
+ type !== ROLE_CODE.CONSULTANT &&
|
213
|
189
|
<Block>
|
|
190
|
+ <text>意向楼盘</text>
|
|
191
|
+ <view className='FormLine flex-h'>
|
|
192
|
+ <view className='flex-item'>
|
|
193
|
+ <Picker range-key='name' onChange={PickerChange} value={null} range={BuildingList}>
|
|
194
|
+ <text>{BuildingName || '请选择'}</text>
|
|
195
|
+ </Picker>
|
|
196
|
+ </view>
|
|
197
|
+ </view>
|
|
198
|
+
|
|
199
|
+ <text>内场接待(选填)</text>
|
|
200
|
+ <view className='FormLine flex-h'>
|
|
201
|
+ <view className='flex-item'>
|
|
202
|
+ <Picker range-key='name' onChange={CardPickerChange} value={null} range={CardList}>
|
|
203
|
+ <text>{CardName || '请选择'}</text>
|
|
204
|
+ </Picker>
|
|
205
|
+ </view>
|
|
206
|
+ <Image mode='heightFix' src={defaultSpecialImage}></Image>
|
|
207
|
+ <text>选择</text>
|
|
208
|
+ </view>
|
|
209
|
+
|
214
|
210
|
<text>备注</text>
|
215
|
211
|
<view className='FormLine flex-h'>
|
216
|
212
|
<view className='flex-item'>
|