Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

454 řádky
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 :disabled="dataCode!=6" 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. dataCode:''
  179. // stagelist:[],
  180. // // 置业需求
  181. // demandlist:[],
  182. // // 意向面积
  183. // arealist:[],
  184. // // 预算
  185. // budgetlist:[],
  186. // // 关注点
  187. // foucelist:[],
  188. // // 客户来源
  189. // sourelist:[],
  190. }
  191. },
  192. onLoad(e) {
  193. const {
  194. dataCode
  195. } = uni.getStorageSync("weapp_session_userInfo_data");
  196. this.dataCode=dataCode
  197. console.log(e)
  198. // 先调用借口查询数据
  199. this.customerId=e.id
  200. this.getdetail()
  201. },
  202. methods:{
  203. Edittag(item,item1,index,i){
  204. // var selected='';
  205. // console.log(item,item1,index,i)
  206. // return
  207. if(this.allList[index].children[i].selected==0){
  208. this.allList[index].children[i].selected=1;
  209. }else{
  210. this.allList[index].children[i].selected=0;
  211. }
  212. this.$forceUpdate()
  213. // this.$u.post("/matchKeywords/updatePersonalMatchData", {
  214. // carId: this.customerId,
  215. // selected:selected,
  216. // name:chend.name,
  217. // pid:chend.pid,
  218. // level:chend.level,
  219. // endName:chend.endName,
  220. // keywordsId:chend.keywordsId
  221. // }).then(res => {
  222. // })
  223. },
  224. sourecheck(index){
  225. this.sourelist[index].checked=!this.sourelist[index].checked
  226. this.$forceUpdate()
  227. },
  228. demandcheck(index){
  229. this.demandlist[index].checked=!this.demandlist[index].checked
  230. this.$forceUpdate()
  231. },
  232. areacheck(index){
  233. this.arealist[index].checked=!this.arealist[index].checked
  234. this.$forceUpdate()
  235. },
  236. levelshowCallback(e){
  237. this.selectform.level=e[0].label
  238. this.form.level=e[0].value
  239. },
  240. // 获取用户数据
  241. getdetail(){
  242. this.$u.get("customer/findById?",{id:this.customerId})
  243. .then(res=>{
  244. // console.log(res)
  245. this.form=res
  246. // 给客户等级赋值
  247. let idx= this.levellist.findIndex(item=>item.value==res.level)
  248. if(idx!=-1){
  249. this.selectform.level=this.levellist[idx].label
  250. }
  251. // 获取置业需求
  252. this.getListByType()
  253. // // 获取意向面积
  254. // this.getListByType()
  255. // // 获取客户来源
  256. // this.getListByType()
  257. })
  258. },
  259. // 字典表接口
  260. getListByType(){
  261. this.$u.get("/matchKeywords/findPersonalMatchData",{customerId:this.customerId})
  262. .then(res=>{
  263. // console.log(res)
  264. res.forEach(item1=>{
  265. item1.children.map(item=>{
  266. if(item.isInterval==0){
  267. item.label=item.name+item.unit+'-'+item.endName+item.unit;
  268. }else{
  269. item.label=item.name
  270. }
  271. item.value=item.id;
  272. })
  273. })
  274. // console.log(res)
  275. this.allList=res
  276. // return
  277. })
  278. },
  279. // 提交
  280. submit(){
  281. let param={}
  282. let str=[]
  283. if(this.form.name==''){
  284. uni.showToast({
  285. title:'请输入客户姓名',
  286. icon:'none'
  287. })
  288. return
  289. }
  290. if(this.form.phone==''){
  291. uni.showToast({
  292. title:'请输入手机号',
  293. icon:'none'
  294. })
  295. return
  296. }
  297. if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){
  298. uni.showToast({
  299. title: "请检查手机号码格式",
  300. icon:'none'
  301. });
  302. // this.form.phone=''
  303. return false;
  304. }
  305. this.allList.map(item=>{
  306. item.children.map(item1=>{
  307. if(item1.selected==0){
  308. str.push(item1.keywordsId)
  309. }
  310. })
  311. })
  312. str=str.join(',')
  313. param=this.form
  314. param.keywordIds=str
  315. console.log(param)
  316. // return
  317. this.$u.post("customer/update",param)
  318. .then(res=>{
  319. // console.log(res)
  320. uni.showToast({
  321. title:'操作成功',
  322. icon:'none',
  323. success: () => {
  324. uni.navigateBack()
  325. }
  326. })
  327. })
  328. },
  329. }
  330. }
  331. </script>
  332. <style lang="scss" scoped>
  333. .box {
  334. width: 100%;
  335. height: 100%;
  336. background: #F8F8F8;
  337. overflow: hidden;
  338. }
  339. .conmsg{
  340. background: #FFFFFF;
  341. margin-top: 20rpx;
  342. .conmsg-title{
  343. height: 92rpx;
  344. line-height: 92rpx;
  345. font-weight: bold;
  346. padding: 0 30rpx;
  347. // font-weight: 500;
  348. color: #303030;
  349. font-size: 32rpx;
  350. border-bottom: 1px solid #E0E0E0;
  351. }
  352. .conmsg-msg{
  353. padding: 0 30rpx;
  354. .conmsg-msg-lab{
  355. height: 102rpx;
  356. display: flex;
  357. font-size: 30rpx;
  358. font-weight: 400;
  359. color: #333333;
  360. border-bottom: 1px solid #E0E0E0;
  361. line-height: 102rpx;
  362. .conmsg-msg-lab-1{
  363. display: flex;
  364. min-width: 136rpx;
  365. .star{
  366. color: #E7483C;
  367. line-height: 108rpx;
  368. }
  369. }
  370. .conmsg-msg-lab-inp{
  371. margin-top: 30rpx;
  372. margin-left: 44rpx;
  373. }
  374. .conmsg-msg-lab-img{
  375. width: 14rpx;
  376. height: 30rpx;
  377. margin-top: 6rpx;
  378. margin-left: auto;
  379. image{
  380. width: 100%;
  381. height: 100%;
  382. }
  383. }
  384. }
  385. }
  386. }
  387. .submit{
  388. position: fixed;
  389. bottom: 20rpx;
  390. left: 20rpx;
  391. height: 120rpx;
  392. background: #FFFFFF;
  393. .btn{
  394. // margin: 60rpx auto;
  395. text-align: center;
  396. width: 690rpx;
  397. height: 88rpx;
  398. background: #2671E2;
  399. border-radius: 8rpx;
  400. font-size: 32tpx;
  401. font-weight: 400;
  402. color: #FFFFFF;
  403. line-height: 88rpx;
  404. }
  405. }
  406. .con-msg-con{
  407. display: flex;
  408. flex-wrap: wrap;
  409. // justify-content: space-around;
  410. border-bottom: 1px solid #E0E0E0;
  411. padding-bottom: 16rpx;
  412. .chebox{
  413. // width: 20%;
  414. height: 60rpx;
  415. line-height: 60rpx;
  416. // margin: 10rpx 0;
  417. margin-bottom: 25rpx;
  418. margin-right: 20rpx;
  419. border: 1px solid #E0E0E0;
  420. box-sizing: border-box;
  421. padding: 0 10rpx;
  422. }
  423. }
  424. .sexchose{
  425. width: 120rpx;
  426. height: 60rpx;
  427. background: #FFFFFF;
  428. border-radius: 4rpx;
  429. border: 1px solid #E0E0E0;
  430. text-align: center;
  431. line-height: 60rpx;
  432. margin-right: 20rpx;
  433. }
  434. </style>