|
@@ -22,7 +22,7 @@ const sexDicts = [
|
22
|
22
|
export default withLayout((props) => {
|
23
|
23
|
const { router, person } = props
|
24
|
24
|
const { personId, personType } = person
|
25
|
|
- const { buildingId : originBuiding } = router.params
|
|
25
|
+ const { buildingId: originBuiding } = router.params
|
26
|
26
|
|
27
|
27
|
const [loading, setLoading] = useState(false)
|
28
|
28
|
const [buildingId, setBuildingId] = useState(null)
|
|
@@ -41,7 +41,7 @@ export default withLayout((props) => {
|
41
|
41
|
|
42
|
42
|
useEffect(() => {
|
43
|
43
|
console.log('------originBuiding------>', originBuiding)
|
44
|
|
- if(originBuiding) {
|
|
44
|
+ if (originBuiding) {
|
45
|
45
|
setBuildingId(originBuiding)
|
46
|
46
|
}
|
47
|
47
|
}, [originBuiding])
|
|
@@ -63,7 +63,7 @@ export default withLayout((props) => {
|
63
|
63
|
Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
|
64
|
64
|
return false
|
65
|
65
|
}
|
66
|
|
- if (buildingId === null && personType !== ROLE_CODE.CONSULTANT && personType !== ROLE_CODE.CUSTOMER) {
|
|
66
|
+ if (buildingId === null && personType !== ROLE_CODE.CUSTOMER) {
|
67
|
67
|
Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
|
68
|
68
|
return false
|
69
|
69
|
}
|
|
@@ -77,6 +77,7 @@ export default withLayout((props) => {
|
77
|
77
|
phone: FormData.phone, // 电话
|
78
|
78
|
sex: SexId, // 性别
|
79
|
79
|
describe: FormData.describe, // 描述
|
|
80
|
+ buildingId,
|
80
|
81
|
} :
|
81
|
82
|
{
|
82
|
83
|
...FormData,
|
|
@@ -84,24 +85,24 @@ export default withLayout((props) => {
|
84
|
85
|
buildingId,
|
85
|
86
|
realtyConsultant: CardId
|
86
|
87
|
};
|
87
|
|
-
|
|
88
|
+
|
88
|
89
|
if (!preSubmit(payload)) {
|
89
|
90
|
return;
|
90
|
91
|
}
|
91
|
92
|
|
92
|
93
|
setLoading(true)
|
93
|
94
|
let url = null
|
94
|
|
- if(personType === ROLE_CODE.CONSULTANT) {
|
|
95
|
+ if (personType === ROLE_CODE.CONSULTANT) {
|
95
|
96
|
url = API_REPORT_CUETOMER
|
96
|
|
- } else if(personType === ROLE_CODE.CHANNEL_AGENT) {
|
|
97
|
+ } else if (personType === ROLE_CODE.CHANNEL_AGENT) {
|
97
|
98
|
url = API_CHANNEL_REPORT
|
98
|
|
- } else if(personType === ROLE_CODE.CUSTOMER) {
|
|
99
|
+ } else if (personType === ROLE_CODE.CUSTOMER) {
|
99
|
100
|
url = API_USER_ADD_CUSTOMER
|
100
|
101
|
}
|
101
|
102
|
fetch({ url, method: 'post', payload }).then(() => {
|
102
|
103
|
setLoading(false)
|
103
|
104
|
Taro.showToast({ title: '操作成功', icon: 'none' })
|
104
|
|
-
|
|
105
|
+
|
105
|
106
|
const t = setTimeout(() => {
|
106
|
107
|
Taro.navigateBack({ delta: 1 })
|
107
|
108
|
clearTimeout(t)
|
|
@@ -149,16 +150,16 @@ export default withLayout((props) => {
|
149
|
150
|
{/* <text className='iconfont icon-jiantoudown'></text> */}
|
150
|
151
|
</view>
|
151
|
152
|
|
|
153
|
+ <text>意向楼盘</text>
|
|
154
|
+ <view className='FormLine flex-h'>
|
|
155
|
+ <view className='flex-item'>
|
|
156
|
+ <BuildingPicker change={BuildingChange} value={buildingId} type={personType} />
|
|
157
|
+ </view>
|
|
158
|
+ </view>
|
|
159
|
+
|
152
|
160
|
{
|
153
|
161
|
personType !== ROLE_CODE.CONSULTANT &&
|
154
|
162
|
<Block>
|
155
|
|
- <text>意向楼盘</text>
|
156
|
|
- <view className='FormLine flex-h'>
|
157
|
|
- <view className='flex-item'>
|
158
|
|
- <BuildingPicker change={BuildingChange} value={buildingId} type={personType} />
|
159
|
|
- </view>
|
160
|
|
- </view>
|
161
|
|
-
|
162
|
163
|
<text>内场接待(选填)</text>
|
163
|
164
|
<view className='FormLine flex-h'>
|
164
|
165
|
<view className='flex-item'>
|