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.

edit.vue 11 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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">
  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. <!-- 客户等级 -->
  117. <u-select v-model="levelshow" :list="levellist" @confirm="levelshowCallback"></u-select>
  118. <!-- 客户阶段 -->
  119. <!-- <u-select v-model="stageshow" :list="stagelist" @confirm="stageshowCallback"></u-select> -->
  120. <!-- 职业需求 -->
  121. <!-- <u-select v-model="demandshow" :list="demandlist" @confirm="demandshowCallback"></u-select> -->
  122. <!-- 意向面积 -->
  123. <!-- <u-select v-model="areashow" :list="arealist" @confirm="areashowCallback"></u-select> -->
  124. <!-- 预算 -->
  125. <!-- <u-select v-model="budgetshow" :list="budgetlist" @confirm="budgetshowCallback"></u-select> -->
  126. <!-- 关注点 -->
  127. <!-- <u-select v-model="fouceshow" :list="foucelist" @confirm="fouceshowCallback"></u-select> -->
  128. <!-- 客户来源 -->
  129. <!-- <u-select v-model="soureshow" :list="sourelist" @confirm="soureshowCallback"></u-select> -->
  130. </view>
  131. </template>
  132. <script>
  133. export default{
  134. data(){
  135. return{
  136. form:{
  137. name:'',
  138. sex:'1',
  139. phone:'',
  140. chatNo:'',
  141. level:'',
  142. remarks:'',
  143. },
  144. selectform:{
  145. level:'',
  146. stage:'',
  147. demand:'',
  148. area:'',
  149. budget:'',
  150. fouce:'',
  151. soure:'',
  152. },
  153. levelshow:false,
  154. customerId:'',
  155. // 等级
  156. levellist:[
  157. {
  158. value:1,
  159. label:'A'
  160. },
  161. {
  162. value:2,
  163. label:'B'
  164. },
  165. {
  166. value:3,
  167. label:'C'
  168. },
  169. {
  170. value:4,
  171. label:'D'
  172. },
  173. ],
  174. allList:[],
  175. // stagelist:[],
  176. // // 置业需求
  177. // demandlist:[],
  178. // // 意向面积
  179. // arealist:[],
  180. // // 预算
  181. // budgetlist:[],
  182. // // 关注点
  183. // foucelist:[],
  184. // // 客户来源
  185. // sourelist:[],
  186. }
  187. },
  188. onLoad(e) {
  189. console.log(e)
  190. // 先调用借口查询数据
  191. this.customerId=e.id
  192. this.getdetail()
  193. },
  194. methods:{
  195. Edittag(item,item1,index,i){
  196. // var selected='';
  197. // console.log(item,item1,index,i)
  198. // return
  199. if(this.allList[index].children[i].selected==0){
  200. this.allList[index].children[i].selected=1;
  201. }else{
  202. this.allList[index].children[i].selected=0;
  203. }
  204. this.$forceUpdate()
  205. // this.$u.post("/matchKeywords/updatePersonalMatchData", {
  206. // carId: this.customerId,
  207. // selected:selected,
  208. // name:chend.name,
  209. // pid:chend.pid,
  210. // level:chend.level,
  211. // endName:chend.endName,
  212. // keywordsId:chend.keywordsId
  213. // }).then(res => {
  214. // })
  215. },
  216. sourecheck(index){
  217. this.sourelist[index].checked=!this.sourelist[index].checked
  218. this.$forceUpdate()
  219. },
  220. demandcheck(index){
  221. this.demandlist[index].checked=!this.demandlist[index].checked
  222. this.$forceUpdate()
  223. },
  224. areacheck(index){
  225. this.arealist[index].checked=!this.arealist[index].checked
  226. this.$forceUpdate()
  227. },
  228. levelshowCallback(e){
  229. this.selectform.level=e[0].label
  230. this.form.level=e[0].value
  231. },
  232. // 获取用户数据
  233. getdetail(){
  234. this.$u.get("customer/findById?",{id:this.customerId})
  235. .then(res=>{
  236. // console.log(res)
  237. this.form=res
  238. // 给客户等级赋值
  239. let idx= this.levellist.findIndex(item=>item.value==res.level)
  240. if(idx!=-1){
  241. this.selectform.level=this.levellist[idx].label
  242. }
  243. // 获取置业需求
  244. this.getListByType()
  245. // // 获取意向面积
  246. // this.getListByType()
  247. // // 获取客户来源
  248. // this.getListByType()
  249. })
  250. },
  251. // 字典表接口
  252. getListByType(){
  253. this.$u.get("/matchKeywords/findPersonalMatchData",{customerId:this.customerId})
  254. .then(res=>{
  255. // console.log(res)
  256. res.forEach(item1=>{
  257. item1.children.map(item=>{
  258. if(item.isInterval==0){
  259. item.label=item.name+item.unit+'-'+item.endName+item.unit;
  260. }else{
  261. item.label=item.name
  262. }
  263. item.value=item.id;
  264. })
  265. })
  266. // console.log(res)
  267. this.allList=res
  268. // return
  269. })
  270. },
  271. // 提交
  272. submit(){
  273. let param={}
  274. let str=[]
  275. if(this.form.name==''){
  276. uni.showToast({
  277. title:'请输入客户姓名',
  278. icon:'none'
  279. })
  280. return
  281. }
  282. if(this.form.phone==''){
  283. uni.showToast({
  284. title:'请输入手机号',
  285. icon:'none'
  286. })
  287. return
  288. }
  289. if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){
  290. uni.showToast({
  291. title: "请检查手机号码格式",
  292. icon:'none'
  293. });
  294. // this.form.phone=''
  295. return false;
  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. param.keywordIds=str
  307. console.log(param)
  308. // return
  309. this.$u.post("customer/update",param)
  310. .then(res=>{
  311. // console.log(res)
  312. uni.showToast({
  313. title:'操作成功',
  314. icon:'none',
  315. success: () => {
  316. uni.navigateBack()
  317. }
  318. })
  319. })
  320. },
  321. }
  322. }
  323. </script>
  324. <style lang="scss" scoped>
  325. .box {
  326. width: 100%;
  327. height: 100%;
  328. background: #F8F8F8;
  329. overflow: hidden;
  330. }
  331. .conmsg{
  332. background: #FFFFFF;
  333. margin-top: 20rpx;
  334. .conmsg-title{
  335. height: 92rpx;
  336. line-height: 92rpx;
  337. font-weight: bold;
  338. padding: 0 30rpx;
  339. // font-weight: 500;
  340. color: #303030;
  341. font-size: 32rpx;
  342. border-bottom: 1px solid #E0E0E0;
  343. }
  344. .conmsg-msg{
  345. padding: 0 30rpx;
  346. .conmsg-msg-lab{
  347. height: 102rpx;
  348. display: flex;
  349. font-size: 30rpx;
  350. font-weight: 400;
  351. color: #333333;
  352. border-bottom: 1px solid #E0E0E0;
  353. line-height: 102rpx;
  354. .conmsg-msg-lab-1{
  355. display: flex;
  356. width: 136rpx;
  357. .star{
  358. color: #E7483C;
  359. line-height: 108rpx;
  360. }
  361. }
  362. .conmsg-msg-lab-inp{
  363. margin-top: 30rpx;
  364. margin-left: 44rpx;
  365. }
  366. .conmsg-msg-lab-img{
  367. width: 14rpx;
  368. height: 30rpx;
  369. margin-top: 6rpx;
  370. margin-left: auto;
  371. image{
  372. width: 100%;
  373. height: 100%;
  374. }
  375. }
  376. }
  377. }
  378. }
  379. .submit{
  380. height: 228rpx;
  381. .btn{
  382. margin: 60rpx auto;
  383. text-align: center;
  384. width: 690rpx;
  385. height: 88rpx;
  386. background: #2671E2;
  387. border-radius: 8rpx;
  388. font-size: 32tpx;
  389. font-weight: 400;
  390. color: #FFFFFF;
  391. line-height: 88rpx;
  392. position: fixed;
  393. bottom: 20rpx;
  394. left: 20rpx;
  395. }
  396. }
  397. .con-msg-con{
  398. display: flex;
  399. flex-wrap: wrap;
  400. // justify-content: space-around;
  401. border-bottom: 1px solid #E0E0E0;
  402. padding-bottom: 16rpx;
  403. .chebox{
  404. // width: 20%;
  405. height: 60rpx;
  406. line-height: 60rpx;
  407. // margin: 10rpx 0;
  408. margin-bottom: 25rpx;
  409. margin-right: 20rpx;
  410. border: 1px solid #E0E0E0;
  411. box-sizing: border-box;
  412. padding: 0 10rpx;
  413. }
  414. }
  415. .sexchose{
  416. width: 120rpx;
  417. height: 60rpx;
  418. background: #FFFFFF;
  419. border-radius: 4rpx;
  420. border: 1px solid #E0E0E0;
  421. text-align: center;
  422. line-height: 60rpx;
  423. margin-right: 20rpx;
  424. }
  425. </style>