lisenzhou 2 gadus atpakaļ
vecāks
revīzija
659e493462

+ 186
- 0
src/components/BuildingMultipleSelect/index.jsx Parādīt failu

@@ -0,0 +1,186 @@
1
+import Taro from "@tarojs/taro";
2
+import {
3
+  View,
4
+  Button,
5
+  CheckboxGroup,
6
+  Label,
7
+  Checkbox,
8
+} from "@tarojs/components";
9
+import { API_GET_AGENT_BUILDINGS, API_ITEMS_LIST } from "@/constants/api";
10
+import { ROLE_CODE } from "@/constants/user";
11
+import { useSelector } from "react-redux";
12
+import { fetch } from "@/utils/request";
13
+
14
+import { useState, useEffect, useMemo } from "react";
15
+import "./style.css";
16
+
17
+const wrapAnimate = "wrap wrapAnimate";
18
+const frameAnimate = "frame-wrapper";
19
+
20
+export default (props) => {
21
+  const { value, onChange, role } = props;
22
+
23
+  const city = useSelector((state) => state.city);
24
+  console.log(value, "==288888=");
25
+  const [dicts, setDicts] = useState([]);
26
+  const [visible, setVisible] = useState(false);
27
+  const [loading, setLoading] = useState(false);
28
+  // const [val, setVal] = useState({ buildingName: '意向楼盘' })
29
+  // const [buildingTitle, setBuildingTitle] = useState({ buildingName: '意向楼盘' })
30
+  const [buildingList, setBuildingList] = useState([]);
31
+
32
+  const buildingProp = useMemo(
33
+    () =>
34
+      (dicts || []).filter((x) => value?.find((y) => y === x.buildingId)) || [],
35
+    [value, dicts]
36
+  );
37
+  console.log(buildingProp, value, "buildingProp");
38
+  useEffect(() => {
39
+    setBuildingList(buildingProp);
40
+  }, [buildingProp]);
41
+
42
+  useEffect(() => {
43
+    setLoading(true);
44
+
45
+    if (
46
+      role !== ROLE_CODE.CUSTOMER &&
47
+      role !== ROLE_CODE.DRIFT &&
48
+      role !== ROLE_CODE.CONSULTANT &&
49
+      role !== ROLE_CODE.BROKER
50
+    ) {
51
+      fetch({ url: API_GET_AGENT_BUILDINGS })
52
+        .then((res) => {
53
+          setDicts(res || []);
54
+          setLoading(false);
55
+        })
56
+        .catch(() => setLoading(false));
57
+    } else {
58
+      fetch({
59
+        url: API_ITEMS_LIST,
60
+        payload: {
61
+          pageNumber: 1,
62
+          pageSize: 1000,
63
+          cityId: city.curCity.id,
64
+          isBroker: role === ROLE_CODE.BROKER,
65
+        },
66
+      })
67
+        .then((res) => {
68
+          setDicts(res.records);
69
+          setLoading(false);
70
+        })
71
+        .catch(() => setLoading(false));
72
+    }
73
+  }, [city.curCity.id, role]);
74
+
75
+  const handleSelect = (e) => {
76
+    console.log(e.detail.value);
77
+    // const buildingId = e.detail.value;
78
+    const building = dicts.filter((x) =>
79
+      e.detail.value?.find((y) => y === x.buildingId)
80
+    );
81
+
82
+    setBuildingList(building);
83
+  };
84
+  const handleSubmit = (e) => {
85
+    e.stopPropagation();
86
+    setVisible(false);
87
+
88
+    onChange(
89
+      buildingList.map((x) => x.buildingId),
90
+      buildingList
91
+    );
92
+  };
93
+
94
+  const handleCancel = () => {
95
+    setVisible(false);
96
+    setBuildingList((dicts || []).filter((x) => value?.find((y) => y === x.buildingId)) || []);
97
+    
98
+  };
99
+
100
+  return (
101
+    <view>
102
+      {visible ? (
103
+        <>
104
+          <view onClick={handleCancel} className={wrapAnimate}></view>
105
+          <view className={frameAnimate} catchMove>
106
+            <view className="frame">
107
+              {/* 标题  */}
108
+              <view className="title-wrapper">
109
+                <view>请选择</view>
110
+              </view>
111
+              {/* 内容 */}
112
+              <view style="overflow-x: hidden;">
113
+                <View className="page-section">
114
+                  <View className="radio-list">
115
+                    <scroll-view
116
+                      scrollY
117
+                      style={{ height: "40vh", overflow: "hidden" }}
118
+                      catchMove
119
+                    >
120
+                      {loading && "加载中..."}
121
+                      {!loading && (
122
+                        <CheckboxGroup
123
+                          className="radio-list__RadioGroup"
124
+                          onChange={handleSelect}
125
+                          onClick={(e) => e.stopPropagation()}
126
+                        >
127
+                          {dicts.map((item, i) => {
128
+                            return (
129
+                              <Label
130
+                                catchMove
131
+                                className="radio-list__label"
132
+                                for={`rdo-${i}`}
133
+                                key={i}
134
+                              >
135
+                                <view className="radio-list__text">
136
+                                  {item.buildingName}
137
+                                </view>
138
+
139
+                                <Checkbox
140
+                                  id={`rdo-${i}`}
141
+                                  catchMove
142
+                                  className="radio-list__radio"
143
+                                  value={item.buildingId}
144
+                                  checked={
145
+                                    !!buildingList.find((x) => item === x)
146
+                                  }
147
+                                ></Checkbox>
148
+                              </Label>
149
+                            );
150
+                          })}
151
+                        </CheckboxGroup>
152
+                      )}
153
+                    </scroll-view>
154
+                  </View>
155
+                </View>
156
+
157
+                {/* <view className='bottom-text' onClick={handleTextNext}> */}
158
+                <view style={{ display: "flex", margin: "2em auto" }}>
159
+                  <Button className="checkBtn" onClick={handleCancel}>
160
+                    取消
161
+                  </Button>
162
+                  <Button
163
+                    className="okBtn"
164
+                    // disabled={!current.buildingId}
165
+                    onClick={handleSubmit}
166
+                  >
167
+                    
168
+                    确定
169
+                  </Button>
170
+                </view>
171
+                {/* <view className='Btn'>
172
+                    <Button onClick={handleCancel} >取消</Button>
173
+                    <Button disabled={!val.buildingId} onClick={handleSubmit}>确定</Button>
174
+                  </view> */}
175
+              </view>
176
+            </view>
177
+          </view>
178
+        </>
179
+      ) : (
180
+        <View onClick={() => setVisible(true)}>
181
+          {buildingList?.length>0? buildingList?.map((x,index) => index===0? x.buildingName:`、${x.buildingName}`) : "请选择"}
182
+        </View>
183
+      )}
184
+    </view>
185
+  );
186
+};

