Commit 9e5157be by 前端

Merge branch 'v2.11.0' into 'master'

V2.11.0

See merge request !47
2 parents 937e9793 4d5e3da5
Showing 55 changed files with 2635 additions and 27 deletions
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^2.0.4",
"glsx-components": "^1.5.2", "glsx-components": "^1.5.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"set-promise-interval": "^1.0.8",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-amap": "^0.5.10", "vue-amap": "^0.5.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
......
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 13:59:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-10 14:33:27
* @FilePath: \scrm-micro-authorize\public\index.html
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
...@@ -5,6 +13,7 @@ ...@@ -5,6 +13,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>微前端子应用:博客</title> <title>微前端子应用:博客</title>
</head> </head>
......
import { http, http2 } from '@/main'
// 获取验证码
const getLoginQcCode = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getLoginQcCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 验证二维码是否失效
const getQcCodeDetail = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getQcCodeDetail'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const wechatDepositList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getLoginQcCode,
getQcCodeDetail,
wechatDepositList
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 15:23:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-04 09:38:21
* @FilePath: \scrm-micro-authorize\src\api\modules\common.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default { pictureUpload }
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerGroupList = params => {
params.type = 2
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${path}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detail = params => {
params.type = 2
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const findLordGroup = params => {
params.method = 'entmicro.api.staff.findLordGroup'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
// params.method = 'scrm.api.datahub.label.querylabeltree'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const groupList = params => {
params.method = 'entmicro.api.customer.group.list.by.merchant'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerCount = params => {
params.method = 'entmicro.api.mass.detail.customer.filter.count'
// return http({
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 客户群发、客户群群发基本信息详情
const customerDetail = params => {
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发统计
const detailStatistic = params => {
params.method = `${path}detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发统计
const groupDetailStatistic = params => {
params.method = `${path}group.detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发员工列表
const staffList = params => {
params.method = `${path}staff.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list.page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发列表
const groupDetailList = params => {
params.method = `${path}group.detail.sender.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 根据id提醒用户 ,列表
const listRemindOperate = params => {
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 详情页客户群提醒
const remindUserGroup = params => {
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const groupDetailUpdate = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const followerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const followerEcho = params => {
params.method = 'entmicro.api.mass.follower.echo'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新客户群发客户列表
const renewDetailList = params => {
params.method = `${path}update.merchant`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 客户群发统计
const renewStatistic = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
customerList,
customerGroupList,
insert,
detail,
remindUserGroup,
listRemindOperate,
listDepartmentTree,
querylabeltree,
groupList,
customerCount,
customerDetail,
detailStatistic,
groupDetailStatistic,
staffList,
customerDetailList,
groupDetailList,
getMerchant,
getCard,
getCoupon,
merchant,
merchantOpen,
getPackage,
getActivity,
nameVaild,
getStatus,
templatePage,
templateSave,
templateUpdate,
createdNameList,
templateDetail,
groupDetailUpdate,
findLordGroup,
followerType,
queryCrowdtree,
followerEcho,
getGroupListApi,
getMaterialListApi,
renewDetailList,
renewStatistic
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 14:42:45
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-09-30 14:13:48
* @FilePath: \scrm-micro-authorize\src\api\modules\friendGroup.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http, http_common } from '@/main'
//朋友圈群发任务多条件分页查询
const conditionPage = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.condition.page'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈群发任务新建
const batchmomentSave = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//发送记录分页查询
const batchmomentRecord = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.record.page'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//企微高级群发创建门店列表
const merchantList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const compressionUpload = params => {
return http_common({
url: 'https://scrm.test.glsx.com.cn/rpc-scrm-entmicro-container/file/upload',
// url: 'http://192.168.3.145:8186/rpc-scrm-entmicro-container/video/compression/upload',
method: 'POST',
data: params,
sign: false
})
}
export default {
merchantList,
conditionPage,
batchmomentRecord,
batchmomentSave,
compressionUpload
}
import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const batchmessagingRecord = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 企微群发查看预计群发人数
const batchmessagingCustomercount = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 企微群发任务创建
const atchmessagingCreate = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create'
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const recordSend = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record.send'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
querylabeltree,
queryCrowdtree,
batchmessagingRecord,
batchmessagingCustomercount,
atchmessagingCreate,
getStoreList,
recordSend
}
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
//权益卡
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//权益卡
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//是否开通权益
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//优惠券
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//套餐
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//秒杀活动
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 众筹模式活动
const crowdfundingActivity = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//模板列表
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板保存
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板更新
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板创建人
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCard,
merchant,
getActivity,
getPackage,
getMerchant,
getCoupon,
merchantOpen,
getGroupListApi,
getMaterialListApi,
templatePage,
createdNameList,
templateUpdate,
templateSave,
templateDetail,
crowdfundingActivity
}
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: * @version:
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: huyue * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-04-25 11:31:28 * @LastEditTime: 2022-09-23 09:40:29
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
...@@ -19,7 +19,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -19,7 +19,7 @@ export const fetchConfig = function(isEnv = true) {
// } // }
//return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: 1.0.0 * @version: 1.0.0
* @Author: limin * @Author: limin
* @Date: 2021-08-13 14:12:11 * @Date: 2021-08-13 14:12:11
* @LastEditors: Please set LastEditors * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-02-16 14:49:58 * @LastEditTime: 2022-09-21 16:49:04
* @FilePath: \scrm\scrm-sub-blog\src\main.js * @FilePath: \scrm\scrm-sub-blog\src\main.js
*/ */
import Vue from 'vue' import Vue from 'vue'
...@@ -15,7 +15,8 @@ import { start } from '@/setup' ...@@ -15,7 +15,8 @@ import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
Vue.config.silent = true
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
\ No newline at end of file \ No newline at end of file
export const http_common = params => Vue.prototype.$http_common(params)
export default {
methods: {
merchantList() {
const params = {
pageNum: 1,
pageSize: 10000
}
return this.$apis.friendGroup.merchantList(params)
}
}
}
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-02-10 19:00:41 * @Date: 2022-02-10 19:00:41
* @LastEditTime: 2022-07-11 18:35:19 * @LastEditTime: 2022-11-04 09:38:04
* @LastEditors: huyue * @LastEditors: yangming yangming@didihu.com.cn
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-pay\src\setup\qiankun.js * @FilePath: \scrm-micro-pay\src\setup\qiankun.js
*/ */
...@@ -15,6 +15,7 @@ import ElementUI from 'element-ui' ...@@ -15,6 +15,7 @@ import ElementUI from 'element-ui'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import render from './render' import render from './render'
import GLEditor from 'glsx-components/src/packages/Editor'
let routes = [] let routes = []
let router = null let router = null
let instance = null let instance = null
...@@ -23,6 +24,7 @@ Vue.use(GLTable) ...@@ -23,6 +24,7 @@ Vue.use(GLTable)
Vue.use(GLCombiForm) Vue.use(GLCombiForm)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLTableButton) Vue.use(GLTableButton)
Vue.use(GLEditor)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, sign_common, secret, request_common } = await fetchConfig(true) //globalState.configSwitch const { response, request, sign, sign_common, secret, request_common } = await fetchConfig(true) //globalState.configSwitch
...@@ -30,6 +32,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -30,6 +32,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
// const response_custom = Object.assign({}, { ...response, code_success_value: 'true', data_key: 'result', code_key: 'success' })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
......
/* /*
* @Descripttion: * @Author: yangming yangming@didihu.com.cn
* @version: 1.0.0 * @Date: 2022-09-15 13:59:56
* @Author: limin * @LastEditors: yangming yangming@didihu.com.cn
* @Date: 2021-08-13 14:12:11 * @LastEditTime: 2022-09-22 09:41:50
* @LastEditors: limin * @FilePath: \scrm-micro-authorize\src\store\index.js
* @LastEditTime: 2021-08-25 14:14:44 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm\scrm-base\src\store\index.js
*/ */
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
......
...@@ -20,8 +20,8 @@ export default { ...@@ -20,8 +20,8 @@ export default {
commit('SET_PAGE_SIZE', data) commit('SET_PAGE_SIZE', data)
}, },
// 设置token // 设置token
setToken({ commit }, data) { setToken(context, data) {
commit('SET_TOKEN', data) console.log(context, data)
} }
} }
} }
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-02-16 18:09:07 * @Date: 2022-02-16 18:09:07
* @LastEditTime: 2022-02-16 18:09:07 * @LastEditTime: 2022-09-28 15:55:01
* @LastEditors: Please set LastEditors * @LastEditors: yangming yangming@didihu.com.cn
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-wechat\src\utils\data.js * @FilePath: \scrm-micro-wechat\src\utils\data.js
*/ */
const MODEL = { const MODEL = {
1: '集团企微模式', 1: '集团企微模式',
2: '单店企微模式' 2: '单店企微模式'
} }
export {
MODEL
}
\ No newline at end of file \ No newline at end of file
export { MODEL }
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
if (month < 10) month = '0' + month
if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1
month = month + 12
}
if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function(time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function(dateStr, separator) {
if (!separator) {
separator = '-'
}
var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0])
var month
//处理月份为04这样的情况
if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1))
} else {
month = parseInt(dateArr[1])
}
var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day)
return date
}
util.getDay = function(num, str = '-') {
var today = new Date()
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
export default util
<template>
<div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<div class="header-text">已激活列表</div>
<div>
<el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" plain mode="el-button">
企微接入授权
</el-button>
</div>
</div>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm"
:tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="staffName" slot-scope="scope">
<div class="staffName">
<span>{{ scope.scope.staffName }}</span>
<span class="entmicroName" v-if="scope.scope.entmicroName">@{{ scope.scope.entmicroName }}</span>
</div>
</div>
<div slot="loginStatus" slot-scope="scope">
<div class="loginStatus">
<span class="cycle"
:style="{ background: scope.scope.loginStatus == '1' ? '#2CCA74' : scope.scope.loginStatus == '0' ? '#999999' : '' }"></span>
{{ scope.scope.loginStatus == '1' ? '在线' : scope.scope.loginStatus == '0' ? '离线' : '--' }}
</div>
</div>
</GLTable>
<GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible">
<div v-loading="addLoading" class="qrIMGbox">
<img class="qrIMG" :src="qrcodeUrl"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" disabled v-if="!show" class="count">{{ count }} s</el-button>
<el-button type="primary" size="small" v-if="show" @click="getCode">刷新</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import setPromiseInterval, { clearPromiseInterval } from 'set-promise-interval'
import {utils} from 'glsx-common'
export default {
name: 'collocation',
data() {
return {
url,
show: true,
count: '',
timer: null,
verifyQRCodeFailsToOpen: false,
addLoading: false,
qrCodeInterval: null,
qrCodeIntervalList: [],
qrcodeUrl: '',
qrCodeVisible: false,
qrcodeId: '',
searchForm: {
loginStatus: ''
},
searchFormData: [
{
label: '所属企微',
name: 'entmicroName',
type: 'input',
isClear: true
},
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true
},
{
label: '手机号码',
name: 'staffPhone',
type: 'input',
isClear: true
},
{
label: '状态',
name: 'loginStatus',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '在线',
value: 1
},
{
label: '离线',
value: 0
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
}
],
tableParams: {
listName: 'data',
tableColumns: [
{
label: '员工企微',
prop: 'staffName',
addHtml: 'staffName',
minwidth: 110
},
{
label: '手机号码',
prop: 'staffPhone',
minwidth: 110
},
{
label: '所属门店',
prop: 'merchantName',
minwidth: 110
},
{
label: '最后同步时间',
prop: 'lastLoginTime',
minwidth: 110
},
{
label: '状态',
prop: 'loginStatus',
addHtml: 'loginStatus',
minwidth: 110
}
]
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'},
getListApi: this.$apis.collocation.wechatDepositList
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
},
async handleqrCode() {
this.addLoading = true
this.qrCodeVisible = true
this.verifyQRCodeFailsToOpen = false
await this.$apis.collocation
.getLoginQcCode({})
.then(res => {
this.addLoading = false
;(this.verifyQRCodeFailsToOpen = true), (this.qrcodeUrl = `data:image/png;base64,${res.qcCodeUrl}`)
this.qrcodeId = res.id
})
.catch(err => {
this.qrCodeVisible = false
this.clearAllInterval()
})
},
clearAllInterval() {
console.log(this.qrCodeIntervalList)
this.qrCodeIntervalList.length && this.qrCodeIntervalList.forEach(item => {
clearInterval(item)
})
clearPromiseInterval(this.qrCodeInterval)
this.qrCodeIntervalList = [];
this.qrCodeInterval = null;
},
verifyQRCodeIsInvalid() {
this.qrCodeInterval = setPromiseInterval(() => this.qrcodeTimeoutApi(), 15000)
this.qrCodeIntervalList.push(this.qrCodeInterval)
},
getCode() {
this.clearAllInterval()
this.handleqrCode()
const TIME_COUNT = 10;
if (!this.timer) {
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
}
},
async qrcodeTimeoutApi() {
await this.$apis.collocation.getQcCodeDetail({id: this.qrcodeId}).then(res => {
if (res == true) {
this.$message({
type: 'error',
message: '二维码已失效,请刷新'
})
this.verifyQRCodeFailsToOpen = false
clearInterval(this.qrCodeInterval)
return
}
})
}
},
computed: {
listenChange() {
const {verifyQRCodeFailsToOpen, qrCodeVisible} = this
return {verifyQRCodeFailsToOpen, qrCodeVisible}
}
},
watch: {
listenChange(val) {
if (val.qrCodeVisible == true && val.verifyQRCodeFailsToOpen == true) {
this.verifyQRCodeIsInvalid()
} else {
this.clearAllInterval()
}
}
}
}
</script>
<style lang="scss" scoped>
/deep/ {
.el-table th > .cell {
padding: 0 16px;
}
}
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
.qrIMGbox {
display: flex;
align-items: center;
justify-content: center;
.qrIMG {
width: 150px;
height: 150px;
}
}
/deep/ .loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.staffName {
display: flex;
align-items: center;
.entmicroName {
font-size: 12px;
color: #fb8f28;
}
}
}
</style>
<template>
<div>
<el-drawer title="发送记录" :visible.sync="drawVisible" direction="rtl" size="50%">
<div class="horizon"></div>
<div class="drawer-body">
<div class="record-panel">
<div class="record-border">
<div class="record-status">发送成功</div>
<div class="record-num">{{ successCount }}</div>
</div>
<div class="record-border">
<div class="record-status">发送失败</div>
<div class="record-num">{{ failCount }}</div>
</div>
</div>
<GLTable ref="proGroupRef" @refreshTable="getListData" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" :pageConf="pageConf">
<div slot="status" slot-scope="scope">
<span style="color: #EB4E4E" v-if="scope.scope.status == 2">发送失败</span>
<span style="color: #2CCA74" v-else-if="scope.scope.status == 3">发送成功</span>
</div>
</GLTable>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
data() {
return {
successCount: 0,
failCount: 0,
drawVisible: false,
tableData: [],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '员工',
prop: 'staffName',
minwidth: 240
},
{
label: '发送时间',
prop: 'sendTime',
minwidth: 180
},
{
label: '发送结果',
prop: 'status',
addHtml: 'status',
minwidth: 180
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
getListData() {
this.loading = true
const params = {
pageSize: this.$refs.proGroupRef.page.pageSize,
pageNum: this.$refs.proGroupRef.page.pageNum,
id: this.recordId
}
this.$apis.friendGroup.batchmomentRecord(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.data
this.tableTotal = res.count
}
})
},
init(row) {
const { id, successCount = 0, failCount = 0 } = row
this.recordId = id
this.successCount = successCount
this.failCount = failCount
this.drawVisible = true
this.$nextTick(() => {
this.getListData()
})
}
}
}
</script>
<style scoped lang="scss">
.drawer-body {
padding: 20px;
}
.horizon {
width: 100%;
height: 1px;
background: #e8e8ea;
}
.record-panel {
display: flex;
.record-border {
width: 50%;
height: 66px;
padding: 8px 20px;
background: #ffffff;
border: 1px solid #e8e8ea;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 16px;
&:first-child {
margin-right: 20px;
.record-num {
color: #2cca74;
}
}
.record-status {
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
line-height: 22px;
}
.record-num {
font-size: 20px;
color: #eb4e4e;
letter-spacing: 0;
line-height: 24px;
margin-top: 6px;
}
}
}
</style>
import { http } from '@/main'
const URL = 'rop-scrm-entmicro/router'
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getStoreList
}
<template>
<el-select ref="selectRef" clearable filterable remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore" v-model="inputVal" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item[label]" :value="item[value]"></el-option>
</el-select>
</template>
<script>
import { getStoreList } from './api'
export default {
name: 'SearchDropDown',
props: ['inputBoxSearchValue', 'label', 'value'],
data() {
return {
searchContentStorage: '',
inputVal: '',
dataItems: [],
arrBack:[],
totalNum:'',
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 10
}
}
},
directives: {
/** 下拉框懒加载 */
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
mounted() {
this.loadUpData(this.pageData)
},
watch: {
// 'inputVal'(newVal, oldVal) {
// console.log(newVal,oldVal)
// // if (oldVal !== newVal) {
// // this.dataItems = []
// // this.loadUpData({
// // pageNum: 1,
// // pageSize: 10
// // },newVal)
// // }
// }
'inputVal': {
handler(val) {
console.log(val)
if (!val) {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
})
}
}
}
},
methods: {
async loadUpData(pageData, searchVal) {
let params = {
...pageData,
merchantName: searchVal
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.totalNum = res.count
this.arrBack = res.data
})
this.dataItems = [...this.dataItems,...this.arrBack]
},
loadmore() {
this.pageData.pageNum++
let acquireCount = this.pageData.pageNum * this.pageData.pageSize
if (acquireCount - this.totalNum >= this.pageData.pageSize){
return
}
if (this.searchContentStorage) {
this.loadUpData(this.pageData, this.searchContentStorage)
} else {
this.loadUpData(this.pageData, '') //类似于分页查询
}
},
// 远程搜索
async remoteMethod(searchValue) {
console.log(this.inputVal)
if (searchValue !== '') {
this.searchContentStorage = searchValue
this.dataItems = []
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
},'')
}
},
// 根据所选商户获取品牌和地址
async selectChange(label) {
if (label) {
let obj = this.dataItems.filter(el => {
return el['incomingDisplayLabel'] == label
})
}
}
}
}
</script>
<style scoped></style>
<template>
<div>
<GLDialog :bigTitle="'人群筛选'" mode="big" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable
placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal"
:layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf"
:noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<!-- <div class="member-name">人群({{ innerTags.length }}项)</div> -->
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false"
@close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
props: {
resetMerchantId: {
type: String,
default: ''
}
},
data() {
return {
url: 0,
crowdVisible: false,
searchForm: {keyword: ''},
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
getCrowdList(page = {pageNum: 1, pageSize: 10}) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.resetMerchantId ? this.resetMerchantId : this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.wechatGroup.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({pageNum: 1, pageSize: 10})
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = {keyword: {}}
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: calc(100% - 286px);
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
.el-pagination {
margin-top: 0;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 480px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
//border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: 100%;
display: flex;
align-items: center;
max-height: 557px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
font-size: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template>
<div>
<GLDialog :mode="'big'" class="gl-form-min" bigTitle="选择门店" :visible.sync="storeDiaVisible" @close="clearStaff">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="门店名称:">
<el-input v-model="searchForm.storeName" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label="门店编号:">
<el-input v-model="searchForm.storeNum" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" class="gap8" @click="findNotActiveStaff">查询</el-button>
<el-button plain :size="size" class="btn-three" @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">员工列表</div>
<div class="member-content">
<div class="table-content" style="max-height: 456px;">
<GLTable :hasPage="false" v-loading="loading" ref="activateTable" :tableData="tableActiveData" :tableParams="tableParams" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="openJoinStatusString" class="dot" slot-scope="scope">
<div :class="status[scope.scope.openJoinStatusString]"></div>
<span v-if="scope.scope.openJoinStatusString == '未开启'">未开启</span>
<span v-if="scope.scope.openJoinStatusString == '已开启'">已开启</span>
<span v-if="scope.scope.openJoinStatusString == '未授权'">未授权</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选列表</div>
<div class="member-context">
<div class="member-name">已选({{ innerTags.length }}项)</div>
<el-button type="text" @click="clearStaff">清空</el-button>
</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="tag in innerTags" :key="tag.userId" type="info" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="closeDia">取 消</el-button>
<el-button size="small" type="primary" @click="activeStaff" :loading="butLoading">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
const status = {
未开启: 'dot3',
已开启: 'dot2',
未授权: 'dot3'
}
const options = [
{
value: 0,
label: '未开启'
},
{
value: 1,
label: '已开启'
},
{
value: 2,
label: '未授权'
}
]
export default {
name: 'ActivateDia',
props: ['selectData'],
data() {
return {
url: url,
butLoading: false,
searchForm: {
storeName: '',
storeNum: ''
},
checked: '',
treeData: [],
options: options,
status,
storeDiaVisible: false,
defaultProps: {
children: 'children',
label: 'departmentName'
},
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '启用状态',
prop: 'openJoinStatusString',
addHtml: 'openJoinStatusString'
}
]
},
// 未激活员工表信息
tableActiveData: [],
innerTags: [],
// 账号信息
activeInfo: {}
}
},
mounted() {},
methods: {
init(row) {
this.activeInfo = row
this.storeDiaVisible = true
this.findNotActiveStaff()
},
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {
storeName: '',
storeNum: ''
}
this.findNotActiveStaff()
},
findNotActiveStaff() {
const { corpId, merchantId } = this.activeInfo
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
corpId,
merchantId
}
this.loading = true
this.$apis.accountConfig.findNotActiveStaff(params).then(res => {
if (res.code == 0) {
this.tableActiveData = res.data
this.loading = false
} else {
this.loading = false
this.$message({
message: res.message,
type: 'error',
customClass: 'global-messageZindex'
})
}
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
remove(item) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
// 激活员工
activeStaff() {
if (!this.innerTags.length) {
this.$message({
message: '未选中员工,无法激活',
type: 'error',
customClass: 'global-messageZindex'
})
return
}
var userIdList = []
this.innerTags.forEach(item => {
userIdList.push(item.userId)
})
const { merchantId, corpId } = this.activeInfo
var params = {
corpId,
merchantId,
userIdList
}
this.butLoading = true
this.$apis.accountConfig.activeAccount(params).then(res => {
if (res.code == '0') {
this.butLoading = false
this.storeDiaVisible = false
var txt = '<p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>'
this.$confirm(txt, '提示', {
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
showCancelButton: false,
confirmButtonClass: 'confirmbtn',
type: 'success',
customClass: 'gl-message-box confirm-btn',
callback: action => {
if (res.data && res.data > 0) {
this.$emit('activeStaff')
}
}
})
} else {
this.butLoading = false
this.$message.error(res.message)
}
})
},
// 清空右侧选择员工
clearStaff() {
this.$refs.activateTable.$refs.salelistMutiTable.clearSelection()
this.innerTags = []
},
// 关闭弹窗
closeDia() {
this.clearStaff()
this.storeDiaVisible = false
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 400;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 70%;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 30%;
margin-left: 14px;
.member-context {
display: flex;
justify-content: space-between;
padding: 11px 8px 11px 16px;
border: 1px solid #eee;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 72px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
/deep/ .el-tag--info {
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
.global-messageZindex {
z-index: 3000 !important;
}
</style>
<template>
<div>
<div class="createANewGroupBtn">
<GLButton fn="新建群发" @click="addSendGroup" :size="size" type="primary" mode="el-button">
<i class="el-icon-plus"></i>
新建群发
</GLButton>
</div>
<div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="optionBtns" slot-scope="scope">
<div v-if="scope.scope.sendState == '1'">
<span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div>
</div>
<div slot="sendState" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : '' }}
</div>
</div>
</GLTable>
</div>
<el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div>
<div class="sendRecordDrawerbox">
<div v-for="(item, index) in sendRecordDrawer.traceFailandSuccess" :key="index" class="itemContent">
<div>
<p class="title">{{ item.title }}</p>
<p class="num" :style="{ color: item.color }">{{ item.num }}</p>
</div>
</div>
</div>
<div class="liststyle">
<GLTable ref="sendRecordDrawerRef" :noDataImg="url" :getListApi="sendRecordDrawer.getListApi" :searchForm="sendRecordDrawer.searchForm" :tableParams="sendRecordDrawer.tableParams" :pageConf="sendRecordDrawer.pageConf">
<div slot="sendResult" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendResult == true ? '#2CCA74' : scope.scope.sendResult == false ? '#EB4E4E' : '' }"></span>
{{ scope.scope.sendResult == true ? '成功' : scope.scope.sendResult == false ? '失败' : '' }}
</div>
</div>
</GLTable>
</div>
</el-drawer>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'collocation',
data() {
return {
url,
sendRecordDrawer: {
isVisible: false,
direction: 'rtl',
traceFailandSuccess: [
{
title: '发送成功',
id: '1',
num: '',
color: '#2CCA74'
},
{
title: '发送失败',
id: '2',
num: '',
color: '#EB4E4E '
}
],
searchForm: {
msgId: ''
},
tableParams: {
listName: 'data',
tableColumns: [
{
label: '客户',
prop: 'customerName'
},
{
label: '发送时间',
prop: 'sendTime'
},
{
label: '发送结果',
prop: 'sendResult',
addHtml: 'sendResult'
}
]
},
getListApi: this.$apis.wechatGroup.recordSend,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
},
searchForm: {},
searchFormData: [
{
label: '群发名称',
name: 'msgName',
type: 'input',
isClear: true
},
{
label: '群发时间',
name: 'daterange',
type: 'datePicker',
isClear: true,
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
label: '群发门店',
name: 'msgMerchantName',
type: 'input',
isClear: true
}
],
searchFormTable: {},
tableParams: {
listName: 'data',
tableColumns: [
{
label: '群发名称',
prop: 'msgName',
width: 170,
line: 1
},
{
label: '群发门店',
prop: 'msgMerchant',
width: 170,
line: 1
},
{
label: '客户数',
prop: 'customerCount',
width: 80
},
{
label: '标签/人群',
prop: 'labelCrowdName',
width: 220,
line: 1
},
{
label: '创建时间',
prop: 'createTime',
width: 280,
line: 1
},
{
label: '发送状态',
prop: 'sendState',
addHtml: 'sendState',
},
{
label: '发送成功',
prop: 'successCompletion'
},
{
label: '发送失败',
prop: 'failCompletion'
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: this.$apis.wechatGroup.batchmessagingRecord
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {}
this.handleSearch()
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.startTime) delete params.startTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise(async resolve => {
this.searchFormTable = this.getParams()
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
},
// 跳转新建群发
addSendGroup() {
this.$router.push('/wechatGroup/addWechatGroup')
},
async traceRecord(scope) {
const { msgId, successCompletion, failCompletion } = scope
this.sendRecordDrawer.traceFailandSuccess[0].num = successCompletion
this.sendRecordDrawer.traceFailandSuccess[1].num = failCompletion
this.sendRecordDrawer.searchForm.msgId = msgId
this.sendRecordDrawer.isVisible = true
this.$nextTick(() => {
this.$refs.sendRecordDrawerRef.refreshTable()
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/.el-drawer.rtl{
overflow: scroll;
}
/deep/ {
.el-table th > .cell {
padding: 0 16px;
}
}
.el-table--border .el-table__cell:first-child .cell, .el-table .cell{
padding-right: 10px;
}
.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.createANewGroupBtn {
margin-bottom: 16px;
}
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
.sendRecord {
color: #5850ff;
cursor: pointer;
}
/deep/.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
}
.horizon {
width: 100%;
height: 1px;
background: #e8e8ea;
}
.sendRecordDrawerbox {
padding: 20px;
display: flex;
justify-content: space-between;
.itemContent {
width: 46%;
padding: 8px 0 8px 20px;
border: 1px solid #e8e8ea;
}
.title {
color: #666666;
font-size: 14px;
margin-bottom: 8px;
}
.num {
font-size: 20px;
font-width: 600;
}
}
.liststyle{
padding: 0 20px;
}
</style>
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 13:59:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-17 10:21:09
* @FilePath: \scrm-micro-authorize\vue.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const path = require('path') const path = require('path')
const packageName = require('./package.json').name const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production' const node_env = process.env.NODE_ENV === 'production'
...@@ -5,9 +13,10 @@ const node_env = process.env.NODE_ENV === 'production' ...@@ -5,9 +13,10 @@ const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/' const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
module.exports = { module.exports = {
outputDir: `dist/child/${packageName}`, outputDir: `dist`,
publicPath, publicPath,
assetsDir: 'static', assetsDir: 'static',
productionSourceMap: false,
configureWebpack: { configureWebpack: {
resolve: { resolve: {
alias: { alias: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!