Files
crm-uni/pages/customer/detile.vue
T

431 lines
10 KiB
Vue
Raw Normal View History

2025-03-14 16:55:12 +08:00
<template>
<view>
2025-03-20 10:58:04 +08:00
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('navbar.customerinfo')"></uni-nav-bar>
2025-03-14 16:55:12 +08:00
<view class="content">
2025-03-21 17:57:32 +08:00
<view class="contents" >
<view class="top">
<view class="name">{{datas.contacts}}</view>
<view class="right">
<text class="medal" :style="{color:(datas.magnitude == 0 ?'#F5AB00' : datas.magnitude == 1 ?'#8495B8': '#9B7200')}">{{datas.magnitude_txt}}</text>
<text class="tag" :style="{background:(datas.follow == 0 ?'#3471FF' : datas.follow == 1 ?'#27C89C': '#FF4040')}">{{datas.follow_txt}}</text>
</view>
2025-03-14 16:55:12 +08:00
</view>
2025-03-21 17:57:32 +08:00
<u-line margin="20rpx 0px" color="#fff" :hairline="false"></u-line>
<view class="cont">
<view class="title">
<view class=""><text class="name">{{datas.phone}}</text></view>
<view class="ststus">渠道:{{datas.channel_name}}</view>
</view>
<view class="info"><text class="sex">{{datas.sex_txt}}</text> | <text class="addr">{{datas.country_name}}</text><text class="type">{{datas.car_type_name}}</text>
</view>
<view v-if="datas.email!=''">Email: {{datas.email}}</view>
<view v-if="datas.WhatsApp!=''">WhatsAPP: {{datas.WhatsApp}}</view>
<view v-if="datas.address!=''">公司: {{datas.address}}</view>
<view v-if="datas.describe!=''">备注: {{datas.describe}}</view>
2025-03-17 17:43:41 +08:00
</view>
2025-03-21 17:57:32 +08:00
<view class="edt">
<view class="btn" @click="editFn"><image src="/static/image/customer/edit.png" mode=""></image><text> {{$t('edtbtn')}}</text></view>
2025-03-14 16:55:12 +08:00
</view>
</view>
<view class="cell">
2025-03-20 17:35:53 +08:00
<view class="item">{{$t('customer.Cstomerfj')}}</view>
2025-03-15 15:46:16 +08:00
<view class="right select" @click="showgrade = true">
2025-03-20 17:35:53 +08:00
<!-- <input :placeholder="$t('customer.Cstomerfjinput')" disabled v-model="grade_name" /> -->
<view class="" :class="['content2', { placeholder: !grade_name }]">{{grade_name || $t('customer.Cstomerfjinput')}}</view>
2025-03-14 16:55:12 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
</view>
<u-gap height="10" bgColor="#F6F6F6"></u-gap>
<view class="steps">
<view class="title">
2025-03-18 13:32:13 +08:00
<view class="">
2025-03-19 15:39:21 +08:00
{{$t('customer.followrecord')}} <text class="status" :style="{color:(datas.follow == 0 ?'#3471FF' : datas.follow == 1 ?'#27C89C': '#FF4040')}">{{datas.follow_txt}}</text>
2025-03-18 13:32:13 +08:00
</view>
<view class="btnjl" @click="followupFn">
2025-03-20 10:58:04 +08:00
{{$t('navbar.addfollowup')}}
2025-03-18 13:32:13 +08:00
</view>
2025-03-14 16:55:12 +08:00
</view>
2025-03-18 13:32:13 +08:00
<u-steps v-if="followList.length>0" :current="followList.length" direction="column" dot>
<u-steps-item :title="item.type_txt" v-for="(item, index) in followList" :key="index">
2025-03-14 16:55:12 +08:00
<view slot="desc" class="desc">
2025-03-18 13:32:13 +08:00
<view class="" v-if="item.type==0">
2025-03-14 16:55:12 +08:00
<view class="">
2025-03-18 13:32:13 +08:00
<view class="">
2025-03-19 15:39:21 +08:00
{{$t('times')}} :{{item.created_at}}
2025-03-18 13:32:13 +08:00
</view>
2025-03-19 15:39:21 +08:00
<view class="">{{$t('address')}}:{{item.address}}</view>
<view class="">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
2025-03-14 16:55:12 +08:00
</view>
<view class="">
2025-03-18 13:32:13 +08:00
<image :src="item.oss_picture" mode=""></image>
2025-03-14 16:55:12 +08:00
</view>
</view>
2025-03-18 13:32:13 +08:00
<view class="" v-else>
<view class="">
2025-03-19 15:39:21 +08:00
{{$t('times')}}:{{item.created_at}}
2025-03-18 13:32:13 +08:00
</view>
<view class="">
<image :src="item.oss_picture" mode=""></image>
</view>
2025-03-14 16:55:12 +08:00
</view>
</view>
</u-steps-item>
</u-steps>
2025-03-18 13:32:13 +08:00
<empty :list="followList"></empty>
2025-03-14 16:55:12 +08:00
</view>
<view class="zw"></view>
2025-03-21 17:57:32 +08:00
<!-- <view class="foot">
2025-03-19 15:39:21 +08:00
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
2025-03-21 17:57:32 +08:00
</view> -->
2025-03-20 10:58:04 +08:00
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexfj" :show="showgrade" @cancel="cancel('showgrade')" @close="close('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
2025-03-19 15:39:21 +08:00
<!-- <u-popup :show="showmap" :round="10" mode="bottom" @close="mapclose">
2025-03-18 13:32:13 +08:00
<view class="mapcont">
<view class="header">
<view class="cancel" @click="mapclose">取消</view>
<view class="title">地图位置</view>
<view class="confirm" @click="mapconfirm">确定</view>
</view>
<view class="map">
</view>
</view>
2025-03-19 15:39:21 +08:00
</u-popup> -->
2025-03-14 16:55:12 +08:00
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
id:'',
2025-03-18 13:32:13 +08:00
followList:[],
showmap: false,
showmagnitude: false,
2025-03-15 15:46:16 +08:00
showgrade: false,
showcartype: false,
2025-03-18 13:32:13 +08:00
showchannel: false,
showarea: false,
2025-03-19 15:39:21 +08:00
getGradeList1:[],
2025-03-21 17:57:32 +08:00
getGradeList:[],
2025-03-15 15:46:16 +08:00
grade_name:'',
2025-03-18 13:32:13 +08:00
defaultIndexfj:[0],
2025-03-15 15:46:16 +08:00
form: {
grade:'',
2025-03-19 15:39:21 +08:00
},
datas:''
2025-03-14 16:55:12 +08:00
}
},
onLoad(options) {
console.log(options);
2025-03-18 13:32:13 +08:00
this.id = options.id;
2025-03-14 16:55:12 +08:00
var that = this
2025-03-18 13:32:13 +08:00
this.getGrade()
this.customerdetailfn()
2025-03-14 16:55:12 +08:00
},
2025-03-18 13:32:13 +08:00
onShow() {
2025-03-19 15:39:21 +08:00
if(uni.getStorageSync('location')){
this.location = JSON.parse(uni.getStorageSync('location'))
this.form.address = this.location.address
this.form.lng = this.location.lng
this.form.lat = this.location.lat
console.log(this.location)
}
2025-03-18 13:32:13 +08:00
this.followlistfn()
},
2025-03-14 16:55:12 +08:00
methods: {
leftClick(){
uni.navigateBack({})
2025-03-15 15:46:16 +08:00
},
2025-03-19 15:39:21 +08:00
gomap(){
uni.navigateTo({
url: '/pages/customer/map'
});
},
select(){
var that=this;
that.getGradeList1.forEach((item,index) => {
if(item.id == that.form.grade){
that.grade_name = item.name
that.defaultIndexfj=[index]
}
})
},
2025-03-18 13:32:13 +08:00
//客户详情
customerdetailfn(){
2025-03-19 15:39:21 +08:00
var that=this;
2025-03-18 13:32:13 +08:00
request({
url:'customer/detail',
method:'get',
data: {
id:this.id,
}
}).then(res => {
2025-03-19 15:39:21 +08:00
that.datas = res.data.data
that.form = res.data.data
that.select()
2025-03-18 13:32:13 +08:00
})
},
// 跟进记录
followlistfn(){
request({
url:'follow/list',
method:'get',
data: {
customer_id:this.id,
}
}).then(res => {
this.followList = res.data.data
console.log(res.data.data)
})
},
//添加跟进
followupFn(){
uni.navigateTo({
url: '/pages/customer/followup?id='+this.id
});
},
mapclose(){
this.showmap = false
},
mapconfirm(){
this.showmap = false
},
//客户等级
2025-03-15 15:46:16 +08:00
getGrade(){
request({
url:'customer/getGrade',
method:'get',
}).then(res => {
var list = res.data.data
this.getGradeList = [list]
2025-03-19 15:39:21 +08:00
this.getGradeList1 = list
2025-03-15 15:46:16 +08:00
})
},
2025-03-18 13:32:13 +08:00
//客户等级切换事件
2025-03-15 15:46:16 +08:00
gradeHandler(val){
2025-03-18 13:32:13 +08:00
this.form.grade = val.value[0].id
2025-03-15 15:46:16 +08:00
this.grade_name = val.value[0].name
this.showgrade = false
2025-03-21 17:57:32 +08:00
request({
url:'customer/grade',
method:'post',
data:{
id:this.id,
grade:this.form.grade
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
// if(res.data.code ==0){
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/index/customer',// 替换为你要跳转的页面路径
// });
// }, 1000);
// }
})
2025-03-15 15:46:16 +08:00
},
cancel(val){
this[val] = false
},
2025-03-20 10:58:04 +08:00
close(val){
this[val] = false
},
2025-03-21 17:57:32 +08:00
editFn(){
uni.navigateTo({
url: '/pages/customer/editdetile?id='+this.id
});
},
2025-03-15 15:46:16 +08:00
nextFn(){
2025-03-20 10:58:04 +08:00
request({
url:'customer/save',
method:'post',
data:this.form
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
if(res.data.code ==0){
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/customer',// 替换为你要跳转的页面路径
});
}, 1000);
}
})
2025-03-14 16:55:12 +08:00
}
}
}
</script>
<style lang="scss">
2025-03-20 10:58:04 +08:00
.u-m-lr-10{
margin: 0px 10px;
}
2025-03-20 17:35:53 +08:00
.placeholder {
color: #999; /* 占位符颜色 */
}
2025-03-18 13:32:13 +08:00
textarea {
min-height: 200rpx;// 设置默认高度 ,解决设置自适应高度之后高度无效问题
margin-top: 15px;
background-color: #F6F6F6;
padding: 15px;
border-radius: 10px;
}
.red{
color: red;
2025-03-14 16:55:12 +08:00
}
.zw{
height: 120px;
}
.uniui-right{
position: absolute;
top: 2px;
}
.cell{
position: relative;
display: flex;
justify-content:space-between;
padding: 18px 20px;
align-items: center;
font-weight: 500;
2025-03-20 17:35:53 +08:00
.item{
width: 90px;
2025-03-21 17:57:32 +08:00
color: #666666;
2025-03-20 17:35:53 +08:00
}
2025-03-21 17:57:32 +08:00
background: #f6f6f6;
border-radius: 10px;
2025-03-14 16:55:12 +08:00
}
.arrowright{
margin-right: -15px;
}
.right{
text-align: right;
}
.select{
display: flex;
position: relative;
margin-right: 10px;
}
2025-03-21 17:57:32 +08:00
.content{
padding: 10px 15px;
background: #FFFFFF;
.contents{
background-color:#F6F6F6;
border-radius: 10px;
margin-bottom: 10px;
.edt{
display: flex;
justify-content: right;
padding-bottom: 10px;
image{
width: 14px;
height: 14px;
margin-right: 5px;
vertical-align: middle;
}
}
.btn{
color: #3471FF;
text-align: right;
padding: 0px 15px 0px;
}
.top{
padding: 10px 15px 0px;
display: flex;
align-items: center;
justify-content: space-between;
.tag{
color: white;
border-radius: 20px 0px 0px 20px;
padding: 3px 10px;
margin-right: -15px;
}
.right{
display: flex;
align-items: center;
.medal{
margin-right: 10px;
}
}
}
.name{
font-size: 32rpx;
font-weight: bold;
margin-right: 10px;
}
.cont{
padding: 0px 15px 10px;
font-size: 24rpx;
.title{
display: flex;
align-items: center;
justify-content: space-between;
color: #222222;
}
.ststus{
color: #666666;
}
.info,.desc{
color: #78758E;
line-height: 26px;
}
.sex{
margin-right: 5px;
}
.addr{
margin-left: 5px;
}
.type{
margin-left: 5px;
color: #3471FF;
}
}
}
}
2025-03-14 16:55:12 +08:00
.steps{
padding: 15px;
2025-03-19 15:39:21 +08:00
background: #fff;
2025-03-14 16:55:12 +08:00
image{
width: 44px;
height:44px;
}
.desc{
display: flex;
justify-content: space-between;
align-items: center;
color: #999999;
}
.title{
2025-03-18 13:32:13 +08:00
display: flex;
align-items: center;
justify-content: space-between;
2025-03-14 16:55:12 +08:00
color: #666666;
font-size: 32rpx;
margin-bottom: 15px;
.status{
font-size: 28rpx;
margin-left: 10px;
}
2025-03-18 13:32:13 +08:00
.btnjl{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
padding: 4px 10px;
border-radius: 20px;
font-size: 28rpx;
}
2025-03-14 16:55:12 +08:00
}
}
</style>