+ 123
- 0
src/components/BuildingMultipleSelect/style.css Parādīt failu

@@ -0,0 +1,123 @@
1
+.wrapAnimate {
2
+  animation: wrapAnimate 0.2s ease forwards;
3
+}
4
+@keyframes wrapAnimate {
5
+  0% {
6
+  }
7
+  100% {
8
+    background: rgba(0, 0, 0, 0.35);
9
+  }
10
+}
11
+
12
+.frame-wrapper {
13
+  position: fixed;
14
+  height: 100vh;
15
+  width: 100vw;
16
+  z-index: 80;
17
+  top: 0;
18
+  left: 0;
19
+}
20
+.frame {
21
+  background: #fff;
22
+  position: absolute;
23
+
24
+  bottom: 0;
25
+  width: 100%;
26
+  padding: 2.9vw 2.9vw 0;
27
+  border-top-left-radius: 20px;
28
+  border-top-right-radius: 20px;
29
+  z-index: 85;
30
+  box-sizing: border-box;
31
+  align-items: center;
32
+  text-align: center;
33
+}
34
+
35
+.page-section {
36
+  padding-top: 1em;
37
+}
38
+.title-wrapper {
39
+  -webkit-justify-content: space-between;
40
+  -ms-flex-pack: justify;
41
+  justify-content: space-between;
42
+  text-align: center;
43
+  /* height: 28rpx; */
44
+  font-size: 35px;
45
+  font-weight: 700;
46
+  color: #202020;
47
+  /* margin-bottom: 5.9vw; */
48
+  /* margin: 1.5em auto; */
49
+  line-height: 80px;
50
+  padding-bottom: 2.9vw;
51
+
52
+  border-bottom: 1px solid rgba(99, 99, 99, 0.2);
53
+}
54
+.title-wrapper > image {
55
+  width: 3.5vw;
56
+  height: 3.5vw;
57
+  padding: 0 5vw;
58
+  margin-right: -5vw;
59
+}
60
+
61
+.wrap {
62
+  position: fixed;
63
+  z-index: 1;
64
+  top: 0;
65
+  left: 0;
66
+  right: 0;
67
+  bottom: 0;
68
+}
69
+
70
+.checkBtn {
71
+  display: inline-block;
72
+
73
+  width: 35%;
74
+  text-align: center;
75
+  font-size: 32px;
76
+  line-height: 92px;
77
+  background: #ffff;
78
+  color: #193c83;
79
+  font-weight: bold;
80
+  border-radius: 92px;
81
+  border: #193c83 1px solid;
82
+}
83
+
84
+.okBtn {
85
+  width: 35%;
86
+  text-align: center;
87
+  font-size: 32px;
88
+  line-height: 92px;
89
+  background: #193c83;
90
+  color: #fff;
91
+  font-weight: bold;
92
+  border-radius: 92px;
93
+}
94
+.radio-list__label {
95
+  display: flex;
96
+  align-items: center;
97
+  margin: 1.5em auto;
98
+}
99
+.Btn {
100
+  padding: 40px;
101
+  position: relative;
102
+  overflow: hidden;
103
+}
104
+button {
105
+  /* display: block; */
106
+  text-align: center;
107
+  font-size: 32px;
108
+  line-height: 92px;
109
+  background: #193c83;
110
+  color: #fff;
111
+  font-weight: bold;
112
+  border-radius: 92px;
113
+}
114
+.radio-list__radio {
115
+  display: flex;
116
+}
117
+.radio-list__text {
118
+  width: 100%;
119
+  align-items: center;
120
+  color: #000;
121
+  position: relative;
122
+  left: 24px;
123
+}

