Commit 31797b7c by qiyeqing

群聊!

1 parent 6f32c84a
...@@ -14,6 +14,13 @@ const getTree=(params)=>{ ...@@ -14,6 +14,13 @@ const getTree=(params)=>{
params, params,
}) })
} }
const chatGrounpList=(params)=>{
return request({
url:'/wecom/finance/getChatRoomContactList',
method: 'get',
params,
})
}
const listByCustomer=(params)=>{ const listByCustomer=(params)=>{
return request({ return request({
url:'/wecom/customer/list', url:'/wecom/customer/list',
...@@ -33,5 +40,6 @@ const getTree=(params)=>{ ...@@ -33,5 +40,6 @@ const getTree=(params)=>{
getTree, getTree,
chatList, chatList,
listByCustomer, listByCustomer,
getChatAllList getChatAllList,
chatGrounpList
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,15 +6,14 @@ ...@@ -6,15 +6,14 @@
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'"> <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'">
<el-col :span="3"> <img :src="item.finalChatContext.fromInfo.avatar"></el-col> <el-col :span="3"> <img v-if="item.finalChatContext.fromInfo" :src="item.finalChatContext.fromInfo.avatar"></el-col>
<el-col :span="21"> <el-col :span="21">
<p>{{item.roomInfo.groupName}} <span class="fr gray">{{parseTime(item.finalChatContext.fromInfo.updateTime)}}</span></p> <p>{{item.finalChatContext.roomInfo.name}} <span class="fr gray">{{parseTime(item.finalChatContext.fromInfo.updateTime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.fromInfo">{{item.finalChatContext.fromInfo.name}}:{{item.finalChatContext.text.content}}</p> <p class="gray padt10" v-if="item.finalChatContext.fromInfo">{{item.finalChatContext.fromInfo.name}}:{{item.finalChatContext.text.content}}</p>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'"> <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'">
<el-col :span="3">&nbsp; `</el-col>
<el-col :span="3">&nbsp;</el-col>
<el-col :span="21"> <el-col :span="21">
<p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p> <p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" >{{item.finalChatContext.from}}: <p class="gray padt10" >{{item.finalChatContext.from}}:
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
}, },
methods:{ methods:{
liClick(e){ liClick(e){
this.$emit('chatFn',e) this.$emit('groupFn',e)
} }
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</list> </list>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="群聊" name="2"> <el-tab-pane label="群聊" name="2">
<grouplist v-if="activeName==2" :personList="personList" :loading="loading" @chatFn='chatFn'> <grouplist v-if="activeName==2" :personList="personList" :loading="loading" @groupFn='groupFn'>
</grouplist> </grouplist>
</el-tab-pane> </el-tab-pane>
...@@ -49,43 +49,37 @@ ...@@ -49,43 +49,37 @@
<el-tab-pane label="全部" name="0"> <el-tab-pane label="全部" name="0">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<chat :allChat="allChat" v-if="allChat.length>=1"></chat> <chat :allChat="allChat" v-if="allChat.length>=1"></chat>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" <el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" class="pagination"
class="pagination" :current-page="currentPage" @current-change="currentChange" :current-page="currentPage" @current-change="currentChange" :total="total">
:total="total">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="图片及视频" name="1"> <el-tab-pane label="图片及视频" name="1">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat> <chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat>
<el-pagination background v-if="allChatImg.length>=1" class="pagination" <el-pagination background v-if="allChatImg.length>=1" class="pagination" layout="prev, pager, next"
layout="prev, pager, next" :total="total" @current-change="currentChange" :total="total" @current-change="currentChange" :current-page="currentPage">
:current-page="currentPage">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文件" name="2"> <el-tab-pane label="文件" name="2">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="allFile" stripe style="width: 100%" <el-table :data="allFile" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型"> <el-table-column prop="msgtype" label="类型">
</el-table-column> </el-table-column>
<el-table-column label="名称"> <el-table-column label="名称">
...@@ -115,9 +109,8 @@ ...@@ -115,9 +109,8 @@
<el-tab-pane label="链接" name="3"> <el-tab-pane label="链接" name="3">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
...@@ -125,13 +118,11 @@ ...@@ -125,13 +118,11 @@
<el-tab-pane label="语音通话" name="4"> <el-tab-pane label="语音通话" name="4">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="fileData" stripe style="width: 100%" <el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人"> <el-table-column prop="date" label="发起人">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="通话时间"> <el-table-column prop="name" label="通话时间">
...@@ -162,7 +153,8 @@ ...@@ -162,7 +153,8 @@
} from '@/utils/common.js' } from '@/utils/common.js'
export default { export default {
components: { components: {
list,grouplist, list,
grouplist,
chat chat
}, },
data() { data() {
...@@ -216,9 +208,12 @@ ...@@ -216,9 +208,12 @@
}, },
currentChange(e) { currentChange(e) {
this.currentPage = e this.currentPage = e
if (this.activeName == '2') {
return this.activeNameThreeClick(true, true)
}
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
activeNameThreeClick(page) { activeNameThreeClick(page, group) {
if (!!!page) { if (!!!page) {
this.currentPage = 1 this.currentPage = 1
} }
...@@ -235,16 +230,41 @@ ...@@ -235,16 +230,41 @@
} else if (this.activeNameThree == 4) { } else if (this.activeNameThree == 4) {
msgType = 'voice' msgType = 'voice'
} }
let query = { let query = {
fromId: this.employId, fromId: this.employId,
receiveId: this.chat.receiveId,
msgType, msgType,
pageSize: '10', pageSize: '10',
pageNum: this.currentPage, pageNum: this.currentPage,
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '',
} }
if (group) {
query.roomId = this.chat.roomId
} else {
query.receiveId = this.chat.receiveId
}
if (group) {
console.log(query)
content.chatGrounpList(query).then(res => {
this.total = Number(res.total)
if (this.activeNameThree == 0) {
return this.allChat = res.rows
}
if (this.activeNameThree == 1) {
return this.allChatImg = res.rows
}
if (this.activeNameThree == 2) {
return this.allFile = res.rows
}
if (this.activeNameThree == 3) {
return this.allLInk = res.rows
}
if (this.activeNameThree == 4) {
return this.allVoice = res.rows
}
})
} else {
content.chatList(query).then(res => { content.chatList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.total)
if (this.activeNameThree == 0) { if (this.activeNameThree == 0) {
...@@ -264,6 +284,7 @@ ...@@ -264,6 +284,7 @@
} }
}) })
} }
}
}, },
chatFn(data) { chatFn(data) {
this.chat = data; this.chat = data;
...@@ -271,6 +292,11 @@ ...@@ -271,6 +292,11 @@
this.activeNameThreeClick() this.activeNameThreeClick()
} }
}, },
groupFn(data) {
this.chat = data;
this.chat.receiveWeCustomer = 'a'
this.activeNameThreeClick('', true)
},
getTree() { getTree() {
api.getTree().then(({ api.getTree().then(({
data data
...@@ -334,6 +360,7 @@ ...@@ -334,6 +360,7 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
* { * {
...@@ -403,6 +430,7 @@ ...@@ -403,6 +430,7 @@
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
color: #999; color: #999;
text-align: center; text-align: center;
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
...@@ -415,10 +443,12 @@ ...@@ -415,10 +443,12 @@
} }
} }
.pagination { .pagination {
padding: 10px 0; padding: 10px 0;
height: 30px; height: 30px;
float: left; float: left;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!