Commit b773cd75 by 胡悦

提交 一客一群

1 parent 94031874
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7",
"echarts": "^5.2.0", "echarts": "^5.2.0",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
...@@ -46,4 +47,4 @@ ...@@ -46,4 +47,4 @@
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }
\ No newline at end of file \ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<img src="./assets/logo.png" alt="" srcset="" /> <img src="./assets/logo.png" alt="" srcset="" />
</div> --> </div> -->
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd"> <keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd,guestGroupDetail">
<router-view></router-view> <router-view></router-view>
</keep-alive> </keep-alive>
</div> </div>
......
...@@ -10,6 +10,7 @@ import { http } from '@/main' ...@@ -10,6 +10,7 @@ import { http } from '@/main'
const URL = '/rop-scrm-entmicro/router' const URL = '/rop-scrm-entmicro/router'
const PATH = 'entmicro.api.one.template.' const PATH = 'entmicro.api.one.template.'
const WURL = '/rop-scrm-wechat/router' const WURL = '/rop-scrm-wechat/router'
const PATH2 = 'entmicro.api.group.'
const templateList = params => { const templateList = params => {
params.method = `${PATH}page` params.method = `${PATH}page`
...@@ -102,7 +103,17 @@ const getStatus = params => { ...@@ -102,7 +103,17 @@ const getStatus = params => {
} }
//一客一群详情页 //一客一群详情页
const getListApi = params => { const getListApi = params => {
params.method = `${PATH}page` params.method = `${PATH}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerList = params => {
params.method = `${PATH2}template.customer.page`
return http({ return http({
url: URL, url: URL,
method: 'GET', method: 'GET',
...@@ -111,6 +122,15 @@ const getListApi = params => { ...@@ -111,6 +122,15 @@ const getListApi = params => {
}) })
} }
const getFollower = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
templateList, templateList,
...@@ -122,5 +142,7 @@ export default { ...@@ -122,5 +142,7 @@ export default {
nameVaild, nameVaild,
getStatus, getStatus,
updateNameVaild, updateNameVaild,
getListApi getListApi,
customerList,
getFollower
} }
...@@ -12,11 +12,11 @@ let cfg = require('./conf.js') ...@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (isEnv = true) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
// https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base // https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config // https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config
return new Http({request:{timeout:3000}}).get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config') return new Http({request:{timeout:3000}}).get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config')
......
...@@ -29,6 +29,7 @@ Vue.config.productionTip = false ...@@ -29,6 +29,7 @@ Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.use(glsxTable); Vue.use(glsxTable);
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.size = 'small'
// Vue.prototype.btn_size = 'mini' // Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants Vue.prototype.$Constants = Constants
Vue.prototype.$Utils = Util Vue.prototype.$Utils = Util
......
import { Message } from 'element-ui'
let util = {}
util.cloneText = function (message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function (sign = '-') {
let day = new Date();
let month = day.getMonth() + 1;
let date = day.getDate();
if (month < 10) month = '0' + month;
if (date < 10) date = '0' + date;
var s = day.getFullYear() + sign + month + sign + date;
return s;
}
util.getBeforeMonth = function (days) {
let month = new Date().getMonth() + 1;
let year = new Date().getFullYear();
let arr = new Array();
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1;
month = month + 12;
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
}
return arr;
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function (time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function (dateStr, separator) {
if (!separator) {
separator = "-";
}
var dateArr = dateStr.split(separator);
var year = parseInt(dateArr[0]);
var month;
//处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) {
month = parseInt(dateArr[1].substring(1));
} else {
month = parseInt(dateArr[1]);
}
var day = parseInt(dateArr[2]);
var date = new Date(year, month - 1, day);
return date;
}
util.getDay = function (num, str = '-') {
var today = new Date();
var nowTime = today.getTime();
var ms = 24 * 3600 * 1000 * num;
today.setTime(parseInt(nowTime + ms));
var oYear = today.getFullYear();
var oMoth = (today.getMonth() + 1).toString();
if (oMoth.length <= 1) oMoth = '0' + oMoth;
var oDay = today.getDate().toString();
if (oDay.length <= 1) oDay = '0' + oDay;
return oYear + str + oMoth + str + oDay;
}
util.openUrl = function (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image();
// 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous");
image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
var context = canvas.getContext("2d");
context.drawImage(image, 0, 0, image.width, image.height);
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件
};
image.src = imgsrc;
}
export default util
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main" v-loading="loading">
<el-dialog title="选择跟进专员" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<div class="table-box">
<GLTable v-if="dialogVisible" ref="table" :layout="layout" :tableData="tableData" :hasNum="false" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable" @row-click="rowClick"></GLTable>
<div class="form-tips">必须配置至少1个跟进专员</div>
</div>
<span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl">新增专员</a>
<el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'SelectFollow',
data() {
return {
loading: false,
dialogVisible: false,
tableSearchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
}
]
},
layout: '',
tableData: [],
tableTotal: 0,
selectItem: [],
selectEmp: []
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/home/followUp/index')
},
getFollower() {
var params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum
}
this.$apis.groupGuest.getFollower(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.count > 10) {
this.layout = 'pager'
}
this.tableData.forEach(item => {
this.selectEmp.forEach((itm, index) => {
if (itm.staffId == item.relationId) {
this.$refs.table.$refs.salelistMutiTable.toggleRowSelection(item)
this.selectEmp.splice(index, 1)
}
})
})
})
},
init(item) {
this.tableSearchForm = {}
this.selectEmp = JSON.parse(JSON.stringify(item))
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.table.page.pageNum = 1
this.getFollower()
})
},
handleSearch() {
this.getFollower()
},
selectionTable(val) {
this.selectItem = val
},
handleClose() {
this.handleCancel()
},
rowClick(row) {
this.$refs.table.$refs.salelistMutiTable.toggleRowSelection(row)
},
handleCancel: utils.debounce(function () {
this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300),
handleSelect: utils.debounce(function () {
this.loading = true
let selectEmp = this.selectEmp.map(item => {
return {
relationId: item.staffId,
staffName: item.staffName
}
})
const selectItem = this.selectItem.concat(selectEmp)
if (selectItem.length == 0) {
this.$message.error('请选择员工')
return
}
this.loading = false
this.dialogVisible = false
this.$emit('selectTable', this.selectItem.concat(selectEmp))
this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300)
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850FF;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.square-main {
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
.form-tips {
position: absolute;
bottom: 0;
right: 0;
font-size: 12px;
color: #999;
line-height: 32px;
}
.table-box {
position: relative;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -102,11 +102,7 @@ export default { ...@@ -102,11 +102,7 @@ export default {
this.innerTags.forEach(item => { this.innerTags.forEach(item => {
userIds.push(item.userId) userIds.push(item.userId)
}) })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
} }
// onCancel() {
// this.$emit('closeDrawer')
// }
}, },
mounted() {} mounted() {}
} }
......
<template> <template>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<div class="btn-header"> <div class="btn-header">
<!-- <el-button class="addBtn" @click="btnClick('create')">新建群组</el-button> --> <el-button class="addBtn" @click="btnClick('create')">新建群组</el-button>
<GLButton class="addBtn" @click="btnClick('create')" fn="新建群组">新建群组</GLButton> <GLButton class="addBtn" @click="btnClick('create')" fn="新建群组">新建群组</GLButton>
<span class="toptips"> <span class="toptips">
<span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span> <span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span>
...@@ -9,13 +9,25 @@ ...@@ -9,13 +9,25 @@
</div> </div>
<div class="container"> <div class="container">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="searchFormData"> <search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="searchFormData"
>
<span class="inline-b" style="float: right" slot="form-slot"> <span class="inline-b" style="float: right" slot="form-slot">
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
</span> </span>
</search-form> </search-form>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="gueastGroup" @setTableFinishFun="setTableFinishFun" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf"> <GLTable
ref="gueastGroup"
@setTableFinishFun="setTableFinishFun"
:noDataImg="url"
:getListApi="getListApi"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div slot="entmicro-name" class="entmicro" slot-scope="scope"> <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<!-- <span v-for="(i, index) in scope.scope.userList" :key="index"> <!-- <span v-for="(i, index) in scope.scope.userList" :key="index">
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
...@@ -29,10 +41,20 @@ ...@@ -29,10 +41,20 @@
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }} {{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag> </el-tag>
<el-tag type="info" v-if="scope.scope.userList.length > 9 && idx == 9"> <el-tag type="info" v-if="scope.scope.userList.length > 9 && idx == 9">
<el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"> <el-popover
placement="top"
width="600"
trigger="hover"
content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<span slot="reference">...({{ scope.scope.userList.length }})</span> <span slot="reference">...({{ scope.scope.userList.length }})</span>
<div class="entmicro-hover"> <div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in scope.scope.userList" :key="index" :disable-transitions="false"> <el-tag
type="info"
v-for="(i, index) in scope.scope.userList"
:key="index"
:disable-transitions="false"
>
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag> </el-tag>
...@@ -42,17 +64,25 @@ ...@@ -42,17 +64,25 @@
</div> </div>
</div> </div>
<span slot="status" slot-scope="scope"> <span slot="status" slot-scope="scope">
<span class="statusText" :class="{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">{{ scope.scope.status == '1' ? '启用' : '停用' }}</span> <span
class="statusText"
:class="{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }"
>{{ scope.scope.status == '1' ? '启用' : '停用' }}</span>
</span> </span>
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<!-- <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button> --> <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
<el-button type="text" @click="btnClick('detail', scope.scope)">查看详情</el-button>
<GLButton type="text" @click="btnClick('detail', scope.scope)" fn="客户群详情">查看详情</GLButton> <GLButton type="text" @click="btnClick('detail', scope.scope)" fn="客户群详情">查看详情</GLButton>
<GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton> <GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton>
<GLButton type="text" @click="btnClick('status', scope.scope)" fn="启用禁用">{{ scope.scope.status == 1 ? '停用' : '启用' }}</GLButton> <GLButton
type="text"
@click="btnClick('status', scope.scope)"
fn="启用禁用"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</GLButton>
<!-- <el-button <!-- <el-button
type="text" type="text"
@click="btnClick('status', scope.scope)" @click="btnClick('status', scope.scope)"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button> --> >{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button>-->
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -89,7 +119,7 @@ export default { ...@@ -89,7 +119,7 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '群聊名称', label: '群聊名称',
prop: 'orgName', prop: 'groupName',
width: 200 width: 200
}, },
{ {
...@@ -247,7 +277,7 @@ export default { ...@@ -247,7 +277,7 @@ export default {
btnClick(name, rowData) { btnClick(name, rowData) {
switch (name) { switch (name) {
case 'create': case 'create':
this.$router.push('/guestGroup/add') this.$router.push('/guestGroup/add/-1')
break break
case 'edit': case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id) this.$router.push('/guestGroup/add/' + rowData.id)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!