You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

448 lines
11 KiB

  1. <template>
  2. <view class="box">
  3. <!-- 编辑 -->
  4. <view class="conmsg">
  5. <view class="conmsg-title">
  6. 客户信息
  7. </view>
  8. <view class="conmsg-msg">
  9. <view class="conmsg-msg-lab">
  10. <view class="conmsg-msg-lab-1">
  11. 客户姓名
  12. <view class="star">
  13. *
  14. </view>
  15. </view>
  16. <view class="conmsg-msg-lab-inp">
  17. <input type="text" placeholder="请输入客户姓名" placeholder-style="color:#B2B2B2;" v-model="form.name"/>
  18. </view>
  19. </view>
  20. <view class="conmsg-msg-lab">
  21. <view class="conmsg-msg-lab-1">
  22. 客户性别
  23. </view>
  24. <view class="conmsg-msg-lab-inp" style="margin-top: 20rpx;">
  25. <!-- <u-radio-group v-model="form.sex" >
  26. <view style="display: flex;">
  27. <u-radio name="1" shape='circle'>男</u-radio>
  28. <u-radio name="2" shape='circle'>女</u-radio>
  29. </view>
  30. </u-radio-group> -->
  31. <view style="border: none; display: flex;">
  32. <view class="sexchose" @click="form.sex=1" :style="{border:form.sex==1?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
  33. </view>
  34. <view class="sexchose" @click="form.sex=2" :style="{border:form.sex==2?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="conmsg-msg-lab">
  40. <view class="conmsg-msg-lab-1">
  41. 联系电话
  42. <view class="star">
  43. *
  44. </view>
  45. </view>
  46. <view class="conmsg-msg-lab-inp">
  47. <input type="number" placeholder="请输入联系电话" placeholder-style="color:#B2B2B2;" maxlength="11" v-model="form.phone"/>
  48. </view>
  49. </view>
  50. <view class="conmsg-msg-lab">
  51. <view class="conmsg-msg-lab-1">
  52. 微信账号
  53. </view>
  54. <view class="conmsg-msg-lab-inp">
  55. <input type="text" placeholder="请输入微信账号" placeholder-style="color:#B2B2B2;" v-model="form.chatNo"/>
  56. </view>
  57. </view>
  58. <view class="conmsg-msg-lab">
  59. <view class="conmsg-msg-lab-1">
  60. 客户等级
  61. </view>
  62. <view class="conmsg-msg-lab-inp">
  63. <input type="text" placeholder="请选择客户等级" @click="levelshow = true" v-model="selectform.level" disabled/>
  64. </view>
  65. <view class="conmsg-msg-lab-img">
  66. <image class="screen-sel-img" src="../../../static/images/right.png" mode=""></image>
  67. </view>
  68. </view>
  69. <!-- <view class="conmsg-msg-lab">
  70. <view class="conmsg-msg-lab-1">
  71. 客户阶段
  72. </view>
  73. <view class="conmsg-msg-lab-inp">
  74. <input type="text" placeholder="请选择客户阶段" @click="stageshow = true" v-model="selectform.stage" disabled/>
  75. </view>
  76. <view class="conmsg-msg-lab-img">
  77. <image class="screen-sel-img" src="../../../static/images/right.png" mode=""></image>
  78. </view>
  79. </view> -->
  80. <view class="conmsg-msg-lab" style="border: none;">
  81. <view class="conmsg-msg-lab-1">
  82. 备注内容
  83. </view>
  84. <view class="conmsg-msg-lab-inp">
  85. <input type="text" placeholder="请输入备注内容" placeholder-style="color:#B2B2B2;" v-model="form.remarks"/>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="conmsg" v-if="allList.length!=0">
  91. <view class="conmsg-title">
  92. 客户标签
  93. </view>
  94. <view class="conmsg-msg">
  95. <view v-for="(item,index) in allList" :key="index">
  96. <view class="">
  97. <view class="conmsg-msg-lab" style="border: none;">
  98. <view class="conmsg-msg-lab-1">
  99. {{item.name}}
  100. </view>
  101. </view>
  102. <view class="con-msg-con" :style="{borderBottom:index==allList.length-1?'none':'1px solid #E0E0E0'}">
  103. <view v-for="(item1,i) in item.children" :key="index" @click="Edittag(item,item1,index,i)" :style="{border:item1.selected==0?'1px solid #0A6EE9':'1px solid #E0E0E0'}" class="chebox" >
  104. {{item1.label}}
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="submit">
  112. <view class="btn" @click="submit">
  113. 确定
  114. </view>
  115. </view>
  116. <view class="" style="height: 220rpx;" >
  117. <!-- :style="{marginTop:allList.length!=0?'0':'500rpx'}" -->
  118. </view>
  119. <!-- 客户等级 -->
  120. <u-select v-model="levelshow" :list="levellist" @confirm="levelshowCallback"></u-select>
  121. <!-- 客户阶段 -->
  122. <!-- <u-select v-model="stageshow" :list="stagelist" @confirm="stageshowCallback"></u-select> -->
  123. <!-- 职业需求 -->
  124. <!-- <u-select v-model="demandshow" :list="demandlist" @confirm="demandshowCallback"></u-select> -->
  125. <!-- 意向面积 -->
  126. <!-- <u-select v-model="areashow" :list="arealist" @confirm="areashowCallback"></u-select> -->
  127. <!-- 预算 -->
  128. <!-- <u-select v-model="budgetshow" :list="budgetlist" @confirm="budgetshowCallback"></u-select> -->
  129. <!-- 关注点 -->
  130. <!-- <u-select v-model="fouceshow" :list="foucelist" @confirm="fouceshowCallback"></u-select> -->
  131. <!-- 客户来源 -->
  132. <!-- <u-select v-model="soureshow" :list="sourelist" @confirm="soureshowCallback"></u-select> -->
  133. </view>
  134. </template>
  135. <script>
  136. export default{
  137. data(){
  138. return{
  139. form:{
  140. name:'',
  141. sex:'1',
  142. phone:'',
  143. chatNo:'',
  144. level:'',
  145. remarks:'',
  146. },
  147. selectform:{
  148. level:'',
  149. stage:'',
  150. demand:'',
  151. area:'',
  152. budget:'',
  153. fouce:'',
  154. soure:'',
  155. },
  156. levelshow:false,
  157. customerId:'',
  158. // 等级
  159. levellist:[
  160. {
  161. value:1,
  162. label:'A'
  163. },
  164. {
  165. value:2,
  166. label:'B'
  167. },
  168. {
  169. value:3,
  170. label:'C'
  171. },
  172. {
  173. value:4,
  174. label:'D'
  175. },
  176. ],
  177. allList:[],
  178. // stagelist:[],
  179. // // 置业需求
  180. // demandlist:[],
  181. // // 意向面积
  182. // arealist:[],
  183. // // 预算
  184. // budgetlist:[],
  185. // // 关注点
  186. // foucelist:[],
  187. // // 客户来源
  188. // sourelist:[],
  189. }
  190. },
  191. onLoad(e) {
  192. console.log(e)
  193. // 先调用借口查询数据
  194. this.customerId=e.id
  195. this.getdetail()
  196. },
  197. methods:{
  198. Edittag(item,item1,index,i){
  199. // var selected='';
  200. // console.log(item,item1,index,i)
  201. // return
  202. if(this.allList[index].children[i].selected==0){
  203. this.allList[index].children[i].selected=1;
  204. }else{
  205. this.allList[index].children[i].selected=0;
  206. }
  207. this.$forceUpdate()
  208. // this.$u.post("/matchKeywords/updatePersonalMatchData", {
  209. // carId: this.customerId,
  210. // selected:selected,
  211. // name:chend.name,
  212. // pid:chend.pid,
  213. // level:chend.level,
  214. // endName:chend.endName,
  215. // keywordsId:chend.keywordsId
  216. // }).then(res => {
  217. // })
  218. },
  219. sourecheck(index){
  220. this.sourelist[index].checked=!this.sourelist[index].checked
  221. this.$forceUpdate()
  222. },
  223. demandcheck(index){
  224. this.demandlist[index].checked=!this.demandlist[index].checked
  225. this.$forceUpdate()
  226. },
  227. areacheck(index){
  228. this.arealist[index].checked=!this.arealist[index].checked
  229. this.$forceUpdate()
  230. },
  231. levelshowCallback(e){
  232. this.selectform.level=e[0].label
  233. this.form.level=e[0].value
  234. },
  235. // 获取用户数据
  236. getdetail(){
  237. this.$u.get("customer/findById?",{id:this.customerId})
  238. .then(res=>{
  239. // console.log(res)
  240. this.form=res
  241. // 给客户等级赋值
  242. let idx= this.levellist.findIndex(item=>item.value==res.level)
  243. if(idx!=-1){
  244. this.selectform.level=this.levellist[idx].label
  245. }
  246. // 获取置业需求
  247. this.getListByType()
  248. // // 获取意向面积
  249. // this.getListByType()
  250. // // 获取客户来源
  251. // this.getListByType()
  252. })
  253. },
  254. // 字典表接口
  255. getListByType(){
  256. this.$u.get("/matchKeywords/findPersonalMatchData",{customerId:this.customerId})
  257. .then(res=>{
  258. // console.log(res)
  259. res.forEach(item1=>{
  260. item1.children.map(item=>{
  261. if(item.isInterval==0){
  262. item.label=item.name+item.unit+'-'+item.endName+item.unit;
  263. }else{
  264. item.label=item.name
  265. }
  266. item.value=item.id;
  267. })
  268. })
  269. // console.log(res)
  270. this.allList=res
  271. // return
  272. })
  273. },
  274. // 提交
  275. submit(){
  276. let param={}
  277. let str=[]
  278. if(this.form.name==''){
  279. uni.showToast({
  280. title:'请输入客户姓名',
  281. icon:'none'
  282. })
  283. return
  284. }
  285. if(this.form.phone==''){
  286. uni.showToast({
  287. title:'请输入手机号',
  288. icon:'none'
  289. })
  290. return
  291. }
  292. if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){
  293. uni.showToast({
  294. title: "请检查手机号码格式",
  295. icon:'none'
  296. });
  297. // this.form.phone=''
  298. return false;
  299. }
  300. this.allList.map(item=>{
  301. item.children.map(item1=>{
  302. if(item1.selected==0){
  303. str.push(item1.keywordsId)
  304. }
  305. })
  306. })
  307. str=str.join(',')
  308. param=this.form
  309. param.keywordIds=str
  310. console.log(param)
  311. // return
  312. this.$u.post("customer/update",param)
  313. .then(res=>{
  314. // console.log(res)
  315. uni.showToast({
  316. title:'操作成功',
  317. icon:'none',
  318. success: () => {
  319. uni.navigateBack()
  320. }
  321. })
  322. })
  323. },
  324. }
  325. }
  326. </script>
  327. <style lang="scss" scoped>
  328. .box {
  329. width: 100%;
  330. height: 100%;
  331. background: #F8F8F8;
  332. overflow: hidden;
  333. }
  334. .conmsg{
  335. background: #FFFFFF;
  336. margin-top: 20rpx;
  337. .conmsg-title{
  338. height: 92rpx;
  339. line-height: 92rpx;
  340. font-weight: bold;
  341. padding: 0 30rpx;
  342. // font-weight: 500;
  343. color: #303030;
  344. font-size: 32rpx;
  345. border-bottom: 1px solid #E0E0E0;
  346. }
  347. .conmsg-msg{
  348. padding: 0 30rpx;
  349. .conmsg-msg-lab{
  350. height: 102rpx;
  351. display: flex;
  352. font-size: 30rpx;
  353. font-weight: 400;
  354. color: #333333;
  355. border-bottom: 1px solid #E0E0E0;
  356. line-height: 102rpx;
  357. .conmsg-msg-lab-1{
  358. display: flex;
  359. width: 136rpx;
  360. .star{
  361. color: #E7483C;
  362. line-height: 108rpx;
  363. }
  364. }
  365. .conmsg-msg-lab-inp{
  366. margin-top: 30rpx;
  367. margin-left: 44rpx;
  368. }
  369. .conmsg-msg-lab-img{
  370. width: 14rpx;
  371. height: 30rpx;
  372. margin-top: 6rpx;
  373. margin-left: auto;
  374. image{
  375. width: 100%;
  376. height: 100%;
  377. }
  378. }
  379. }
  380. }
  381. }
  382. .submit{
  383. position: fixed;
  384. bottom: 20rpx;
  385. left: 20rpx;
  386. height: 120rpx;
  387. background: #FFFFFF;
  388. .btn{
  389. // margin: 60rpx auto;
  390. text-align: center;
  391. width: 690rpx;
  392. height: 88rpx;
  393. background: #2671E2;
  394. border-radius: 8rpx;
  395. font-size: 32tpx;
  396. font-weight: 400;
  397. color: #FFFFFF;
  398. line-height: 88rpx;
  399. }
  400. }
  401. .con-msg-con{
  402. display: flex;
  403. flex-wrap: wrap;
  404. // justify-content: space-around;
  405. border-bottom: 1px solid #E0E0E0;
  406. padding-bottom: 16rpx;
  407. .chebox{
  408. // width: 20%;
  409. height: 60rpx;
  410. line-height: 60rpx;
  411. // margin: 10rpx 0;
  412. margin-bottom: 25rpx;
  413. margin-right: 20rpx;
  414. border: 1px solid #E0E0E0;
  415. box-sizing: border-box;
  416. padding: 0 10rpx;
  417. }
  418. }
  419. .sexchose{
  420. width: 120rpx;
  421. height: 60rpx;
  422. background: #FFFFFF;
  423. border-radius: 4rpx;
  424. border: 1px solid #E0E0E0;
  425. text-align: center;
  426. line-height: 60rpx;
  427. margin-right: 20rpx;
  428. }
  429. </style>