Commit f14340ff by unknown

'前端生成群活码'

2 parents d01e43d1 8c12f4d1
Showing 63 changed files with 2158 additions and 819 deletions
......@@ -13,6 +13,7 @@
"core-js": "^3.6.5",
"normalize.css": "^8.0.1",
"vant": "^2.12.2",
"vconsole": "^3.4.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
......
......@@ -4,13 +4,11 @@ export default {
name: 'App',
data() {
return {
appId: 'appId',
appId: '',
agentId: '1000005',
}
},
created() {
// this.wxConfig()
},
created() {},
watch: {
// 通过config接口注入权限验证配置
// 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用)
......@@ -23,16 +21,19 @@ export default {
getAgentTicket(window.location.href.split('#')[0]).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.agentConfig({
debug: true,
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填
jsApiList: ['sendChatMessage', 'getContext'], //必填
success: (res) => {
// 回调
// this.$toast('agentId成功:')
},
fail: (res) => {
this.$toast('agentId失败:' + JSON.stringify(res))
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
}
......@@ -40,48 +41,49 @@ export default {
})
})
},
_wxConfig() {
// 获取企业的jsapi_ticket
getAppTicket(window.location.href).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: this.appId, // 必填,企业微信的corpID
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: ['getContext', 'sendChatMessage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
})
wx.ready(() => {
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
getAgentTicket(window.location.href).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.agentConfig({
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填
success: (res) => {
// 回调
},
fail: (res) => {
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
}
},
})
})
})
// 丢弃
// _wxConfig() {
// // 获取企业的jsapi_ticket
// getAppTicket(window.location.href).then(({ data }) => {
// let { timestamp, nonceStr, signature } = data
// wx.config({
// beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
// debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
// appId: this.appId, // 必填,企业微信的corpID
// timestamp, // 必填,生成签名的时间戳
// nonceStr, // 必填,生成签名的随机串
// signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
// jsApiList: ['getContext', 'sendChatMessage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
// })
// wx.ready(() => {
// // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
// getAgentTicket(window.location.href).then(({ data }) => {
// let { timestamp, nonceStr, signature } = data
// wx.agentConfig({
// corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
// agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
// timestamp, // 必填,生成签名的时间戳
// nonceStr, // 必填,生成签名的随机串
// signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
// jsApiList: ['sendChatMessage'], //必填
// success: (res) => {
// // 回调
// },
// fail: (res) => {
// if (res.errMsg.indexOf('function not exist') > -1) {
// alert('版本过低请升级')
// }
// },
// })
// })
// })
wx.error(function(res) {
console.error(res)
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
})
})
},
// wx.error(function(res) {
// console.error(res)
// // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
// })
// })
// },
},
}
</script>
......
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/chat'
const wecom = window.CONFIG.services.wecom
const service = wecom + '/chat'
const serviceMaterial = wecom + '/material'
/**
* 侧边栏列表
......@@ -45,6 +47,9 @@ export function addCollection(data) {
return request({
url: service + '/collection/addCollection',
method: 'post',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
data,
})
}
......@@ -64,3 +69,17 @@ export function cancleCollection(data) {
data,
})
}
/**
* 获取企业微信素材media_id
* @param {*} params
* url [string] 是 素材路径
type [string] 是 素材类型
name [string] 是 文件名称
*/
export function getMaterialMediaId(params) {
return request({
url: serviceMaterial + '/temporaryMaterialMediaId',
params,
})
}
......@@ -11,6 +11,7 @@ export function getAgentTicket(url) {
url: service + '/ticket/getAgentTicket',
params: {
url,
agentId: '1000005',
},
})
}
......@@ -29,7 +30,7 @@ export function getAppTicket(url) {
}
/**
* 获取企业的jsapi_ticket
* 获取登录用户id
* @param {*} url 页面url
*/
export function getUserInfo(code) {
......@@ -37,6 +38,7 @@ export function getUserInfo(code) {
url: service + '/user/getUserInfo',
params: {
code,
agentId: '1000005',
},
})
}
......@@ -4,38 +4,9 @@ const config = {
*/
cookieExpires: 1,
/**
* @description 是否使用国际化,默认为false
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
useI18n: false,
/**
* @description api请求基础路径
*/
// 测试服
domain:
process.env.NODE_ENV === 'development'
? 'http://192.168.1.32:8888'
: 'http://192.168.1.26:8888', //
// 正式服
// domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.35:8118' : 'https://gateway.visualinsur.cn:8888', //
/**
* @description 默认打开的首页的路由name值,默认为home
*/
homeName: 'home',
/**
* @description 需要加载的插件
*/
plugin: {
// 'error-store': {
// showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
// developmentOff: false // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
// }
},
// get domain() {
// return process.env.NODE_ENV === 'development' ? this.baseUrl.dev : this.baseUrl.pro
// }
}
config.services = {
......
......@@ -16,6 +16,9 @@ import App from './App.vue'
import router from './router'
import store from './store'
import VConsole from 'vconsole'
process.env.NODE_ENV === 'production' && new VConsole()
Vue.config.productionTip = false
new Vue({
......
import axios from 'axios'
import { Toast } from 'vant'
import { Toast, Dialog } from 'vant'
function createAxios(baseURL) {
const instance = axios.create({
......@@ -7,7 +7,7 @@ function createAxios(baseURL) {
headers: {
Auth_token: '',
},
timeout: 3000,
timeout: 10000,
})
// 请求拦截
instance.interceptors.request.use(
......@@ -45,7 +45,7 @@ function createAxios(baseURL) {
if (error.response) {
addErrorLog(error.response)
} else {
Toast.fail('服务器未启动或连接超时')
Dialog({ message: '服务器未启动或连接超时' })
console.error('服务器未启动或连接超时')
}
return Promise.reject(error)
......@@ -69,7 +69,7 @@ function createAxios(baseURL) {
process.env.NODE_ENV === 'development'
? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`)
: console.error(`${JSON.parse(responseText).message}`)
Toast.fail(`${responseText}`)
Dialog({ message: responseText })
}
return instance
......
2
<script>
import { getUserInfo } from '@/api/common'
import { getTypeList } from '@/api/chat'
......@@ -15,8 +14,6 @@ export default {
finished: false,
show: false,
userId: '',
auth_code: '',
auth_code1: '',
}
},
watch: {},
......@@ -28,7 +25,6 @@ export default {
// .slice(1)
// .split('&')[0]
// .split('=')[1]
// this.auth_code1 = auth_code
// if (!auth_code) {
// this.$toast('未获得授权')
// return
......@@ -47,7 +43,6 @@ export default {
.slice(1)
.split('&')[0]
.split('=')[1]
this.auth_code1 = auth_code
if (!auth_code) {
this.$toast('未获得授权')
return
......@@ -55,13 +50,15 @@ export default {
getUserInfo(auth_code)
.then(({ data }) => {
this.userId = data.userId
this.$toast('userId:' + this.userId)
// this.$toast('userId:' + this.userId)
})
.catch((err) => {
this.$toast('err:' + err)
Dialog.confirm({
title: '标题',
message: err,
})
})
this.getList()
this.auth_code = location
},
mounted() {},
methods: {
......@@ -90,10 +87,6 @@ export default {
<van-icon name="plus" @click="add" />
</template> -->
</van-search>
<span>{{ auth_code }}</span>
<br />
<span>auth_code:{{ auth_code1 }}</span>
<van-tabs v-model="active">
<van-tab v-if="!!userId" title="我的">
<List ref="list0" :userId="userId" :keyword="keyword"></List>
......@@ -106,6 +99,7 @@ export default {
<List
:ref="'list' + (index + 1)"
:sideId="item.sideId"
:mediaType="item.mediaType"
:userId="userId"
:keyword="keyword"
></List>
......
# 开发环境配置
ENV = 'development'
# 塬微管理系统/开发环境
VUE_APP_BASE_API = 'http://146.56.222.200/api/'
# 仟微管理系统/开发环境
VUE_APP_BASE_API = 'http://146.56.222.200/api'
# VUE_APP_BASE_API = 'http://n3rpzt.natappfree.cc'
# 开发环境IP
......
# 生产环境配置
ENV = 'production'
# 塬微管理系统/生产环境api
VUE_APP_BASE_API = 'http://106.13.236.58:8080'
# 仟微管理系统/生产环境api
VUE_APP_BASE_API = 'http://146.56.222.200'
# 生产环境IP
VUE_APP_BASE_URL = 'http://106.13.236.58:8080'
VUE_APP_BASE_URL = 'http://146.56.222.200'
tag-version-prefix=""
registry=https://registry.npm.taobao.org
\ No newline at end of file
......@@ -45,6 +45,7 @@
"core-js": "3.6.5",
"echarts": "4.2.1",
"element-ui": "2.13.2",
"fabric": "^3.5.1",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
"js-beautify": "1.10.2",
......@@ -58,6 +59,8 @@
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"uuid": "^8.3.2",
"tui-color-picker": "^2.2.6",
"tui-image-editor": "^3.11.0",
"video.js": "^7.10.2",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
......
import request from '@/utils/request'
import { dataURLtoFile } from '@/utils/common'
const service = window.CONFIG.services.common
export function upload(data) {
return request({
url: service + '/uploadFile2Cos',
method: 'POST',
data,
})
}
/**
* 下载网络连接文件
* @param {*} params
......
......@@ -11,6 +11,14 @@ export function getList(params) {
}
/**
* 更新海报
* @param {*} params
*/
export function updatePoster(data) {
return request({ url: serviceCategory + '/update', method: 'put', data })
}
/**
* 添加海报
* @param {*} data
*/
......@@ -22,8 +30,8 @@ export function addPoster(data) {
* 查询海报详情
* @param {*} data
*/
export function getPosterInfo(data) {
return request({ url: serviceCategory + '/entity', method: 'get', data })
export function getPosterInfo(id) {
return request({ url: serviceCategory + '/entity/' + id })
}
/**
......
No preview for this file type
<script>
import * as api from "@/api/customer/tag";
import * as api from '@/api/customer/tag'
export default {
name: "AddTag",
name: 'AddTag',
components: {},
props: {
// 添加标签显隐
......@@ -14,7 +14,7 @@ export default {
form: {
type: Object,
default: () => ({
gourpName: "",
gourpName: '',
weTags: [],
}),
},
......@@ -22,15 +22,15 @@ export default {
data() {
return {
// 添加标签输入框
newInput: "",
newInput: '',
// 表单验证规则
rules: Object.freeze({
gourpName: [{ required: true, message: "必填项", trigger: "blur" }],
weTags: [{ required: true, message: "必填项", trigger: "blur" }],
gourpName: [{ required: true, message: '必填项', trigger: 'blur' }],
weTags: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
// 添加便签按钮显隐
visibleAdd: false,
};
}
},
watch: {},
computed: {
......@@ -38,13 +38,13 @@ export default {
get() {
if (this.visible) {
this.$nextTick(() => {
this.$refs["form"].clearValidate();
});
this.$refs['form'].clearValidate()
})
}
return this.visible;
return this.visible
},
set(val) {
this.$emit("update:visible", val);
this.$emit('update:visible', val)
},
},
},
......@@ -53,43 +53,50 @@ export default {
methods: {
closeTag(tag, index) {
if (tag.id) {
tag.status = 1;
tag.status = 1
} else {
this.form.weTags.splice(index, 1);
this.form.weTags.splice(index, 1)
}
},
showInput() {
this.visibleAdd = true;
this.visibleAdd = true
this.$nextTick((_) => {
this.$refs.saveTagInput.$refs.input.focus();
});
this.$refs.saveTagInput.$refs.input.focus()
})
},
newInputConfirm() {
let name = this.newInput;
let name = this.newInput
if (name) {
Array.isArray(this.form.weTags) || (this.form.weTags = []);
this.form.weTags.push({ name });
Array.isArray(this.form.weTags) || (this.form.weTags = [])
let isExist = this.form.weTags.some((e) => {
return e.name === name
})
if (isExist) {
this.msgError('标签名已存在,不可重复添加')
return
}
this.form.weTags.push({ name })
}
this.visibleAdd = false;
this.newInput = "";
this.visibleAdd = false
this.newInput = ''
},
submit() {
this.$refs["form"].validate((valid) => {
let form = JSON.parse(JSON.stringify(this.form));
this.$refs['form'].validate((valid) => {
this.newInput = ''
let form = JSON.parse(JSON.stringify(this.form))
if (!form.weTags.length) {
return;
return
}
debugger;
api[form.groupId ? "update" : "add"](form).then(() => {
this.msgSuccess("操作成功");
this.Pvisible = false;
this.$emit("success");
});
});
api[form.groupId ? 'update' : 'add'](form).then(() => {
this.msgSuccess('操作成功')
this.Pvisible = false
this.$emit('success')
})
})
},
},
};
}
</script>
<template>
......@@ -102,7 +109,7 @@ export default {
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标签组名称" prop="gourpName">
<el-input
v-model="form.gourpName"
v-model.trim="form.gourpName"
maxlength="15"
show-word-limit
placeholder="请输入标签组名称,该名称不支持再次修改"
......@@ -118,12 +125,14 @@ export default {
size="medium"
:key="index"
@close="closeTag(item, index)"
>{{item.name}}</el-tag>
>
{{ item.name }}
</el-tag>
</template>
<el-input
class="input-new-tag"
v-if="visibleAdd"
v-model="newInput"
v-model.trim="newInput"
ref="saveTagInput"
size="mini"
maxlength="10"
......@@ -138,11 +147,14 @@ export default {
class="button-new-tag"
size="mini"
@click="showInput"
>+ 添加标签</el-button>
>+ 添加标签</el-button
>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
<el-button type="primary" @click="submit" v-preventReClick="1000"
>确 定</el-button
>
<el-button @click="Pvisible = false">取 消</el-button>
</div>
</el-dialog>
......
......@@ -25,7 +25,7 @@ export default {
<template>
<div class="preview ac">
<div class="top">小微</div>
<div class="small">塬微科技-企微</div>
<div class="small">仟微科技-企微</div>
<div class="time">凌晨2:20</div>
<div class="flex msg-li">
<el-avatar
......
......@@ -69,7 +69,7 @@ export default {
</script>
<template>
<el-dialog title="选择素材" :visible.sync="Pvisible" width="650px">
<el-dialog title="选择素材" :visible.sync="Pvisible" width="650px" append-to-body>
<div>
<el-tabs v-model="Ptype">
<el-tab-pane name="0" v-if="showArr.includes(0)">
......
......@@ -134,7 +134,7 @@ export default {
v-model="radio"
>
<el-radio v-for="(item, index) in list" :label="item" :key="index">
<img class="img-li" :src="item.materialUrl" alt />
<img crossorigin="anonymous" class="img-li" :src="item.materialUrl" alt />
<div class="ac mt5">{{ item.materialName }}</div>
</el-radio>
</el-radio-group>
......
<script>
import { getTree, getList } from "@/api/material";
import { getTree, getList } from '@/api/material'
export default {
components: {},
props: {
// 0: '图片', 1: '语音', 2: '视频', 3: '普通文件', 4: '文本', 5: '海报',
type: {
type: String,
default: "4",
default: '4',
},
multiple: {
type: Boolean,
......@@ -23,83 +24,83 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
categoryId: "",
search: "",
mediaType: "4",
categoryId: '',
search: '',
mediaType: '4',
},
list: [], // 列表
total: 0, // 总条数
treeData: [], // 树
// 树props
treeProps: {
children: "children",
label: "name",
children: 'children',
label: 'name',
},
// 分组props
groupProps: {
// expandTrigger: 'hover',
checkStrictly: true,
children: "children",
label: "name",
value: "id",
children: 'children',
label: 'name',
value: 'id',
emitPath: false,
},
radio: "",
radio: '',
// 树props
treeProps: {
children: "children",
label: "name",
children: 'children',
label: 'name',
},
selectedx: []
};
selectedx: [],
}
},
watch: {
radio(val) {
this.$emit("change", val);
this.$emit('change', val)
},
},
computed: {},
created() {
this.query.mediaType = this.type;
this.getTree();
this.getList();
this.query.mediaType = this.type
this.getTree()
this.getList()
},
mounted() {},
methods: {
// 获取类目树
getTree() {
getTree(this.type).then(({ data }) => {
this.treeData = data;
});
this.treeData = data
})
},
// 获取素材列表
getList(page) {
page && (this.query.pageNum = page);
this.loading = true;
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
this.$emit("listChange", this.list);
this.list = rows
this.total = +total
this.loading = false
this.$emit('listChange', this.list)
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
// 节点单击事件
handleNodeClick(data) {
this.query.categoryId = data.id;
this.getList(1);
this.query.categoryId = data.id
this.getList(1)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.$emit("update:selected", selection);
this.$emit('update:selected', selection)
},
},
};
}
</script>
<template>
......@@ -168,6 +169,7 @@ export default {
<el-row :gutter="10">
<el-col :span="6">
<el-tree
class="bfc-o"
ref="tree"
:data="treeData"
:props="treeProps"
......@@ -191,17 +193,29 @@ export default {
></el-pagination>
</div>
<el-table
v-if="[3, 4].includes(+type)"
v-if="[1, 3, 4].includes(+type)"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="content" label="文本内容"></el-table-column>
<el-table-column
v-if="type == 4"
prop="content"
label="文本内容"
></el-table-column>
<el-table-column
v-else
prop="materialName"
label="素材名称"
></el-table-column>
<el-table-column prop="createTime" label="时间"></el-table-column>
</el-table>
<el-row v-else :gutter="20">
<el-checkbox-group v-model="selectedx" @change="handleSelectionChange">
<el-checkbox-group
v-model="selectedx"
@change="handleSelectionChange"
>
<el-col
:span="6"
style="margin-bottom: 24px; min-width: 220px"
......@@ -210,12 +224,23 @@ export default {
>
<el-card shadow="hover" body-style="padding: 0px;">
<div class="img-wrap">
<el-image :src="item.materialUrl" fit="contain"></el-image>
<el-image
v-if="type == 0"
:src="item.materialUrl"
fit="contain"
></el-image>
<el-image
v-else-if="type == 2"
:src="item.coverUrl"
fit="contain"
></el-image>
</div>
<div style="padding: 14px">
<el-checkbox :label="item">{{
item.materialName
}}</el-checkbox>
<el-checkbox :label="item">
<span class="label">
{{ item.materialName }}
</span>
</el-checkbox>
</div>
</el-card>
</el-col>
......@@ -254,4 +279,10 @@ export default {
top: 0;
}
}
/deep/ .el-checkbox__label {
vertical-align: text-top;
}
.label {
white-space: normal;
}
</style>
......@@ -29,12 +29,27 @@ export default {
listOneArray: [],
selectedGroup: '', // 选择的标签分组
removeTag: [],
Pselected: this.selected,
Pselected: [],
}
},
watch: {
type(val) {
val === 'remove' && (this.removeTag = this.selected.slice())
// type(val) {
// val === 'remove' && (this.removeTag = this.selected.slice())
// },
selected(val) {
if (this.type === 'add') {
this.Pselected = []
val.forEach((element) => {
let find = this.listOneArray.find((d) => {
return element.tagId === d.tagId
})
this.Pselected.push(find)
})
} else if (this.type === 'remove') {
this.removeTag = val.slice()
this.Pselected = val.slice()
}
// this.list = JSON.parse(JSON.stringify(this.list))
},
},
computed: {
......@@ -49,14 +64,14 @@ export default {
},
},
created() {
// this.type === 'remove' && (this.removeTag = this.Pselected.slice())
this.getList()
},
mounted() {},
methods: {
getList() {
getList().then(({ rows }) => {
this.list = Object.freeze(rows)
// this.list = Object.freeze(rows)
this.list = rows
this.listOneArray = []
this.list.forEach((element) => {
element.weTags.forEach((d) => {
......@@ -66,9 +81,22 @@ export default {
})
},
submit() {
if (!this.Pselected.length) {
this.msgError('请至少选择一个标签')
return
}
this.Pvisible = false
this.$emit('success', this.Pselected)
},
isChecked(unit) {
// debugger
return this.Pselected.some((el) => {
return unit.tagId === el.tagId
})
},
toJson(data) {
return JSON.stringify(data)
},
},
}
</script>
......@@ -86,20 +114,22 @@ export default {
:value="item.groupId"
></el-option>
</el-select>
<div class="mt20">
<el-checkbox-group v-model="Pselected" v-if="type !== 'remove'">
<div class="mt20" v-if="Pvisible">
<el-checkbox-group v-if="type !== 'remove'" v-model="Pselected">
<template v-for="(item, index) in list">
<div
class="bfc-d mr30"
v-show="item.groupId === selectedGroup || !selectedGroup"
v-if="item.groupId === selectedGroup || !selectedGroup"
:key="index"
>
<el-checkbox
:label="unit"
v-for="(unit, unique) in item.weTags"
:key="index + unique"
>{{ unit.name }}</el-checkbox
>
<template v-for="(unit, unique) in item.weTags">
<el-checkbox
v-if="unit.name.trim()"
:label="unit"
:key="index + '' + unique"
>{{ unit.name }}</el-checkbox
>
</template>
</div>
</template>
</el-checkbox-group>
......@@ -109,7 +139,7 @@ export default {
v-if="item.groupId === selectedGroup || !selectedGroup"
:label="item"
:key="index"
>{{ item.name }}</el-checkbox
>{{ item.name.trim() || '(空的无效标签,请移除)' }}</el-checkbox
>
</template>
</el-checkbox-group>
......
......@@ -84,14 +84,23 @@ export default {
},
// 选择变化
handleCheckChange(data, checked, indeterminate) {
// debugger
if (checked) {
if (this.isSigleSelect) {
// 单选情况
this.$refs.tree.setCheckedKeys([data.key])
}
this.userList.push(data)
if (this.isOnlyLeaf) {
if (data.userId) {
this.userList.push(data)
}
} else {
this.userList.push(data)
}
} else {
this.userList.splice(this.userList.indexOf(data), 1)
let index = this.userList.indexOf(data)
index > 0 && this.userList.splice(index, 1)
}
// console.log(data, checked, indeterminate);
},
......
......@@ -31,6 +31,7 @@ window.CONFIG = {
services: {
wecom: '/wecom',
common: '/common',
},
get headers() {
......
import hasRole from './hasRole'
import hasPermi from './hasPermi'
import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import preventReClick from './preventReClick'
const install = function(Vue) {
Vue.directive('hasRole', hasRole)
Vue.directive('hasPermi', hasPermi)
Vue.directive('preventReClick', preventReClick)
}
if (window.Vue) {
window['hasRole'] = hasRole
window['hasPermi'] = hasPermi
Vue.use(install); // eslint-disable-line
Vue.use(install) // eslint-disable-line
}
export default install
/**
* vue 自定义阻止按钮连续点击指令
* 使用 <div @click="search" v-preventReClick="1000">搜索</div>
*/
export default {
inserted(el, binding) {
el.addEventListener('click', () => {
el.style.pointerEvents = 'none'
setTimeout(() => {
el.style.pointerEvents = 'auto'
}, binding.value || 2000)
})
},
}
......@@ -6,25 +6,25 @@
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view class="page" :key="key" />
</keep-alive>
<router-view class="page" :key="key" />
<!-- <keep-alive :include="cachedViews">
</keep-alive> -->
</transition>
</section>
</template>
<script>
export default {
name: "AppMain",
name: 'AppMain',
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews;
return this.$store.state.tagsView.cachedViews
},
key() {
return this.$route.path;
return this.$route.path
},
},
};
}
</script>
<style lang="scss" scoped>
......
......@@ -10,7 +10,7 @@
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
<div class="right-menu">
<template v-if="device!=='mobile'">
<template v-if="device !== 'mobile'">
<search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
......@@ -28,9 +28,12 @@
<screenfull id="screenfull" class="right-menu-item hover-effect" />
</template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
>
<div class="avatar-wrapper">
塬微
仟微
<!-- <img :src="avatar" class="user-avatar"> -->
<i class="el-icon-caret-bottom" />
</div>
......@@ -51,11 +54,11 @@
</template>
<script>
import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from "@/components/Hamburger";
import Search from "@/components/HeaderSearch";
import screenfull from "@/components/Screenfull";
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
import Search from '@/components/HeaderSearch'
import screenfull from '@/components/Screenfull'
export default {
components: {
......@@ -65,43 +68,43 @@ export default {
screenfull,
},
computed: {
...mapGetters(["sidebar", "avatar", "device"]),
...mapGetters(['sidebar', 'avatar', 'device']),
setting: {
get() {
return this.$store.state.settings.showSettings;
return this.$store.state.settings.showSettings
},
set(val) {
this.$store.dispatch("settings/changeSetting", {
key: "showSettings",
this.$store.dispatch('settings/changeSetting', {
key: 'showSettings',
value: val,
});
})
},
},
},
methods: {
toggleSideBar() {
this.$store.dispatch("app/toggleSideBar");
this.$store.dispatch('app/toggleSideBar')
},
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/";
});
});
this.$store.dispatch('LogOut').then(() => {
location.href = '/'
})
})
},
goto(type) {
window.open(
type
? "https://gitee.com/LinkWeChat/link-wechat"
: "https://gitee.com/LinkWeChat/link-wechat"
);
? 'https://gitee.com/LinkWeChat/link-wechat'
: 'https://gitee.com/LinkWeChat/link-wechat'
)
},
},
};
}
</script>
<style lang="scss" scoped>
......
<template>
<div id="tags-view-container" class="tags-view-container">
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
<scroll-pane
ref="scrollPane"
class="tags-view-wrapper"
@scroll="handleScroll"
>
<router-link
v-for="tag in visitedViews"
ref="tag"
:key="tag.path"
:class="isActive(tag)?'active':''"
:class="isActive(tag) ? 'active' : ''"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
:style="activeStyle(tag)"
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@contextmenu.prevent.native="openMenu(tag,$event)"
@click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
@contextmenu.prevent.native="openMenu(tag, $event)"
>
{{ tag.title }}
{{ tag.meta.title }}
<span
v-if="!isAffix(tag)"
class="el-icon-close"
......@@ -21,9 +25,15 @@
/>
</router-link>
</scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<ul
v-show="visible"
:style="{ left: left + 'px', top: top + 'px' }"
class="contextmenu"
>
<li @click="refreshSelectedTag(selectedTag)">刷新页面</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭当前</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">
关闭当前
</li>
<li @click="closeOthersTags">关闭其他</li>
<li @click="closeAllTags(selectedTag)">关闭所有</li>
</ul>
......@@ -31,8 +41,8 @@
</template>
<script>
import ScrollPane from "./ScrollPane";
import path from "path";
import ScrollPane from './ScrollPane'
import path from 'path'
export default {
components: { ScrollPane },
......@@ -43,177 +53,177 @@ export default {
left: 0,
selectedTag: {},
affixTags: [],
};
}
},
computed: {
visitedViews() {
return this.$store.state.tagsView.visitedViews;
return this.$store.state.tagsView.visitedViews
},
routes() {
return this.$store.state.permission.routes;
return this.$store.state.permission.routes
},
theme() {
return this.$store.state.settings.theme;
return this.$store.state.settings.theme
},
},
watch: {
$route() {
this.addTags();
this.moveToCurrentTag();
this.addTags()
this.moveToCurrentTag()
},
visible(value) {
if (value) {
document.body.addEventListener("click", this.closeMenu);
document.body.addEventListener('click', this.closeMenu)
} else {
document.body.removeEventListener("click", this.closeMenu);
document.body.removeEventListener('click', this.closeMenu)
}
},
},
mounted() {
this.initTags();
this.addTags();
this.initTags()
this.addTags()
},
methods: {
isActive(route) {
return route.path === this.$route.path;
return route.path === this.$route.path
},
activeStyle(tag) {
if (!this.isActive(tag)) return {};
if (!this.isActive(tag)) return {}
return {
"background-color": this.theme,
"border-color": this.theme,
};
'background-color': this.theme,
'border-color': this.theme,
}
},
isAffix(tag) {
return tag.meta && tag.meta.affix;
return tag.meta && tag.meta.affix
},
filterAffixTags(routes, basePath = "/") {
let tags = [];
filterAffixTags(routes, basePath = '/') {
let tags = []
routes.forEach((route) => {
if (route.meta && route.meta.affix) {
const tagPath = path.resolve(basePath, route.path);
const tagPath = path.resolve(basePath, route.path)
tags.push({
fullPath: tagPath,
path: tagPath,
name: route.name,
meta: { ...route.meta },
});
})
}
if (route.children) {
const tempTags = this.filterAffixTags(route.children, route.path);
const tempTags = this.filterAffixTags(route.children, route.path)
if (tempTags.length >= 1) {
tags = [...tags, ...tempTags];
tags = [...tags, ...tempTags]
}
}
});
return tags;
})
return tags
},
initTags() {
const affixTags = (this.affixTags = this.filterAffixTags(this.routes));
const affixTags = (this.affixTags = this.filterAffixTags(this.routes))
for (const tag of affixTags) {
// Must have tag name
if (tag.name) {
this.$store.dispatch("tagsView/addVisitedView", tag);
this.$store.dispatch('tagsView/addVisitedView', tag)
}
}
},
addTags() {
const { name } = this.$route;
const { name } = this.$route
if (name) {
this.$store.dispatch("tagsView/addView", this.$route);
this.$store.dispatch('tagsView/addView', this.$route)
}
return false;
return false
},
moveToCurrentTag() {
const tags = this.$refs.tag;
const tags = this.$refs.tag
this.$nextTick(() => {
for (const tag of tags) {
if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag);
this.$refs.scrollPane.moveToTarget(tag)
// when query is different then update
if (tag.to.fullPath !== this.$route.fullPath) {
this.$store.dispatch("tagsView/updateVisitedView", this.$route);
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
}
break;
break
}
}
});
})
},
refreshSelectedTag(view) {
this.$store.dispatch("tagsView/delCachedView", view).then(() => {
const { fullPath } = view;
this.$store.dispatch('tagsView/delCachedView', view).then(() => {
const { fullPath } = view
this.$nextTick(() => {
this.$router.replace({
path: "/redirect" + fullPath,
});
});
});
path: '/redirect' + fullPath,
})
})
})
},
closeSelectedTag(view) {
this.$store
.dispatch("tagsView/delView", view)
.dispatch('tagsView/delView', view)
.then(({ visitedViews }) => {
if (this.isActive(view)) {
this.toLastView(visitedViews, view);
this.toLastView(visitedViews, view)
}
});
})
},
closeOthersTags() {
this.$router.push(this.selectedTag);
this.$router.push(this.selectedTag)
this.$store
.dispatch("tagsView/delOthersViews", this.selectedTag)
.dispatch('tagsView/delOthersViews', this.selectedTag)
.then(() => {
this.moveToCurrentTag();
});
this.moveToCurrentTag()
})
},
closeAllTags(view) {
this.$store.dispatch("tagsView/delAllViews").then(({ visitedViews }) => {
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
if (this.affixTags.some((tag) => tag.path === view.path)) {
return;
return
}
this.toLastView(visitedViews, view);
});
this.toLastView(visitedViews, view)
})
},
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0];
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView.fullPath);
this.$router.push(latestView.fullPath)
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
if (view.name === "Dashboard") {
if (view.name === 'Dashboard') {
// to reload home page
this.$router.replace({ path: "/redirect" + view.fullPath });
this.$router.replace({ path: '/redirect' + view.fullPath })
} else {
this.$router.push("/");
this.$router.push('/')
}
}
},
openMenu(tag, e) {
const menuMinWidth = 105;
const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left
const offsetWidth = this.$el.offsetWidth; // container width
const maxLeft = offsetWidth - menuMinWidth; // left boundary
const left = e.clientX - offsetLeft + 15; // 15: margin right
const menuMinWidth = 105
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - menuMinWidth // left boundary
const left = e.clientX - offsetLeft + 15 // 15: margin right
if (left > maxLeft) {
this.left = maxLeft;
this.left = maxLeft
} else {
this.left = left;
this.left = left
}
this.top = e.clientY;
this.visible = true;
this.selectedTag = tag;
this.top = e.clientY
this.visible = true
this.selectedTag = tag
},
closeMenu() {
this.visible = false;
this.visible = false
},
handleScroll() {
this.closeMenu();
this.closeMenu()
},
},
};
}
</script>
<style lang="scss" scoped>
......@@ -248,7 +258,7 @@ export default {
color: #fff;
border-color: #42b983;
&::before {
content: "";
content: '';
background: #fff;
display: inline-block;
width: 8px;
......
......@@ -20,7 +20,7 @@ import config from '@/config'
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import directive from './directive'
import './assets/icons' // icon
import './permission' // permission control
......@@ -69,7 +69,7 @@ Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Upload', Upload)
Vue.use(permission)
Vue.use(directive)
/**
* If you don't want to use mock-server
......
const state = {
visitedViews: [],
cachedViews: []
cachedViews: [],
}
const mutations = {
ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
if (state.visitedViews.some((v) => v.path === view.path)) return
view.meta.title = view.meta.title || 'no-name'
state.visitedViews.push(Object.assign({}, view))
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
......@@ -33,7 +30,7 @@ const mutations = {
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => {
state.visitedViews = state.visitedViews.filter((v) => {
return v.meta.affix || v.path === view.path
})
},
......@@ -46,12 +43,12 @@ const mutations = {
}
},
DEL_ALL_VISITED_VIEWS: state => {
DEL_ALL_VISITED_VIEWS: (state) => {
// keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
const affixTags = state.visitedViews.filter((tag) => tag.meta.affix)
state.visitedViews = affixTags
},
DEL_ALL_CACHED_VIEWS: state => {
DEL_ALL_CACHED_VIEWS: (state) => {
state.cachedViews = []
},
......@@ -62,7 +59,7 @@ const mutations = {
break
}
}
}
},
}
const actions = {
......@@ -78,69 +75,69 @@ const actions = {
},
delView({ dispatch, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
dispatch('delVisitedView', view)
dispatch('delCachedView', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
cachedViews: [...state.cachedViews],
})
})
},
delVisitedView({ commit, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
delCachedView({ commit, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_CACHED_VIEW', view)
resolve([...state.cachedViews])
})
},
delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
dispatch('delOthersVisitedViews', view)
dispatch('delOthersCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
cachedViews: [...state.cachedViews],
})
})
},
delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_OTHERS_CACHED_VIEWS', view)
resolve([...state.cachedViews])
})
},
delAllViews({ dispatch, state }, view) {
return new Promise(resolve => {
return new Promise((resolve) => {
dispatch('delAllVisitedViews', view)
dispatch('delAllCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
cachedViews: [...state.cachedViews],
})
})
},
delAllVisitedViews({ commit, state }) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
},
delAllCachedViews({ commit, state }) {
return new Promise(resolve => {
return new Promise((resolve) => {
commit('DEL_ALL_CACHED_VIEWS')
resolve([...state.cachedViews])
})
......@@ -148,12 +145,12 @@ const actions = {
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
}
},
}
export default {
namespaced: true,
state,
mutations,
actions
actions,
}
......@@ -224,6 +224,7 @@ export default {
<SelectMaterialMult
:selected.sync="selectedMaterial"
:type="metarialParams.mediaType"
:key="metarialParams.mediaType"
></SelectMaterialMult>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
......
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
// import clipboard from "clipboard";
export default {
......@@ -10,7 +10,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
},
dateRange: [], // 添加日期
total: 0,
......@@ -20,18 +20,18 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"]
};
status: ['正常', '停用'],
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -39,53 +39,53 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/appTool/groupFissionAev",
query: { id }
});
}
}
};
path: '/appTool/groupFissionAev',
query: { id },
})
},
},
}
</script>
<template>
......@@ -222,7 +222,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -232,7 +232,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
// import clipboard from "clipboard";
export default {
......@@ -10,7 +10,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
},
dateRange: [], // 添加日期
total: 0,
......@@ -20,18 +20,18 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"]
};
status: ['正常', '停用'],
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -39,53 +39,53 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/appTool/taskAev",
query: { id }
});
}
}
};
path: '/appTool/taskAev',
query: { id },
})
},
},
}
</script>
<template>
......@@ -222,7 +222,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -232,7 +232,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
<script>
import { getDetail, add, update, getQrcode } from '@/api/drainageCode/staff'
import { getList } from '@/api/drainageCode/welcome'
import PhoneDialog from '@/components/PhoneDialog'
import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag'
import SelectMaterial from '@/components/SelectMaterial'
export default {
components: {},
props: {},
components: { PhoneDialog, SelectTag, SelectUser, SelectMaterial },
data() {
return {};
return {
dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false,
dialogVisibleSelectMaterial: false,
dialogVisibleSelectWel: false,
// 遮罩层
loading: false,
// 表单参数
form: {
codeType: 1,
qrCode: '',
isJoinConfirmFriends: 0,
weEmpleCodeTags: [],
weEmpleCodeUseScops: [],
},
materialSelected: '',
welQuery: { welcomeMsg: '' },
welLoading: false,
welList: [],
welSelected: {},
type: { 1: '单人', 2: '多人', 3: '批量单人' },
activeName: '',
}
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
created() {
let id = this.$route.query.id
id && this.getDetail(id)
},
methods: {
/** 获取详情 */
getDetail(id) {
this.loading = true
getDetail(id).then(({ data }) => {
this.form = data
this.materialSelected =
data.weMaterial == null ? '' : data.weMaterial.materialUrl
this.loading = false
})
},
/** 获取欢迎语列表 */
getWelList() {
this.welLoading = true
getList(this.welQuery).then(({ rows }) => {
this.welList = rows
this.$refs.table.$forceUpdate()
this.welLoading = false
})
},
codeTypeChange() {
this.form.weEmpleCodeUseScops = []
this.form.qrCode = ''
},
// 选择人员变化事件
selectedUser(users) {
let params = { userIds: [], departmentIds: [] }
this.form.weEmpleCodeUseScops = users.map((d) => {
d.userId && params.userIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return {
businessId: d.id || d.userId,
businessName: d.name,
businessIdType: d.userId ? 2 : 1,
}
})
params.userIds += ''
params.departmentIds += ''
getQrcode(params).then(({ data }) => {
this.$set(this.form, 'qrCode', data.qr_code)
})
},
submitSelectTag(data) {
this.form.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name,
}))
},
// 选择素材确认按钮
submitSelectMaterial(text, image, file) {
this.form.mediaId = image.id
this.materialSelected = image.materialUrl
this.dialogVisibleSelectMaterial = false
},
removeMaterial() {
this.form.mediaId = ''
this.materialSelected = ''
},
// 欢迎语确认按钮
selectWelcome() {
this.form.welcomeMsg = this.welSelected.welcomeMsg
this.form.mediaId = this.welSelected.mediaId
this.dialogVisibleSelectWel = false
},
submit() {
if (!this.form.weEmpleCodeUseScops.length) {
this.msgError('请至少选择一名使用员工')
return
}
this.loading = true
;(this.form.id ? update : add)(this.form)
.then(({ data }) => {
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
},
},
}
</script>
<template>
<div>
<img src="@/assets/example/groupSOP.jpg" alt="" />
<div class="wrap" v-loading="loading">
<el-form :model="form" ref="form" label-width="100px">
<el-form-item label="规则名称" prop="activityScene">
<el-input
v-model="form.activityScene"
maxlength="30"
show-word-limit
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="执行群聊">
<!-- closable -->
<el-tag
size="medium"
v-for="(item, index) in form.weEmpleCodeUseScops"
:key="index"
>{{ item.businessName }}</el-tag
>
<el-button
type="primary"
plain
class="ml10"
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectUser = true"
>{{ form.weEmpleCodeUseScops.length ? '修改' : '添加' }}</el-button
>
</el-form-item>
<el-form-item label="内容名称" prop="isJoinConfirmFriends">
<el-input
v-model="form.welcomeMsg"
maxlength="220"
show-word-limit
:autosize="{ minRows: 5, maxRows: 20 }"
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="执行时间" prop="codeType">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="消息内容" prop="activityScene">
<div class="content-left">
<el-button class="create" @click="goRoute">新建素材</el-button>
<el-tabs v-model="activeName">
<el-tab-pane name="0">
<span slot="label"> <i class="el-icon-date"></i> 文本 </span>
<el-input
v-model="form.textMessage"
type="textarea"
maxlength="220"
show-word-limit
:autosize="{ minRows: 10, maxRows: 50 }"
placeholder="请输入"
></el-input>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"> <i class="el-icon-date"></i> 图片 </span>
<el-image
v-if="form.imageMessage"
style="width: 200px;"
:src="form.imageMessage"
fit="fit"
></el-image>
</el-tab-pane>
<el-button
type="primary"
class="mt20"
@click="dialogVisibleSelectMaterial = true"
>从素材库选择</el-button
>
</el-tabs>
</div>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="submit">保存</el-button>
<el-button @click="$router.back()">取消</el-button>
</el-form-item>
</el-form>
<div class="preview-wrap">
<!-- 预览 -->
<div class="tip">欢迎语样式</div>
<PhoneDialog
:message="form.welcomeMsg || '请输入加群引导语'"
:isOther="!!materialSelected"
>
<el-image style="border-radius: 6px;" :src="materialSelected" fit="fit">
</el-image>
</PhoneDialog>
</div>
<!-- 选择使用员工弹窗 -->
<SelectUser
:key="form.codeType"
:visible.sync="dialogVisibleSelectUser"
title="选择使用员工"
:isOnlyLeaf="form.codeType !== 2"
:isSigleSelect="form.codeType == 1"
@success="selectedUser"
></SelectUser>
<!-- 选择标签弹窗 -->
<SelectTag
:visible.sync="dialogVisibleSelectTag"
:selected="form.toTag"
@success="submitSelectTag"
>
</SelectTag>
<!-- 选择素材弹窗 -->
<SelectMaterial
:visible.sync="dialogVisibleSelectMaterial"
type="1"
:showArr="[1]"
@success="submitSelectMaterial"
>
</SelectMaterial>
<el-dialog
key="a"
title="选择欢迎语"
:visible.sync="dialogVisibleSelectWel"
width="500"
>
<div>
<el-input
class="welcome-input"
placeholder="请输入关键字"
v-model="welQuery.welcomeMsg"
>
<el-button slot="append" @click="getWelList">查询</el-button>
</el-input>
<el-table
ref="table"
v-loading="welLoading"
:data="welList"
:max-height="300"
:show-header="false"
highlight-current-row
@current-change="(val) => (welSelected = val)"
>
<el-table-column
property="welcomeMsg"
show-overflow-tooltip
></el-table-column>
<el-table-column width="60">
<template slot-scope="{ row }">
<i
v-if="welSelected.id === row.id"
class="el-icon-check"
style="color: rgb(65, 133, 244); font-size: 25px;"
></i>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer">
<el-button @click="dialogVisibleSelectWel = false">取 消</el-button>
<el-button type="primary" @click="selectWelcome">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<style lang="less" scoped></style>
<style lang="scss" scoped>
.wrap {
display: flex;
margin-top: 24px;
.el-form {
margin-right: 10%;
}
}
.preview-wrap {
line-height: 26px;
}
.tip {
color: #999;
}
.welcome-input {
display: table;
width: 80%;
margin: 0 auto 20px;
}
.el-icon-error {
}
</style>
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
export default {
components: {},
......@@ -9,7 +9,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
},
dateRange: [], // 添加日期
total: 0,
......@@ -19,22 +19,22 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"],
status: ['正常', '停用'],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
0: '发给客户',
1: '发给客户群',
},
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -42,85 +42,141 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/groupSOPAev",
query: { id }
});
}
}
};
path: '/communityOperating/groupSOPAev',
query: { id },
})
},
},
}
</script>
<template>
<div>
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="80px"
class="top-search"
size="small"
>
<el-form-item label="规则名称" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="创建人">
<div class="tag-input" @click="dialogVisibleSelectUser = true">
<el-input v-model="query.name" placeholder="请输入"></el-input>
<!-- <span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else>
<el-tag
type="info"
v-for="(unit, unique) in queryUser"
:key="unique"
>{{ unit.name }}</el-tag
>
</template> -->
</div>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="">
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="getList(1)"
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:customer:query']"
type="info"
@click="resetForm()"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="fxbw mb10 aic">
<div class="total">
群SOP 制定推送规则后,通知群主定时给指定客户群发送消息。
<el-button type="primary" @click="goRoute()">新建规则</el-button>
<!-- 新客自动拉群
客户通过员工活码添加员工,自动发送入群引导语、群活码,客户扫码入群。 -->
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>创建规则</el-button
<el-button
v-hasPermi="['customerManage:customer:export']"
type="cyan"
@click="exportCustomer"
>批量删除</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-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="规则名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column
label="执行群聊"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="创建人" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
......@@ -143,7 +199,7 @@ export default {
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>删除</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
......@@ -207,7 +263,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -217,7 +273,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
<script>
import { getDetail, add, update, getQrcode } from '@/api/drainageCode/staff'
import { getList } from '@/api/drainageCode/welcome'
import PhoneDialog from '@/components/PhoneDialog'
import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag'
import SelectMaterial from '@/components/SelectMaterial'
export default {
components: {},
props: {},
components: { PhoneDialog, SelectTag, SelectUser, SelectMaterial },
data() {
return {};
return {
dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false,
dialogVisibleSelectMaterial: false,
dialogVisibleSelectWel: false,
// 遮罩层
loading: false,
// 表单参数
form: {
codeType: 1,
qrCode: '',
isJoinConfirmFriends: 0,
weEmpleCodeTags: [],
weEmpleCodeUseScops: [],
},
materialSelected: '',
welQuery: { welcomeMsg: '' },
welLoading: false,
welList: [],
welSelected: {},
type: { 1: '单人', 2: '多人', 3: '批量单人' },
}
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
created() {
let id = this.$route.query.id
id && this.getDetail(id)
},
methods: {
/** 获取详情 */
getDetail(id) {
this.loading = true
getDetail(id).then(({ data }) => {
this.form = data
this.materialSelected =
data.weMaterial == null ? '' : data.weMaterial.materialUrl
this.loading = false
})
},
/** 获取欢迎语列表 */
getWelList() {
this.welLoading = true
getList(this.welQuery).then(({ rows }) => {
this.welList = rows
this.$refs.table.$forceUpdate()
this.welLoading = false
})
},
codeTypeChange() {
this.form.weEmpleCodeUseScops = []
this.form.qrCode = ''
},
// 选择人员变化事件
selectedUser(users) {
let params = { userIds: [], departmentIds: [] }
this.form.weEmpleCodeUseScops = users.map((d) => {
d.userId && params.userIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return {
businessId: d.id || d.userId,
businessName: d.name,
businessIdType: d.userId ? 2 : 1,
}
})
params.userIds += ''
params.departmentIds += ''
getQrcode(params).then(({ data }) => {
this.$set(this.form, 'qrCode', data.qr_code)
})
},
submitSelectTag(data) {
this.form.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name,
}))
},
// 选择素材确认按钮
submitSelectMaterial(text, image, file) {
this.form.mediaId = image.id
this.materialSelected = image.materialUrl
this.dialogVisibleSelectMaterial = false
},
removeMaterial() {
this.form.mediaId = ''
this.materialSelected = ''
},
// 欢迎语确认按钮
selectWelcome() {
this.form.welcomeMsg = this.welSelected.welcomeMsg
this.form.mediaId = this.welSelected.mediaId
this.dialogVisibleSelectWel = false
},
submit() {
if (!this.form.weEmpleCodeUseScops.length) {
this.msgError('请至少选择一名使用员工')
return
}
this.loading = true
;(this.form.id ? update : add)(this.form)
.then(({ data }) => {
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
},
},
}
</script>
<template>
<div>
<img src="@/assets/example/keywords.jpg" alt="" />
<div class="wrap" v-loading="loading">
<el-form :model="form" ref="form" label-width="100px">
<el-form-item label="活码名称" prop="activityScene">
<el-input
v-model="form.activityScene"
maxlength="30"
show-word-limit
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="关键词">
<!-- closable -->
<el-tag
size="medium"
v-for="(item, index) in form.weEmpleCodeUseScops"
:key="index"
>{{ item.businessName }}</el-tag
>
<el-button
type="primary"
plain
class="ml10"
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectUser = true"
>{{ form.weEmpleCodeUseScops.length ? '修改' : '添加' }}</el-button
>
</el-form-item>
<el-form-item label="加群引导语" prop="isJoinConfirmFriends">
<el-input
type="textarea"
v-model="form.welcomeMsg"
maxlength="220"
show-word-limit
:autosize="{ minRows: 5, maxRows: 20 }"
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="选择群活码" prop="activityScene">
<el-button
type="primary"
plain
class="ml10"
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectUser = true"
>{{ form.weEmpleCodeUseScops.length ? '修改' : '添加' }}</el-button
>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="submit">保存</el-button>
<el-button @click="$router.back()">取消</el-button>
</el-form-item>
</el-form>
<div class="preview-wrap">
<!-- 预览 -->
<div class="tip">欢迎语样式</div>
<PhoneDialog
:message="form.welcomeMsg || '请输入加群引导语'"
:isOther="!!materialSelected"
>
<el-image style="border-radius: 6px;" :src="materialSelected" fit="fit">
</el-image>
</PhoneDialog>
</div>
<!-- 选择使用员工弹窗 -->
<SelectUser
:key="form.codeType"
:visible.sync="dialogVisibleSelectUser"
title="选择使用员工"
:isOnlyLeaf="form.codeType !== 2"
:isSigleSelect="form.codeType == 1"
@success="selectedUser"
></SelectUser>
<!-- 选择标签弹窗 -->
<SelectTag
:visible.sync="dialogVisibleSelectTag"
:selected="form.toTag"
@success="submitSelectTag"
>
</SelectTag>
<!-- 选择素材弹窗 -->
<SelectMaterial
:visible.sync="dialogVisibleSelectMaterial"
type="1"
:showArr="[1]"
@success="submitSelectMaterial"
>
</SelectMaterial>
<el-dialog
key="a"
title="选择欢迎语"
:visible.sync="dialogVisibleSelectWel"
width="500"
>
<div>
<el-input
class="welcome-input"
placeholder="请输入关键字"
v-model="welQuery.welcomeMsg"
>
<el-button slot="append" @click="getWelList">查询</el-button>
</el-input>
<el-table
ref="table"
v-loading="welLoading"
:data="welList"
:max-height="300"
:show-header="false"
highlight-current-row
@current-change="(val) => (welSelected = val)"
>
<el-table-column
property="welcomeMsg"
show-overflow-tooltip
></el-table-column>
<el-table-column width="60">
<template slot-scope="{ row }">
<i
v-if="welSelected.id === row.id"
class="el-icon-check"
style="color: rgb(65, 133, 244); font-size: 25px;"
></i>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer">
<el-button @click="dialogVisibleSelectWel = false">取 消</el-button>
<el-button type="primary" @click="selectWelcome">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<style lang="less" scoped></style>
<style lang="scss" scoped>
.wrap {
display: flex;
margin-top: 24px;
.el-form {
margin-right: 10%;
}
}
.preview-wrap {
line-height: 26px;
}
.tip {
color: #999;
}
.welcome-input {
display: table;
width: 80%;
margin: 0 auto 20px;
}
.el-icon-error {
}
</style>
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
export default {
components: {},
......@@ -9,7 +9,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
},
dateRange: [], // 添加日期
total: 0,
......@@ -19,22 +19,22 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"],
status: ['正常', '停用'],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
0: '发给客户',
1: '发给客户群',
},
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -42,73 +42,135 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/keywordsAev",
query: { id }
});
}
}
};
path: '/communityOperating/keywordsAev',
query: { id },
})
},
},
}
</script>
<template>
<div>
<div>
<div>配置链接</div>
<div>
请点击按钮复制该应用链接,并将应用页面配置到聊天工具栏,方便成员在与客户的聊天中查看和使用,提高服务效率
</div>
<div>
<div>https://platform.wshoto.com/H5/?corpId=ww8e09372aff8d9190</div>
<div>
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="getList(1)"
>查询</el-button
>
<span>如何配置?</span>
</div>
</div>
</div>
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="80px"
class="top-search"
size="small"
>
<el-form-item label="活码名称" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="创建人">
<div class="tag-input" @click="dialogVisibleSelectUser = true">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</div>
</el-form-item>
<el-form-item label="关键词" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="">
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="getList(1)"
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:customer:query']"
type="info"
@click="resetForm()"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="fxbw mb10 aic">
<div class="total">
关键词拉群
配置聊天工具栏,管理员创建关键词拉群后,员工可在聊天功能栏使用。
<el-button type="primary" @click="goRoute()">新建关键词</el-button>
<!-- 新客自动拉群
客户通过员工活码添加员工,自动发送入群引导语、群活码,客户扫码入群。 -->
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>新建关键词拉群</el-button
<el-button type="primary" @click="goRoute()">批量下载</el-button>
<el-button
v-hasPermi="['customerManage:customer:export']"
type="cyan"
@click="exportCustomer"
>批量删除</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-card shadow="never" :body-style="{padding: '20px 0 0'}">
......@@ -122,7 +184,7 @@ export default {
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="活动名称" align="center">
<el-table-column prop="createTime" label="活码名称" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
......@@ -137,6 +199,12 @@ export default {
width="160"
></el-table-column>
<el-table-column
label="创建人"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
......@@ -150,12 +218,20 @@ export default {
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>下载</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
......@@ -163,7 +239,7 @@ export default {
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>删除</el-button
>
</template>
</el-table-column>
......@@ -219,7 +295,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -229,7 +305,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
<script>
import { getDetail, add, update, getQrcode } from '@/api/drainageCode/staff'
import { getList } from '@/api/drainageCode/welcome'
import PhoneDialog from '@/components/PhoneDialog'
import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag'
import SelectMaterial from '@/components/SelectMaterial'
export default {
components: {},
props: {},
components: { PhoneDialog, SelectTag, SelectUser, SelectMaterial },
data() {
return {};
return {
dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false,
dialogVisibleSelectMaterial: false,
dialogVisibleSelectWel: false,
// 遮罩层
loading: false,
// 表单参数
form: {
codeType: 1,
qrCode: '',
isJoinConfirmFriends: 0,
weEmpleCodeTags: [],
weEmpleCodeUseScops: [],
},
materialSelected: '',
welQuery: { welcomeMsg: '' },
welLoading: false,
welList: [],
welSelected: {},
type: { 1: '单人', 2: '多人', 3: '批量单人' },
}
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
created() {
let id = this.$route.query.id
id && this.getDetail(id)
},
methods: {
/** 获取详情 */
getDetail(id) {
this.loading = true
getDetail(id).then(({ data }) => {
this.form = data
this.materialSelected =
data.weMaterial == null ? '' : data.weMaterial.materialUrl
this.loading = false
})
},
/** 获取欢迎语列表 */
getWelList() {
this.welLoading = true
getList(this.welQuery).then(({ rows }) => {
this.welList = rows
this.$refs.table.$forceUpdate()
this.welLoading = false
})
},
codeTypeChange() {
this.form.weEmpleCodeUseScops = []
this.form.qrCode = ''
},
// 选择人员变化事件
selectedUser(users) {
let params = { userIds: [], departmentIds: [] }
this.form.weEmpleCodeUseScops = users.map((d) => {
d.userId && params.userIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return {
businessId: d.id || d.userId,
businessName: d.name,
businessIdType: d.userId ? 2 : 1,
}
})
params.userIds += ''
params.departmentIds += ''
getQrcode(params).then(({ data }) => {
this.$set(this.form, 'qrCode', data.qr_code)
})
},
submitSelectTag(data) {
this.form.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name,
}))
},
// 选择素材确认按钮
submitSelectMaterial(text, image, file) {
this.form.mediaId = image.id
this.materialSelected = image.materialUrl
this.dialogVisibleSelectMaterial = false
},
removeMaterial() {
this.form.mediaId = ''
this.materialSelected = ''
},
// 欢迎语确认按钮
selectWelcome() {
this.form.welcomeMsg = this.welSelected.welcomeMsg
this.form.mediaId = this.welSelected.mediaId
this.dialogVisibleSelectWel = false
},
submit() {
if (!this.form.weEmpleCodeUseScops.length) {
this.msgError('请至少选择一名使用员工')
return
}
this.loading = true
;(this.form.id ? update : add)(this.form)
.then(({ data }) => {
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
},
},
}
</script>
<template>
<div>
<img src="@/assets/example/newCustomer.jpg" alt="" />
<div class="wrap" v-loading="loading">
<el-form :model="form" ref="form" label-width="100px">
<el-form-item label="活码名称" prop="activityScene">
<el-input
v-model="form.activityScene"
maxlength="30"
show-word-limit
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="使用员工">
<!-- closable -->
<el-tag
size="medium"
v-for="(item, index) in form.weEmpleCodeUseScops"
:key="index"
>{{ item.businessName }}</el-tag
>
<el-button
type="primary"
plain
class="ml10"
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectUser = true"
>{{ form.weEmpleCodeUseScops.length ? '修改' : '添加' }}</el-button
>
</el-form-item>
<el-form-item label="加群引导语" prop="isJoinConfirmFriends">
<el-input
type="textarea"
v-model="form.welcomeMsg"
maxlength="220"
show-word-limit
:autosize="{ minRows: 5, maxRows: 20 }"
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="选择群活码" prop="activityScene">
<el-button
type="primary"
plain
class="ml10"
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectUser = true"
>{{ form.weEmpleCodeUseScops.length ? '修改' : '添加' }}</el-button
>
</el-form-item>
<el-form-item label="扫码标签" prop="weEmpleCodeTags">
<!-- closable -->
<el-tag
size="medium"
v-for="(item, index) in form.weEmpleCodeTags"
:key="index"
>{{ item.tagName }}</el-tag
>
<el-button
type="primary"
class="ml10"
plain
icon="el-icon-plus"
size="mini"
@click="dialogVisibleSelectTag = true"
>添加标签</el-button
>
<!-- <div class="tip">
根据使用场景做标签记录,扫码添加的客户,可自动打上标签
</div> -->
</el-form-item>
<el-form-item label="添加设置" prop="isJoinConfirmFriends">
<el-checkbox
:true-label="1"
:false-label="0"
v-model="form.isJoinConfirmFriends"
>客户添加时无需经过确认自动成为好友</el-checkbox
>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="submit">保存</el-button>
<el-button @click="$router.back()">取消</el-button>
</el-form-item>
</el-form>
<div class="preview-wrap">
<!-- 预览 -->
<div class="tip">欢迎语样式</div>
<PhoneDialog
:message="form.welcomeMsg || '请输入加群引导语'"
:isOther="!!materialSelected"
>
<el-image style="border-radius: 6px;" :src="materialSelected" fit="fit">
</el-image>
</PhoneDialog>
</div>
<!-- 选择使用员工弹窗 -->
<SelectUser
:key="form.codeType"
:visible.sync="dialogVisibleSelectUser"
title="选择使用员工"
:isOnlyLeaf="form.codeType !== 2"
:isSigleSelect="form.codeType == 1"
@success="selectedUser"
></SelectUser>
<!-- 选择标签弹窗 -->
<SelectTag
:visible.sync="dialogVisibleSelectTag"
:selected="form.toTag"
@success="submitSelectTag"
>
</SelectTag>
<!-- 选择素材弹窗 -->
<SelectMaterial
:visible.sync="dialogVisibleSelectMaterial"
type="1"
:showArr="[1]"
@success="submitSelectMaterial"
>
</SelectMaterial>
<el-dialog
key="a"
title="选择欢迎语"
:visible.sync="dialogVisibleSelectWel"
width="500"
>
<div>
<el-input
class="welcome-input"
placeholder="请输入关键字"
v-model="welQuery.welcomeMsg"
>
<el-button slot="append" @click="getWelList">查询</el-button>
</el-input>
<el-table
ref="table"
v-loading="welLoading"
:data="welList"
:max-height="300"
:show-header="false"
highlight-current-row
@current-change="(val) => (welSelected = val)"
>
<el-table-column
property="welcomeMsg"
show-overflow-tooltip
></el-table-column>
<el-table-column width="60">
<template slot-scope="{ row }">
<i
v-if="welSelected.id === row.id"
class="el-icon-check"
style="color: rgb(65, 133, 244); font-size: 25px;"
></i>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer">
<el-button @click="dialogVisibleSelectWel = false">取 消</el-button>
<el-button type="primary" @click="selectWelcome">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<style lang="less" scoped></style>
<style lang="scss" scoped>
.wrap {
display: flex;
margin-top: 24px;
.el-form {
margin-right: 10%;
}
}
.preview-wrap {
line-height: 26px;
}
.tip {
color: #999;
}
.welcome-input {
display: table;
width: 80%;
margin: 0 auto 20px;
}
.el-icon-error {
}
</style>
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
export default {
components: {},
......@@ -9,7 +9,9 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
beginTime: '', // "开始时间",
endTime: '', // "结束时间"
},
dateRange: [], // 添加日期
total: 0,
......@@ -19,22 +21,23 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"],
status: ['正常', '停用'],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
0: '发给客户',
1: '发给客户群',
},
queryUser: [], // 搜索框选择的添加人
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -42,80 +45,133 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/newCustomerAev",
query: { id }
});
}
}
};
path: '/communityOperating/newCustomerAev',
query: { id },
})
},
},
}
</script>
<template>
<div>
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="80px"
class="top-search"
size="small"
>
<el-form-item label="活码名称" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="创建人">
<div class="tag-input" @click="dialogVisibleSelectUser = true">
<el-input v-model="query.name" placeholder="请输入"></el-input>
<!-- <span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else>
<el-tag
type="info"
v-for="(unit, unique) in queryUser"
:key="unique"
>{{ unit.name }}</el-tag
>
</template> -->
</div>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="">
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="getList(1)"
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:customer:query']"
type="info"
@click="resetForm()"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="fxbw mb10 aic">
<div class="total">
新客自动拉群
客户通过员工活码添加员工,自动发送入群引导语、群活码,客户扫码入群。
<el-button type="primary" @click="goRoute()">新建自动拉群</el-button>
<!-- 新客自动拉群
客户通过员工活码添加员工,自动发送入群引导语、群活码,客户扫码入群。 -->
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>新建自动拉群</el-button
<el-button type="primary" @click="goRoute()">批量下载</el-button>
<el-button
v-hasPermi="['customerManage:customer:export']"
type="cyan"
@click="exportCustomer"
>批量删除</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-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="createTime" label="活码名称" align="center">
</el-table-column>
<el-table-column
label="员工活码"
align="center"
......@@ -127,17 +183,17 @@ export default {
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="使用成员" align="center">
<el-table-column prop="createTime" label="使用员工" align="center">
已结束
</el-table-column>
<el-table-column
label="标签"
label="客户标签"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="群聊"
label="实际群聊"
align="center"
prop="createTime"
width="160"
......@@ -149,6 +205,12 @@ export default {
width="160"
></el-table-column>
<el-table-column
label="创建人"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
......@@ -162,12 +224,20 @@ export default {
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>下载</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
......@@ -175,7 +245,7 @@ export default {
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>删除</el-button
>
</template>
</el-table-column>
......@@ -231,7 +301,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -241,7 +311,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
<script>
import * as api from "@/api/customer";
import * as api from '@/api/customer'
// import clipboard from "clipboard";
export default {
......@@ -10,7 +10,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: ""
name: '',
},
dateRange: [], // 添加日期
total: 0,
......@@ -20,18 +20,18 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
name: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"]
};
status: ['正常', '停用'],
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
......@@ -39,59 +39,62 @@ export default {
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/oldCustomerAev",
query: { id }
});
}
}
};
path: '/communityOperating/oldCustomerAev',
query: { id },
})
},
},
}
</script>
<template>
<div>
<div class="top-search">
<el-form inline label-position="right" :model="form" label-width="80px">
<el-form-item label="任务名称">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="发送方式">
<el-select v-model="query.pushType" placeholder="请选择" size="small">
<el-option
......@@ -102,9 +105,21 @@ export default {
></el-option>
</el-select>
</el-form-item>
<el-form-item label="任务名称">
<el-form-item label="创建人">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button @click="resetQuery">重置</el-button>
......@@ -126,21 +141,23 @@ export default {
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="任务活动名称"
label="任务名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="裂变客户数量" align="center">
<el-table-column prop="createTime" label="发送方式" align="center">
</el-table-column>
<el-table-column prop="createTime" label="当前群人数" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="活动状态" align="center">
已结束
<el-table-column prop="createTime" label="创建人" align="center">
</el-table-column>
<el-table-column
label="活动时间"
label="创建时间"
align="center"
prop="createTime"
width="160"
......@@ -158,7 +175,7 @@ export default {
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>删除</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
......@@ -222,7 +239,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -232,7 +249,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
......@@ -84,7 +84,7 @@ export default {
rules: Object.freeze({
name: [{ required: true, message: '必填项', trigger: 'blur' }],
userId: [{ required: true, message: '必填项', trigger: 'blur' }],
department: [{ required: true, message: '必填项', trigger: 'blur' }],
department: [{ required: true, message: '必填项', trigger: 'change' }],
joinTime: [{ required: true, message: '必填项', trigger: 'blur' }],
wxAccount: [{ required: true, message: '必填项', trigger: 'blur' }],
email: [
......@@ -143,6 +143,7 @@ export default {
this.getList(1)
},
edit(data, type) {
this.$refs['form'] && this.$refs['form'].clearValidate()
this.form = Object.assign({}, data || { _new: true })
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
......@@ -157,7 +158,7 @@ export default {
.then(() => {
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
this.getList(form._new && 1)
})
.catch(() => {
this.dialogVisible = false
......@@ -260,7 +261,7 @@ export default {
:inline="true"
label-width="100px"
>
<el-form-item label="账号/姓名/手机号" label-width="120px" prop="title">
<el-form-item label="姓名" prop="title">
<el-input v-model="query.name" placeholder="请输入" clearable />
</el-form-item>
<el-form-item label="入职时间">
......@@ -277,7 +278,7 @@ export default {
<el-form-item label="激活状态">
<el-select v-model="query.isActivate">
<el-option label="已激活" :value="1"></el-option>
<el-option label="未激活" :value="2"></el-option>
<el-option label="未激活" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label>
......@@ -309,14 +310,14 @@ export default {
@click="batchImport"
>批量导入</el-button
>
<el-button
<!-- <el-button
v-hasPermi="['contacts:organization:addMember']"
type="primary"
icon="el-icon-plus"
size="mini"
@click="edit()"
>添加成员</el-button
>
> -->
</div>
<el-row :gutter="20">
<!--部门数据-->
......@@ -446,7 +447,7 @@ export default {
<!-- 人员弹窗 -->
<el-dialog
:title="(form.id ? (disabled ? '查看' : '修改') : '添加') + '成员'"
:title="(form.userId ? (disabled ? '查看' : '修改') : '添加') + '成员'"
:visible.sync="dialogVisible"
>
<el-row :gutter="10">
......@@ -484,7 +485,7 @@ export default {
</el-form-item>
<el-form-item label="账号" prop="userId">
<el-input
:disabled="form.id"
:disabled="!form._new"
v-model="form.userId"
placeholder="成员唯一标识,不支持更改,不支持中文"
></el-input>
......@@ -495,7 +496,7 @@ export default {
<el-radio :label="2">女</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号" prop="name">
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile"></el-input>
</el-form-item>
<el-form-item label="邮箱">
......@@ -572,7 +573,7 @@ export default {
:title="(formDepart.id ? '修改' : '添加') + '部门'"
:visible.sync="dialogVisibleDepart"
>
<el-form :model="formDepart" :label-width="80">
<el-form :model="formDepart" label-width="80px">
<el-form-item label="部门名称">
<el-input v-model="formDepart.name"></el-input>
</el-form-item>
......
......@@ -10,6 +10,11 @@ export default {
weFlowerCustomerRels: [{}],
},
birthday: '',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
},
}
},
created() {
......@@ -66,6 +71,7 @@ export default {
v-if="datePickerVisible"
v-model="birthday"
type="date"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd"
placeholder="选择日期便于以后客情维护"
@blur="datePickerVisible = false"
......
<script>
import { getList } from "@/api/customer/dimission";
import { getList } from '@/api/customer/dimission'
export default {
name: "AllocatedStaffList",
name: 'AllocatedStaffList',
components: {},
props: {},
data() {
......@@ -23,77 +23,83 @@ export default {
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
return time.getTime() > Date.now()
},
shortcuts: [
{
text: "最近一周",
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: "最近一个月",
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: "最近三个月",
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
};
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
}
page && (this.query.pageNum = page);
this.loading = true;
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields();
this.dateRange = []
this.$refs['queryForm'].resetFields()
},
},
};
}
</script>
<template>
<div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="已离职员工">
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
>
<el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
......@@ -113,38 +119,63 @@ export default {
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
>重置</el-button
>
</el-form-item>
</el-form>
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
<el-table
ref="multipleTable"
:data="list"
tooltip-effect="dark"
style="width: 100%"
>
<el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column prop="allocateCustomerNum" label="已分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateGroupNum" label="已分配群聊数" show-overflow-tooltip></el-table-column>
<el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<el-table-column
prop="allocateCustomerNum"
label="已分配客户数"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="allocateGroupNum"
label="已分配群聊数"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="dimissionTime"
label="离职时间"
show-overflow-tooltip
>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="$router.push({path: '/customerManage/allocatedStaffDetail', query: {userId: scope.row.userId}})"
@click="
$router.push({
path: '/customerManage/allocatedStaffDetail',
query: { userId: scope.row.userId },
})
"
type="text"
size="small"
>查看</el-button>
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
......@@ -153,5 +184,4 @@ export default {
</div>
</template>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
......@@ -132,7 +132,7 @@ export default {
label-width="100px"
class="top-search"
>
<el-form-item label="已离职员工">
<el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="离职日期">
......@@ -147,14 +147,6 @@ export default {
></el-date-picker>
</el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="query.beginTime"
type="date"
placeholder="离职日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
......
......@@ -15,6 +15,41 @@ export default {
},
// 日期范围
dateRange: [],
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
shortcuts: [
{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
// 遮罩层
loading: false,
// 选中数组
......@@ -123,6 +158,7 @@ export default {
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
......
......@@ -292,6 +292,7 @@ export default {
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="list"
tooltip-effect="dark"
......
<script>
import { getDetail, getUserAddCustomerStat, download } from '@/api/drainageCode/staff'
import {
getDetail,
getUserAddCustomerStat,
download,
} from '@/api/drainageCode/staff'
import ClipboardJS from 'clipboard'
import echarts from 'echarts'
export default {
......@@ -26,6 +30,7 @@ export default {
endTime: undefined,
},
type: { 1: '单人', 2: '多人', 3: '批量单人' },
timeRange: 7,
}
},
created() {
......@@ -89,9 +94,11 @@ export default {
})
},
setTime(days) {
this.timeRange = days
let date = new Date()
date.setDate(date.getDate() - days)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
......@@ -104,19 +111,21 @@ export default {
return year + '-' + month + '-' + date
},
download() {
let userName = this.form.weEmpleCodeUseScops.map((item) =>{
return item.businessName
}).join(",");
let name = userName +"-"+this.form.activityScene+".png"
download(this.form.id).then((res) =>{
if (res!=null) {
let blob = new Blob([res], {type: 'application/zip'});
let url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); // 创建a标签
link.href = url;
link.download = name; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
let userName = this.form.weEmpleCodeUseScops
.map((item) => {
return item.businessName
})
.join(',')
let name = userName + '-' + this.form.activityScene + '.png'
download(this.form.id).then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
},
......@@ -182,10 +191,18 @@ export default {
<div class="mb15">累计总人数:{{ total }}</div>
<div>
<el-button-group>
<el-button size="small" type="primary" plain @click="setTime(7)"
<el-button
size="small"
type="primary"
:plain="timeRange != 7"
@click="setTime(7)"
>近7日</el-button
>
<el-button size="small" type="primary" plain @click="setTime(30)"
<el-button
size="small"
type="primary"
:plain="timeRange != 30"
@click="setTime(30)"
>近30日</el-button
>
</el-button-group>
......
......@@ -231,7 +231,12 @@ export default {
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="cyan" @click="getList(1)">查询</el-button>
<el-button
v-hasPermi="['wecom:code:list']"
type="cyan"
@click="getList(1)"
>查询</el-button
>
<el-button @click="resetQuery">重置</el-button>
<!-- <el-button @click="resetQuery">导出</el-button> -->
</el-form-item>
......@@ -245,14 +250,32 @@ export default {
<span class="num">{{ total }}</span> 个
</div>
<div>
<el-button type="primary" size="mini" @click="goRoute('staffAdd')"
<el-button
v-hasPermi="['wecom:code:add']"
type="primary"
size="mini"
@click="goRoute('staffAdd')"
>新建员工活码</el-button
>
<el-button type="primary" size="mini" @click="dialogVisible = true"
<el-button
v-hasPermi="['wecom:code:batchAdd']"
type="primary"
size="mini"
@click="dialogVisible = true"
>批量新建</el-button
>
<el-button type="primary" size="mini" @click="remove">删除</el-button>
<el-button type="primary" size="mini" @click="downloadBatch()"
<el-button
v-hasPermi="['wecom:code:remove']"
type="primary"
size="mini"
@click="remove"
>删除</el-button
>
<el-button
v-hasPermi="['wecom:code:downloadBatch']"
type="primary"
size="mini"
@click="downloadBatch()"
>批量下载</el-button
>
</div>
......@@ -310,7 +333,7 @@ export default {
<el-button
type="text"
@click="download(row.id, row.useUserName, row.activityScene)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['wecom:code:download']"
>下载</el-button
>
<el-button
......@@ -323,19 +346,19 @@ export default {
<el-button
type="text"
@click="goRoute('staffDetail', row.id)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['drainageCode:staff:detail']"
>查看详情</el-button
>
<el-button
type="text"
@click="goRoute('staffAdd', row.id)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['wecom:code:edit']"
>编辑</el-button
>
<el-button
type="text"
@click="remove(row.id)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['wecom:code:remove']"
>删除</el-button
>
</template>
......
......@@ -12,7 +12,7 @@ export default {
// dialogVisible1: false,
dialogVisibleSelectMaterial: false,
form: {
id: '',
// id: '',
mediaId: '',
welcomeMsgTplType: '',
welcomeMsg: '',
......@@ -25,7 +25,8 @@ export default {
watch: {},
computed: {},
created() {
this.form = this.$route.query
this.form = Object.assign(this.form, this.$route.query)
this.$route.meta.title = (this.form.id ? '编辑' : '新建') + '欢迎语'
},
mounted() {},
methods: {
......@@ -66,7 +67,7 @@ export default {
<div style="height: 300px;">
<el-input
type="textarea"
:rows="5"
:autosize="{ minRows: 2, maxRows: 6 }"
maxlength="100"
show-word-limit
placeholder="请输入欢迎语"
......
......@@ -86,6 +86,7 @@ export default {
<div class="total"></div>
<div>
<el-button
v-hasPermi="['wecom:tlp:add']"
type="primary"
size="mini"
icon="el-icon-plus"
......@@ -116,14 +117,14 @@ export default {
size="mini"
type="text"
@click="goRoute(scope.row)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['wecom:tlp:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="text"
@click="remove(scope.row.id)"
v-hasPermi="['monitor:operlog:query']"
v-hasPermi="['wecom:tlp:remove']"
>删除</el-button
>
</template>
......
<script>
import * as api from "@/api/enterpriseId";
import * as api from '@/api/enterpriseId'
// import clipboard from "clipboard";
export default {
......@@ -10,7 +10,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
companyName: ""
companyName: '',
},
total: 0,
form: {},
......@@ -19,65 +19,65 @@ export default {
disabled: false,
loading: false,
rules: Object.freeze({
companyName: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
companyName: [{ required: true, message: '必填项', trigger: 'blur' }],
corpId: [{ required: true, message: '必填项', trigger: 'blur' }],
corpSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
contactSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
status: ["正常", "停用"]
};
status: ['正常', '停用'],
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
page && (this.query.pageNum = page);
this.loading = true;
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.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
this.form = Object.assign({}, data || {})
this.dialogVisible = true
type || !data ? (this.disabled = false) : (this.disabled = true)
},
submit() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
api[this.form.id ? 'update' : 'add'](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
}
});
})
},
start(corpId) {
api.start(corpId).then(({ rows, total }) => {
this.msgSuccess("操作成功");
this.getList();
});
}
}
};
this.msgSuccess('操作成功')
this.getList()
})
},
},
}
</script>
<template>
......@@ -227,7 +227,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
......@@ -237,7 +237,7 @@ export default {
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到仟微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
......
......@@ -106,13 +106,15 @@ export default {
let { msgid, messageId } = data
syncMsg({ msgid, messageId })
.then(({ data }) => {
this.msgSuccess('同步成功')
this.getList()
// this.list = rows
// this.total = +total
// this.loading = false
// this.ids = []
})
.catch(() => {
this.loading = false
// this.loading = false
})
},
},
......
......@@ -6,7 +6,7 @@
:rules="loginRules"
class="login-form"
>
<h3 class="title">塬微后台管理系统</h3>
<h3 class="title">仟微后台管理系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
......@@ -55,10 +55,17 @@
</div>
</el-form-item>
<el-checkbox
class="fr"
v-model="loginForm.rememberMe"
style="margin:0px 0px 25px 0px;"
>记住密码</el-checkbox
>
<el-checkbox
v-model="isDemonstrationLogin"
@change="changeDemonAccount"
style="margin:0px 0px 25px 0px;"
>演示账号登录</el-checkbox
>
<el-form-item style="width:100%;">
<el-button
:loading="loading"
......@@ -152,6 +159,7 @@ export default {
redirect: undefined,
authLink: '',
dialogVisible: true,
isDemonstrationLogin: false,
}
},
watch: {
......@@ -227,6 +235,10 @@ export default {
goVote() {
window.open('https://www.oschina.net/p/linkwechat')
},
changeDemonAccount(val) {
this.loginForm.username = val ? 'Wecome' : ''
this.loginForm.password = val ? '123456' : ''
},
},
}
</script>
......
......@@ -98,11 +98,19 @@ export default {
// 获取类目树
getTree() {
getTree(this.type).then(({ data }) => {
this.treeData = data
this.treeData = [{
id: "",
name: "全部",
parentId: "0",
hasParent: false,
hasChildren: true,
children: data || []
}]
})
},
// 获取素材列表
getList(page) {
console.log('getList', page, JSON.stringify(this.query))
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
......@@ -161,14 +169,22 @@ export default {
},
// 素材添加/编辑
edit(data, type) {
this.form = Object.assign(
{},
data || { categoryId: this.query.categoryId }
)
this.dialogVisible = true
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
switch (type) {
case 5:
this.$parent.posterEdit.step = 0
this.$parent.dialog.edit = true
break
default:
this.form = Object.assign(
{},
data || { categoryId: this.query.categoryId }
)
this.dialogVisible = true
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
break;
}
// type || !data ? (this.disabled = false) : (this.disabled = true)
},
// 素材提交
......@@ -246,7 +262,7 @@ export default {
>
<div class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span class="fr">
<span class="fr" v-if="data.id">
<i
v-hasPermi="['material:editType']"
class="el-icon-edit"
......@@ -298,7 +314,7 @@ export default {
<div style="position: relative; margin: 10px 0;">
<el-cascader
v-model="group"
:options="treeData"
:options="treeData[0].children"
:props="groupProps"
></el-cascader>
</div>
......@@ -323,7 +339,7 @@ export default {
<el-button
v-hasPermi="['material:add']"
type="primary"
@click="edit(1)"
@click="edit(1, ~~type)"
>添加{{ typeTitle[type] }}</el-button
>
</div>
......@@ -380,7 +396,7 @@ export default {
<el-form-item label="分类" prop="categoryId">
<el-cascader
v-model="form.categoryId"
:options="treeData"
:options="treeData[0].children"
:props="groupProps"
></el-cascader>
</el-form-item>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!