Commit 7012631d by 李伟康

commit

1 parent ea8dd589
<template> <template>
<div id="app"> <div id="app">
<template v-if="showWindow"> <template v-if="showWindow">
<router-view /> <transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
</template> </template>
</div> </div>
</template> </template>
......
...@@ -47,7 +47,8 @@ import { ...@@ -47,7 +47,8 @@ import {
Dialog, Dialog,
ShareSheet, ShareSheet,
Overlay, Overlay,
loading loading,
DatetimePicker
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Button,
...@@ -89,5 +90,6 @@ export const components = [ ...@@ -89,5 +90,6 @@ export const components = [
Dialog, Dialog,
ShareSheet, ShareSheet,
Overlay, Overlay,
loading loading,
DatetimePicker
] ]
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ const pages = { ...@@ -20,7 +20,7 @@ const pages = {
name: 'index', name: 'index',
meta: { meta: {
title: '查看客户详情', title: '查看客户详情',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7',
} }
}, { }, {
name: 'information', name: 'information',
...@@ -32,13 +32,14 @@ const pages = { ...@@ -32,13 +32,14 @@ const pages = {
name: 'detail', name: 'detail',
meta: { meta: {
title: '客户跟进', title: '客户跟进',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7',
keepAlive: true,
} }
}, { }, {
name: 'editDetail', name: 'editDetail',
meta: { meta: {
title: '查看客户详情', backgroundColor: '#F7F7F7',
backgroundColor: '#F7F7F7' keepAlive: true,
} }
}], }],
tag: [{ tag: [{
......
...@@ -31,42 +31,14 @@ ...@@ -31,42 +31,14 @@
</div> </div>
<div class="detail-second"> <div class="detail-second">
<van-cell-group :class="[isMore ? '' : 'more-hidden']"> <van-cell-group :class="[isMore ? '' : 'more-hidden']">
<template v-for="(i,index) in detailObj">
<van-cell <van-cell
title="添加时间" :key="index"
:value="userInfo.info.addTime" :title="i.title"
/> :value="i.value(userInfo)"
<van-cell @click="setDetail(i)"
title="来源"
:value="userInfo.info.addWayName"
/>
<van-cell
title="联系电话"
:value="userInfo.info.customerPhone"
/>
<van-cell
title="购车日期"
:value="userInfo.vehicleInfo.buyTime"
/>
<van-cell
title="近期保养日期"
:value="userInfo.vehicleInfo.maintRecTime"
/>
<van-cell
title="近期到店日期"
:value="userInfo.vehicleInfo.recReachTime"
/>
<van-cell
title="商业险到期日期"
:value="userInfo.vehicleInfo.insEndTime"
/>
<van-cell
title="车系"
:value="userInfo.vehicleInfo.vehicleTrain"
/>
<van-cell
title="车型"
:value="userInfo.vehicleInfo.vehicleType"
/> />
</template>
</van-cell-group> </van-cell-group>
<div <div
class="detail-more text-center" class="detail-more text-center"
...@@ -128,6 +100,21 @@ ...@@ -128,6 +100,21 @@
</div> </div>
</div> </div>
</div> </div>
<van-popup
v-model="showDatePicker"
position="bottom"
round
>
<van-datetime-picker
v-model="selectDate"
type="date"
title="选择年月日"
:min-date="minDate"
:max-date="maxDate"
@confirm="confirmDate"
@cancel="showDatePicker = false"
/>
</van-popup>
</div> </div>
</template> </template>
...@@ -149,22 +136,106 @@ export default { ...@@ -149,22 +136,106 @@ export default {
0: '未知', 0: '未知',
1: '男', 1: '男',
2: '女' 2: '女'
},
detailObj: [
{
title: '添加时间',
value: obj => {
return obj.info.addTime
}
},
{
title: '来源',
value: obj => {
return obj.info.addWayName
} }
},
{
title: '联系电话',
type: 'input',
value: obj => {
return obj.info.customerPhone
} }
}, },
{
title: '购车日期',
type: 'date',
value: obj => {
return obj.vehicleInfo.buyTime
},
key: 'buyTime'
},
{
title: '近期保养日期',
type: 'date',
value: obj => {
return obj.vehicleInfo.maintRecTime
},
key: 'maintRecTime'
},
{
title: '近期到店日期',
type: 'date',
value: obj => {
return obj.vehicleInfo.recReachTime
},
key: 'recReachTime'
},
{
title: '商业险到期日期',
type: 'date',
value: obj => {
return obj.vehicleInfo.insEndTime
},
key: 'insEndTime'
},
{
title: '车系',
type: 'input',
value: obj => {
return obj.vehicleInfo.vehicleTrain
}
},
{
title: '车型',
type: 'input',
value: obj => {
return obj.vehicleInfo.vehicleType
}
}
],
id: '',
showDatePicker: false,
maxDate: new Date(),
selectDate: new Date(),
minDate: new Date(2002, 1, 1),
target: ''
}
},
activated() {
this.watchPageBack().then(() => {
this.getCustomerDetail(this.id)
})
},
mounted() { mounted() {
this.showLoading() this.showLoading()
let { id } = this.getQuery() let { id } = this.getQuery()
id = 'wm219ICgAARGgXJUmUdGxCgNfGxRCWDg'
if (id) { if (id) {
this.id = id
this.getCustomerDetail(id) this.getCustomerDetail(id)
} else { } else {
wxConfig.init(['getCurExternalContact']).then(() => { wxConfig.init(['getCurExternalContact']).then(() => {
wxConfig.getCurExternalContact().then(userId => { wxConfig.getCurExternalContact().then(userId => {
this.id = userId
this.getCustomerDetail(userId) this.getCustomerDetail(userId)
}) })
}) })
} }
}, },
deactivated() {
console.log('离开')
},
methods: { methods: {
moreInfo() { moreInfo() {
this.isMore = !this.isMore this.isMore = !this.isMore
...@@ -185,6 +256,29 @@ export default { ...@@ -185,6 +256,29 @@ export default {
if (res[key]) this.userInfo[key] = res[key] if (res[key]) this.userInfo[key] = res[key]
}) })
}) })
},
setDetail({ type, title, key }) {
if (type) {
if (type == 'input') {
this.$router.push({
name: 'customer.editDetail',
params: {
title
}
})
} else {
let now = new Date()
this.maxDate = key == 'insEndTime' ? new Date(now.getFullYear() + 2, now.getMonth() + 1, now.getDate()) : now
this.showDatePicker = true
this.target = key
}
}
},
confirmDate(e) {
let { target } = this
let val = new Date(e).format('yyyy/MM/dd')
this.showDatePicker = false
this.userInfo.vehicleInfo[target] = val
} }
} }
} }
...@@ -259,7 +353,7 @@ export default { ...@@ -259,7 +353,7 @@ export default {
background-color: #fff; background-color: #fff;
.van-cell-group { .van-cell-group {
transition: all 0.25s; transition: all 0.25s;
height: 600px; height: 540px;
overflow: hidden; overflow: hidden;
} }
.van-cell { .van-cell {
......
<template> <template>
<div class="edit-wrapper"> <div class="edit-wrapper">
<van-field v-model="value" placeholder="请输入" /> <van-field
<div class="submit">保存</div> v-model="value"
placeholder="请输入"
clearable
/>
<div
class="submit"
@click="save"
>保存</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -12,7 +19,13 @@ export default { ...@@ -12,7 +19,13 @@ export default {
} }
}, },
created() { created() {
document.title = this.$route.params.title document.title = `设置${this.$route.params.title}`
},
methods: {
save() {
window.$back = true
this.$router.back(-1)
}
} }
} }
</script> </script>
...@@ -33,7 +46,7 @@ export default { ...@@ -33,7 +46,7 @@ export default {
transform: translateX(-50%); transform: translateX(-50%);
width: 343px; width: 343px;
height: 42px; height: 42px;
background-color: #5859ff; background-color: #3975c6;
border-radius: 21px; border-radius: 21px;
font-size: 14px; font-size: 14px;
color: #fff; color: #fff;
......
<template> <template>
<div class="tagContainer"> <div class="tagContainer" v-if="flag">
<search <search
placeholder="请输入关键字" placeholder="请输入关键字"
v-if="isTitle" v-if="isTitle"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</div> </div>
<div class="customer-info"> <div class="customer-info">
<div class="customer-info-name"> <div class="customer-info-name">
<label class="name"> <label class="name text-hide">
{{ item.customerName }} {{ item.customerName }}
</label> </label>
...@@ -119,7 +119,8 @@ export default { ...@@ -119,7 +119,8 @@ export default {
checkList: [], checkList: [],
allChecked: false, allChecked: false,
title: '', title: '',
userIds: '' userIds: '',
flag:false
} }
}, },
name: 'tag', name: 'tag',
...@@ -131,15 +132,14 @@ export default { ...@@ -131,15 +132,14 @@ export default {
}, },
created() { created() {
console.log(this.isTitle) console.log(this.isTitle)
let { taskId } = this.getQuery()
//获取userid //获取userid
this.taskId = this.$route.query.taskId ? this.$route.query.taskId : 'e0e1a10cf50f427bb6d35906cf3dbf21' this.taskId = taskId || 'e0e1a10cf50f427bb6d35906cf3dbf21'
this.getuserInfo() this.getuserInfo()
//初始化数据 //初始化数据
if (this.isTitle) { this.showLoading()
this.init() if (this.isTitle) this.init()
} else { else this.initAll()
this.initAll()
}
}, },
mounted() { mounted() {
this.initWx() this.initWx()
...@@ -147,8 +147,7 @@ export default { ...@@ -147,8 +147,7 @@ export default {
methods: { methods: {
//初始化微信接口 //初始化微信接口
initWx() { initWx() {
window.$wx = wxConfig wxConfig.init(['openEnterpriseChat']).then(() => {})
window.$wx.init(['openEnterpriseChat']).then(() => {})
}, },
initAll() { initAll() {
let search = { let search = {
...@@ -157,11 +156,15 @@ export default { ...@@ -157,11 +156,15 @@ export default {
} }
this.allChecked = false this.allChecked = false
groupCustomer.getCustomerList(search).then(res => { groupCustomer.getCustomerList(search).then(res => {
this.hideLoading()
this.customerList = res || [] this.customerList = res || []
this.title = `已有${this.customerList.length}位客户已通过您的好友申请!` this.title = `已有${res.length || 0}位客户已通过您的好友申请!`
this.flag = true
if (res && res.length) {
this.customerList.forEach(item => { this.customerList.forEach(item => {
this.$set(item, 'isChecked', false) this.$set(item, 'isChecked', false)
}) })
}
}) })
}, },
getuserInfo() { getuserInfo() {
...@@ -176,9 +179,11 @@ export default { ...@@ -176,9 +179,11 @@ export default {
} }
this.allChecked = false this.allChecked = false
groupTag.getcustomerList(obj).then(res => { groupTag.getcustomerList(obj).then(res => {
this.hideLoading()
this.customerList = res || [] this.customerList = res || []
this.title = `您共有${this.customerList.length}位客户可添加标签` this.title = `您共有${res.length || 0}位客户可添加标签`
if (this.customerList.length > 0) { this.flag = true
if (res && res.length) {
this.customerList.forEach(item => { this.customerList.forEach(item => {
this.$set(item, 'isChecked', false) this.$set(item, 'isChecked', false)
}) })
...@@ -238,7 +243,7 @@ export default { ...@@ -238,7 +243,7 @@ export default {
groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。 groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
chatId: '' chatId: ''
} }
window.$wx.openEnterpriseChat(seach).then(res => { wxConfig.openEnterpriseChat(seach).then(res => {
// console.log(res) // console.log(res)
}) })
}, },
...@@ -258,7 +263,6 @@ export default { ...@@ -258,7 +263,6 @@ export default {
} }
.customer { .customer {
padding: 0 16px; padding: 0 16px;
width: 375px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -274,7 +278,7 @@ export default { ...@@ -274,7 +278,7 @@ export default {
} }
.customer-info { .customer-info {
padding: 16px 0; padding: 16px 0;
width: calc(100% - 130px);
.customer-info-name { .customer-info-name {
font-size: 16px; font-size: 16px;
line-height: 22px; line-height: 22px;
...@@ -282,10 +286,7 @@ export default { ...@@ -282,10 +286,7 @@ export default {
padding-bottom: 6px; padding-bottom: 6px;
display: flex; display: flex;
.name { .name {
// width: 60px; max-width: 70%;
overflow: hidden;
white-space: nowrap;
// text-overflow: ellipsis;
} }
.origin { .origin {
color: #6760ff; color: #6760ff;
...@@ -374,8 +375,8 @@ export default { ...@@ -374,8 +375,8 @@ export default {
} }
.tagContainer /deep/ .van-checkbox__icon--checked .van-icon { .tagContainer /deep/ .van-checkbox__icon--checked .van-icon {
color: #fff; color: #fff;
background-color: #3975C6 !important; background-color: #3975c6 !important;
border-color: #3975C6 !important; border-color: #3975c6 !important;
} }
.tagContainer /deep/.van-checkbox__icon .van-icon { .tagContainer /deep/.van-checkbox__icon .van-icon {
width: 16px; width: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!