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.
 
 
 

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