Commit 5f75facc by xinlaa

放开引流码页面,客户管理,引流码等接口对接中

1 parent 93b5a5bf
import request from '@/utils/request'
const service = config.services.wecom + '/user'
/**
* 获取离职未分配员工列表
* @param {*} params
* {
* pageNum:
pageSize:
userName:离职人员名称
beginTime:}
*/
export function getList(params) {
return request({
url: service + '/leaveUserNoAllocateList',
params
})
}
/**
* 分配离职员工数据
* @param {*} data
{
"handoverUserid": "原跟进成员的userid",
"takeoverUserid": "接替成员的userid"
}
*/
export function allocate(data) {
return request({
url: service + '/allocateLeaveUserAboutData',
method: 'put',
data
})
}
import request from '@/utils/request'
const service = config.services.wecom + '/group'
/**
* 客户群列表
* @param {*} data
* {
* pageNum:
pageSize:
groupName:
beginTime:
endTime:}
*/
export function getList(params) {
return request({
url: service + '/chat/list',
method: 'get',
params
})
}
/**
* 群成员列表
* @param {*} params
* {
"groupId": "群id",
"memberName": "成员名称",
"pageNum": "",
"pageSize": ""
}
*/
export function getMembers(params) {
return request({
url: service + '/chat/members',
params
})
}
...@@ -2,6 +2,26 @@ import request from '@/utils/request' ...@@ -2,6 +2,26 @@ import request from '@/utils/request'
const service = config.services.wecom + '/customer' const service = config.services.wecom + '/customer'
/** /**
* 客户列表
* @param {*} params
* {
"pageNum": "当前页",
"pageSize": "每页显示条数",
"name": "客户名称",
"userId": "添加人id",
"tagIds": "标签id,多个标签,id使用逗号隔开",
"beginTime": "开始时间",
"endTime": "结束时间"
}
*/
export function getList(params) {
return request({
url: service + '/list',
params
})
}
/**
* 客户同步接口 * 客户同步接口
*/ */
export function sync() { export function sync() {
...@@ -9,3 +29,29 @@ export function sync() { ...@@ -9,3 +29,29 @@ export function sync() {
url: service + '/synchWeCustomer', url: service + '/synchWeCustomer',
}) })
} }
/**
* 编辑客户标签
* @param {*} data
* {
"userid": "添加此客户添加人的id",
"externalUserid": "外部联系人userid",
"addTag": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名"
}],
"removeTag": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名"
}]
}
*/
export function makeLabel(data) {
return request({
url: service + '/makeLabel',
method: 'post',
data
})
}
import request from '@/utils/request'
const service = config.services.wecom + '/user'
/**
* 获取离职未分配员工列表
* @param {*} params
* {
* pageNum:
pageSize:
userName:离职人员名称
beginTime:}
*/
export function getList(params) {
return request({
url: service + '/leaveUserNoAllocateList',
params
})
}
/**
* 分配离职员工数据
* @param {*} data
{
"handoverUserid": "原跟进成员的userid",
"takeoverUserid": "接替成员的userid"
}
*/
export function allocate(data) {
return request({
url: service + '/allocateLeaveUserAboutData',
method: 'put',
data
})
}
import request from '@/utils/request'
const service = config.services.wecom + '/tlp'
/**
* 获取欢迎语列表
* @param {*} params
{
"pageNum": "当前页",
"pageSize": "每页显示条数",
"welcomeMsg": "欢迎语关键词",
"welcomeMsgTplType": " 欢迎语模板类型:1:员工欢迎语;2:部门员工欢迎语;3:客户群欢迎语"
}
*/
export function getList(params) {
return request({
url: service + '/list',
params
})
}
/**
* 根据欢迎语模板id获取模板使用范围
* @param {*} id
*/
export function getScop(id) {
return request({
url: service + '/scop/' + id,
})
}
/**
* 编辑欢迎语模板
* @param {*} data
{
"id": "主键",
"welcomeMsg": "欢迎语",
"welcomeMsgTplType": "欢迎语模板类型:1:员工欢迎语;2:部门员工欢迎语;3:客户群欢迎语",
"weMsgTlpScopes": [
{
"useUserId": "使用人员id"
}
]
}
*/
export function edit(data) {
return request({
url: service,
method: 'put',
data
})
}
/**
* 新增欢迎语模板
* @param {*} data
{
"welcomeMsg": "欢迎语",
"mediaId": "素材的id",
"welcomeMsgTplType": "欢迎语模板类型:1:员工欢迎语;2:部门员工欢迎语;3:客户群欢迎语 ",
"weMsgTlpScopes": {
"useUserId": "使用人的id"
}
}
*/
export function add(data) {
return request({
url: service,
method: 'POST',
data
})
}
/**
* 删除欢迎语
* @param {*} ids
*/
export function remove(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
...@@ -18,9 +18,7 @@ export default { ...@@ -18,9 +18,7 @@ export default {
name: "AppMain", name: "AppMain",
computed: { computed: {
cachedViews() { cachedViews() {
return process.env.NODE_ENV === "development" return this.$store.state.tagsView.cachedViews;
? []
: this.$store.state.tagsView.cachedViews;
}, },
key() { key() {
return this.$route.path; return this.$route.path;
......
...@@ -77,7 +77,7 @@ export const constantRoutes = [ ...@@ -77,7 +77,7 @@ export const constantRoutes = [
path: 'groupDetail', path: 'groupDetail',
hidden: true, hidden: true,
component: (resolve) => require(['@/views/customerManage/groupDetail'], resolve), component: (resolve) => require(['@/views/customerManage/groupDetail'], resolve),
meta: { hidden: true, title: '客户群', icon: '' } meta: { hidden: true, title: '客户群', icon: '', activeMenu: '/customerManage/group' }
}, },
{ {
path: 'tag', path: 'tag',
...@@ -113,68 +113,68 @@ export const constantRoutes = [ ...@@ -113,68 +113,68 @@ export const constantRoutes = [
// }, // },
// ] // ]
// }, // },
// { {
// path: '/drainageCode', path: '/drainageCode',
// component: Layout, component: Layout,
// redirect: '/drainageCode/staff', redirect: '/drainageCode/staff',
// meta: { title: '引流码', icon: 'qrcode' }, meta: { title: '引流码', icon: 'qrcode' },
// children: [ children: [
// { {
// path: 'staff', path: 'staff',
// name: 'CodeStaff', name: 'CodeStaff',
// component: (resolve) => require(['@/views/drainageCode/staff/list'], resolve), component: (resolve) => require(['@/views/drainageCode/staff/list'], resolve),
// meta: { title: '员工活码', icon: '' } meta: { title: '员工活码', icon: '' }
// }, },
// { {
// path: 'staffAdd', path: 'staffAdd',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/staff/add'], resolve), component: (resolve) => require(['@/views/drainageCode/staff/add'], resolve),
// meta: { title: '新建员工活码', icon: '' } meta: { title: '新建员工活码', icon: '', activeMenu: '/drainageCode/staff' }
// }, },
// { {
// path: 'staffDetail', path: 'staffDetail',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/staff/detail'], resolve), component: (resolve) => require(['@/views/drainageCode/staff/detail'], resolve),
// meta: { title: '员工活码详情', icon: '' } meta: { title: '员工活码详情', icon: '', activeMenu: '/drainageCode/staff' }
// }, },
// { {
// path: 'group', path: 'group',
// name: 'CodeGroup', name: 'CodeGroup',
// component: (resolve) => require(['@/views/drainageCode/group/list'], resolve), component: (resolve) => require(['@/views/drainageCode/group/list'], resolve),
// meta: { title: '客户群活码', icon: '' } meta: { title: '客户群活码', icon: '' }
// }, },
// { {
// path: 'groupAdd', path: 'groupAdd',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/group/add'], resolve), component: (resolve) => require(['@/views/drainageCode/group/add'], resolve),
// meta: { title: '新增客户群活码', icon: '' } meta: { title: '新增客户群活码', icon: '', activeMenu: '/drainageCode/group' }
// }, },
// { {
// path: 'groupDetail', path: 'groupDetail',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/group/detail'], resolve), component: (resolve) => require(['@/views/drainageCode/group/detail'], resolve),
// meta: { title: '客户群活码信息', icon: '' } meta: { title: '客户群活码信息', icon: '', activeMenu: '/drainageCode/group' }
// }, },
// { {
// path: 'groupBaseInfo', path: 'groupBaseInfo',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/group/baseInfo'], resolve), component: (resolve) => require(['@/views/drainageCode/group/baseInfo'], resolve),
// meta: { title: '客户群活码', icon: '' } meta: { title: '客户群活码', icon: '', activeMenu: '/drainageCode/group' }
// }, },
// { {
// path: 'welcome', path: 'welcome',
// name: 'Welcome', name: 'Welcome',
// component: (resolve) => require(['@/views/drainageCode/welcome/list'], resolve), component: (resolve) => require(['@/views/drainageCode/welcome/list'], resolve),
// meta: { title: '欢迎语', icon: '' } meta: { title: '欢迎语', icon: '' }
// }, },
// { {
// path: 'welcomeAdd', path: 'welcomeAdd',
// hidden: true, hidden: true,
// component: (resolve) => require(['@/views/drainageCode/welcome/add'], resolve), component: (resolve) => require(['@/views/drainageCode/welcome/add'], resolve),
// meta: { title: '新建欢迎语', icon: '' } meta: { title: '新建欢迎语', icon: '', activeMenu: '/drainageCode/welcome' }
// }, },
// ] ]
// }, },
// { // {
// path: '/material', // path: '/material',
// component: Layout, // component: Layout,
......
// cover some element-ui styles // cover some element-ui styles
.el-button {
[class^="el-icon-"], [class*=" el-icon-"] {
vertical-align: top;
}
}
.top-search { .top-search {
.el-input, .el-input,
.el-select { .el-select {
width: 220px; width: 240px;
} }
.el-date-editor--daterange.el-input__inner { .el-date-editor--daterange.el-input__inner {
width: 260px; width: 240px;
} }
} }
......
...@@ -4,6 +4,34 @@ ...@@ -4,6 +4,34 @@
@import './element-ui.scss'; @import './element-ui.scss';
@import './sidebar.scss'; @import './sidebar.scss';
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 8px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
/*深色模式*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #eee;
/*浅色模式*/
/*-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
background: rgb(245, 245, 245);
border: 1px solid #333;
border-bottom-width: 2px;*/
}
// ::-webkit-scrollbar-track {
// /*滚动条里面轨道*/
// -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
// border-radius: 10px;
// background: #eee;
// }
#app { #app {
height: 100%; height: 100%;
} }
......
<script>
import * as api from "@/api/customer/tag";
export default {
name: "AddTag",
components: {},
props: {
// 添加标签显隐
visible: {
type: Boolean,
default: false,
},
// 表单参数
form: {
type: Object,
default: () => ({
gourpName: "",
weTags: [],
}),
},
},
data() {
return {
// 添加标签输入框
newInput: "",
// 表单验证规则
rules: Object.freeze({
gourpName: [{ required: true, message: "必填项", trigger: "blur" }],
}),
// 添加便签按钮显隐
visibleAdd: false,
};
},
watch: {},
computed: {
Pvisible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
created() {},
mounted() {},
methods: {
closeTag(tag, index) {
if (tag.id) {
tag.status = 1;
} else {
this.form.weTags.splice(index, 1);
}
},
showInput() {
this.visibleAdd = true;
this.$nextTick((_) => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
newInputConfirm() {
let name = this.newInput;
if (name) {
Array.isArray(this.form.weTags) || (this.form.weTags = []);
this.form.weTags.push({ name });
}
this.visibleAdd = false;
this.newInput = "";
},
submit() {
this.$refs["form"].validate((valid) => {
let form = JSON.parse(JSON.stringify(this.form));
api[form.id ? "update" : "add"](form).then(() => {
this.msgSuccess("操作成功");
this.Pvisible = false;
this.$emit("success");
});
});
},
},
};
</script>
<template>
<el-dialog
:title="(form.id ? '修改' : '添加') + '标签'"
:visible.sync="Pvisible"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标签组名称" prop="gourpName">
<el-input v-model="form.gourpName" maxlength="15" show-word-limit placeholder="请输入" />
</el-form-item>
<el-form-item label="标签">
<template v-for="(item, index) in form.weTags">
<el-tag
v-if="item.status !== 1"
type="primary"
closable
size="medium"
:key="index"
@close="closeTag(item, index)"
>{{item.name}}</el-tag>
</template>
<el-input
class="input-new-tag"
v-if="visibleAdd"
v-model="newInput"
ref="saveTagInput"
size="mini"
maxlength="10"
show-word-limit
@keyup.enter.native="newInputConfirm"
@blur="newInputConfirm"
></el-input>
<el-button
v-else
type="primary"
plain
class="button-new-tag"
size="mini"
@click="showInput"
>+ 添加标签</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
<el-button @click="Pvisible = false">取 消</el-button>
</div>
</el-dialog>
</template>
<style lang="scss" scoped>
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.button-new-tag {
margin-left: 10px;
}
</style>
<script>
import * as api from "@/api/organization";
export default {
name: "SelectUser",
components: {},
props: {
// 添加标签显隐
visible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "选择成员",
},
},
data() {
return {
treeData: [],
userList: [],
defaultProps: {
label: "name",
children: "children",
disabled(data, node) {
return !data.userId;
},
isLeaf(data, node) {
return !!data.userId;
},
},
};
},
watch: {},
computed: {
Pvisible: {
get() {
// this.getTree();
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
created() {},
mounted() {},
methods: {
loadNode(node, resolve) {
if (node.level === 0) {
this.userList = [];
api.getTree().then(({ data }) => {
let _data = this.handleTree(data);
resolve(_data);
// api.getList({ department: _data[0].id }).then(({ rows, total }) => {
// _data && rows.unshift(..._data);
// resolve(rows);
// });
});
} else {
api.getList({ department: node.data.id }).then(({ rows, total }) => {
node.data.children && rows.push(...node.data.children);
resolve(rows);
});
}
},
handleCheckChange(data, checked, indeterminate) {
checked
? this.userList.push(data)
: this.userList.splice(this.userList.indexOf(data), 1);
// console.log(data, checked, indeterminate);
},
submit() {
this.Pvisible = false;
this.$emit("success", this.userList.splice(0));
},
},
};
</script>
<template>
<el-dialog :title="title" :visible.sync="Pvisible">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="12" :xs="24">
<div class="head-container">
<!-- <div>部门架构</div> -->
<!-- :filter-node-method="filterNode" -->
<el-tree
v-if="Pvisible"
ref="tree"
lazy
show-checkbox
check-on-click-node
:expand-on-click-node="true"
:load="loadNode"
:props="defaultProps"
@check-change="handleCheckChange"
></el-tree>
</div>
</el-col>
<!--用户数据-->
<el-col :span="12" :xs="24" class="user-list">
<el-row :gutter="10">选择人员列表</el-row>
<el-row v-for="(item, index) in userList" :key="index">
<i class="el-icon-user-solid"></i>
{{item.name}}
</el-row>
</el-col>
</el-row>
<div slot="footer">
<el-button @click="Pvisible = false">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</div>
</el-dialog>
</template>
<style lang="scss" scoped>
.user-list {
.el-row {
line-height: 26px;
}
}
</style>
<style lang="scss" scoped> <script>
.page { import * as api from "@/api/customer/dimission";
padding: 24px; import SelectUser from "./components/SelectUser";
}
.el-input, export default {
.el-select { name: "Dimission",
width: 220px; components: { SelectUser },
} props: {},
.mid-action { data() {
display: flex; return {
justify-content: space-between; // 查询参数
margin: 10px 0; query: {
align-items: center; pageNum: 1,
.total { pageSize: 10,
font-size: 14px; userName: undefined,
} beginTime: undefined,
.num { },
color: #00f; loading: false,
isMoreFilter: false,
total: 0,
form: {
user: "",
region: "",
},
list: [],
multipleSelection: [],
dialogVisibleSelectUser: false,
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
submitForm(formName) {
this.$refs["form"].validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
} }
} });
</style> },
resetForm(formName) {
this.$refs["queryForm"].resetFields();
},
allocate(userlist) {
api
.allocate({
handoverUserid: this.multipleSelection[0].id,
takeoverUserid: userlist[0].id,
})
.then(() => {
this.msgSuccess("操作成功");
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection;
},
},
};
</script>
<template> <template>
<div class="page"> <div class="page">
<el-card shadow="never" :body-style="{padding: '20px 0 0'}"> <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form ref="form" :inline="true" :model="form" label-width="100px" class="top-search">
<el-form-item label="已离职员工"> <el-form-item label="已离职员工">
<el-input v-model="form.user" placeholder="请输入"></el-input> <el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker <el-date-picker v-model="query.beginTime" type="date" placeholder="离职日期" align="right"></el-date-picker>
v-model="value2"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label>
<el-button type="primary" @click="submitForm">查询</el-button> <el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="info" @click="resetForm('ruleForm')">重置</el-button> <el-button type="info" @click="resetForm('queryForm')">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card>
<div class="mid-action"> <div class="mid-action">
<div class="total">从通讯录将离职员工删除后,可以分配他的客户及客户群给其他员工继续跟进</div> <div class="total">从通讯录将离职员工删除后,可以分配他的客户及客户群给其他员工继续跟进</div>
<div> <div>
<el-button type="primary" size="mini">已分配的离职员工</el-button> <el-button type="primary" size="mini">已分配的离职员工</el-button>
<el-button type="primary" size="mini">分配给其他员工</el-button> <el-button type="primary" size="mini" @click="dialogVisibleSelectUser = true">分配给其他员工</el-button>
</div> </div>
</div> </div>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="list"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="已离职员工" width="120"> <el-table-column prop="userName" label="已离职员工" width="120"></el-table-column>
<template slot-scope="scope">{{ scope.row.date }}</template> <el-table-column prop="department" label="所属部门" width="120"></el-table-column>
</el-table-column> <el-table-column prop="allocateCustomerNum" label="待分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="name" label="所属部门" width="120"></el-table-column> <el-table-column prop="allocateGroupNum" label="待分配群聊数" show-overflow-tooltip></el-table-column>
<el-table-column prop="address" label="待分配客户数" show-overflow-tooltip></el-table-column> <el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<el-table-column prop="address" label="待分配群聊数" show-overflow-tooltip></el-table-column> <template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
<el-table-column prop="address" label="离职时间" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -79,96 +127,44 @@ ...@@ -79,96 +127,44 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <pagination
background v-show="total>0"
@size-change="handleSizeChange" :total="total"
@current-change="handleCurrentChange" :page.sync="query.pageNum"
:current-page="currentPage4" :limit.sync="query.pageSize"
:page-sizes="[100, 200, 300, 400]" @pagination="getList"
:page-size="100" />
layout="total, sizes, prev, pager, next, jumper"
:total="400" <!-- 选择添加人弹窗 -->
></el-pagination> <SelectUser :visible.sync="dialogVisibleSelectUser" title="选择分配人" @success="allocate"></SelectUser>
</div> </div>
</template> </template>
<script> <style lang="scss" scoped>
export default { .page {
name: "Dimission", padding: 24px;
components: {}, }
props: {}, .el-input,
data() { .el-select {
return { width: 220px;
isMoreFilter: false, }
total: 0, .mid-action {
form: { display: flex;
user: "", justify-content: space-between;
region: "", margin: 10px 0;
}, align-items: center;
tableData: [ .total {
{ background-color: rgba(65, 133, 244, 0.1);
date: "2016-05-03", border: 1px solid rgba(65, 133, 244, 0.2);
name: "王小虎", border-radius: 3px;
address: "上海市普陀区金沙江路 1518 弄", font-size: 14px;
}, min-height: 32px;
{ line-height: 32px;
date: "2016-05-02", padding: 0 12px;
name: "王小虎", color: #606266;
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-08",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-06",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-07",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
],
multipleSelection: [],
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
submitForm(formName) {
this.$refs["form"].validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
} }
}); .num {
}, color: #00f;
resetForm(formName) { }
this.$refs["form"].resetFields(); }
}, </style>
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
},
};
</script>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
<template>
<div class="app-container">
<el-card shadow="never" :body-style="{padding: '20px 0 0'}">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
class="top-search"
label-width="80px"
>
<el-form-item label="群名" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入群名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="群主" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入群主"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleQuery">查询</el-button>
<el-button type="info" @click="resetQuery">重置</el-button>
<el-button type="cyan" @click="resetQuery">导出列表</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="mid-action">
<div class="total">
己选
<span class="num">{{total}}</span> 个客户群
<span>
最近更新:2020-08-25 06:35:00,同步
<span class="num">{{total}}</span> 条信息 ,共
<span class="num">{{total}}</span> 个客户群
</span>
</div>
<div>
<el-button type="primary" size="mini" icon="el-icon-refresh">同步客户群</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="群名" align="center" prop="operId" />
<el-table-column label="群人数" align="center" prop="title" />
<el-table-column label="群主" align="center" prop="businessType" :formatter="typeFormat" />
<el-table-column label="创建时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script> <script>
import * as api from "@/api/customer/group";
export default { export default {
name: "CustomerGroup", name: "CustomerGroup",
data() { data() {
return { return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
groupName: undefined,
beginTime: undefined,
endTime: undefined,
},
// 日期范围
dateRange: [],
// 遮罩层 // 遮罩层
loading: false, loading: false,
// 选中数组 // 选中数组
...@@ -135,71 +33,43 @@ export default { ...@@ -135,71 +33,43 @@ export default {
typeOptions: [], typeOptions: [],
// 类型数据字典 // 类型数据字典
statusOptions: [], statusOptions: [],
// 日期范围
dateRange: [],
// 表单参数 // 表单参数
form: {}, form: {},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined,
operName: undefined,
businessType: undefined,
status: undefined,
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_oper_type").then((response) => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
}, },
methods: { methods: {
/** 查询登录日志 */ /** 查询 */
getList() { getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false; this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then( })
(response) => { .catch(() => {
this.list = response.rows;
this.total = response.total;
this.loading = false; this.loading = false;
} });
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.$refs["queryForm"].resetFields();
this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.operId); this.ids = selection.map((item) => item.id);
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const operIds = row.operId || this.ids; const operIds = row.operId || this.ids;
...@@ -239,14 +109,14 @@ export default { ...@@ -239,14 +109,14 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const query = this.query;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", { this.$confirm("是否确认导出所有数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(function () { .then(function () {
return exportOperlog(queryParams); return exportOperlog(query);
}) })
.then((response) => { .then((response) => {
this.download(response.msg); this.download(response.msg);
...@@ -256,3 +126,102 @@ export default { ...@@ -256,3 +126,102 @@ export default {
}, },
}; };
</script> </script>
<template>
<div class="app-container">
<el-form
:model="query"
ref="queryForm"
:inline="true"
v-show="showSearch"
class="top-search"
label-width="80px"
>
<el-form-item label="群名">
<el-input v-model="query.groupName" placeholder="请输入群名" clearable />
</el-form-item>
<el-form-item label="群主">
<el-input v-model="query.groupLeader" placeholder="请输入群主" clearable />
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="info" @click="resetQuery">重置</el-button>
<el-button type="cyan" @click="handleExport">导出列表</el-button>
</el-form-item>
</el-form>
<div class="mid-action">
<div class="total">
己选
<span class="num">{{total}}</span> 个客户群
<span>
最近更新:2020-08-25 06:35:00,同步
<span class="num">{{total}}</span> 条信息 ,共
<span class="num">{{total}}</span> 个客户群
</span>
</div>
<div>
<el-button type="primary" size="mini" icon="el-icon-refresh">同步客户群</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="群名" align="center" prop="groupName" />
<el-table-column label="群人数" align="center" prop="memberNum" />
<el-table-column label="群主" align="center" prop="groupLeader" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="$router.push({ path: '/customerManage/groupDetail', query: scope.row })"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList"
/>
</div>
</template>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
.el-input {
display: table;
width: 30%;
margin: 40px auto;
}
.info-wrap{
margin-left: 20px;
.info {
color: #aaa;
}
}
</style>
<template>
<div class="app-container">
<el-button slot="append" circle icon="el-icon-back" @click="$router.back()"></el-button>返回
<el-card shadow="never" :body-style="{padding: '20px'}">
<div class="flex">
<el-avatar :size="120" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"></el-avatar>
<div class="info-wrap">
<div style="margin-bottom: 20px;">享佳健康红包体验群</div>
<div class="info">
群主:智廷 | 创建时间:2020-08-24 16:09:21 | 群公告:未设置
</div>
</div>
</div>
<el-input placeholder="请输入关键字" v-model="input3" class="">
<el-button slot="append">查询</el-button>
</el-input>
<div>共4位群成员</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="群成员" align="center" prop="operId" />
<el-table-column label="进群时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="进群方式" align="center" prop="businessType" :formatter="typeFormat" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script> <script>
import * as api from "@/api/customer/group";
export default { export default {
name: "Operlog", name: "GroupDetail",
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -95,58 +25,31 @@ export default { ...@@ -95,58 +25,31 @@ export default {
statusOptions: [], statusOptions: [],
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
// 表单参数 // 群信息
form: {}, group: {},
// 查询参数 // 查询参数
queryParams: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
title: undefined, groupId: undefined,
operName: undefined, memberName: undefined,
businessType: undefined,
status: undefined,
}, },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_oper_type").then((response) => { this.group = this.$route.query;
this.typeOptions = response.data; this.query.groupId = this.group.id;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
}, },
methods: { methods: {
/** 查询登录日志 */ getList(page) {
getList() { page && (this.query.pageNum = page);
this.loading = false; this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then( api.getMembers(this.query).then((response) => {
(response) => {
this.list = response.rows; this.list = response.rows;
this.total = response.total; this.total = +response.total;
this.loading = false; this.loading = false;
} });
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
...@@ -197,14 +100,14 @@ export default { ...@@ -197,14 +100,14 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const query = this.query;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", { this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(function () { .then(function () {
return exportOperlog(queryParams); return exportOperlog(query);
}) })
.then((response) => { .then((response) => {
this.download(response.msg); this.download(response.msg);
...@@ -214,3 +117,83 @@ export default { ...@@ -214,3 +117,83 @@ export default {
}, },
}; };
</script> </script>
<template>
<div class="app-container">
<!-- <el-button slot="append" circle icon="el-icon-back" @click="$router.back()"></el-button>返回 -->
<div class="flex aic">
<el-avatar
:size="100"
src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
></el-avatar>
<div class="info-wrap">
<div style="margin-bottom: 20px;">{{group.groupName}}</div>
<div
class="info"
>群主:{{group.groupLeader}} | 创建时间:{{group.createTime}} | 群公告:{{group.notice || '未设置'}}</div>
</div>
</div>
<el-input placeholder="请输入群成员" v-model="query.memberName" class>
<el-button slot="append" @click="getList(1)">查询</el-button>
</el-input>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="群成员" align="center" prop="operId">
<template slot-scope="scope">
{{ scope.row.memberName }}
<!-- <span
:style="{color: scope.row.joinType == 1 ? '#4bde03' : '#f9a90b'}"
>{{ ({1: '@微信', 2: '@企业微信'})[scope.row.joinType] }}</span>-->
<!-- <i :class="['el-icon-s-custom', ({1: 'man', 2: 'woman'})[scope.row.gender]]"></i> -->
</template>
</el-table-column>
<el-table-column label="进群时间" align="center" prop="joinTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.joinTime) }}</span>
</template>
</el-table-column>
<el-table-column label="进群方式" align="center" prop="joinType" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList"
/>
</div>
</template>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
.el-input {
display: table;
width: 30%;
margin: 40px auto;
}
.info-wrap {
margin-left: 20px;
.info {
color: #aaa;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<script> <script>
import * as api from "@/api/customer/tag"; import * as api from "@/api/customer/tag";
import AddTag from "./components/AddTag";
export default { export default {
name: "CustomerTag", name: "CustomerTag",
components: { AddTag },
data() { data() {
return { return {
query: { query: {
...@@ -64,48 +66,12 @@ export default { ...@@ -64,48 +66,12 @@ export default {
}); });
}, },
edit(data, type) { edit(data, type) {
this.form = Object.assign({ weTags: [] }, data || {}); this.form = JSON.parse(
JSON.stringify(Object.assign({ weTags: [] }, data || {}))
);
this.dialogVisible = true; this.dialogVisible = true;
}, },
closeTag(tag, index) {
if (tag.id) {
tag.status = 1;
} else {
this.form.weTags.splice(index, 1);
}
},
showInput() {
this.newInputVisible = true;
this.$nextTick((_) => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
newInputConfirm() {
let name = this.newInput;
if (name) {
this.form.weTags.push({ name });
}
this.newInputVisible = false;
this.newInput = "";
},
submit() {
this.$refs["form"].validate((valid) => {
if (this.form.weTags.length) {
}
let form = JSON.parse(JSON.stringify(this.form));
api[form.id ? "update" : "add"](form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
});
},
sync() {}, sync() {},
// 操作日志状态字典翻译 // 操作日志状态字典翻译
statusFormat(row, column) { statusFormat(row, column) {
...@@ -225,53 +191,7 @@ export default { ...@@ -225,53 +191,7 @@ export default {
</el-table> </el-table>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog <AddTag :visible.sync="dialogVisible" :form="form" @success="getList(!form.id && 1)" />
:title="(form.id ? '修改' : '添加') + '标签'"
:visible.sync="dialogVisible"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标签组名称" prop="gourpName">
<el-input v-model="form.gourpName" maxlength="15" show-word-limit placeholder="请输入" />
</el-form-item>
<el-form-item label="标签">
<template v-for="(item, index) in form.weTags">
<el-tag
v-if="item.status !== 1"
type="primary"
closable
size="medium"
:key="index"
@close="closeTag(item, index)"
>{{item.name}}</el-tag>
</template>
<el-input
class="input-new-tag"
v-if="newInputVisible"
v-model="newInput"
ref="saveTagInput"
size="mini"
maxlength="10"
show-word-limit
@keyup.enter.native="newInputConfirm"
@blur="newInputConfirm"
></el-input>
<el-button
v-else
type="primary"
plain
class="button-new-tag"
size="mini"
@click="showInput"
>+ 添加标签</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -284,12 +204,4 @@ export default { ...@@ -284,12 +204,4 @@ export default {
color: #00f; color: #00f;
} }
} }
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.button-new-tag {
margin-left: 10px;
}
</style> </style>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
<template>
<div class="app-container">
<el-card shadow="never" :body-style="{padding: '20px 0 0'}">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="使用员工" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="活动场景" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建人" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">导出</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="mid-action">
<div class="total">
己选
<span class="num">{{total}}</span> 条,当前已经配置
<span class="num">{{total}}</span> 个 最多配置
<span class="num">{{total}}</span> 个
</div>
<div>
<el-button type="primary" size="mini" icon="el-icon-plus">新建员工活码</el-button>
<el-button type="primary" size="mini">批量新建</el-button>
<el-button type="primary" size="mini">删除</el-button>
<el-button type="primary" size="mini">下载</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="样式" align="center" prop="operId" />
<el-table-column label="使用员工" align="center" prop="title" />
<el-table-column label="姓名" align="center" prop="businessType" />
<el-table-column label="手机号" align="center" prop="businessType" />
<el-table-column label="活动场景" align="center" prop="businessType" />
<el-table-column label="创建人" align="center" prop="businessType" />
<el-table-column label="创建时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>下载</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>复制链接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: "Operlog",
data() {
return {
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
list: [],
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 类型数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 表单参数
form: {},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined,
operName: undefined,
businessType: undefined,
status: undefined,
},
};
},
created() {
this.getList();
this.getDicts("sys_oper_type").then((response) => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询登录日志 */
getList() {
this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.operId);
this.multiple = !selection.length;
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */
handleDelete(row) {
const operIds = row.operId || this.ids;
this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delOperlog(operIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 清空按钮操作 */
handleClean() {
this.$confirm("是否确认清空所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return cleanOperlog();
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportOperlog(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
<template>
<div class="app-container page">
<el-input placeholder="请输入关键字" style="width: 240px;" class="mr10" v-model="input3">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
<el-button type="primary" icon="el-icon-plus">新建客户群活码</el-button>
<el-button type="primary">批量下载</el-button>
<div class="mid-action">
<div class="total">
客户群活码是一个可变化的群二维码,相当于一个跳转页面,当一个群快满时,会自动在跳转页面中显示另一个群的二维码,突破客户入群的限制。
<el-popover placement="right" width="400" trigger="hover">
<div class="notic-message">
<p>1. 群活码并未改变微信原有规则,只是提供了一个固定不变的入口二维码、根据人数自动换群及扫码数据统计分析等功能</p>
<p>2. 如果微信群7天没有加满200人,系统会提前一天通过服务号发送群二维码即将到期提醒,请及时更新群二维码,避免因群二维码过期无法进群</p>
<p>3. 微信群超过200人无法扫码只能邀请进群,想实现所有人都能扫码进群,需要拆分为多个200人群,准督多个空群,每扫码200人自动换过</p>
<p>4. 支持将活码二维码以图片方式分享朋友圈(活码以文字链接方式分享不影响),如有需要可以绑定自有域名,或开启防护加速仅支持企业版已认证用户功能</p>
<p>5. 根据《微信外链管理规范》,违规内容/用途、用户投诉等可能导致活码被封,且申诉有可能无法解封,具体以官方处理结果为准,无法更换活码的(例如用于印刷),建议绑定自有域名或开启防护加速功能</p>
<p>6. 禁止任何违法、违规用途,所有活码都有专人审核,一经发现即关闭访问、停止分配域名,情节严重将封停账户《微信外链管理规范》</p>
</div>
<span class="num" slot="reference">使用须知</span>
</el-popover>
</div>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="样式" align="center" prop="operId" />
<el-table-column label="活动名称" align="center" prop="title" />
<el-table-column label="活动场景" align="center" prop="businessType" />
<el-table-column label="实际群码数" align="center" prop="businessType" />
<el-table-column label="扫码次数" align="center" prop="businessType" />
<el-table-column label="创建人" align="center" prop="businessType" />
<el-table-column label="创建时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>下载</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>复制链接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: "Operlog",
data() {
return {
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
list: [],
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 类型数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 表单参数
form: {},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined,
operName: undefined,
businessType: undefined,
status: undefined,
},
};
},
created() {
this.getList();
this.getDicts("sys_oper_type").then((response) => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询登录日志 */
getList() {
this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.operId);
this.multiple = !selection.length;
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */
handleDelete(row) {
const operIds = row.operId || this.ids;
this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delOperlog(operIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 清空按钮操作 */
handleClean() {
this.$confirm("是否确认清空所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return cleanOperlog();
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportOperlog(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped>
</style>
<template>
<div>
<div class="mid-action">
<div class="total">实际群码</div>
<div>
<el-button type="primary" size="mini" icon="el-icon-plus" @click="dialogVisible = true">添加实际群码</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="实际群码" align="center" prop="operId" />
<el-table-column label="群名称" align="center" prop="title" />
<el-table-column label="有效期" align="center" prop="businessType" />
<el-table-column label="扫码次数" align="center" prop="businessType" />
<el-table-column label="扫码次数限制" align="center" prop="businessType" />
<el-table-column label="状态" align="center" prop="businessType" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">上一步</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">下一步</el-button>
</div>
<el-dialog
title="添加实际群码"
:visible.sync="dialogVisible"
width="width"
:before-close="dialogBeforeClose">
<el-form :model="form" :label-width="100">
<el-form-item label="实际群码" prop="title">
<el-upload
class="avatar-uploader"
action
:show-file-list="false"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
>
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>注:只能上传jpg/png格式图片,且不超过2M
</el-form-item>
<el-form-item label="群名称">
<el-input v-model="a"></el-input>
</el-form-item>
<el-form-item label="有效期">
<el-date-picker v-model="time" type="date" placeholder="date"></el-date-picker>
</el-form-item>
<el-form-item label="扫码次数限制">
<el-input type="number" v-model="a"></el-input>
<div>注:微信群建议设为300;企业微信群建议设为130</div>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components:{},
props:{},
data(){
return {
dialogVisible: false
}
},
watch:{},
computed:{},
created(){},
mounted(){},
methods:{},
}
</script>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
.top {
align-items: flex-start;
}
</style>
<template>
<div class="app-container">
<el-card :body-style="{padding: '20px 0 0'}">
<div>员工活码信息</div>
<div class="flex top">
<div>
<img src alt />
<div>
<el-button type="text">下载二维码</el-button>
<el-button type="text">复制链接</el-button>
</div>
</div>
<el-form ref="form" label-width="100px">
<el-form-item label="使用成员:">
<el-tag type="success">春夏</el-tag>
</el-form-item>
<el-form-item label="活动场景:">55</el-form-item>
<el-form-item label="类型:">单人</el-form-item>
<el-form-item label="类型:">客户添加时无需经过确认自动成为好友</el-form-item>
<el-form-item label="创建人:">wsscrm2019</el-form-item>
<el-form-item label="创建时间:">2020-08-26 17:39:08</el-form-item>
</el-form>
<el-form ref="form" label-width="100px">
<el-form-item label="扫码标签:">客户添加时无需经过确认自动成为好友</el-form-item>
<el-form-item label="欢迎语:">wsscrm2019</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="never">
<div>扫码人数</div>
<div>累计总人数:0</div>
<div>
<el-button-group>
<el-button type="primary">近7日</el-button>
<el-button type="primary">近30日</el-button>
</el-button-group>
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</div>
<div class="chart" ref="chart" style="width: 600px;height:400px;"></div>
</el-card>
</div>
</template>
<script>
import echarts from "echarts";
export default {
name: "Operlog",
data() {
return {
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
list: [],
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 类型数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 表单参数
form: {},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined,
operName: undefined,
businessType: undefined,
status: undefined,
},
};
},
created() {
this.getList();
this.getDicts("sys_oper_type").then((response) => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
},
mounted() {
var option = {
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: {
type: "value",
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
},
],
};
console.log('ec', echarts);
var myChart = echarts.init(this.$refs.chart);
myChart.setOption(option);
},
methods: {
/** 查询登录日志 */
getList() {
this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.operId);
this.multiple = !selection.length;
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */
handleDelete(row) {
const operIds = row.operId || this.ids;
this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delOperlog(operIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 清空按钮操作 */
handleClean() {
this.$confirm("是否确认清空所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return cleanOperlog();
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportOperlog(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
\ No newline at end of file \ No newline at end of file
<script>
import * as api from "@/api/drainageCode/welcome";
export default {
components: {},
props: {},
data() {
return {
dialogVisible: false,
dialogVisible1: false,
form: { id: "", welcomeMsgTplType: "", welcomeMsg: "" },
};
},
watch: {},
computed: {},
created() {
this.form = this.$route.query;
},
mounted() {},
methods: {
getData() {},
submit() {
api.edit(this.form);
},
insertName() {
this.form.welcomeMsg += "#客户昵称#";
},
},
};
</script>
<template>
<div class="flex page">
<el-form ref="form" :model="form" label-width="80px" class="form">
<el-form-item label="欢迎语">
<el-card shadow="never" class="card">
<div style="height: 300px;">
<el-input
type="textarea"
:rows="5"
maxlength="100"
show-word-limit
v-model="form.welcomeMsg"
placeholder
></el-input>
</div>
<div class="bfc-o">
<el-button
type="default"
class="fr"
round
icon="el-icon-user-solid"
@click="insertName()"
>插入客户昵称</el-button>
</div>
<el-divider></el-divider>
<el-popover placement="top-start" trigger="hover">
<div class="flex">
<el-upload
class="mr10"
action
:show-file-list="false"
:on-success="on-success"
:before-upload="before-upload"
>
<img v-if="imageUrl" :src="imageUrl" />
<el-button v-else>
<i class="el-icon-picture-outline"></i>
<p>图片</p>
</el-button>
</el-upload>
<el-button @click="dialogVisible = true">
<i class="el-icon-link"></i>
<p>网页</p>
</el-button>
<!-- <el-button @click="dialogVisible1 = true">
<i class="el-icon-link"></i>
<p>小程序</p>
</el-button>-->
</div>
<el-button slot="reference" icon="el-icon-plus" size="mini" @click="resetQuery">添加图片/网页</el-button>
</el-popover>
</el-card>
</el-form-item>
<el-form-item label=" ">
<el-button type="cyan" icon="el-icon-search" size="mini" @click="submit">保存</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="$router.back()">取消</el-button>
</el-form-item>
</el-form>
<div class="preview ac">
<div class="top">小微</div>
<div class="small">塬微科技-企微</div>
<div class="time">凌晨2:20</div>
<div class="flex">
<el-avatar shape="square" size="small" :src="require('@/assets/image/profile.jpg')"></el-avatar>
<div class="msg">{{form.welcomeMsg}}</div>
</div>
</div>
<el-dialog
title="添加网页消息"
:visible.sync="dialogVisible"
width="width"
:before-close="dialogBeforeClose"
>
<el-form :model="form" inline>
<el-form-item label="添加网页消息" label-width="200">
<el-input style="width: 400px;" v-model="j" placeholder="以http或https开头"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</div>
</el-dialog>
<el-dialog
title="添加小程序消息"
:visible.sync="dialogVisible1"
width="width"
:before-close="dialogBeforeClose"
>
<div class="flex filter-wrap">
<el-select v-model="model" placeholder="请选择分组">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<el-input v-model="j" style="width: 240px;"></el-input>
<el-button type="primary">搜索</el-button>
<div class="filter-right">
<i class="el-icon-arrow-left"></i> 1/1
<i class="el-icon-arrow-right"></i>
</div>
</div>
<el-divider></el-divider>
<div class="flex list-wrap">
<el-card v-for="(item, index) in 5" :key="index">
<div>2020-20-02-02 20:20:20</div>
<div>标题标题标题</div>
<img src="@/assets/image/profile.jpg" alt />
</el-card>
</div>
<div slot="footer">
<el-button @click="dialogVisible1 = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible1 = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.page {
padding: 30px;
background-color: #fff;
border-radius: 8px;
}
.form {
width: 50%;
max-width: 500px;
}
.preview {
width: 260px;
background: #eee;
border-radius: 8px;
padding: 15px 10px;
height: 450px;
margin-left: 10%;
.top {
font-weight: 600;
}
.small {
font-size: 10px;
}
.time {
font-size: 12px;
color: #aaa;
transform: scale(0.8);
padding: 10px 0 5px;
}
.msg {
min-height: 28px;
background-color: #fff;
border: 1px solid #e4e6e9;
display: inline-block;
position: relative;
text-align: left;
font-size: 14px;
line-height: 22px;
padding: 3px 6px;
border-radius: 4px;
max-width: 70%;
min-width: 24px;
box-sizing: border-box;
word-break: break-all;
white-space: pre-line;
margin-left: 10px;
&:before {
content: " ";
display: block;
position: absolute;
left: -6px;
border-width: 4px 6px;
border-left: 0;
width: 0;
border-style: solid;
border-color: transparent;
border-right-color: #fff;
top: 10px;
z-index: 888;
}
}
}
.filter-wrap {
justify-content: space-between;
}
.list-wrap {
flex-wrap: wrap;
}
</style>
<script>
import * as api from "@/api/drainageCode/welcome";
export default {
name: "Tab",
components: {},
props: {
// 添加标签显隐
type: {
type: Number | String,
default: "1",
},
},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
welcomeMsg: undefined,
welcomeMsgTplType: 1,
},
loading: false,
total: 0,
list: [],
wel: {
1: "员工",
2: "部门员工",
3: "客户",
},
};
},
watch: {},
computed: {},
created() {
this.query.welcomeMsgTplType = +this.type;
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
/** 删除按钮操作 */
remove(id) {
// const operIds = id || this.ids + "";
this.$confirm("是否确认删除吗?", "警告", {
type: "warning",
})
.then(function () {
return api.remove(id);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
});
},
goRoute(data) {
let query = {};
if (data) {
let { id, welcomeMsgTplType, welcomeMsg } = data;
query = { id, welcomeMsgTplType, welcomeMsg };
} else {
query.welcomeMsgTplType = this.type;
}
this.$router.push({ path: "welcomeAdd", query: query });
},
},
};
</script>
<template>
<div>
<div class="mid-action">
<div class="total"></div>
<div>
<el-button
type="primary"
size="mini"
icon="el-icon-plus"
@click="goRoute()"
>新建{{wel[type]}}欢迎语</el-button>
<el-input
placeholder="请输入内容"
prefix-icon="el-icon-search"
v-model="query.welcomeMsg"
style="width: 240px; margin-left: 10px;"
@change="getList(0)"
></el-input>
</div>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="欢迎语" align="center" prop="welcomeMsg" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="goRoute(scope.row)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
<el-button
size="mini"
type="text"
@click="remove(scope.row.id)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
padding: 10px 0;
align-items: center;
background: #fff;
.total {
background-color: rgba(65, 133, 244, 0.1);
// border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
// padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-tabs :value="active" type="card">
<el-tab-pane label="员工欢迎语(45)" name="1">
<Tab ref="staff" type="1"></Tab>
</el-tab-pane>
<el-tab-pane label="部门员工欢迎语(4)" name="2">
<Tab ref="department" type="2"></Tab>
</el-tab-pane>
<el-tab-pane label="客户群欢迎语(4)" name="3">
<Tab ref="customer" type="3"></Tab>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import Tab from "./components/Tab";
export default {
name: "Welcome",
components: { Tab },
props: {},
data() {
return {
active: "1",
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!