Commit 12799a45 by 匡雅琴

Merge branch 'v2.0.0' of http://192.168.3.233:8090/saas/scrm-micro-marketing into kuangyq_dev_v2.0.0

2 parents 7468b0c6 e167aa26
Showing 60 changed files with 2809 additions and 671 deletions
......@@ -15,8 +15,10 @@
"glsx-common": "^1.4.6",
"glsx-components": "^1.3.7",
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuedraggable": "^2.24.3",
"vuex": "^3.1.2",
"wangeditor": "^4.7.12"
},
......
......@@ -3,58 +3,68 @@ import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getCenterListApi = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.card.merchant.record.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.card.merchant.record.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMoreMerchant = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.third.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//获取上方卡片的相关信息
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.third.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//获取上方卡片的相关信息
const getCardContent = params => {
// scrm.api.equity.card.get.by.merchant.id旧版的
params.method = `scrm.api.equity.open.card.price.get.by.merchantid`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
// scrm.api.equity.card.get.by.merchant.id旧版的
params.method = `scrm.api.equity.open.card.price.get.by.merchantid`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateCardContent = params => {
params.method = `scrm.api.equity.card.class.update`
params.method = `scrm.api.equity.card.class.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
const memberExportApi = params => {
params.method = `scrm.api.equity.card.merchant.record.export`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const memberExportApi = params =>{
params.method=`scrm.api.equity.card.merchant.record.export`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
const getQrUrl = params => {
params.method = 'scrm.api.equity.card.class.generate.try.url'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
export { getCenterListApi,getMoreMerchant ,updateCardContent,getCardContent,memberExportApi}
\ No newline at end of file
export { getCenterListApi, getMoreMerchant, updateCardContent, getCardContent, memberExportApi, getQrUrl }
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
let session = 'scrm-base-e11bd247-ac78-4f0b-a509-1c9a4e2ed48e-rop'
const getListApi = params => {
params.method = 'marketing.api.moment.page'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//根据id查询朋友圈任务详情数据
const momentDetail = params => {
params.method = 'marketing.api.moment.detail'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务详情 员工列表
const momentStaff = params => {
params.method = 'marketing.api.moment.staff.list'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务详情 员工列表
const momentStaffCustomers = params => {
params.method = 'marketing.api.moment.staff.customers'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务详情统计数据
const momentStatistic = params => {
params.method = 'marketing.api.moment.detail.statistic'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务 - 筛选客户数
const momentCount = params => {
params.method = 'marketing.api.moment.detail.customer.filter.count'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务数据保存接口
const momentInsert = params => {
params.method = 'marketing.api.moment.insert'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈任务列表提醒
const momentListRemindOperate = params => {
params.method = 'marketing.api.moment.listRemindOperate'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//根据id提醒用户
const momentRemindUser = params => {
params.method = 'marketing.api.moment.remindUser'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//根据id提醒用户
const momentCancel = params => {
params.method = 'marketing.api.moment.created.cancel'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
momentDetail,
momentRemindUser,
momentListRemindOperate,
momentInsert,
momentCount,
momentStatistic,
momentStaff,
momentStaffCustomers,
getListApi,
momentCancel
}
\ No newline at end of file
......@@ -97,4 +97,15 @@ const insertGiftApi = params => {
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi }
const templateModal = params => {
params.method = 'scrm.api.coupon.directional.gift.approve.template.detail'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi,templateModal }
......@@ -97,4 +97,14 @@ const getGoodsCommentListApi = params => {
})
}
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi, getGoodsCommentListApi }
\ No newline at end of file
const getBusinessTypeByIdApi = params => {
params.method = 'scrm.api.shopmall.goods.getBusinessTypeById'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {getBusinessTypeByIdApi, getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi, getGoodsCommentListApi }
\ No newline at end of file
......@@ -117,6 +117,9 @@ html {
.marketing .edit-container {
margin-bottom: 84px;
}
.marketing .approval-container{
margin-bottom: 10px;
}
.marketing .edit-form-container {
margin-top: 20px;
......
......@@ -21,6 +21,7 @@ module.exports = {
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://scrm.dev.glsx.com.cn/',
<<<<<<< HEAD
// baseURL: 'http://192.168.1.78:8065/',
// 设置超时时间
timeout: 180000,
......@@ -46,6 +47,8 @@ module.exports = {
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://didicb.glsx.com.cn/',
// baseURL: 'http://192.168.1.78:8065/',
=======
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
// 设置超时时间
timeout: 180000,
// 携带凭证
......@@ -53,6 +56,12 @@ module.exports = {
// 返回数据类型
responseType: 'json'
},
request2: {
timeout: 180000,
baseURL: 'http://ismv.branch.glsx.com.cn',
responseType: 'json',
withCredentials: true
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
......
......@@ -12,14 +12,15 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
// return new Http().get('http://192.168.3.171:7300/mock/619c87331072f92988f05a29/marketing/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -256,6 +256,12 @@ const staticRoutes = Object.freeze([{
meta: {}
},
{
name: 'addMaterial',
path: '/material/addMaterial',
component: resolve => require([`@/views/material/addMaterial.vue`], resolve),
meta: {}
},
{
name: 'materialDetail',
path: '/material/materialDetail',
component: resolve => require([`@/views/material/materialDetail.vue`], resolve),
......@@ -265,6 +271,29 @@ const staticRoutes = Object.freeze([{
name: 'addMaterial',
path: '/material/addMaterial',
component: resolve => require([`@/views/material/addMaterial.vue`], resolve),
},
{
name: 'friendGroup',
path: '/friendGroup/index',
component: resolve => require([`@/views/friendGroup/index.vue`], resolve),
meta: {}
},
{
name: 'friendGroupAdd',
path: '/friendGroup/friendGroupAdd',
component: resolve => require([`@/views/friendGroup/friendGroupAdd.vue`], resolve),
meta: {}
},
{
name: 'friendGroupDetail',
path: '/friendGroup/friendGroupDetail/:id',
component: resolve => require([`@/views/friendGroup/friendGroupDetail.vue`], resolve),
meta: {}
},
{
name: 'materialDetail',
path: '/material/materialDetail',
component: resolve => require([`@/views/material/materialDetail.vue`], resolve),
meta: {}
}
])
......
......@@ -34,15 +34,16 @@
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
</template>
<template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">否</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">是</el-radio>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
</template>
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br />
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
......@@ -112,6 +113,8 @@ export default {
name: 'editCashCoupon',
data() {
return {
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: "yyyy-MM-dd HH:mm:ss", // 日期显示格式
showSubmit: true,
userDisable: false,
size: 'small',
......@@ -237,13 +240,6 @@ export default {
// index:4
},
{
label: '定向礼包专用',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '适用商品',
name: 'goods',
addHtml: 'goodsHtml',
......@@ -271,6 +267,13 @@ export default {
// index:9
},
{
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
......@@ -596,8 +599,8 @@ export default {
//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00'
obj.effectiveEndTime = d[1] + ' 23:59:59'
obj.effectiveStartTime = d[0]
obj.effectiveEndTime = d[1]
}
}
......@@ -663,7 +666,7 @@ export default {
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
......
......@@ -49,10 +49,15 @@
</div>
<p class="edit-title">{{ title }}折扣劵</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
</template>
<template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
......@@ -85,6 +90,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: "yyyy-MM-dd HH:mm:ss", // 日期显示格式
showSubmit: true,
userDisable: false,
size: 'small',
......@@ -127,7 +134,8 @@ export default {
effectiveType: '2',
effectiveTime: [],
effectiveDays: '',
anticipatedCost: ''
anticipatedCost: '',
directionalFlag: '1'
},
editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
......@@ -161,6 +169,13 @@ export default {
append: '张'
},
{
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
......@@ -257,6 +272,7 @@ export default {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res)
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期
......@@ -309,8 +325,8 @@ export default {
//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00'
obj.effectiveEndTime = d[1] + ' 23:59:59'
obj.effectiveStartTime = d[0]
obj.effectiveEndTime = d[1]
}
}
......@@ -323,6 +339,8 @@ export default {
}
//使用描述
obj.useDescription = form.useDescription
//是否定制礼包专用
obj.directionalFlag = form.directionalFlag
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
return obj
......@@ -341,7 +359,7 @@ export default {
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
......
......@@ -28,10 +28,15 @@
</div>
<p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
</template>
<template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
......@@ -64,6 +69,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: "yyyy-MM-dd HH:mm:ss", // 日期显示格式
showSubmit: true,
userDisable: false,
size: 'small',
......@@ -106,7 +113,8 @@ export default {
effectiveType: '2',
effectiveTime: [],
effectiveDays: '',
anticipatedCost: ''
anticipatedCost: '',
directionalFlag: '1'
},
editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
......@@ -140,6 +148,13 @@ export default {
append: '张'
},
{
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
......@@ -235,6 +250,7 @@ export default {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res)
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期
......@@ -287,8 +303,8 @@ export default {
//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00'
obj.effectiveEndTime = d[1] + ' 23:59:59'
obj.effectiveStartTime = d[0]
obj.effectiveEndTime = d[1]
}
}
......@@ -301,6 +317,8 @@ export default {
}
//使用描述
obj.useDescription = form.useDescription
//是否定制礼包专用
obj.directionalFlag = form.directionalFlag
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
return obj
......@@ -319,7 +337,7 @@ export default {
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
......
......@@ -105,6 +105,15 @@ export default {
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
},
{
label: '使用规则',
name: 'directionalFlag',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'directionalFlagList'
}
],
// 表格
......@@ -160,6 +169,14 @@ export default {
return useChannel
}
},
{
label: '使用规则',
name: 'directionalFlag',
width: '150px',
formatter: cellValue => {
return this.baseData.directionalFlagList.find(item => item.confId == cellValue.directionalFlag).confName
}
},
{
label: '优惠券状态',
name: 'status',
......@@ -190,6 +207,20 @@ export default {
// confName: '会员服务'
// }
],
directionalFlagList:[
{
confId: '1',
confName: '所有客户可用'
},
{
confId: '2',
confName: '定向礼包专用'
},
{
confId: '3',
confName: '关联商品可用'
}
],
statusList: [
{
confId: '1',
......@@ -380,7 +411,7 @@ export default {
couponName: '',
discountType: '',
status: '',
discountTypes: [2, 3, 4]
discountTypes: [2, 3, 4],
}
this.handleSearch()
},
......
......@@ -74,7 +74,8 @@ export default {
useB: '',
// 表格
searchForm: {
phone: ''
phone: '',
wechatUserFlag:''
},
tableSearchForm: {},
// 搜索
......@@ -84,6 +85,15 @@ export default {
name: 'phone',
type: 'input',
maxlength: 11
},
{
label:'是否加企微',
name:'wechatUserFlag',
type:'select',
optionList:[],
optionId: 'statusId',
optionLabel: 'statusName',
optionsName: 'wechatUserFlagList'
}
],
// 表格
......@@ -100,6 +110,13 @@ export default {
label: '用户昵称',
prop: 'userName'
},
{
label: '是否加入企微',
prop: 'wechatUserFlag',
formatter: cellValue => {
return this.baseData.wechatUserFlagList.find(item => item.statusId == cellValue.wechatUserFlag).statusName
}
},
{
label: '优惠券状态',
prop: 'userStatus',
......@@ -113,7 +130,7 @@ export default {
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
......@@ -135,6 +152,16 @@ export default {
confId: '3',
confName: '已过期'
}
],
wechatUserFlagList: [
{
statusId: '2',
statusName: '是'
},
{
statusId: '1',
statusName: '否'
}
]
},
exportLoading: false
......@@ -260,7 +287,8 @@ export default {
handleReset() {
this.searchForm = {
phone: ''
phone: '',
wechatUserFlag:''
}
this.handleSearch()
},
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
\ No newline at end of file
<!-- 查看产品 - 评价信息 -->
<template>
<div class="comment-detail container edit-container">
<div style="padding: 20px">
<!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="starLevel" slot-scope="scope">
<img v-for="(item, index) in scope.scope.starLevel" :key="index" class="icon-star" src="@/assets/icon-star.png" />
</div>
<div slot="goodsImage" class="table-image" slot-scope="scope">
<span v-if="!scope.scope.imgUrls">-</span>
<img v-else class="img-60" :src="scope.scope.imgUrls[0]" @click="handleImgLook(scope.scope.imgUrls)" />
</div>
</GLTable>
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible" :close-on-click-modal="false">
<div class="dialog-look">
<span v-for="(item, index) in dialogObj.imgUrls" :key="index">
<el-image style="width: 200px; height: 200px; margin-right: 10px" :src="item" :preview-src-list="[item]"></el-image>
</span>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'commentDetail',
data() {
return {
size: 'small',
url: url,
searchForm: {
goodsId: ''
},
isImgVisible: false,
// imgUrls: [],,
dialogObj: {
imgUrls: [],
uploadType: 'img'
},
// 表格
getListApi: this.$apis.proManage.getGoodsCommentListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '评价用户名称',
prop: 'customerName'
},
{
label: '评价时间',
prop: 'createdDateStr'
},
{
label: '评价星级',
prop: 'starLevel',
addHtml: 'starLevel'
},
{
label: '评价内容',
prop: 'commentContent',
line: 3
},
{
label: '图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
props: {
goodsId: {
type: Object,
default: () => {}
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.goodsId = this.goodsId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
},
handleImgLook(imgUrls) {
this.isImgVisible = !this.isImgVisible
this.dialogObj = {
imgUrls: imgUrls,
uploadType: 'img'
}
}
}
}
</script>
<style></style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion
class="emotion-item"
v-for="(item, i) in line"
:key="i"
@click.native="clickHandler(item)"
>{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-info">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt />
<div class="preview-box" v-for="item in previewList" :key="item.id">
<div class="preview-box-desc">
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent[0]"></div>
</template>
<template v-else-if="item.attType == 7">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{ item.attContent[0].marketingName }}</div>
</div>
</template>
<template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>
</template>
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<div class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="item.attContent[0]" type="video/mp4" />
</video>
<i
class="el-icon-video-play"
@click="
videoShow = true
videoUrl = item.attContent[0]
"
></i>
</div>
</template>
</div>
</div>
<div class="preview-operation">赞 | 评论</div>
</div>
</div>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose" class="video-dialog">
<div slot="title" style="height: 18px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls :src="this.videoUrl"></video>
</el-dialog>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import emoji from '@/utils/emo'
export default {
name: 'Preview',
props: { eventBus: Object },
data() {
return {
videoShow: false,
previewList: [],
previewListFilter: [],
videoUrl: ''
}
},
watch: {
previewList(val) {
if (val.length && val[0].attType == 1) {
const attContent = val[0].attContent[0]
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
val[0].attContent[0] = htm
}
//图片合并
// const previewListFilter = val.map(item=>{
// return {
// attContent: [item.attContent],
// attType: item.attType
// }
// })
// this.previewListFilter = previewListFilter.reduce((prev, cur) => {
// let index = prev.find(item=>item.attType == ATT_TYPE.IMAGE)
// if(index != -1 && prev.length) {
// return prev[index].attContent.concat(cur.attContent)
// }
// return prev.concat(cur)
// },[])
// console.log(this.previewListFilter)
}
},
created() {
this.eventBus.$on('update', val => {
setTimeout(() => {
this.previewList = val
}, 100)
})
},
mounted() {}
}
</script>
<style lang="scss" scope>
.img-list {
margin-right: 3px;
margin-bottom: -10px;
}
.img-bg {
position: relative;
width: 290px;
height: 566px;
background-image: url(../../../assets/guestCustom/friend-bg.png);
background-size: 100%;
.preview-content {
position: absolute;
width: 250px;
height: 350px;
overflow-y: auto;
top: 125px;
left: 20px;
// background-color: cornflowerblue;
.preview-time {
font-size: 10px;
color: #999;
text-align: center;
margin-bottom: 15px;
}
.preview-info {
padding: 0 0px 20px 9px;
position: relative;
.avatar {
position: absolute;
top: 0px;
left: 5px;
width: 26px;
height: 26px;
margin-right: 8px;
}
.preview-box {
margin-left: 30px;
width: 180px;
}
.preview-operation {
float: right;
margin-right: 30px;
margin-top: 15px;
text-align: center;
width: 64px;
height: 22px;
line-height: 22px;
background: #f7f7f7;
font-size: 10px;
font-weight: 400;
color: #556993;
}
.video-panel {
width: 136px;
height: 102px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
video {
position: absolute;
}
i {
z-index: 10;
font-size: 20px;
color: #fff;
cursor: pointer;
}
}
.preview-text {
position: relative;
color: #333;
background-color: #fff;
border-radius: 4px;
word-break: break-all;
display: flex;
img {
width: 20px;
height: 20px;
}
}
.text {
font-size: 12px;
padding: 8px 0px;
}
.preview-link {
padding: 6px 0px;
font-size: 12px;
background: #f7f7f7;
display: flex;
align-items: center;
img {
margin: 0px 12px 0px 5px;
width: 24px;
height: 24px;
}
div {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.preview-text::before {
content: '';
position: absolute;
left: -10px;
top: 20%;
border-width: 5px;
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue;
}
.preview-applet {
img {
width: 20px;
height: 20px;
margin-right: 4px;
}
&-title {
display: flex;
align-self: center;
color: #999;
margin-bottom: 5px;
}
}
.preview-activity {
width: 160px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #dce1e5;
padding: 7px 7px 0;
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.applet-logo {
width: 95px;
height: 24px;
}
.activity-footer {
margin-top: 4px;
border-top: 1px solid #edeff3;
}
}
}
}
}
.video-dialog {
.el-dialog__header {
border-bottom: 0px;
background-color: rgb(0, 0, 0);
}
.el-dialog__body {
padding: 0px;
}
}
</style>
<template>
<div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div>
<div class="emp-scroll-panel" :style="{
height: treeHeight + 'px'
}">
<div class="tree-title">所在门店/部门</div>
<el-tree
v-loading="loading"
:data="listTree"
:expand-on-click-node="false"
highlight-current
:props="defaultProps"
@node-click="handleNodeClick"
></el-tree>
</div>
</div>
<el-col
class="scrm-p10 emp-table-panel"
:style="{
height: treeHeight + 20 + 'px'
}"
>
<GLTable
v-loading="loading"
ref="saleTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
@selectionTable="selectionTable"
></GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
props: ['selectData', 'islord'],
data() {
return {
treeHeight: 0,
staffName: '',
listTree: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '职务',
prop: 'staffTitle'
}
]
},
tableEmpData: [],
currentArr: [],
loading: true
}
},
methods: {
selectionTable(val) {
this.$emit('selectTable', val)
},
listDepartmentTree() {
const params = { merchantId: 10001001, addChildrensFlag: true }
if (this.islord) {
params.islord = this.islord
}
params.isHavCustomer = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.listTree = res
this.loading = false
if (this.listTree.length) {
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
}
if (this.selectData && this.selectData.length) {
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
this.clearSelect(row)
})
}
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
})
})
},
clearSelect(row) {
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
this.$refs.saleTable.$refs.salelistMutiTable.clearSelection()
},
handleNodeClick(data) {
this.departmentId = data.id
this.tableEmpData = data.entmicroStaffResponses
// this.currentArr = this.$common.utils.deepClone(data.entmicroStaffResponses)
// this.listEntmicroStaff()
},
getEmployee(d, arr = []) {
d.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
searchTable(search) {
const arr = []
if (this.currentArr && this.currentArr.length != 0) {
this.currentArr.forEach(item => {
if (item.staffName.indexOf(search) != -1) {
arr.push(item)
}
})
}
this.tableEmpData = arr
}
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 650
this.listDepartmentTree()
}
}
</script>
<style scoped lang="scss">
.select-emp-panel {
display: flex;
.emp-tree-panel {
margin-top: 10px;
width: 200px;
position: relative;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
.emp-scroll-panel {
min-height: 200px;
overflow: auto;
box-sizing: border-box;
}
.popper-arrow {
border-top-width: 0;
border-width: 6px;
position: absolute;
top: -12px;
left: 30px;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #e4e7ed;
&:after {
content: ' ';
border-width: 6px;
top: 1px;
margin-left: -6px;
border-top-width: 0;
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #fff;
}
}
}
.emp-table-panel {
flex: 1;
min-height: 200px;
overflow: auto;
margin-top: 10px;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner {
background-color: #999999;
}
}
.emp-tree-panel {
margin-right: 10px;
font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff;
background: #f2f5fa;
}
}
.tree-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 14px;
padding: 10px;
}
}
</style>
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>共{{ chatGroupCount }}个群聊,{{ tableEmpData.length }}个群主成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">所在门店/部门</span>
<el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
<el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
<el-input v-model="searchForm.department" slot="reference" :size="size" readonly style="width: 215px" placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0">
<el-input :size="size" v-model.trim="searchForm.lordName" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">跟进专员类型</span>
<el-select v-model="searchForm.followerId" style="width: 215px" :size="size" placeholder="请选择">
<el-option v-for="item in followTypeList" :key="item.id" :label="item.followName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item label style="margin-bottom: 0; margin-left: 40px">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</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)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectLord',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName',
formatter: cellValue => {
return cellValue.followerTypeName ? cellValue.followerTypeName : '-'
}
},
{
label: '群数量',
prop: 'chatCount'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
followTypeList: [],
chatGroupCount: 0
}
},
mounted() {
this.getFindLordGroup({}, true)
this.getFollowerType()
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
getFindLordGroup(params, isFirst) {
this.$apis.customerTransform.findLordGroup(params).then(res => {
this.loading = false
if (res) {
this.tableEmpData = res
this.tableEmpData.map(item => (this.chatGroupCount += item.chatCount))
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
if (isFirst && this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
listDepartmentTree() {
const params = { addChildrensFlag: true }
params.islord = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.treeData = res
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.getFindLordGroup(this.searchForm)
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
getFollowerType() {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
},
handleReset() {
this.searchForm = {}
this.search()
}
}
}
</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;
}
}
.lord-label {
display: inline-block;
width: 110px;
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
border-bottom: none;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 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%;
}
.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% - 86px);
display: flex;
align-items: center;
max-height: 500px;
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;
}
</style>
<template>
<div class="drawer-sale-panel">
<el-form label-width="100px" :model="addForm" @submit.native.prevent>
<el-form-item label="请选择成员">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<div class="tag-box">
<el-tag
v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
<el-input
size="small"
v-model.trim="newTag"
placeholder="选择员工"
@input="inputTag"
style="outline: none; border: none"
@keyup.enter.native="searchEmp"
></el-input>
</div>
<div>
<el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button>
</div>
</div>
<div>
<div class="select-sale-panel">
<select-emp
:selectData="selectData"
:islord="islord"
@selectTable="selectTable"
ref="selectEmpTabel"
></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp.vue'
export default {
name: 'SelectMembers',
props: ['selectData', 'islord'],
components: {
selectEmp
},
data() {
return {
addForm: {},
typeIndex: 0,
empType: [],
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.searchTable(this.newTag)
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择成员',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
}
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted() {}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.tag-box {
max-height: 66px;
overflow: auto;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #606266;
display: inline-block;
outline: none;
padding: 0 0 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
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: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 4px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
</style>
<!-- 树形搜索 -->
<template>
<div>
<el-popover
ref="popover"
placement="bottom-start"
trigger="click"
v-model="popoverVisible"
:disabled="targetItem.isDisabled"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
ref="tree"
class="select-tree"
highlight-current
default-expand-all
node-key="id"
:expand-on-click-node="isExpand"
:style="`min-width: ${treeWidth}`"
:data="treeData"
:current-node-key="form[targetItem.name]"
:props="defaultProps"
:filter-node-method="handleFilterNode"
@current-change="handleNodeClick"
></el-tree>
<el-input
slot="reference"
ref="input"
v-model="form[targetItem.nameLabel]"
clearable
:disabled="targetItem.isDisabled"
:style="`width: ${width}px`"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
:placeholder="'请选择' + targetItem.label"
@change="handleClear"
></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto'
}
},
props: {
// 输入框宽度
width: String,
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
},
defaultProps: {
type: Object,
default: () => ({
parent: 'parentId',
value: 'id',
label: 'menuName',
children: 'childlist'
})
}
},
watch: {
form(val) {
if (this.form[this.targetItem.name]) {
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
}
},
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
if (this.form[this.targetItem.name]) {
// console.log(this.treeData)
// console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
},
methods: {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
if (!query) return true
return data[this.defaultProps.label].indexOf(query) !== -1
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = []
stark = stark.concat(tree)
while (stark.length) {
const temp = stark.shift()
if (temp[this.defaultProps.children]) {
stark = stark.concat(temp[this.defaultProps.children])
}
if (temp[this.defaultProps.value] === id) {
return temp[this.defaultProps.label]
}
}
return
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
</style>
\ No newline at end of file
<!-- 分享弹窗 -->
<template>
<glsx-dialog title="分享" width="806px" :noCancel="true" btnOkLabel="关闭" :isVisible="isShareVisible" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.posterUrl)">保存图片</el-button>
</div>
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.qrCodeUrl)">保存图片</el-button>
</div>
<img style="width: 180px; height: 180px" :src="shareForm.qrCodeUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{ shareForm.linkUrl }}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.linkUrl)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
</glsx-dialog>
</template>
<script>
export default {
name: 'share',
data() {
return {
}
},
props: {
isShareVisible: {
type: Boolean,
default: false
},
shareForm: {
type: Object,
default: () => {}
}
},
mounted() {},
methods: {
handleSaveImg(url) {
var alink = document.createElement("a")
alink.href = url
alink.setAttribute('target', '_blank')
alink.download = '海报'
alink.click()
alink.remove()
},
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
handleShareClose() {
this.$emit('handleShareClose')
}
}
}
</script>
<style scoped>
.share-dialog .box {
background: #f7f7f7;
border-radius: 6px;
padding: 30px;
}
.share-dialog .poster img {
width: 180px;
height: 297px;
margin-left: 45px;
}
.share-dialog .page-route {
margin-top: 16px;
}
.share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style>
<!-- 编辑礼包 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div v-if="routeInfo.addOrEdit!='add'" class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{editForm.approveBy}}</div>
<div class="approval_label">审批状态:<span :style="{color:approvalStatusColor[approvalStatus]}">{{approvalStatusVal[approvalStatus]}}</span></div>
<div v-if="approvalStatus==2" class="approval_label">驳回说明:<div class="approval_con">{{editForm.approveExplain}}</div></div>
</div>
</div>
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
......@@ -37,10 +45,23 @@
</div>
</div>
</glsx-combi-form>
<div v-if="routeInfo.addOrEdit!='add'" class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{editForm.createdDate}}</span>
<span class="">创建人:{{editForm.createdBy}}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{editForm.updatedDate}}</span>
<span class="">修改人:{{editForm.updatedBy}}</span>
</div>
</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="primary" @click="handleConfirm">提交</el-button>
</div>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
<select-staff-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchStaffForm" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-staff-dialog>
......@@ -50,6 +71,7 @@
<script>
import selectStaffDialog from './selectStaffDialog.vue'
import selectGiftDialog from './selectGiftDialog.vue'
import * as dayjs from 'dayjs'
export default {
name: 'editGift',
data() {
......@@ -224,7 +246,15 @@ export default {
maxlength: 50,
width: '567px'
}
]
],
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatus:1,
approvalStatusVal:['审批中','审批通过','已驳回','审批撤销','待审批'],
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E','#999999','#999999'],
isChangeCoupons:true,
isChangePeople:true,
currentCoupons:[],
currentPeople:[]
}
},
......@@ -239,6 +269,16 @@ export default {
this.editStatus = true
},
deep: true
},
'editForm.couponList':{
handler(val){
this.isChangeCoupons = this.judgeAddOrDel(val,this.currentCoupons,'id')
}
},
'editForm.staffList':{
handler(val){
this.isChangePeople = this.judgeAddOrDel(val,this.currentPeople,'staffUUID')
}
}
},
......@@ -259,6 +299,9 @@ export default {
item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost
})
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.approvalStatus = res.data.approveStatus - 1
this.editForm = res.data
this.editForm.receiveWay = this.editForm.receiveWay + ''
this.recoveryCoupon()
......@@ -280,9 +323,24 @@ export default {
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
this.currentPeople = this.$common.utils.deepClone(this.editForm.staffList)
this.hasCouponBlock(false)
},
// 用来判断券和发放员工是否有增删 type: id为礼券 staffUUID为发放员工
judgeAddOrDel(newArr,oldArr,type='id'){
let id1 = [],id2 = []
newArr.forEach(item=>{
id1.push(item[type])
})
oldArr.forEach(item=>{
id2.push(item[type])
})
let flag = id1.length === id2.length && id1.sort().toString() === id2.sort().toString();
return flag
},
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
......@@ -389,24 +447,44 @@ export default {
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
this.loading = true
this.$apis.giftBag
.insertGiftApi(params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
params.requestSource = 1
// 插入判断是否存在审批模板
const { session } = this.$globalState
this.$apis.giftBag.templateModal({merchantId:session.merchantId}).then((result)=>{
if(result.data&&(!this.isChangeCoupons || !this.isChangePeople)){
this.$confirm(`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString:true
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
.then(() => {
this.insertHttp(params)
})
.catch(() => { })
}else{
this.insertHttp(params)
}
})
}
})
},
// 创建-更新接口
insertHttp(params){
this.loading = true
this.$apis.giftBag.insertGiftApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
},
cancelJump() {
this.$router.push({
path: '/giftBag/index'
......@@ -543,4 +621,49 @@ export default {
width: 100px;
}
}
// v2.0.0
.approval-info{
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label{
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con{
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
white-space: pre-wrap;
}
}
}
.approval_note_container{
.line{
margin: 0 20px;
border-top: 1px solid #D8D8D8 ;
}
.note_container{
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,.right{
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40{
margin-right: 40px;
}
}
}
}
</style>
<!-- 礼包详情 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{editForm.approveBy}}</div>
<div class="approval_label">审批状态:<span :style="{color:approvalStatusColor[approvalStatus]}">{{approvalStatusVal[approvalStatus]}}</span></div>
<div v-if="approvalStatus==2" class="approval_label">驳回说明:<div class="approval_con">{{editForm.approveExplain}}</div></div>
</div>
</div>
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
......@@ -33,14 +41,29 @@
</div>
</div>
</glsx-combi-form>
<div class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{editForm.createdDate}}</span>
<span class="">创建人:{{editForm.createdBy}}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{editForm.updatedDate}}</span>
<span class="">修改人:{{editForm.updatedBy}}</span>
</div>
</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
<!-- <el-button type="default" @click="handleCancel">修改</el-button> -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'giftDetail',
data() {
......@@ -141,7 +164,11 @@ export default {
name: 'giveReason',
type: 'showTxt'
}
]
],
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatus:2,
approvalStatusVal:['审批中','审批通过','已驳回','审批撤销','待审批'],
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E','#999999','#999999'],
}
},
......@@ -158,7 +185,10 @@ export default {
this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data
this.approvalStatus = res.data.approveStatus - 1
this.recoveryCoupon()
this.recoveryTotalPrice()
})
......@@ -319,4 +349,50 @@ export default {
width: 100px;
}
}
// v2.0.0
.approval-info{
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label{
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
// width: 80px;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con{
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
white-space: pre-wrap;
}
}
}
.approval_note_container{
.line{
margin: 0 20px;
border-top: 1px solid #D8D8D8 ;
}
.note_container{
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,.right{
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40{
margin-right: 40px;
}
}
}
}
</style>
......@@ -38,6 +38,9 @@
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
</div>
<div slot="approveStatus" slot-scope="scope">
<span :style="{color:approvalStatusColor[scope.scope.approveStatus-1]}">{{approvalStatusVal[scope.scope.approveStatus-1]}}</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
......@@ -61,6 +64,7 @@ export default {
searchForm: {
name: '',
staffName: '',
approveStatus:'',
createDate: []
},
tableSearchForm: {},
......@@ -82,6 +86,15 @@ export default {
isClear: true
},
{
label: '审批状态',
name: 'approveStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'approvalStatusList'
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
......@@ -140,6 +153,11 @@ export default {
}
},
{
label: '审批状态',
prop: 'approveStatus',
addHtml: 'approveStatus',
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
......@@ -160,8 +178,30 @@ export default {
confId: '1',
confName: '已发布'
}
],
approvalStatusList:[
{
confId: 5,
confName: '待审批'
},
{
confId: 1,
confName: '审批中'
},
{
confId: 2,
confName: '审批通过'
},
{
confId: 3,
confName: '已驳回'
},
]
}
},
// 1 审批中;2 审批通过; 3审批驳回 4审批撤销 5待审批
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E','#999999','#999999'],
approvalStatusVal:['审批中','审批通过','已驳回','审批撤销','待审批'],
}
},
......@@ -216,6 +256,13 @@ export default {
},
handleDelete(row) {
if(row.approveStatus==1){
this.$message({
message: '不支持删除审批中状态的礼包',
type: 'error'
})
return
}
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
......@@ -231,6 +278,13 @@ export default {
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
if(addOrEdit=='edit'&&row.approveStatus==1){
this.$message({
message: '不支持修改审批中状态的礼包',
type: 'error'
})
return
}
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
......
<!-- 编辑sop -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<div>
<base-info v-show="activeName == 'baseInfo'" :routeInfo="routeInfo"></base-info>
<edit-event v-show="activeName == 'editEvent'"></edit-event>
</div>
</template>
<script>
import baseInfo from './editSop/baseInfo'
import editEvent from './editSop/editEvent'
export default {
name: 'editGift',
name: 'editSop',
data() {
return {
size: 'small',
title: '新增信息',
titleObj: {
add: '新增信息',
edit: '编辑信息'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
activeName: 'baseInfo',
routeInfo: {
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
zoneName: '',
zoneImg: '',
merchantList: []
},
editRule: {
zoneName: [{ required: true, message: '请输入sop名称', trigger: 'change' }],
zoneImg: [{ required: true, message: '请选择sop图片', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }]
},
isEdit: true,
editFormData: [
{
label: 'sop名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: 'sop图片',
name: 'zoneImg',
type: 'upload',
limitSize: 10,
maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
}
]
}
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
components: {
baseInfo,
editEvent
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
console.log(this.routeInfo.addOrEdit)
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName
// this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
params.merchantList = []
this.editForm.merchantList.forEach(item => {
params.merchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
// console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
}
})
},
cancelJump() {
this.$router.push({
path: '/sop/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
methods: {}
}
</script>
<style scoped>
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
<style lang="scss">
</style>
<!-- 编辑sop -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="customerList">
<el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button :size="size" @click="handleResetCostomer">重置客户</el-button>
<!-- <div v-show="editForm.customerList.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div> -->
</div>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="isTagVisible"></SelectLabel>
</div>
</template>
<script>
import SelectLabel from './components/selectLabel.vue'
export default {
name: 'baseInfo',
data() {
return {
size: 'small',
title: '基本信息',
// titleObj: {
// add: '新增信息',
// edit: '编辑信息'
// },
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
editStatus: false,
labelWidth: '144px',
// 标签弹窗
isTagVisible: false,
tagging: [],
editForm: {
sopName: '',
sopTime: '2022-01-01',
// tagging: [],
customerList: [],
customerIds: []
},
editRule: {
sopName: [{ required: true, message: '请输入sop名称', trigger: 'change' }],
sopTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }],
customerList: [{ required: true, message: '请选择营销对象', trigger: 'change' }],
},
isEdit: true,
editFormData: [
{
label: 'sop名称',
name: 'sopName',
type: 'input',
maxlength: 20
},
{
label: '营销时间',
name: 'sopTime',
type: 'showTxt'
},
{
label: '营销对象',
name: 'customerList',
addHtml: 'customerList'
}
]
}
},
components: {
SelectLabel
},
props: {
routeInfo: {
type: Object,
default: () => {
return {
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
id: ''
}
}
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
console.log(this.routeInfo.addOrEdit)
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.sopName = res.sopName
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
},
// 选择标签
handleSelect(val) {
this.isUpdate = true
this.tagging = val
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
console.log(this.taggingList)
// this.taggingList = val
console.log(val, '1')
console.log(this.tagging, '2')
},
handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init(this.tagging)
console.log(this.isTagVisible)
},
handleResetCostomer() { },
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
// console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
}
})
},
cancelJump() {
this.$router.push({
path: '/sop/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
}
</script>
<style scoped>
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
</style>
......@@ -67,7 +67,7 @@ export default {
align: 'center'
}
},
color: ['#5850ff', '#eeeeee'],
color: ['#7A80FF', '#F0F0F0'],
series: [
{
name: '',
......@@ -189,6 +189,7 @@ export default {
let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(this.pieOption))
// option.title.text = item.completedPercent == '100' ? '√' : item.completedPercent + '%'
option.title.text = item.completedPercent + '%'
option.series[0].name = item.sopName
option.series[0].data = [
......
<!-- 完成率分析-->
<template>
<div class="marketing">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<GLButton :size="size" class="default-blue-btn" type="default" fn="导出" @click="handleExport">导出</GLButton>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="giftInfo" slot-scope="scope">
<div class="p-b-12">礼包明细</div>
<div class="gift-detail flex-wrap">
<div class="gift-item" v-for="(item, index) in scope.scope.couponList" :key="index">
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
data() {
return {
size: 'small',
url: url,
searchForm: {
name: '',
staffName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '礼包名称',
name: 'name',
type: 'input',
maxlength: 30,
placeholder: '请输入礼包名称或备注名称',
isClear: true
},
{
label: '发放员工',
name: 'staffName',
type: 'input',
maxlength: 30,
isClear: true
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.giftBag.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx',
width: '60'
},
{
label: '礼包名称',
prop: 'name',
addHtml: 'name'
},
{
label: '备注名称',
prop: 'remarkName',
width: '200'
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '发放员工',
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
},
{
label: '赠送原因',
prop: 'giveReason',
formatter: cellValue => {
return cellValue.giveReason || '-'
}
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
handleExport() {
var params = this.getParams()
this.$apis.giftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/giftBag/giftDetail',
query: {
id: row.id
}
})
},
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
path: '/giftBag/editGift',
query: params
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
var page = this.$refs.giftListRef.page
// 添加序号
this.$refs.giftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
},
handleReset() {
this.searchForm = {
name: '',
staffName: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style lang="scss">
.p-b-12 {
margin-bottom: 14px;
}
.gift-detail .gift-item {
margin-right: 80px;
.gift-coupon-name {
display: inline-block;
margin-right: 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.gift-detail .gift-item:last-child {
margin-right: 0;
}
</style>
<!-- 完成率分析-->
<template>
<div class="marketing sop-analysis complete-list">
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
</div>
<div class="analysis-box flex-default">
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
营销时间总数
<img src="@/assets/sop/sop-event.png" />
</div>
<p class="analysis-num">20</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已完成事件数
<img src="@/assets/sop/completed-event.png" />
</div>
<p class="analysis-num">12</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
完成率
</div>
<p class="analysis-num">60%</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
<p class="m-b-10">日营销事件明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption'
export default {
name: 'completeList',
data() {
return {
size: 'small',
url: url,
searchForm: {},
// 表格
getListApi: this.$apis.giftBag.getListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '营销事件',
prop: 'name'
},
{
label: '营销渠道',
prop: 'remarkName',
width: '200'
},
{
label: '营销事件总数',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '已完成事件数',
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
}
},
mounted() {
this.drawPie()
},
methods: {
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
drawPie() {
let chartDom = document.getElementById('completePie')
let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(pieOption))
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
name: '已触发的营销事件'
},
{
value: 40,
name: '未触发的营销事件'
}
]
console.log(option)
option && myChart.setOption(option)
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
}
}
}
</script>
<style lang="scss">
.sop-analysis {
.title {
height: 32px;
line-height: 32px;
font-size: 20px;
font-weight: 600;
}
.analysis-box {
margin-bottom: 40px;
.analysis-block {
position: relative;
box-sizing: border-box;
width: 216px;
height: 116px;
padding: 10px 20px 20px;
margin-right: 20px;
flex-basis: 0 0 auto;
background: #ffffff;
background-image: linear-gradient(0deg, #f8f8fc 0%, #f4f4ff 100%);
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.analysis-title-block {
display: flex;
justify-content: space-between;
align-items: center;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #666666;
}
.chart-pie {
position: absolute;
top: 20px;
right: 20px;
width: 70px;
height: 74px;
}
.analysis-num {
font-size: 26px;
font-weight: 600;
}
}
}
}
</style>
var pieOption = {
tooltip: {
trigger: 'item'
},
color: ['#7A80FF', '#e6e6ef'],
series: [
{
name: '',
type: 'pie',
radius: ['60%', '90%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false
}
},
labelLine: {
show: false
},
data: []
}
]
}
export { pieOption }
<!-- 定向礼包-->
<!-- 完成率分析-->
<template>
<div class="marketing">
<div class="m-b-10">
<!-- <el-button :size="size" type="primary" fn="新增礼包" class="el-icon-plus" @click="handleEdit('add')">新增礼包</el-button> -->
<GLButton :size="size" type="primary" fn="新增礼包" class="el-icon-plus" @click="handleEdit('add')">新增礼包</GLButton>
</div>
<div class="list-tips m-b-10">
<img class="tips-img" src="@/assets/icon-info.png" />
<span>定向礼包:将多种券和服务组合成定向礼包,由指定的员工向指定的客户发放,客户需准确输入设定内容才能成功领取。</span>
</div>
<div class="marketing sop-analysis touch-list">
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
</div>
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<!-- <span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<GLButton :size="size" class="default-blue-btn" type="default" fn="导出" @click="handleExport">导出</GLButton>
</span>
</span> -->
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="giftInfo" slot-scope="scope">
<div class="p-b-12">礼包明细</div>
<div class="gift-detail flex-wrap">
<div class="gift-item" v-for="(item, index) in scope.scope.couponList" :key="index">
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p>
</div>
<div class="analysis-box flex-default">
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
客户总数
<img src="@/assets/sop/customer-total.png" />
</div>
<p class="analysis-num">20</p>
</div>
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已触达客户数
<img src="@/assets/sop/touch-customer.png" />
</div>
<p class="analysis-num">12</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
触达率
</div>
<p class="analysis-num">60%</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
<p class="m-b-10">客户触达明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
......@@ -49,11 +54,13 @@
</template>
<script>
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption'
export default {
name: 'giftList',
name: 'completeList',
data() {
return {
size: 'small',
......@@ -67,85 +74,39 @@ export default {
// 搜索
searchFormData: [
{
label: '礼包名称',
label: '营销事件',
name: 'name',
type: 'input',
maxlength: 30,
placeholder: '请输入礼包名称或备注名称',
isClear: true
},
{
label: '发放员工',
name: 'staffName',
type: 'input',
maxlength: 30,
isClear: true
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
type: 'select',
width: '415px'
}
],
// 表格
getListApi: this.$apis.giftBag.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
label: '客户名称',
prop: 'name'
},
{
label: '序号',
prop: 'idx',
width: '60'
},
{
label: '礼包名称',
prop: 'name',
addHtml: 'name'
},
{
label: '备注名称',
label: '客户手机号',
prop: 'remarkName',
width: '200'
},
{
label: '预估成本/元',
label: '初次查看事件',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '发放员工',
label: '营销事件总数',
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
},
{
label: '赠送原因',
prop: 'giveReason',
formatter: cellValue => {
return cellValue.giveReason || '-'
}
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
......@@ -166,6 +127,7 @@ export default {
},
mounted() {
this.drawPie()
this.getOptionsList('searchFormData')
},
......@@ -268,52 +230,81 @@ export default {
}
},
setTableFinishFun() {
var page = this.$refs.giftListRef.page
// 添加序号
this.$refs.giftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
drawPie() {
let chartDom = document.getElementById('completePie')
let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(pieOption))
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
name: '已触发的营销事件'
},
{
value: 40,
name: '未触发的营销事件'
}
]
console.log(option)
option && myChart.setOption(option)
},
handleReset() {
this.searchForm = {
name: '',
staffName: '',
createDate: []
}
this.handleSearch()
handleSearch() {
this.$refs.giftListRef.refreshTable()
}
}
}
</script>
<style lang="scss">
.p-b-12 {
margin-bottom: 14px;
}
.gift-detail .gift-item {
margin-right: 80px;
.gift-coupon-name {
display: inline-block;
margin-right: 7px;
.sop-analysis {
.title {
height: 32px;
line-height: 32px;
font-size: 20px;
font-weight: 600;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
.analysis-box {
margin-bottom: 40px;
.analysis-block {
position: relative;
box-sizing: border-box;
width: 216px;
height: 116px;
padding: 10px 20px 20px;
margin-right: 20px;
flex-basis: 0 0 auto;
background: #ffffff;
background-image: linear-gradient(0deg, #f8f8fc 0%, #f4f4ff 100%);
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.analysis-title-block {
display: flex;
justify-content: space-between;
align-items: center;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #666666;
}
.chart-pie {
position: absolute;
top: 20px;
right: 20px;
width: 70px;
height: 74px;
}
.analysis-num {
font-size: 26px;
font-weight: 600;
}
}
}
}
.gift-detail .gift-item:last-child {
margin-right: 0;
}
</style>
......@@ -3,7 +3,7 @@
<div class="sop-analysis">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="完成率分析" name="compleList">
<comple-list v-if="activeName == 'compleList'"></comple-list>
<complete-list v-if="activeName == 'compleList'"></complete-list>
</el-tab-pane>
<el-tab-pane label="触达率分析" name="touchList">
<touch-list v-if="activeName == 'touchList'"></touch-list>
......@@ -12,23 +12,25 @@
<staff-list v-if="activeName == 'staffList'"></staff-list>
</el-tab-pane>
</el-tabs>
<el-button :size="size" class="sop-back-btn" type="primary" @click="handleBack">返回</el-button>
</div>
</template>
<script>
import compleList from './sopAnalysis/compleList.vue'
import completeList from './sopAnalysis/completeList.vue'
import touchList from './sopAnalysis/touchList.vue'
import staffList from './sopAnalysis/staffList.vue'
export default {
name: 'gitfBag',
data() {
return {
activeName: 'compleList'
activeName: 'compleList',
size: 'small'
}
},
components: {
compleList,
completeList,
touchList,
staffList
},
......@@ -36,12 +38,23 @@ export default {
mounted() { },
methods: {
handleTabClick() { }
handleTabClick() { },
handleBack() {
this.$router.push({
path: '/sop/index'
})
}
}
}
</script>
<style>
.sop-analysis {
position: relative;
}
.sop-analysis .el-tabs__header {
margin-bottom: 20px;
}
.sop-analysis .el-tabs__nav-wrap:after {
opacity: 0;
}
......@@ -58,4 +71,9 @@ export default {
.sop-analysis .el-tabs__item.is-active {
color: #5f5efb;
}
.sop-analysis .sop-back-btn {
position: absolute;
top: 0;
right: 0;
}
</style>
......@@ -8,7 +8,7 @@
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
......@@ -94,9 +94,10 @@ export default {
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
}
]
}
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!