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",
......
...@@ -267,8 +267,14 @@ html { ...@@ -267,8 +267,14 @@ html {
} }
.marketing .flex-wrap { .marketing .flex-wrap {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
}
.marketing .flex-center {
display: flex;
justify-content: center;
align-items: center;
} }
.marketing .flex-grow { .marketing .flex-grow {
......
...@@ -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>
<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>
<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> <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>
<div class="flex"> <div class="container edit-container m-b-20">
<p>sop监测</p> <div class="edit-title flex p-r-20">
<div> <p>SOP监测</p>
<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> <GLButton :size="size" type="default" class="default-blue-btn" fn="创建sop" @click="handleEdit('add')">创建sop</GLButton>
<GLButton :size="size" type="primary" fn="分析sop" @click="handleJump('sopAnalysisList')">sop分析</GLButton> <GLButton :size="size" type="default" class="default-blue-btn" fn="管理sop" @click="handleJump('sopList')">管理全部sop</GLButton>
<GLButton :size="size" type="primary" fn="结束sop" @click="handleEnd({})">结束</GLButton> </div>
<GLButton :size="size" type="primary" fn="编辑sop" @click="handleEdit('edit')">编辑sop</GLButton> </div>
<div class="sop-box" :style="{ 'padding-bottom': sopList.length ? '2px' : '12px' }">
<div class="chart-box sop-flex">
<div class="chart-item" v-for="item in sopList" :key="item.id">
<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!