AI销管
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.
 
 
 
 

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