+ 251
- 129
src/pages/mine/addCustomer/index.jsx Parādīt failu

@@ -1,196 +1,318 @@
1
-import { useState, useEffect } from 'react'
2
-import withLayout from '@/layout'
3
-import { ScrollView, Input, Image, Block, View, Button } from '@tarojs/components'
4
-import '@/assets/css/iconfont.css'
5
-import { fetch } from '@/utils/request'
6
-import BuildingSelect from '@/components/BuildingSelect'
7
-
8
-import { API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
9
-import { ROLE_CODE } from '@/constants/user'
10
-import Taro from '@tarojs/taro'
11
-import Picker from '@/components/Picker'
1
+import { useState, useEffect } from "react";
2
+import withLayout from "@/layout";
3
+import {
4
+  ScrollView,
5
+  Input,
6
+  Image,
7
+  Block,
8
+  View,
9
+  Button,
10
+} from "@tarojs/components";
11
+import "@/assets/css/iconfont.css";
12
+import { fetch } from "@/utils/request";
13
+import BuildingSelect from "@/components/BuildingSelect";
14
+import BuildingMultipleSelect from "@/components/BuildingMultipleSelect";
15
+import { API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from "@/constants/api";
16
+import { ROLE_CODE } from "@/constants/user";
17
+import Taro from "@tarojs/taro";
18
+import Picker from "@/components/Picker";
12 19
 // import BuildingPicker from './components/BuildingPicker'
13
-import ConsultantPicker from './components/ConsultantPicker'
20
+import ConsultantPicker from "./components/ConsultantPicker";
14 21
 
15
-import './index.scss'
22
+import "./index.scss";
16 23
 
17
-
18
-const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
24
+const defaultSpecialImage =
25
+  "https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg";
19 26
 
20 27
 const sexDicts = [
21
-  { name: '男', id: '1' },
22
-  { name: '女', id: '2' },
23
-]
28
+  { name: "男", id: "1" },
29
+  { name: "女", id: "2" },
30
+];
24 31
 
25 32
 export default withLayout((props) => {
26
-  const { router, person } = props
27
-  const { personId, personType } = person
28
-  const { buildingId: originBuiding } = router.params
29
-
30
-  const [loading, setLoading] = useState(false)
31
-  const [buildingId, setBuildingId] = useState(null)
32
-  const [CardId, setCardId] = useState(null)
33
-  const [SexId, setSexId] = useState(null)
33
+  const { router, person } = props;
34
+  const { personId, personType } = person;
35
+  const { buildingId: originBuiding } = router.params;
36
+
37
+  const [loading, setLoading] = useState(false);
38
+  const [buildingId, setBuildingId] = useState(null);
39
+  const [buildingIdList, setBuildingIdList] = useState([]);
40
+  const [CardId, setCardId] = useState(null);
41
+  const [SexId, setSexId] = useState(null);
34 42
   const [FormData, setFormData] = useState({
35
-    name: '', // 姓名
36
-    phone: '', // 电话
37
-    sex: '', // 性别
38
-    intention: '', // 意向楼盘
39
-    realtyConsultant: '', // 置业顾问
40
-    remark: '', // 描述
41
-  })
43
+    name: "", // 姓名
44
+    phone: "", // 电话
45
+    sex: "", // 性别
46
+    intention: "", // 意向楼盘
47
+    realtyConsultant: "", // 置业顾问
48
+    remark: "", // 描述
49
+  });
42 50
 
43 51
   useEffect(() => {
44
-    console.log('------originBuiding------>', originBuiding)
52
+    console.log("------originBuiding------>", originBuiding);
45 53
     if (originBuiding) {
46
-      setBuildingId(originBuiding)
54
+      if (personType === ROLE_CODE.BROKER) {
55
+        setBuildingIdList([originBuiding]);
56
+      } else {
57
+        setBuildingId(originBuiding);
58
+      }
47 59
     }
48
-  }, [originBuiding])
60
+  }, [originBuiding]);
49 61
 
