AI销管
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

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