Commit 9da67433 by 王志慧

commit

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