50 62
   const preSubmit = (payload) => {
51
-    if (payload.name === '') {
52
-      Taro.showToast({ title: '请填写客户姓名', icon: 'none' })
53
-      return false
63
+    if (payload.name === "") {
64
+      Taro.showToast({ title: "请填写客户姓名", icon: "none" });
65
+      return false;
54 66
     }
55 67
     if (SexId === null) {
56
-      Taro.showToast({ title: '请选择客户性别', icon: 'none' })
57
-      return false
58
-    }
59
-    if (payload.phone === '') {
60
-      Taro.showToast({ title: '请填写客户电话', icon: 'none' })
61
-      return false
68
+      Taro.showToast({ title: "请选择客户性别", icon: "none" });
69
+      return false;
62 70
     }
63
-    if (!(/^1[3|4|5|6|7|8|9][0-9]\d{4,8}$/.test(payload.phone)) || payload.phone.length != 11) {
64
-      Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
65
-      return false
71
+    if (payload.phone === "") {
72
+      Taro.showToast({ title: "请填写客户电话", icon: "none" });
73
+      return false;
66 74
     }
67
-    if (buildingId === null) {
68
-      Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
69
-      return false
75
+    if (
76
+      !/^1[3|4|5|6|7|8|9][0-9]\d{4,8}$/.test(payload.phone) ||
77
+      payload.phone.length != 11
78
+    ) {
79
+      Taro.showToast({ title: "请填写正确的客户电话", icon: "none" });
80
+      return false;
70 81
     }
71
-    if (buildingId === null && personType !== ROLE_CODE.CUSTOMER) {
72
-      Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
73
-      return false
82
+    if (personType === ROLE_CODE.BROKER) {
83
+      if (buildingIdList?.length == 0) {
84
+        Taro.showToast({ title: "请选择客户的意向楼盘", icon: "none" });
85
+        return false;
86
+      }
87
+    } else {
88
+      if (buildingId === null) {
89
+        Taro.showToast({ title: "请选择客户的意向楼盘", icon: "none" });
90
+        return false;
91
+      }
92
+      if (buildingId === null && personType !== ROLE_CODE.CUSTOMER) {
93
+        Taro.showToast({ title: "请选择客户的意向楼盘", icon: "none" });
94
+        return false;
95
+      }
74 96
     }
75 97
 
76
-    return true
77
-  }
98
+    return true;
99
+  };
100
+  // return new Promise((resovle, reject) => {
101
+  //   Taro.showLoading()
102
+  //   queryChatHistory({
103
+  //     chatWith: friend,
104
+  //     pageSize: 20,
105
+  //     ...params || {},
106
+  //   }).then((res) => {
107
+  //     const { records } = res;
108
+  //     Taro.hideLoading()
109
+
110
+  //     const lst = (records || []).reverse()
111
+  //     resovle(lst)
112
+  //   }).catch(() => {
113
+  //     Taro.hideLoading()
114
+  //   })
115
+  // })
116
+  const submitFetch = (url, payload) => {
117
+
118
+    return new Promise((resovle, reject) => {
78 119
 
79
-  const onSubmit = () => {
120
+      fetch({ url, method: "post", payload })
121
+        .then(() => {
122
+          console.log("success");
123
+          resovle("success");
124
+
125
+        })
126
+        .catch(() => {
127
+         
128
+          reject("fail");
129
+
130
+        });
131
+    });
132
+  };
133
+  const onSubmit = async () => {
80 134
     const payload = {
81 135
       ...FormData,
82 136
       sex: SexId,
83
-      buildingId,
84
-      realtyConsultant: CardId
137
+      realtyConsultant: CardId,
85 138
     };
86 139
 
87 140
     if (!preSubmit(payload)) {
88 141
       return;
89 142
     }
90 143
 
91
-    setLoading(true)
92
-    let url = null
93
-    if (personType === ROLE_CODE.CONSULTANT || personType === ROLE_CODE.CUSTOMER || personType === ROLE_CODE.BROKER) {
144
+    setLoading(true);
145
+    let url = null;
146
+    if (
147
+      personType === ROLE_CODE.CONSULTANT ||
148
+      personType === ROLE_CODE.CUSTOMER ||
149
+      personType === ROLE_CODE.BROKER
150
+    ) {
94 151
       // url = API_REPORT_CUETOMER
95
-      url = API_USER_ADD_CUSTOMER
152
+      url = API_USER_ADD_CUSTOMER;
96 153
     } else if (personType === ROLE_CODE.CHANNEL_AGENT) {
97
-      url = API_CHANNEL_REPORT
154
+      url = API_CHANNEL_REPORT;
98 155
     } else if (personType === ROLE_CODE.CUSTOMER) {
99 156
       // url = API_USER_ADD_CUSTOMER
100 157
     }
101
-    fetch({ url, method: 'post', payload }).then(() => {
102
-      setLoading(false)
103
-      Taro.showToast({ title: '操作成功', icon: 'none' })
104
-
105
-      const t = setTimeout(() => {
106
-        Taro.navigateBack({ delta: 1 })
107
-        clearTimeout(t)
108
-      }, 1500)
109
-    }).catch(() => {
110
-      setLoading(false)
111
-    })
112
-  }
113 158
 
114
-  const FormInput = (e) => {
115
-    let Data = { ...FormData }
116
-    Data[e.currentTarget.dataset.type] = e.detail.value
117
-    setFormData(Data)
118
-  }
159
+    if (personType === ROLE_CODE.BROKER) {
160
+      Promise.all(
161
+        buildingIdList.map((x) => {
162
+          return submitFetch(url, { ...payload, buildingId: x });
163
+        })
164
+      )
165
+        .then((res) => {
166
+          setLoading(false);
167
+          Taro.showToast({ title: "操作成功", icon: "none" });
119 168
 
120
-  const handleBuildingSelect = (bid, building) => {
121
-    console.log("🚀 ~ file: index.jsx ~ line 121 ~ handleBuildingSelect ~ building", building)
122
-    setBuildingId(bid)
123
-    // setBuildingId(building.buildingId)
124
-  }
125
-console.log(personType === ROLE_CODE.CONSULTANT || ROLE_CODE.CUSTOMER,'===')
126
-  return (
127
-    <view className='Page addCustomer'>
169
+          const t = setTimeout(() => {
170
+            Taro.navigateBack({ delta: 1 });
171
+            clearTimeout(t);
172
+          }, 1500);
173
+        })
174
+        .catch(() => {
175
+          setLoading(false);
176
+        });
177
+    } else {
178
+      try {
179
+        const res = await submitFetch(url, { ...payload, buildingId });
180
+        setLoading(false);
181
+        Taro.showToast({ title: "操作成功", icon: "none" });
128 182
 
183
+        const t = setTimeout(() => {
184
+          Taro.navigateBack({ delta: 1 });
185
+          clearTimeout(t);
186
+        }, 1500);
187
+      } catch (error) {
188
+        setLoading(false);
189
+      }
190
+    }
191
+  };
192
+
193
+  const FormInput = (e) => {
194
+    let Data = { ...FormData };
195
+    Data[e.currentTarget.dataset.type] = e.detail.value;
196
+    setFormData(Data);
197
+  };
129 198
 
130
-      <ScrollView scroll-y refresher-enabled={false} refresher-background='#fff'>
131
-        <view className='PageContent'>
199
+  const handleBuildingSelect = (bid, building) => {
200
+    console.log(
201
+      "🚀 ~ file: index.jsx ~ line 121 ~ handleBuildingSelect ~ building",
202
+      building
203
+    );
204
+    if (personType === ROLE_CODE.BROKER) {
205
+      setBuildingIdList(bid);
206
+    } else {
207
+      setBuildingId(bid);
208
+    }
209
+  };
132 210
 
211
+  return (
212
+    <view className="Page addCustomer">
213
+      <ScrollView
214
+        scroll-y
215
+        refresher-enabled={false}
216
+        refresher-background="#fff"
217
+      >
218
+        <view className="PageContent">
133 219
           <text>客户姓名</text>
134
-          <view className='FormLine flex-h'>
135
-            <view className='flex-item'>
136
-              <Input placeholder='请输入客户真实姓名' data-type='name' onInput={FormInput.bind(this)}></Input>
220
+          <view className="FormLine flex-h">
221
+            <view className="flex-item">
222
+              <Input
223
+                placeholder="请输入客户真实姓名"
224
+                data-type="name"
225
+                onInput={FormInput.bind(this)}
226
+              ></Input>
137 227
             </view>
138 228
           </view>
139 229
 
140 230
           <text>客户电话</text>
141
-          <view className='FormLine flex-h'>
142
-            <view className='flex-item'>
143
-              <Input placeholder='请输入手机号' data-type='phone' onInput={FormInput.bind(this)}></Input>
231
+          <view className="FormLine flex-h">
232
+            <view className="flex-item">
233
+              <Input
234
+                placeholder="请输入手机号"
235
+                data-type="phone"
236
+                onInput={FormInput.bind(this)}
237
+              ></Input>
144 238
             </view>
145 239
           </view>
146 240
 
147 241
           <text>性别</text>
148
-          <view className='FormLine flex-h'>
149
-            <view className='flex-item'>
150
-              <Picker kv={['name', 'id']} dicts={sexDicts} onChange={setSexId} value={SexId} />
242
+          <view className="FormLine flex-h">
243
+            <view className="flex-item">
244
+              <Picker
245
+                kv={["name", "id"]}
246
+                dicts={sexDicts}
247
+                onChange={setSexId}
248
+                value={SexId}
249
+              />
151 250
             </view>
152 251
             {/* <text className='iconfont icon-jiantoudown'></text> */}
153 252
           </view>
154 253
 
155 254
           <text>意向楼盘</text>
156
-          <view className='FormLine flex-h'>
157
-            <view className='flex-item'>
255
+          <view className="FormLine flex-h">
256
+            <view className="flex-item">
158 257
               {/* <BuildingPicker change={BuildingChange} value={buildingId} type={personType} /> */}
159 258
               {/* <View onClick={() => setShowFrame(true)} >{buildingName}</View> */}
160
-              <BuildingSelect value={buildingId} onChange={handleBuildingSelect} role={personType} />
259
+              {personType === ROLE_CODE.BROKER ? (
260
+                <BuildingMultipleSelect
261
+                  value={buildingIdList}
262
+                  onChange={handleBuildingSelect}
263
+                  role={personType}
264
+                />
265
+              ) : (
266
+                <BuildingSelect
267
+                  value={buildingId}
268
+                  onChange={handleBuildingSelect}
269
+                  role={personType}
270
+                />
271
+              )}
161 272
             </view>
162 273
           </view>
163 274
 
164
-          {
165
-            personType === ROLE_CODE.CONSULTANT || ROLE_CODE.CUSTOMER ?
166
-              <Block>
167
-                <text>内场接待(选填)</text>
168
-                <view className='FormLine flex-h'>
169
-                  <view className='flex-item'>
170
-                    <ConsultantPicker onChange={setCardId} value={CardId} buildingId={buildingId} />
275
+          {personType === ROLE_CODE.CONSULTANT || ROLE_CODE.CUSTOMER ? (
276
+            <Block>
277
+              {
278
+               personType !== ROLE_CODE.BROKER&& <>
279
+                  <text>内场接待(选填)</text>
280
+                  <view className="FormLine flex-h">
281
+                    <view className="flex-item">
282
+                      <ConsultantPicker
283
+                        onChange={setCardId}
284
+                        value={CardId}
285
+                        buildingId={buildingId}
286
+                      />
287
+                    </view>
171 288
                   </view>
172
-                  {/* <Image mode='heightFix' src={defaultSpecialImage}></Image>
173
-                <text>选择</text> */}
174
-                </view>
289
+                </>
290
+              }
175 291
 
176
-                <text>备注</text>
177
-                <view className='FormLine flex-h'>
178
-                  <view className='flex-item'>
179
-                    {
180
-                      //解决事件穿透
181
-                      <Input placeholder='补充说明(选填)' dataType='remark' onInput={FormInput.bind(this)}></Input>
182
-                    }
183
-                  </view>
292
+              <text>备注</text>
293
+              <view className="FormLine flex-h">
294
+                <view className="flex-item">
295
+                  {
296
+                    //解决事件穿透
297
+                    <Input
298
+                      placeholder="补充说明(选填)"
299
+                      dataType="remark"
300
+                      onInput={FormInput.bind(this)}
301
+                    ></Input>
302
+                  }
184 303
                 </view>
185
-              </Block> : ''
186
-          }
187
-          <view className='Btn'>
188
-            <Button loading={loading} onClick={onSubmit}>提交</Button>
304
+              </view>
305
+            </Block>
306
+          ) : (
307
+            ""
308
+          )}
309
+          <view className="Btn">
310
+            <Button loading={loading} onClick={onSubmit}>
311
+              提交
312
+            </Button>
189 313
           </view>
190
-
191 314
         </view>
192 315
       </ScrollView>
193
-
194 316
     </view>
195
-  )
196
-})
317
+  );
318
+});