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

509 lines
14 KiB
Vue
Raw Normal View History

2025-03-14 16:55:12 +08:00
<template>
<view>
2025-03-19 15:39:21 +08:00
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('customer.customerinfo')"></uni-nav-bar>
2025-03-14 16:55:12 +08:00
<view class="content">
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.CustomerChannel')}}</view>
2025-03-18 13:32:13 +08:00
<view class="right select" @click="showchannel = true">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.CustomerChannelinput')" disabled v-model="channel_name" />
2025-03-18 13:32:13 +08:00
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexqd" :show="showchannel" @cancel="cancel('showchannel')" :columns="channelList" keyName="name" @confirm="channelChange"></u-picker>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
<u-line></u-line>
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Medal')}}</view>
2025-03-18 13:32:13 +08:00
<view class="right select" @click="showmagnitude = true">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.Medalinput')" disabled v-model="magnitude_name" />
2025-03-18 13:32:13 +08:00
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexsj" :show="showmagnitude" @cancel="cancel('showmagnitude')" :columns="magnitudeList" keyName="name" @confirm="magnitudeChange"></u-picker>
2025-03-17 17:43:41 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
2025-03-18 13:32:13 +08:00
<u-line></u-line>
2025-03-17 17:43:41 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.CustomerName')}} <text class="red">*</text></view>
2025-03-14 16:55:12 +08:00
<view class="right">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.CustomerNameinput')" v-model="form.contacts" />
2025-03-14 16:55:12 +08:00
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('gender')}}</view>
2025-03-14 16:55:12 +08:00
<view class="right">
2025-03-18 13:32:13 +08:00
<u-radio-group v-model="form.sex">
2025-03-19 15:39:21 +08:00
<u-radio name="0">{{$t('gender0')}}</u-radio>
<u-radio name="1">{{$t('gender1')}}</u-radio>
<u-radio name="2">{{$t('gender2')}}</u-radio>
2025-03-14 16:55:12 +08:00
</u-radio-group>
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.lxcall')}} <text class="red">*</text></view>
2025-03-14 16:55:12 +08:00
<view class="right">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('mine.lxcallinputhd')" v-model="form.phone" />
2025-03-14 16:55:12 +08:00
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
<view>Email</view>
<view class="right">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.Emailinput')" v-model="form.email" />
2025-03-14 16:55:12 +08:00
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
<view class="cell">
<view>WhatsApp</view>
<view class="right">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.WhatsAppinput')" v-model="form.WhatsApp" />
2025-03-17 17:43:41 +08:00
</view>
</view>
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Customerph')}}</view>
2025-03-15 15:46:16 +08:00
<view class="right select" @click="showcartype = true">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.Customerphinput')" disabled v-model="car_type_name" />
2025-03-18 13:32:13 +08:00
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')":defaultIndex="defaultIndexph" :show="showcartype" @cancel="cancel('showcartype')" :columns="carTypeList" keyName="name" @confirm="cartypesChange"></u-picker>
2025-03-14 16:55:12 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Cstomerfj')}}</view>
2025-03-15 15:46:16 +08:00
<view class="right select" @click="showgrade = true">
2025-03-19 15:39:21 +08:00
<input :placeholder="$t('customer.Cstomerfjinput')" disabled v-model="grade_name" />
2025-03-18 13:32:13 +08:00
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexfj" :show="showgrade" @cancel="cancel('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
2025-03-14 16:55:12 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Country')}}</view>
2025-03-18 13:32:13 +08:00
<view class="right select" @click="showarea = true">
2025-03-19 17:06:58 +08:00
<input :placeholder="$t('customer.Countryinput')" disabled v-model="country_name" />
2025-03-18 13:32:13 +08:00
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexgj" :show="showarea" @cancel="cancel('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker>
2025-03-17 17:43:41 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Company')}}</view>
<view class="right select" @click="gomap">
<input :placeholder="$t('customer.Companyinput')" type="text" disabled v-model="form.address"/>
2025-03-14 16:55:12 +08:00
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
2025-03-17 17:43:41 +08:00
<u-line></u-line>
2025-03-14 16:55:12 +08:00
<view class="cell1">
2025-03-19 15:39:21 +08:00
<view>{{$t('customer.Remarks')}}</view>
2025-03-14 16:55:12 +08:00
<view class="">
2025-03-19 15:39:21 +08:00
<textarea auto-height v-model="form.describe" :placeholder="$t('customer.Remarksinputhd')"/>
2025-03-14 16:55:12 +08:00
</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-19 15:39:21 +08:00
{{$t('navbar.addfollow')}}
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>
<view class="foot">
2025-03-19 15:39:21 +08:00
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
2025-03-14 16:55:12 +08:00
</view>
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-15 15:46:16 +08:00
getGradeList:[],
carTypeList:[],
2025-03-18 13:32:13 +08:00
channelList:[],
magnitudeList:[],
2025-03-19 15:39:21 +08:00
getGradeList1:[],
carTypeLis1:[],
channelList1:[],
magnitudeList1:[],
areaList1:[],
2025-03-15 15:46:16 +08:00
areaList:[],
grade_name:'',
car_type_name:'',
country_name:'',
2025-03-18 13:32:13 +08:00
channel_name:'',
magnitude_name:'',
defaultIndexqd:[0],
defaultIndexsj:[0],
defaultIndexph:[0],
defaultIndexfj:[0],
defaultIndexgj:[0],
2025-03-15 15:46:16 +08:00
form: {
contacts: '',
2025-03-19 15:39:21 +08:00
sex: 0,
2025-03-15 15:46:16 +08:00
phone: '',
email: '',
describe: '',
grade:'',
country_id:'',
2025-03-18 13:32:13 +08:00
car_type_id:'',
channel_id:'',
magnitude:'',
2025-03-19 15:39:21 +08:00
address:'',
lat:'',
lng:'',
},
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.getChannel()
this.getMagnitude()
this.getGrade()
this.carType()
this.area()
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.channelList1.forEach((item,index) => {
if(item.id == that.form.channel_id){
that.channel_name = item.name
that.defaultIndexqd=[index]
}
})
that.getGradeList1.forEach((item,index) => {
if(item.id == that.form.grade){
that.grade_name = item.name
that.defaultIndexfj=[index]
}
})
that.carTypeList1.forEach((item,index) => {
if(item.id == that.form.car_type_id){
that.car_type_name = item.name
that.defaultIndexph=[index]
}
})
that.magnitudeList1.forEach((item,index) => {
if(item.id == that.form.magnitude){
that.magnitude_name = item.name
that.defaultIndexsj=[index]
}
})
that.areaList1.forEach((item,index) => {
if(item.id == that.form.country_id){
that.channel_name = item.name
that.defaultIndexgj=[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
},
//渠道
getChannel(){
request({
url:'customer/getChannel',
method:'get',
}).then(res => {
var list = res.data.data
2025-03-19 15:39:21 +08:00
this.channelList1 = list
2025-03-18 13:32:13 +08:00
this.channelList = [list]
})
},
//客户等级
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
carType(){
request({
url:'carType/getAll',
method:'get',
}).then(res => {
var list = res.data.data
2025-03-19 15:39:21 +08:00
this.carTypeList1 = list
2025-03-15 15:46:16 +08:00
this.carTypeList = [list]
})
},
2025-03-18 13:32:13 +08:00
//国家
2025-03-15 15:46:16 +08:00
area(){
request({
2025-03-18 13:32:13 +08:00
url:'area/getCountry',
2025-03-15 15:46:16 +08:00
method:'get',
}).then(res => {
var list = res.data.data
2025-03-19 15:39:21 +08:00
this.areaList1 = list
2025-03-15 15:46:16 +08:00
this.areaList = [list]
})
},
2025-03-18 13:32:13 +08:00
//商机
getMagnitude(){
request({
url:'customer/getMagnitude',
method:'get',
}).then(res => {
var list = res.data.data
2025-03-19 15:39:21 +08:00
this.magnitudeList1 = list
2025-03-18 13:32:13 +08:00
this.magnitudeList = [list]
})
},
//商机切换事件
magnitudeChange(val){
this.form.magnitude = val.value[0].id
this.magnitude_name = val.value[0].name
this.showmagnitude = false
},
//通道切换事件
channelChange(val){
this.form.channel_id = val.value[0].id
this.channel_name = val.value[0].name
this.showchannel = false
},
//客户等级切换事件
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-18 13:32:13 +08:00
//国家切换事件
2025-03-15 15:46:16 +08:00
areaChange(val){
2025-03-18 13:32:13 +08:00
this.form.country_id = val.value[0].id
2025-03-15 15:46:16 +08:00
this.country_name = val.value[0].name
this.showarea = false
},
2025-03-18 13:32:13 +08:00
//偏好切换事件
2025-03-15 15:46:16 +08:00
cartypesChange(val){
2025-03-18 13:32:13 +08:00
this.form.car_type_id = val.value[0].id
2025-03-15 15:46:16 +08:00
this.car_type_name = val.value[0].name
this.showcartype = false
},
cancel(val){
this[val] = false
},
nextFn(){
2025-03-14 16:55:12 +08:00
}
}
}
</script>
<style lang="scss">
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;
}
.content{
padding-top: 10px;
background: #FFFFFF;
}
.cell{
position: relative;
display: flex;
justify-content:space-between;
padding: 18px 20px;
align-items: center;
font-weight: 500;
}
.arrowright{
margin-right: -15px;
}
.cell1{
font-size: 32rpx;
padding: 18px 20px;
align-items: center;
font-weight: 500;
}
.right{
text-align: right;
}
.select{
display: flex;
position: relative;
margin-right: 10px;
}
.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
}
}
.foot{
position: fixed;
bottom: 0px;
width: 100%;
height: 160rpx;
background: #FFFFFF;
z-index: 1;
}
.btn{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 50px;
width: 92%;
margin-bottom: 40px;
margin: 15px 4%;
}
</style>