Commit 52504ec5 by xuyl

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

2 parents 636a2615 fbdd12b2
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2",
"wangeditor": "^4.7.12"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
......
...@@ -271,6 +271,12 @@ html { ...@@ -271,6 +271,12 @@ html {
flex-wrap: wrap; flex-wrap: wrap;
} }
.marketing .flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.marketing .flex-grow { .marketing .flex-grow {
flex: 1; flex: 1;
} }
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</template> --> </template> -->
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option> <el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select> </el-select>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
......
...@@ -28,6 +28,12 @@ module.exports = { ...@@ -28,6 +28,12 @@ module.exports = {
// 返回数据类型 // 返回数据类型
responseType: 'json' responseType: 'json'
}, },
request2: {
timeout: 180000,
baseURL: 'http://ismv.branch.glsx.com.cn',
responseType: 'json',
withCredentials: true
},
sign: { sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
......
...@@ -12,11 +12,11 @@ let cfg = require('./conf.js') ...@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (isEnv = true) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
//return window.fetch('https://', {}).then(res => res.json()) //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' }) // 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('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
......
...@@ -248,6 +248,24 @@ const staticRoutes = Object.freeze([{ ...@@ -248,6 +248,24 @@ const staticRoutes = Object.freeze([{
path: '/sop/sopAnalysisList', path: '/sop/sopAnalysisList',
component: resolve => require([`@/views/sop/sopAnalysisList.vue`], resolve), component: resolve => require([`@/views/sop/sopAnalysisList.vue`], resolve),
meta: {} meta: {}
},
{
name: 'materialList',
path: '/material/index',
component: resolve => require([`@/views/material/index.vue`], resolve),
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),
meta: {}
} }
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
<template>
<div class="container">
<el-form ref=" " :model="materialAddForm" label-width="146px" :rules="materialAddFormRules">
<div class="creat-material">
<h4>{{ title }}</h4>
<el-divider></el-divider>
<el-form-item label="选择素材组:" prop="selectMaterialGroup">
<el-select v-model="materialAddForm.selectMaterialGroup" placeholder="请选择" :size="size">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="素材名称:" prop="materialName">
<el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="素材类型:" prop="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange">
<el-radio :label="1">PDF文件</el-radio>
<el-radio :label="2">自定义链接</el-radio>
<el-radio :label="3">图文</el-radio>
</el-radio-group>
<!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1">
<el-upload action="https://jsonplaceholder.typicode.com/posts/" accept=".pdf" show-file-list :on-remove="handleRemove" :on-success="handleSuccess" :on-error="handleError" :limit="1" :on-exceed="handleExceed" :file-list="fileList">
<el-button type="info" icon="el-icon-plus" :size="size">上传PDF文件</el-button>
<span>支持10M以内的文件</span>
</el-upload>
</div>
<!-- 选择自定义链接 -->
<div v-show="materialAddForm.materialType == 2">
<el-form :model="linkForm" :rules="linkRules" ref="linkForm" label-width="100px">
<el-form-item label="链接地址" prop="link">
<el-input v-model="linkForm.link" placeholder="请填写跳转链接" maxlength="150" show-word-limit></el-input>
</el-form-item>
</el-form>
</div>
<!-- 选择图文 -->
<div v-show="materialAddForm.materialType == 3">
<textBox></textBox>
</div>
</el-form-item>
</div>
<div class="track">
<h4>追踪设置</h4>
<el-divider></el-divider>
<el-form-item label="业务类型:" prop="applicationType">
<el-checkbox-group v-model="materialAddForm.applicationType">
<el-checkbox v-for="(value, index) in businessTypes" :key="index" :label="index">{{ value }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="动态通知:" prop="notification">
<el-radio v-model="materialAddForm.notification">客户打开素材链接时通知发送人</el-radio>
<span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item>
<el-form-item label="行为标签:" prop="behaviorTag">
<span class="track-behavior">客户打开素材/链接时通知发送人</span>
<span class="track-tips">(最多支持3个标签)</span>
<!-- 选择标签展示 -->
<div>
<span></span>
<el-button :size="size">
<i class="el-icon-plus"></i>
选择标签
</el-button>
</div>
</el-form-item>
</div>
<div class="share">
<div class="share-container">
<div class="share-top">
<span>分享设置</span>
<span class="share-tips">设置自定义分享内容,能提高用户体验,促进用户打开链接的概率</span>
</div>
<div class="share-unfold" @click="shareContainerShow">
<span v-if="!descVisible">
展开
<i class="el-icon-arrow-down"></i>
</span>
<span v-else>
收起
<i class="el-icon-arrow-up"></i>
</span>
</div>
</div>
<el-divider></el-divider>
<div class="share-desc" v-show="descVisible">
<el-form-item label="分享标题:">
<el-input v-model="materialAddForm.title" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义标题"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="textarea" v-model="materialAddForm.desc" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义描述"></el-input>
</el-form-item>
<el-form-item label="封面:">
<el-upload class="avatar-uploader" accept=".jpg, .jpeg, png" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="materialAddForm.imageUrl" class="avatar" />
<div v-else class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
</div>
</el-upload>
<span>查看效果></span>
</el-form-item>
</div>
</div>
<div class="material-bottom">
<el-form-item>
<div class="btns">
<el-button @click="onSave" :size="size">存草稿</el-button>
<el-button :size="size" @click="handleSubmit" type="primary">确定</el-button>
<el-button :size="size" @click="handleCancel" type="primary">取消</el-button>
</div>
</el-form-item>
</div>
</el-form>
</div>
</template>
<script>
import textBox from '@/views/material/components/textBox'
export default {
name: 'addMaterialForm',
components: {
textBox
},
data() {
return {
title: '创建营销素材',
titleObj: {
1: '创建营销素材',
2: '编辑营销素材'
},
materialAddForm: {
selectMaterialGroup: '',
materialName: '',
materialType: '',
applicationType: [],
notification: '',
behaviorTag: [],
title: '',
desc: '',
imageUrl: ''
},
// 素材类型--链接
linkForm: {
link: ''
},
fileList: [],
// 分享设置显示
descVisible: false,
businessTypes: ['整车/新车', '保养', '维修', '车险', '二手车', '改装', '汽车金融', '零配件/精品', '通用(节假日等关怀素材)'],
materialAddFormRules: {
selectMaterialGroup: [{ required: true, message: '请选择素材组', trigger: 'change' }],
materialName: [
{ required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 5, message: '素材名称长度不能超过30', trigger: 'blur' }
],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }],
applicationType: [{ required: true, message: '请选择业务类型', trigger: 'change' }]
},
linkRules: {
link: [
{ required: true, message: '请输入链接地址', trigger: 'change' },
{ max: 150, message: '链接地址长度不能超过30', trigger: 'blur' }
]
}
}
},
mounted() {
this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit]
// this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
methods: {
// 素材类型切换
radioChange(value) {
console.log(value)
this.materialAddForm.materialType = value
},
// 素材类型上传PDF,移除
handleRemove() {},
// 素材类型上传PDF,上传成功
handleSuccess() {},
// 素材类型上传PDF,上传失败
handleError() {},
// 素材类型上传PDF,超出限制
handleExceed() {},
// 存草稿
onSave() {},
// 提交
handleSubmit() {
this.$refs.materialAddform.validate(valid => {
if (valid) {
alert('submit!')
} else {
console.log('error submit!!')
return false
}
})
},
// 取消
handleCancel() {
this.$router.push('/material/index')
},
// 分享设置展示
shareContainerShow() {
this.descVisible = !this.descVisible
}
}
}
</script>
<style lang="scss" scoped>
.creat-material,
.track,
.share,
.material-bottom {
background-color: #fff;
}
.creat-material,
.track {
margin-bottom: -10px;
}
.container {
h4,
.share-container {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin: 17px 0 17px 20px;
&:first-child {
padding-top: 17px;
margin-top: 0;
}
}
}
.track {
&-tips {
font-size: 14px;
color: #999999;
}
&-info {
margin-left: -28px;
}
&-behavior {
color: #606266;
}
}
.share {
&-container {
display: flex;
justify-content: space-between;
.share-unfold {
span {
font-size: 12px;
color: #5850ff;
margin: 20px 21px 20px 0;
}
}
}
&-tips {
color: #999999;
font-size: 14px;
margin-left: 16px;
}
}
.material-bottom {
height: 78px;
position: relative;
.el-form-item {
position: absolute;
top: 25%;
left: 40%;
.el-form-item__content {
margin-left: 0;
}
}
.btns {
.el-button {
padding: 10px 24px;
margin-left: 20px;
&:nth-child(1) {
margin-left: 0;
padding: 10px 17px;
}
}
}
}
.el-input--small,
.el-select,
.el-select--small {
width: 411px;
}
.avatar-uploader,
.el-upload {
border: 1px dashed #d9d9d9;
height: 104px;
width: 104px;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader,
.el-upload:hover {
border: 1px dashed rgba(0, 0, 0, 0.15);
}
.avatar-uploader-desc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
&-icon {
font-size: 24px;
color: #8c939d;
}
&-word {
width: 78px;
height: 22px;
font-size: 14px;
color: #666666;
}
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="120px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="groupName">
<el-input v-model="materialGroupAddForm.groupName" maxlength="8" show-word-limit></el-input>
</el-form-item>
<el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group v-model="materialGroupAddForm.businessType" @change="handleCheckChange">
<el-checkbox v-for="value in businessTypes" :key="value" :label="value">{{ value }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span>添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确定创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'addMaterialGroupDia',
data() {
return {
title: '新增素材组',
dialogVisible: false,
materialGroupAddForm: {
groupName: '',
businessType: []
},
businessTypes: ['整车/新车','保养','维修','车险','二手车','改装','汽车金融','零配件/精品','通用(节假日等关怀素材)'],
materialGroupAddRules: {
groupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 16, message: '分组名称最长为8个字', trigger: 'blur' }
]
}
}
},
methods: {
init(value) {
// console.log(value, '~~~~');
if (value == 1) {
this.materialGroupAddForm = {
groupName: '',
businessType: []
}
}
this.dialogVisible = true
},
// 创建
submitForm() {
this.$refs.materialGroupAddForm.validate((valid) => {
if (valid) {
this.$emit('addMaterialGroup', this.materialGroupAddForm)
this.dialogVisible = false
} else {
alert('请输入分组名称')
return false;
}
});
},
handleCheckChange(val) {
console.log(val);
this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm);
}
}
}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="readPerDetailTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
export default {
name: 'readPerDetail',
data() {
return {
url,
searchForm: {
staffName: ''
},
readPerDetailFormData: [
{
label: '客户名称:',
name: 'cunstormName',
maxlength: 10,
type: 'input'
},
{
label: '发送人:',
name: 'staffName',
maxlength: 10,
type: 'input'
}
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'cunstormName'
},
{
label: '发送人',
prop: 'staffName'
},
{
label: '所属企微成员',
prop: 'resdTimes'
},
{
label: '阅读次数',
prop: 'readTimes'
},
{
label: '首次阅读时间',
prop: 'firstReadTime'
},
{
label: '最后阅读时间',
prop: 'lastReadTime'
}
]
}
}
}
}
</script>
<style lang="" scoped>
</style>
<template>
<div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
export default {
name: 'staffSendDetail',
data() {
return {
url,
searchForm: {
staffName: ''
},
staffSendFormData: [
{
label: '姓名:',
name: 'staffName',
type: 'input'
}
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '发送次数',
prop: 'sendTimes',
sortable: true
},
{
label: '阅读次数',
prop: 'resdTimes',
sortable: true
},
{
label: '阅读人数',
prop: 'readPer'
},
{
label: '打开率',
prop: 'openRate'
}
]
}
}
}
}
</script>
<style lang="" scoped>
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
content: '',
editorOption: {},
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
var editor = new E('#div-demo')
editor.config.uploadImgShowBase64 = true
editor.config.showMenuTooltips = true
editor.config.menuTooltipPosition = 'down'
editor.config.height = 400
editor.config.uploadVideoServer = '/api/upload-video'
editor.config.excludeMenus = [
'code'
]
editor.create()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
margin-top: 40px;
}
.el-form .editor{
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main-container">
<div class="top">
<el-button type="primary" @click="addMaterial(1)" :size="size">
<i class="el-icon-plus"></i>
创建营销素材
</el-button>
<span>功能介绍<i class="el-icon-arrow-right"></i></span>
</div>
<div class="container">
<div class="search-form">
<glsx-combi-form ref="materialFormRef1" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData1" :inline="true">
</glsx-combi-form>
<glsx-combi-form ref="materialFormRef2" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData2" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
</div>
<div class="tabelList">
<el-row>
<el-col :span="5">
<div class="left">
<el-button class="add-group" type="primary" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">创建素材组</el-button>
<div class="all-group">全部素材组 ({{ groupCounter.length }})</div>
<ul>
<!-- <li class="all-group">全部素材组({{ groupCounter.length }})</li> -->
<li>
新车素材组(默认)
<el-popover placement="right" width="20" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
</li>
<li v-for="(item, index) in groupCounter" :key="index">
{{ item.groupName }}
<el-popover placement="left" width="400" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-s-tools"></i>
</el-popover>
</li>
</ul>
</div>
</el-col>
<el-col :span="19">
<div class="right">
<div class="groupTitle">新车素材组 (共{{ materialTableData.length }}条数据)</div>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange">
<!-- 素材内容 -->
<div slot="materialContent">
<!-- 素材内容为自定义文本 -->
<div v-if="materialTableData.materialType === '图文'">
<div>素材标题</div>
<div>放置图片</div>
</div>
<!-- 素材内容为PDF -->
<div v-if="materialTableData.materialType === 'PDF'">
<div>素材标题</div>
<div>PDF图片 pdf文件名.pdf</div>
</div>
<!-- 素材内容链接 -->
<div v-if="materialTableData.materialType === '自定义链接'">
<div>素材标题</div>
<div>
<div>图片</div>
<div>链接</div>
</div>
</div>
</div>
<!-- 状态 -->
<div slot="status"></div>
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button>
<el-button type="text">更多</el-button>
<!-- <el-button type="text" @click="handleForbid(scope)">禁用</el-button> -->
<!-- <el-button type="text" @click="handleDelete(scope)">删除</el-button> -->
</span>
</GLTable>
</div>
</el-col>
</el-row>
</div>
</div>
<AddMaterialGroupDia ref="addMaterialGroup" :dialogVisible="materialGroupDialog" @addMaterialGroup="addGroup"></AddMaterialGroupDia>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
export default {
name: 'materialList',
components: {
AddMaterialGroupDia
},
data() {
return {
url,
searchForm: {
applicationType: '',
materialType: '',
status: '',
materialName: ''
},
materialTableData: [
{
id: 123,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 124,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 6,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 125,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 112,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 126,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 30,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
}
],
materialGroupDialog: false,
// 素材组
groupCounter: [],
materialFormData1: [
{
label: '业务类型:',
name: 'applicationType',
type: 'select',
placeholder: '全部'
},
{
label: '素材类型:',
name: 'materialType',
type: 'select',
placeholder: '全部类型'
},
{
label: '状态:',
name: 'status',
type: 'select',
placeholder: '全部(不包括删除)'
}
],
materialFormData2: [
{
label: '素材名称:',
name: 'materialName',
type: 'input',
placeholder: '输入素材关键字'
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '素材内容',
prop: 'materialContent',
addHtml: 'materialContent'
},
{
label: '状态',
prop: 'status'
// addHtml: 'status'
},
{
label: '类型',
prop: 'materialType'
},
{
label: '发送次数',
prop: 'sendTimes',
sortable: true
},
{
label: '阅读人数',
prop: 'readPer',
sortable: true
},
{
label: '有效阅读人数',
prop: 'effect_readPer',
sortable: true,
width: '160px'
},
{
label: '更新时间',
prop: 'updateTime',
sortable: true
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableTotal: 4
}
},
methods: {
// 搜索
handleSearch() {
this.$refs.materialRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
applicationType: '',
materialType: '',
status: '',
materialName: ''
}
this.handleSearch()
},
// 素材详情
handleDetail(scope) {
console.log(scope.id)
// this.$router.push('/material/materialDetail/' + scope.id)
this.$router.push({
path: '/material/materialDetail',
query: scope.id
})
},
// 素材禁用
handleForbid() {
this.$confirm('禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '确定禁用',
cancelButtonText: '取消'
})
.then(() => {
this.$message({
type: 'info',
message: '禁用成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消禁用'
})
})
},
// 素材删除
handleDelete() {
this.$confirm('删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '确定删除',
cancelButtonText: '取消'
})
.then(() => {
this.$message({
type: 'info',
message: '删除成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
console.log(addOrEdit, value)
this.materialGroupDialog = true
this.$refs.addMaterialGroup.init(addOrEdit)
},
// 新增或编辑素材组
addGroup(value) {
this.groupCounter.push(value)
console.log(this.groupCounter, '-----')
},
// 素材组置顶
handleStick() {},
// 素材组删除
handleDeleteGroup() {},
// 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) {
console.log(addOrEdit, scope)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材')
}
addOrEdit != 1 && (params.id = scope.id)
this.$router.push({
path: '/material/addMaterial',
query: params
})
},
// 排序
sortChange(sort) {
console.log(sort)
// 获取字段名称和排序类型
var fieldName = sort.prop
var sortingType = sort.order
//如果字段名称为“创建时间”,将“创建时间”转换为时间戳,才能进行大小比较
// if(fieldName=="createTime"){
// this.tableData2.map(item => {
// item.createTime = this.$moment(item.createTime).valueOf()
// })
// 次数排序
if (sort.column.label === '发送次数') {
this.handleSort(sortingType, fieldName)
}
// 阅读人数排序
if (sort.column.label === '阅读人数') {
this.handleSort(sortingType, fieldName)
}
// 有效阅读人数排序
if (sort.column.label === '有效阅读人数') {
this.handleSort(sortingType, fieldName)
}
},
// 排序规则
handleSort(sortingType, fieldName) {
//按照降序排序
if (sortingType == 'descending') {
this.materialTableData = this.materialTableData.sort((a, b) => b[fieldName] - a[fieldName])
}
//按照升序排序
else {
this.materialTableData = this.materialTableData.sort((a, b) => a[fieldName] - b[fieldName])
}
}
}
}
</script>
<style lang="scss" scoped>
.search-form,
.left,
.right {
background-color: #fff;
}
.main-container {
height: 100%;
.top {
span {
margin-left: 16px;
font-size: 16px;
color: #5850FF;
}
}
}
ul {
li {
list-style: none;
}
}
.group-frame {
width: 72px;
height: 106px;
background: #FFFFFF;
ul {
margin: 0 8px;
padding-top: 1px;
text-align: center;
li {
margin: 15px 0;
}
}
}
.container {
margin-top: 10px;
height: 100%;
.search-form {
padding: 20px 68px 0 68px;
}
.tabelList {
margin-top: 10px;
height: 100%;
.left {
height: 100%;
position: relative;
border-right: 1px solid #E8E8EA;
.add-group {
margin: 20px 0 16px 16px;
}
.all-group {
font-size: 16px;
font-weight: 600;
margin: 0 0 19px 16px;
}
ul {
li {
margin: 0 0 22px 18px;
position: relative;
i {
font-size: 16px;
position: absolute;
right: 16px;
transform:rotate(90deg);
}
}
}
}
.right {
.groupTitle {
padding: 20px 0 16px 19px;
font-weight: 600;
}
.glsx-table {
margin: 0 20px;
}
}
}
}
</style>>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="materialDetail">
<span class="materialDetail-title top-title">素材详情</span>
<el-divider></el-divider>
<div class="matrial-detail">
<div class="matrial-detail-left">
<span class="materialDetail-title">我是素材名称我是素材名称</span>
<span class="matrial-detail-left-pre">预览</span>
</div>
<div @click="detailShowVisible" class="matrial-detail-unfold">
<span v-if="!detailVisible">
展开
<i class="el-icon-arrow-down"></i>
</span>
<span v-else>
收起
<i class="el-icon-arrow-up"></i>
</span>
</div>
</div>
<div v-show="detailVisible" class="materialDetail-desc">
<el-descriptions>
<el-descriptions-item label="素材地址:">kooriookwehrhdfvssdgdfhtykyuirami</el-descriptions-item>
<el-descriptions-item label="创建时间:">18100000000</el-descriptions-item>
<el-descriptions-item label="素材组:">苏州市</el-descriptions-item>
<el-descriptions-item label="素材类型:">苏州市</el-descriptions-item>
<el-descriptions-item label="业务类型:">苏州市</el-descriptions-item>
<el-descriptions-item label="动态通知:">苏州市</el-descriptions-item>
<el-descriptions-item label="行为标签:">苏州市</el-descriptions-item>
<el-descriptions-item label="素材内容:">
<div>这里显示素材内容</div>
</el-descriptions-item>
<el-descriptions-item label="分享设置:">
<div>这里显示分享内容</div>
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<div class="summarization">
<div class="countTime">
<span class="materialDetail-title top-title">数据概览</span>
</div>
<el-divider></el-divider>
<div>
<span>统计时间:</span>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size"></el-date-picker>
<el-button type="primary" :size="size">确定</el-button>
</div>
<div class="dataList">
<div>
<h5>总发送人数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总发送次数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总阅读人数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>总阅读次数</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
<div>
<h5>打开率</h5>
<p>44</p>
<h5>今日:**</h5>
</div>
</div>
<div class="detailTable">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="员工发送明细" name="staffSendDetail"></el-tab-pane>
<el-tab-pane label="阅读人员明细" name="readPerDetail"></el-tab-pane>
</el-tabs>
<staffSendDetail v-if="activeName == 'staffSendDetail'"></staffSendDetail>
<readPerDetail v-if="activeName == 'readPerDetail'"></readPerDetail>
</div>
</div>
</div>
</template>
<script>
import staffSendDetail from './components/staffSendDetail.vue'
import readPerDetail from './components/readPerDetail.vue'
export default {
name: 'materialDetail',
components: {
staffSendDetail,
readPerDetail
},
data() {
return {
activeName: 'staffSendDetail',
detailVisible: true
}
},
methods: {
detailShowVisible() {
this.detailVisible = !this.detailVisible
}
}
}
</script>
<style lang="scss" scoped>
.materialDetail,
.summarization {
background-color: #fff;
}
.matrial-detail {
display: flex;
justify-content: space-between;
margin: 33px 0 0 42px;
.matrial-detail-left {
padding-bottom: 16px;
&-pre {
margin-left: 10px;
font-size: 14px;
color: #5850FF;
font-weight: 600;
}
}
&-unfold {
margin-right: 23px;
font-size: 12px;
color: #5850FF;
}
}
.summarization {
margin-top: 20px;
.dataList {
margin: 16px 20px 20px 20px;
display: flex;
justify-content: space-around;
div {
width: 212px;
height: 128px;
background-color: #ccc;
margin-right: 10px;
}
:last-child {
margin-right: 0;
}
}
}
.materialDetail-title {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.top-title {
display: inline-block;
margin: 17px 0 0 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 编辑sop -->
<template> <template>
<div class="edit-gift marketing p-t-20 edit-box"> <div>
<div class="container edit-container"> <base-info v-show="activeName == 'baseInfo'" :routeInfo="routeInfo"></base-info>
<p class="edit-title">{{ title }}</p> <edit-event v-show="activeName == 'editEvent'"></edit-event>
<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> </div>
</template> </template>
<script> <script>
import baseInfo from './editSop/baseInfo'
import editEvent from './editSop/editEvent'
export default { export default {
name: 'editGift', name: 'editSop',
data() { data() {
return { return {
size: 'small', activeName: 'baseInfo',
title: '新增信息',
titleObj: {
add: '新增信息',
edit: '编辑信息'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
routeInfo: { routeInfo: {
// add-新增;edit-编辑;look-查看 // add-新增;edit-编辑;look-查看
addOrEdit: 'add', addOrEdit: 'add',
id: '' 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: { components: {
editForm: { baseInfo,
handler(val) { editEvent
this.editStatus = true
},
deep: true
}
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
console.log(this.routeInfo.addOrEdit)
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
}, },
methods: { 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()
}
}
}
} }
</script> </script>
<style scoped>
.marketing.edit-gift .select-merchant { <style lang="scss">
/* width: calc(98% - 140px); */
width: 98%;
}
</style> </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>
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容" clearable @keydown.enter.native="handleSearch"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
{{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
<!-- <el-radio :label="itm">{{ itm.name.length > 4 ? itm.name.slice(0, 3) + '...' : itm.name }}</el-radio> -->
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-radio-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'activityModel',
data() {
return {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRets: [
// {
// labelGroup: { id: '109', name: '湖口123' },
// labelList: [
// { id: '372', name: '12345678' },
// { id: '371', name: '7654321' },
// { id: '370', name: '1234567' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// },
// {
// labelGroup: { id: '65', name: '自店标签111' },
// labelList: [
// { id: '179', name: '标签44' },
// { id: '178', name: '标签33' },
// { id: '176', name: '标签1112' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// }
]
}
},
watch: {
labelTreeRets: {
handler() {
this.selectNum = 0
this.labelTreeRets.forEach(item => {
if (item.tagChecked) {
this.selectNum++
}
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
console.log(selectItem, '-----')
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
// shopId: '44210934',
labelGroupName: this.labelGroupName,
// labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
// edition: 4
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
console.log(res.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelId = item.labelList[0].id
let index = tag.labelList.findIndex(iem => iem.id == labelId)
console.log(index)
// tag.tagChecked = item.tagChecked
tag.tagChecked = tag.labelList[index]
}
})
})
console.log(this.labelTreeRets)
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
}
})
},
remove(item, idx) {
item.tagChecked = null
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
handleReset() {
this.labelGroupName = ''
this.querylabeltree()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
// ::v-deep .el-tag{
// color: red !important;
// }
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 26px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-radio {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner{
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
}
}
}
.checkbox-group-box {
overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
}
.tag-selected-box {
min-height: 200px;
}
</style>
<template> <template>
<div class="marketing"> <div class="sop-overview marketing p-t-20 edit-box">
<div class="container"> <div class="container edit-container m-b-20">
<div> <p class="edit-title">营销SOP</p>
<p>营销SOP</p> <div class="sop-box">
<p>锁定目标客户群,设置触发时间、场景事件、策略内容和触点,自动触发场景营销SOP推送,完成保养提醒、事故车送修等智能线索推送、新用户培育、客户关怀、激活沉默客户、转化复购等</p> <p class="box-txt">锁定目标客户群,设置触发时间、场景事件、策略内容和触点,自动触发场景营销SOP推送,完成保养提醒、事故车送修等智能线索推送、新用户培育、客户关怀、激活沉默客户、转化复购等。</p>
<div class="flex-center">
<p class="step-circle">1</p>
<p class="step-txt">创建sop</p>
<p class="step-line"></p>
<p class="step-circle">2</p>
<p class="step-txt">添加推送客户</p>
<p class="step-line"></p>
<p class="step-circle">3</p>
<p class="step-txt">设置推送内容及时间</p>
<p class="step-line"></p>
<p class="step-circle">4</p>
<p class="step-txt">系统定时自动推送/任务下发</p>
</div> </div>
</div>
</div>
<div class="container edit-container m-b-20">
<div class="edit-title flex p-r-20">
<p>SOP监测</p>
<div> <div>
<div class="flex"> <GLButton :size="size" type="default" class="default-blue-btn" fn="创建sop" @click="handleEdit('add')">创建sop</GLButton>
<p>sop监测</p> <GLButton :size="size" type="default" class="default-blue-btn" fn="管理sop" @click="handleJump('sopList')">管理全部sop</GLButton>
<div> </div>
<GLButton :size="size" type="primary" fn="创建sop" class="el-icon-plus" @click="handleEdit('add')">创建sop</GLButton> </div>
<GLButton :size="size" type="primary" fn="管理sop" @click="handleJump('sopList')">管理全部sop</GLButton> <div class="sop-box" :style="{ 'padding-bottom': sopList.length ? '2px' : '12px' }">
<GLButton :size="size" type="primary" fn="分析sop" @click="handleJump('sopAnalysisList')">sop分析</GLButton> <div class="chart-box sop-flex">
<GLButton :size="size" type="primary" fn="结束sop" @click="handleEnd({})">结束</GLButton> <div class="chart-item" v-for="item in sopList" :key="item.id">
<GLButton :size="size" type="primary" fn="编辑sop" @click="handleEdit('edit')">编辑sop</GLButton> <p>{{ item.sopName }}</p>
<div :id="'sopPie' + item.id" class="chart-pie"></div>
<p>2021.10.28-2022.10.28</p>
<div class="sop-btns">
<GLButton class="btn-item" :size="size" type="primary" fn="分析sop" @click="handleJump('sopAnalysisList', item)">sop分析</GLButton>
<GLButton class="btn-item" :size="size" type="primary" fn="编辑sop" @click="handleEdit('edit', item)">编辑</GLButton>
<GLButton class="btn-item" :size="size" type="primary" fn="结束sop" @click="handleEnd(item)">结束</GLButton>
</div>
</div> </div>
</div> </div>
<div>图</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'
export default { export default {
name: 'sopIndex', name: 'sopIndex',
data() { data() {
return {} return {
size: 'small',
// 环形图配置
pieOption: {
tooltip: {
trigger: 'item'
},
title: {
text: '0%',
left: 'center',
top: '40%',
textStyle: {
color: '#5850ff',
fontSize: 16,
align: 'center'
}
},
color: ['#7A80FF', '#F0F0F0'],
series: [
{
name: '',
type: 'pie',
radius: ['78%', '90%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false
}
},
labelLine: {
show: false
},
data: []
}
]
},
sopList: [
{
id: '1',
sopName: 'sop的名称1',
// 1-未开始;2-进行中;3-已结束
sopStatus: '2',
sopStatistics: {
finishEventCount: 10,
eventCount: 100
}
},
{
id: '2',
sopName: 'sop的名称2',
sopStatus: '2',
sopStatistics: {
finishEventCount: 22,
eventCount: 100
}
},
{
id: '3',
sopName: 'sop的名称3',
sopStatus: '2',
sopStatistics: {
finishEventCount: 100,
eventCount: 100
}
},
{
id: '4',
sopName: 'sop的名称4',
sopStatus: '2',
sopStatistics: {
finishEventCount: 59,
eventCount: 100
}
},
{
id: '5',
sopName: 'sop的名称5',
sopStatus: '2',
sopStatistics: {
finishEventCount: 13,
eventCount: 100
}
}
]
}
}, },
mounted() { }, mounted() {
this.dealListData()
this.drawPie()
},
methods: { methods: {
handleJump(path) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: '/sop/' + path path: '/sop/' + path,
query: row ? { id: row.id } : ''
}) })
}, },
...@@ -60,6 +176,37 @@ export default { ...@@ -60,6 +176,37 @@ export default {
}) })
}, },
// 数据处理
dealListData() {
this.sopList.forEach(item => {
item.completedPercent = Math.round((item.sopStatistics.finishEventCount / item.sopStatistics.eventCount) * 100).toFixed(0)
})
},
drawPie() {
this.sopList.forEach(item => {
let chartDom = document.getElementById('sopPie' + item.id)
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 = [
{
value: item.sopStatistics.finishEventCount,
name: '已触发的营销事件'
},
{
value: item.sopStatistics.eventCount - item.sopStatistics.finishEventCount,
name: '总营销事件'
}
]
option && myChart.setOption(option)
})
},
// 结束 // 结束
handleEnd(row) { handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'zoneList', 'deleteZoneApi', { id: row.id }) this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'zoneList', 'deleteZoneApi', { id: row.id })
...@@ -81,5 +228,82 @@ export default { ...@@ -81,5 +228,82 @@ export default {
} }
</script> </script>
<style> <style lang="scss">
.sop-overview {
.sop-box {
padding: 32px 20px 12px;
.box-txt {
line-height: 24px;
margin-bottom: 28px;
}
.step-circle {
width: 32px;
height: 32px;
line-height: 32px;
text-align: center;
color: #5058ff;
background: rgba(80, 88, 255, 0.1);
border: 1px solid #5058ff;
border-radius: 32px;
margin-right: 8px;
flex: 0 0 auto;
}
.step-line {
width: 120px;
height: 1px;
background: #5850ff;
margin: 0 20px;
}
.sop-flex {
display: flex;
flex-wrap: wrap;
}
.chart-box {
.chart-item {
position: relative;
box-sizing: border-box;
width: calc((100% - 68px) / 4);
min-width: 270px;
height: 184px;
text-align: center;
background: #ffffff;
border: 1px solid #eaeaea;
padding: 16px;
margin: 0 20px 20px 0;
.chart-pie {
height: 104px;
margin: 8px 0;
}
.sop-btns {
display: none;
box-sizing: border-box;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background: #f4f5fa;
padding: 28px 0;
.btn-item {
display: block;
width: 89px;
margin: 0 auto;
}
.btn-item:nth-child(2) {
margin: 16px auto;
}
}
}
.chart-item:nth-child(4n + 0) {
margin-right: 0px;
}
.chart-item:hover .sop-btns {
display: block;
}
}
}
.p-r-20 {
padding-right: 20px;
}
}
</style> </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 sop-analysis staff-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/task-total.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/task.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>
<!-- 完成率分析-->
<template>
<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="primary" @click="handleSearch">查询</el-button>
</span> -->
</glsx-combi-form>
</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 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>
</div>
</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: {
name: '',
staffName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '营销事件',
name: 'name',
type: 'select',
width: '415px'
}
],
// 表格
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()
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() {
//接收到的数据为空
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>
<!-- sop管理 --> <!-- 营销sop -->
<template> <template>
<div class="marketing p-t-20"> <div class="sop-analysis">
<div class="m-b-20"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建sop</el-button> <el-tab-pane label="完成率分析" name="compleList">
<!-- <GLButton :size="size" type="primary" fn="新建sop" class="el-icon-plus" @click="handleEdit(1)">新建sop</GLButton> --> <complete-list v-if="activeName == 'compleList'"></complete-list>
</div> </el-tab-pane>
<div class="container"> <el-tab-pane label="触达率分析" name="touchList">
<div> <touch-list v-if="activeName == 'touchList'"></touch-list>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> </el-tab-pane>
<span slot="footer" class="footer-btns"> <el-tab-pane label="员工完成率分析" name="staffList">
<el-button :size="size" type="default" @click="handleReset">重置</el-button> <staff-list v-if="activeName == 'staffList'"></staff-list>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> </el-tab-pane>
</span> </el-tabs>
</glsx-combi-form> <el-button :size="size" class="sop-back-btn" type="primary" @click="handleBack">返回</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :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(2, scope.scope)">编辑</GLButton>
<el-button type="text" fn="删除" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import completeList from './sopAnalysis/completeList.vue'
import url from "@/assets/empty.png" import touchList from './sopAnalysis/touchList.vue'
import staffList from './sopAnalysis/staffList.vue'
export default { export default {
name: 'sopAnalysisList', name: 'gitfBag',
data() { data() {
return { return {
size: 'small', activeName: 'compleList',
url: url, size: 'small'
searchForm: {
zoneName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: 'sop名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: 'sop名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
} }
]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
} components: {
completeList,
touchList,
staffList
}, },
mounted() { }, mounted() { },
methods: { methods: {
getParams() { handleTabClick() { },
var params = JSON.parse(JSON.stringify(this.searchForm)) handleBack() {
params.zoneType = '2' //sop类型(1发现频道,2商城sop)
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()
delete this.tableSearchForm.createDate
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()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '新建sop' : '编辑sop')
}
addOrEdit != 1 && (params.id = row.id)
this.$router.push({ this.$router.push({
path: '/zoneList/editZone', path: '/sop/index'
query: params
}) })
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该sop?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: '',
createDate: []
}
this.handleSearch()
} }
} }
} }
</script> </script>
<style scoped></style> <style>
.sop-analysis {
position: relative;
}
.sop-analysis .el-tabs__header {
margin-bottom: 20px;
}
.sop-analysis .el-tabs__nav-wrap:after {
opacity: 0;
}
.sop-analysis .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px;
line-height: 36px;
}
.sop-analysis .el-tabs__item:hover,
.sop-analysis .el-tabs__item.is-active {
color: #5f5efb;
}
.sop-analysis .sop-back-btn {
position: absolute;
top: 0;
right: 0;
}
</style>
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<template> <template>
<div class="marketing p-t-20"> <div class="marketing p-t-20">
<div class="m-b-20"> <div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建sop</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit('add')">新建sop</el-button>
<!-- <GLButton :size="size" type="primary" fn="新建sop" class="el-icon-plus" @click="handleEdit(1)">新建sop</GLButton> --> <!-- <GLButton :size="size" type="primary" fn="新建sop" class="el-icon-plus" @click="handleEdit(1)">新建sop</GLButton> -->
</div> </div>
<div class="container"> <div class="container">
<div> <div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <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="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span> </span>
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton> <el-button type="text" @click="handleJump('sopAnalysisList', scope.scope)">sop分析</el-button>
<el-button type="text" fn="删除" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleEnd(scope.scope)">结束</el-button>
<el-button type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -38,9 +40,9 @@ export default { ...@@ -38,9 +40,9 @@ export default {
url: url, url: url,
searchForm: { searchForm: {
zoneName: '', zoneName: '',
createDate: [] status: []
}, },
tableSearchForm: {}, // tableSearchForm: {},
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
...@@ -50,25 +52,43 @@ export default { ...@@ -50,25 +52,43 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '创建日期', label: '营销状态',
name: 'createDate', name: 'status',
type: 'datePicker', type: 'select'
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
} }
], ],
// 表格 // 表格
getListApi: this.$apis.zoneList.getZoneListApi, getListApi: this.$apis.proManage.getListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: 'sop名称', label: 'sop名称',
prop: 'zoneName' prop: 'goodsName'
}, },
{ {
label: '创建日期', label: '营销时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '营销状态',
prop: 'goodsName'
},
{
label: '完成度',
prop: 'goodsName'
},
{
label: '创建人',
prop: 'goodsName'
},
{
label: '创建时间',
prop: 'createdDate', prop: 'createdDate',
width: '180', width: '180',
formatter: cellValue => { formatter: cellValue => {
...@@ -77,30 +97,34 @@ export default { ...@@ -77,30 +97,34 @@ export default {
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
} }
}, },
mounted() { }, mounted() { },
methods: { methods: {
getParams() { handleJump(path) {
var params = JSON.parse(JSON.stringify(this.searchForm)) this.$router.push({
params.zoneType = '2' //sop类型(1发现频道,2商城sop) path: '/sop/' + path
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()
delete this.tableSearchForm.createDate
resolve()
}) })
}, },
// 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()
// delete this.tableSearchForm.createDate
// resolve()
// })
// },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
...@@ -128,32 +152,37 @@ export default { ...@@ -128,32 +152,37 @@ export default {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id) // addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '新建sop' : '编辑sop') $title: encodeURI(addOrEdit == 'add' ? '新建sop' : '编辑sop')
} }
addOrEdit != 1 && (params.id = row.id) addOrEdit != 'add' && (params.id = row.id)
this.$router.push({ this.$router.push({
path: '/zoneList/editZone', path: '/sop/editSop',
query: params query: params
}) })
}, },
// 结束
handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
handleDelete(row) { handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该sop?', 'zoneList', 'deleteZoneApi', { id: row.id }) this.secondConfirm('删除', 'sop删除后,不可恢复。是否确定删除?', 'proManage', 'deleteZoneApi', { id: row.id })
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun() this.$refs.sopListRef.data.length ? (this.$refs.sopListRef.tableHeightValues = '') : this.$refs.sopListRef.setTableHeightFun()
}, },
handleSearch() { handleSearch() {
this.$refs.zoneRef.refreshTable() this.$refs.sopListRef.refreshTable()
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
zoneName: '', zoneName: '',
createDate: [] status: []
} }
this.handleSearch() this.handleSearch()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!