Commit 9da67433 by 王志慧

commit

1 parent 86dc54ac
......@@ -34,6 +34,7 @@
color: #333333;
line-height: 20px;
margin-bottom: 6px;
max-width: 120px;
.wx {
font-size: 14px;
font-weight: 400;
......
......@@ -42,8 +42,12 @@ export default {
index(n) {
this.tabIndex = n
},
list(n) {
this.data = n
list: {
handler(n) {
this.data = n
},
immediate: true,
deep:true
}
},
mounted() {},
......
......@@ -60,7 +60,7 @@
<div v-for="item in i.labelInfoList" :key="item.id" class="label-text text-center">{{ item.labelName }}</div>
</div>
</template>
<div class="btn-box">
<div class="btn-box" v-if="customerId == 0">
<div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" />
<span>标签</span>
......@@ -228,7 +228,8 @@ export default {
maxDate: new Date(),
selectDate: new Date(),
minDate: new Date(2002, 1, 1),
target: ''
target: '',
customerId: 0 //默认是客户显示打标签按钮
}
},
activated() {
......@@ -243,8 +244,7 @@ export default {
mounted() {
this.showLoading()
let { id, customerId } = this.getQuery()
console.log(id)
// id = 'wmdMreDgAA2tF6eep95QX1zxGuKjObHA'
// id = 'wo_pmOEQAAr93aXGLTNtAjLGZZxpwXuQ'
if (id) {
this.id = id
this.customerId = customerId //用来判断。若员工尚未添加该客户为好友,则暂不允许在客户跟进中修改客户的信息,仅只读。
......@@ -306,7 +306,7 @@ export default {
userInfo: { vehicleInfo, info }
} = this
let userId = this.id
if (this.customerId == 0) return
if (this.customerId == -1) return
if (type == 'tel') {
if (info.customerPhone && save_key == 'customerPhone') return
this.$router.push({
......
......@@ -38,8 +38,8 @@
</div>
</div>
</div>
<tab-customer :list="list" @change="change" :index="tabIndex">
<index ref="customerIndex" :index="tabIndex" :chatId="chatId" @listChange="getList"></index>
<tab-customer :list="['客户(' + custList.length + ')', '员工(' + staffList.length + ')']" @change="change" :index="tabIndex">
<index ref="customerIndex" :index="tabIndex" :keyWord="keyWord" @searchkeyWord="searchkeyWord"></index>
</tab-customer>
</div>
</template>
......@@ -53,16 +53,18 @@ export default {
tabIndex: 0,
baseStatics: '', //群统计
groupBase: '',
list: ['客户', '员工'],
chatId: ''
// list: ['客户', '员工'],
chatId: '',
keyWord: '',
custList: [],
staffList: []
}
},
mounted() {
this.showLoading()
let { id } = this.getQuery()
console.log(id)
// id = '1127'
// id = 'wr_pmOEQAAux1Gl8wPKIswjE49qP1mnQ'
if (id) {
this.chatId = id
this.initData(id)
......@@ -72,7 +74,7 @@ export default {
wxConfig
.getCurExternalChat()
.then(chatId => {
console.log(chatId,'chatId')
console.log(chatId, 'chatId')
this.chatId = chatId
this.initData(chatId)
})
......@@ -90,15 +92,18 @@ export default {
})
}
},
methods: {
initData(id) {
this.getCustomerBaseDetail(id) //群基本信息
this.getCustomerBaseDetailStatics(id) //统计接口
this.getCustomerCustList() //群客户列表
this.getCustomerStaffList() //群员工列表
},
//群基本信息
getCustomerBaseDetail(id) {
getCustomerBaseDetail(chatId) {
let obj = {
id,
chatId,
pageSize: 10,
pageNum: 1
}
......@@ -111,9 +116,9 @@ export default {
})
},
//统计接口
getCustomerBaseDetailStatics(id) {
getCustomerBaseDetailStatics(chatId) {
let obj = {
id,
chatId,
pageSize: 10,
pageNum: 1
}
......@@ -123,12 +128,47 @@ export default {
}
})
},
//群客户列表
getCustomerCustList() {
let obj = {
chatId: this.chatId,
pageSize: 20,
pageNum: 1,
keyword: this.keyWord
}
detailApi.getCustomerCustList(obj).then(res => {
console.log('res', res)
if (res) {
this.custList = res
this.$refs.customerIndex.custList = res
}
})
},
//群员工列表
getCustomerStaffList() {
let obj = {
chatId: this.chatId,
pageSize: 20,
pageNum: 2,
customerName: this.keyWord
}
detailApi.getCustomerStaffList(obj).then(res => {
if (res) {
this.staffList = res
this.$refs.customerIndex.staffList = res
}
})
},
change(index) {
this.$refs.customerIndex.initSearch()
this.keyWord = ''
this.tabIndex = index
if (this.tabIndex == 0) this.getCustomerCustList() //群客户列表
if (this.tabIndex == 1) this.getCustomerStaffList() //群员工列表
},
getList(data) {
this.list = data.list
searchkeyWord(e) {
this.keyWord = e
if (this.tabIndex == 0) this.getCustomerCustList() //群客户列表
if (this.tabIndex == 1) this.getCustomerStaffList() //群员工列表
}
}
}
......
......@@ -11,7 +11,7 @@
<div v-else class="sprite-icon icon-avatar"></div>
</div>
<div class="info">
<div class="phone flex">
<div class="phone flex text-hide">
{{ item.groupNickName }}
<div class="wx">{{ item.type == 1 ? '@微信' : '@企微' }}</div>
</div>
......@@ -24,6 +24,7 @@
</template>
</div>
</div>
<!-- isMyCustomer 是否是我的客户 0是 -1否 -->
<template v-if="item.isMyCustomer == 0 && tabIndex == 0">
<div class="mark">我的客户</div>
</template>
......@@ -42,16 +43,14 @@
<script type='text/ecmascript-6'>
import { detailApi, ssoApi, wxConfig } from '@/api'
import { Toast } from 'vant'
export default {
name: '',
data() {
return {
tabIndex: this.index,
custList: [],
staffList: [],
keyWord: '',
list: [],
id: this.chatId
staffList: []
}
},
props: {
......@@ -59,7 +58,7 @@ export default {
type: Number,
default: 0
},
chatId: {
keyWord: {
type: String,
default: ''
}
......@@ -67,27 +66,6 @@ export default {
watch: {
index(n) {
this.tabIndex = n
},
custList: {
handler() {
this.$emit('listChange', { list: ['客户(' + this.custList.length + ')', '员工(' + this.staffList.length + ')'] })
},
deep: true,
immediate: true
},
staffList: {
handler() {
this.$emit('listChange', { list: ['客户(' + this.custList.length + ')', '员工(' + this.staffList.length + ')'] })
},
deep: true,
immediate: true
},
chatId: {
handler(e) {
this.id = e
this.initData()
},
immediate: true
}
},
created() {
......@@ -101,59 +79,17 @@ export default {
initWx() {
wxConfig.init(['openEnterpriseChat']).then(() => {})
},
initData(index) {
// if (index == 0) this.getCustomerCustList() //群客户列表
// if (index == 1) this.getCustomerStaffList() //群员工列表
this.getCustomerCustList() //群客户列表
this.getCustomerStaffList() //群员工列表
},
initSearch() {
this.keyWord = ''
// console.log(this.keyWord)
this.initData()
},
getuserInfo() {
ssoApi.getuserInfo().then(res => {
this.workUserId = res.data.workUserId
})
},
//群客户列表
getCustomerCustList() {
let obj = {
id: this.id,
pageSize: 20,
pageNum: 1,
keyword: this.tabIndex == 0 ? this.keyWord : ''
}
detailApi.getCustomerCustList(obj).then(res => {
if (res) {
this.custList = res
// console.log(this.custList)
}
})
},
//群员工列表
getCustomerStaffList() {
let obj = {
id: this.id,
pageSize: 20,
pageNum: 2,
customerName: this.tabIndex == 1 ? this.keyWord : ''
}
detailApi.getCustomerStaffList(obj).then(res => {
if (res) {
this.staffList = res
// console.log(this.staffList)
}
})
},
searchkeyWord(e) {
this.keyWord = e
if (this.tabIndex == 0) this.getCustomerCustList() //群客户列表
if (this.tabIndex == 1) this.getCustomerStaffList() //群员工列表
// this.keyWord = e
this.$emit('searchkeyWord', e)
},
change(e) {
// console.log(e)
this.tabIndex = e
},
onReachBottom() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!