Commit 7012631d by 李伟康

commit

1 parent ea8dd589
<template>
<div id="app">
<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>
</div>
</template>
......
......@@ -47,7 +47,8 @@ import {
Dialog,
ShareSheet,
Overlay,
loading
loading,
DatetimePicker
} from 'vant'
export const components = [
Button,
......@@ -89,5 +90,6 @@ export const components = [
Dialog,
ShareSheet,
Overlay,
loading
loading,
DatetimePicker
]
\ No newline at end of file
......@@ -20,7 +20,7 @@ const pages = {
name: 'index',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
backgroundColor: '#F7F7F7',
}
}, {
name: 'information',
......@@ -32,13 +32,14 @@ const pages = {
name: 'detail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7'
backgroundColor: '#F7F7F7',
keepAlive: true,
}
}, {
name: 'editDetail',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
backgroundColor: '#F7F7F7',
keepAlive: true,
}
}],
tag: [{
......
......@@ -31,42 +31,14 @@
</div>
<div class="detail-second">
<van-cell-group :class="[isMore ? '' : 'more-hidden']">
<van-cell
title="添加时间"
:value="userInfo.info.addTime"
/>
<van-cell
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 v-for="(i,index) in detailObj">
<van-cell
:key="index"
:title="i.title"
:value="i.value(userInfo)"
@click="setDetail(i)"
/>
</template>
</van-cell-group>
<div
class="detail-more text-center"
......@@ -128,6 +100,21 @@
</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>
</template>
......@@ -149,22 +136,106 @@ export default {
0: '未知',
1: '男',
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() {
this.showLoading()
let { id } = this.getQuery()
id = 'wm219ICgAARGgXJUmUdGxCgNfGxRCWDg'
if (id) {
this.id = id
this.getCustomerDetail(id)
} else {
wxConfig.init(['getCurExternalContact']).then(() => {
wxConfig.getCurExternalContact().then(userId => {
this.id = userId
this.getCustomerDetail(userId)
})
})
}
},
deactivated() {
console.log('离开')
},
methods: {
moreInfo() {
this.isMore = !this.isMore
......@@ -185,6 +256,29 @@ export default {
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 {
background-color: #fff;
.van-cell-group {
transition: all 0.25s;
height: 600px;
height: 540px;
overflow: hidden;
}
.van-cell {
......
<template>
<div class="edit-wrapper">
<van-field v-model="value" placeholder="请输入" />
<div class="submit">保存</div>
<van-field
v-model="value"
placeholder="请输入"
clearable
/>
<div
class="submit"
@click="save"
>保存</div>
</div>
</template>
<script>
......@@ -12,7 +19,13 @@ export default {
}
},
created() {
document.title = this.$route.params.title
document.title = `设置${this.$route.params.title}`
},
methods: {
save() {
window.$back = true
this.$router.back(-1)
}
}
}
</script>
......@@ -33,7 +46,7 @@ export default {
transform: translateX(-50%);
width: 343px;
height: 42px;
background-color: #5859ff;
background-color: #3975c6;
border-radius: 21px;
font-size: 14px;
color: #fff;
......
<template>
<div class="tagContainer">
<search
placeholder="请输入关键字"
v-if="isTitle"
:keyword="keyWord"
@search="searchkeyWord"
></search>
<tip :title="title"></tip>
<template v-if="customerList && customerList.length > 0">
<div class="customerList">
<scroll-view
class="content"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div
class="customer"
v-for="(item, index) in customerList"
:key="item.id"
@click="gotoInfo(item)"
<div class="tagContainer" v-if="flag">
<search
placeholder="请输入关键字"
v-if="isTitle"
:keyword="keyWord"
@search="searchkeyWord"
></search>
<tip :title="title"></tip>
<template v-if="customerList && customerList.length > 0">
<div class="customerList">
<scroll-view
class="content"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div class="checked-box">
<template v-if="item.isChecked">
<div
class="sprite-icon icon-customer-active"
@click.stop="toggleHandle(index)"
></div>
</template>
<template v-else>
<div
class="checked"
@click.stop="toggleHandle(index)"
></div>
</template>
</div>
<div class="customer-portrait">
<img
:src="item.avatar"
alt=""
v-if="item.avatar"
/>
<div
class="customer"
v-for="(item, index) in customerList"
:key="item.id"
@click="gotoInfo(item)"
>
<div class="checked-box">
<template v-if="item.isChecked">
<div
class="sprite-icon icon-customer-active"
@click.stop="toggleHandle(index)"
></div>
</template>
<template v-else>
<div
class="checked"
@click.stop="toggleHandle(index)"
></div>
</template>
</div>
<div class="customer-portrait">
<img
:src="item.avatar"
alt=""
v-if="item.avatar"
/>
<img
src="../../assets/images/user.png"
alt=""
v-else
/>
</div>
<div class="customer-info">
<div class="customer-info-name">
<label class="name text-hide">
{{ item.customerName }}
</label>
<label class="origin">{{ item.type == 1 ? '@微信' : '@企微' }}</label>
</div>
<div class="date">{{ new Date(item.createdTime.replace(/-/g, '/')).format('yyyy-MM-dd') }}添加</div>
</div>
<img
src="../../assets/images/user.png"
alt=""
v-else
class="icon"
src="../../assets/images/icon/arrow.png"
/>
<div class="buttomLine"></div>
</div>
<div class="customer-info">
<div class="customer-info-name">
<label class="name">
{{ item.customerName }}
</label>
<label class="origin">{{ item.type == 1 ? '@微信' : '@企微' }}</label>
</scroll-view>
<template>
<div class="footer">
<div class="checked-box">
<template v-if="allChecked">
<div
class="sprite-icon icon-customer-active"
@click.stop="checkAll()"
></div>
</template>
<template v-else>
<div
class="checked"
@click.stop="checkAll()"
></div>
</template>
</div>
<div class="date">{{ new Date(item.createdTime.replace(/-/g, '/')).format('yyyy-MM-dd') }}添加</div>
</div>
<img
class="icon"
src="../../assets/images/icon/arrow.png"
/>
<div class="buttomLine"></div>
</div>
</scroll-view>
<template>
<div class="footer">
<div class="checked-box">
<template v-if="allChecked">
<div
class="sprite-icon icon-customer-active"
@click.stop="checkAll()"
></div>
</template>
<template v-else>
<div
class="checked"
@click.stop="checkAll()"
></div>
</template>
</div>
<div class="checkAll">
全选
<label>已选{{ checkList.length }}个客户</label>
<div class="checkAll">
全选
<label>已选{{ checkList.length }}个客户</label>
</div>
<van-button
class="my-button"
round
color="#3975C6"
@click="handleTag"
>批量打标签</van-button>
</div>
<van-button
class="my-button"
round
color="#3975C6"
@click="handleTag"
>批量打标签</van-button>
</div>
</template>
</div>
</template>
<empty
v-else
description="暂无数据"
/>
<make
@success="successHandle"
:externalUserIds="externalUserIds"
ref="popRefs"
></make>
</div>
</template>
</div>
</template>
<empty
v-else
description="暂无数据"
/>
<make
@success="successHandle"
:externalUserIds="externalUserIds"
ref="popRefs"
></make>
</div>
</template>
<script>
import make from './make.vue'
......@@ -119,7 +119,8 @@ export default {
checkList: [],
allChecked: false,
title: '',
userIds: ''
userIds: '',
flag:false
}
},
name: 'tag',
......@@ -131,15 +132,14 @@ export default {
},
created() {
console.log(this.isTitle)
let { taskId } = this.getQuery()
//获取userid
this.taskId = this.$route.query.taskId ? this.$route.query.taskId : 'e0e1a10cf50f427bb6d35906cf3dbf21'
this.taskId = taskId || 'e0e1a10cf50f427bb6d35906cf3dbf21'
this.getuserInfo()
//初始化数据
if (this.isTitle) {
this.init()
} else {
this.initAll()
}
this.showLoading()
if (this.isTitle) this.init()
else this.initAll()
},
mounted() {
this.initWx()
......@@ -147,8 +147,7 @@ export default {
methods: {
//初始化微信接口
initWx() {
window.$wx = wxConfig
window.$wx.init(['openEnterpriseChat']).then(() => {})
wxConfig.init(['openEnterpriseChat']).then(() => {})
},
initAll() {
let search = {
......@@ -157,11 +156,15 @@ export default {
}
this.allChecked = false
groupCustomer.getCustomerList(search).then(res => {
this.hideLoading()
this.customerList = res || []
this.title = `已有${this.customerList.length}位客户已通过您的好友申请!`
this.customerList.forEach(item => {
this.$set(item, 'isChecked', false)
})
this.title = `已有${res.length || 0}位客户已通过您的好友申请!`
this.flag = true
if (res && res.length) {
this.customerList.forEach(item => {
this.$set(item, 'isChecked', false)
})
}
})
},
getuserInfo() {
......@@ -176,9 +179,11 @@ export default {
}
this.allChecked = false
groupTag.getcustomerList(obj).then(res => {
this.hideLoading()
this.customerList = res || []
this.title = `您共有${this.customerList.length}位客户可添加标签`
if (this.customerList.length > 0) {
this.title = `您共有${res.length || 0}位客户可添加标签`
this.flag = true
if (res && res.length) {
this.customerList.forEach(item => {
this.$set(item, 'isChecked', false)
})
......@@ -238,7 +243,7 @@ export default {
groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
chatId: ''
}
window.$wx.openEnterpriseChat(seach).then(res => {
wxConfig.openEnterpriseChat(seach).then(res => {
// console.log(res)
})
},
......@@ -258,7 +263,6 @@ export default {
}
.customer {
padding: 0 16px;
width: 375px;
box-sizing: border-box;
display: flex;
align-items: center;
......@@ -274,7 +278,7 @@ export default {
}
.customer-info {
padding: 16px 0;
width: calc(100% - 130px);
.customer-info-name {
font-size: 16px;
line-height: 22px;
......@@ -282,10 +286,7 @@ export default {
padding-bottom: 6px;
display: flex;
.name {
// width: 60px;
overflow: hidden;
white-space: nowrap;
// text-overflow: ellipsis;
max-width: 70%;
}
.origin {
color: #6760ff;
......@@ -374,8 +375,8 @@ export default {
}
.tagContainer /deep/ .van-checkbox__icon--checked .van-icon {
color: #fff;
background-color: #3975C6 !important;
border-color: #3975C6 !important;
background-color: #3975c6 !important;
border-color: #3975c6 !important;
}
.tagContainer /deep/.van-checkbox__icon .van-icon {
width: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!