Commit 56bc67f3 by xuyl

更新代码

1 parent e7f00739
......@@ -72,7 +72,7 @@ export function customerClusterListExport(params) {
export function customerClusterListShow(params) {
params.method = 'scrm.api.datahub.crowdgroup.queryCrowdGroupList'
return http3({
// https://scrm.dev.glsx.com.cn
// http://scrm.dev.glsx.com.cn
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
......@@ -83,10 +83,10 @@ export function customerClusterListShow(params) {
// 通过分群Id查询人群列表详情请求
export function marketingPeopleListShow(params) {
params.method = 'scrm.api.datahub.crowdgroup.queryCrowdListByCrowdGroupId'
params.method = 'scrm.api.sop.crowd.listWithSop'
return http3({
// http://192.168.3.226:9636
url: '/rop-scrm-datahub/router',
// http://192.168.3.226:9636
url: '/rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
......@@ -109,7 +109,7 @@ export function searchCrowdIdByCrowdname(params) {
const deleteSopEventApi = params => {
params.method = 'scrm.api.sop.sopInfo.delete'
return http({
url: 'rop-scrm-sop/router',
url: '/rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
......@@ -121,7 +121,7 @@ const deleteSopEventApi = params => {
const endSopEventApi = params => {
params.method = 'scrm.api.sop.sopInfo.updateEndStatus'
return http({
url: 'rop-scrm-sop/router',
url: '/rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
......@@ -129,8 +129,8 @@ const endSopEventApi = params => {
})
}
const getSopInfoListApi = params => {
params.method = 'scrm.api.sop.sopInfo.listWithPage'
export function getSopInfoListApi(params) {
params.method = 'scrm.api.sop.crowd.sopList'
return http({
url: '/rop-scrm-sop/router',
method: 'POST',
......@@ -139,4 +139,4 @@ const getSopInfoListApi = params => {
})
}
export default { deleteSopEventApi, endSopEventApi, getSopInfoListApi }
\ No newline at end of file
export default { endSopEventApi, deleteSopEventApi }
\ No newline at end of file
export function debounce(fn, delay, triggerNow) {
var t = null
console.log('ceshi')
var debounced = function() {
var _self = this,
args = arguments
if (t) {
clearTimeout(t)
}
if (triggerNow) {
var exec = !t
var t = null
console.log('ceshi')
var debounced = function() {
var _self = this,
args = arguments
if (t) {
clearTimeout(t)
}
if (triggerNow) {
var exec = !t
t = setTimeout(function() {
t = null
}, delay)
t = setTimeout(function() {
t = null
}, delay)
if (exec) {
// 初次进来
fn.apply(_self, args)
}
} else {
t = setTimeout(function() {
fn.apply(_self, args)
}, delay)
if (exec) {
// 初次进来
fn.apply(_self, args)
}
} else {
t = setTimeout(function() {
fn.apply(_self, args)
}, delay)
}
}
}
debounced.remove = function() {
clearTimeout(t)
t = null
}
debounced.remove = function() {
clearTimeout(t)
t = null
}
return debounced
return debounced
}
//格式化日期
export const formatDate = (date, fmt) => {
if (!date) {
date = new Date()
}
export const formatDate = (date, fmt = '-') => {
//shijianchuo是整数,否则要parseInt转换
var time = new Date(date)
var y = time.getFullYear()
var m = time.getMonth() + 1
var d = time.getDate()
var h = time.getHours()
var mm = time.getMinutes()
var s = time.getSeconds()
return y + fmt + add0(m) + fmt + add0(d) + ' ' + add0(h) + ':' + add0(mm)
}
let o = {
'M+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds(), //毫秒  1-3 位  只能一位占位符
'U+': date.getMilliseconds() //毫秒   可以1-3位占位符
}
fmt = fmt || 'yyyy-MM-dd hh:mm'
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
for (let k in o) if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
return fmt
function add0(m) {
return m < 10 ? '0' + m : m
}
//正则表示式是干什么的? 字符串匹配利器(难,规则多)
export function formatDate2(date, fmt) {
//1.获取年份
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
//2.获取
//M+ ->正则表达式一个规则
//
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str))
//1.获取年份
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
//2.获取
//M+ ->正则表达式一个规则
//
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
}
return fmt
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str))
}
}
return fmt
}
//填补左边的零(一般返回字符串最后两位)
function padLeftZero(str) {
return ('00' + str).substr(str.length)
}
return ('00' + str).substr(str.length)
}
\ No newline at end of file
......@@ -8,18 +8,17 @@
<el-form-item label="分群描述" size="small">
<el-input v-model="ruleForm.crowdGroupDesc" placeholder="请输入分群描述" maxlength="100"></el-input>
</el-form-item>
<!-- <el-form-item label="概览是否展示" size="small">
<el-form-item label="概览是否展示" size="small">
<el-radio-group v-model="ruleForm.isDisplay">
<el-radio label="1">是</el-radio>
<el-radio label="2">否</el-radio>
<el-radio :label="1">是</el-radio>
<el-radio :label="2">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="选择展示位" size="small" v-show="ruleForm.expand == 1">
<el-select v-model="ruleForm.expandNum" placeholder="请选择">
<el-form-item label="选择展示位" size="small" v-show="ruleForm.isDisplay == 1">
<el-select v-model="ruleForm.displayLoc" placeholder="请选择">
<el-option v-for="item in 12" :key="item" :label="`${item}号展示位`" :value="item"></el-option>
</el-select>
</el-form-item> -->
</el-form-item>
<el-form-item label="选择人群" size="small">
<div class="group-tree-container">
<div class="group-tree-panel" :style="{ height: heightBox + 'px' }">
......@@ -206,8 +205,10 @@ export default {
crowdGroup = 'addCrowdGroup'
}
this.$apis.crowdManage[crowdGroup](params).then(res => {
this.groupVisible = false
this.$parent.searchTable()
if (res) {
this.groupVisible = false
this.$parent.searchTable()
}
})
}
})
......@@ -217,9 +218,9 @@ export default {
this.leftSelectNum = 0
this.crowdUnitList = this.$common.utils.deepClone(this.crowdUnitListReset)
this.ruleForm = {
isDisplay: 2
isDisplay: 1,
displayLoc: 1
}
if (row) {
this.ruleForm.crowdGroupId = row.crowdGroupId
this.dialogTitle = '编辑分群'
......@@ -230,11 +231,13 @@ export default {
this.groupVisible = true
},
queryCrowdGroupDetailsByCrowdGroupId(row) {
const { crowdGroupName, crowdGroupDesc, crowdGroupId, crowdUnitList } = row
const { crowdGroupName, crowdGroupDesc, crowdGroupId, crowdUnitList, isDisplay, displayLoc } = row
this.ruleForm = {
crowdGroupName,
crowdGroupDesc,
crowdGroupId
crowdGroupId,
displayLoc,
isDisplay
}
const arr1 = [],
arr2 = []
......
......@@ -2,16 +2,12 @@
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<GLTable v-loading="loading" :hasNum="true" @setTableHeightEvent="setTableHeightEvent" @setTableFinishFun="setTableFinishFun" ref="marketingPlan" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams">
<GLTable :hasNum="true" @setTableFinishFun="setTableFinishFun" :beforeSearchFn="beforeSearchFn" ref="marketingPlan" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :tableParams="tableParams">
<template slot="options" slot-scope="scope">
<el-button class="blue-text" type="text" @click="goSOPAnalysis(scope.scope.id)">SOP分析</el-button>
<el-button class="blue-text" type="text" @click="goSOPEdit(scope.scope.id)">编辑</el-button>
<el-button class="blue-text" type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button class="blue-text" type="text" @click="handleEnd(scope.scope)">结束</el-button>
<!-- <el-button v-if="scope.scope.sopStatus != 1" type="text" @click="handleJump('sopAnalysisList', scope.scope)">SOP分析</el-button>
<el-button v-if="scope.scope.sopStatus != 1" type="text" @click="handleJump(scope.scope.id)">SOP分析</el-button>
<el-button v-if="scope.scope.sopStatus == 2" type="text" @click="handleEnd(scope.scope)">结束</el-button>
<el-button v-if="scope.scope.sopStatus != 3" type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.sopStatus == 1" type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<el-button v-if="scope.scope.sopStatus != 3" type="text" @click="handleEdit(scope.scope.id)">编辑</el-button>
<el-button v-if="scope.scope.sopStatus == 1" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
......@@ -19,21 +15,25 @@
</template>
<script>
import { getTableList } from '@/api/modules/clientManage'
import { getSopInfoListApi } from '@/api/modules/clientDataOverview'
export default {
props: ['crowdGroupId'],
data() {
return {
searchForm: {},
searchForm: {
crowdGroupId: this.crowdGroupId
},
searchFormList: [
{
type: 'input',
inputType: 'text',
// name: 'keyword',
name: 'sopName',
label: '人群名称'
},
{
type: 'select',
// name: 'type',
name: 'sopStatus',
label: '营销状态',
optionLabel: 'label',
optionId: 'value',
......@@ -41,55 +41,87 @@ export default {
{
label: '全部',
value: ''
},
{
label: '未开始',
value: '1'
},
{
label: '进行中',
value: '2'
},
{
label: '已结束',
value: '3'
}
],
placeholder: '请选择'
}
],
getListApi: this.$apis.clientDataOverview.getSopInfoListApi,
baseData: {
sopStatusList: [
{
confId: 1,
confName: '未开始'
},
{
confId: 2,
confName: '进行中'
},
{
confId: 3,
confName: '已结束'
}
]
},
getListApi: getSopInfoListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
listName: 'list',
tableColumns: [
{
label: '人群名称',
prop: 'orderNo'
prop: 'crowdName'
// line: 1,
// width: 220
},
{
label: 'SOP名称',
prop: 'name'
prop: 'sopName'
// width: 240,
// line: 1
},
{
label: '营销时间',
prop: 'phone'
prop: 'startDate',
width: 220,
line: 1
},
{
label: '完成度',
prop: 'dsdasd'
label: '营销状态',
prop: 'sopStatus',
formatter: cellValue => {
return this.baseData.sopStatusList.map(item => item.confId).includes(cellValue.sopStatus) ? this.baseData.sopStatusList.find(item => item.confId == cellValue.sopStatus).confName : '-'
}
},
{
label: '营销状态',
prop: 'dsdasds'
label: '完成度',
prop: 'sopStatistics',
formatter: cellValue => {
return cellValue.sopStatistics ? Math.round((cellValue.sopStatistics.finishEventCount / cellValue.sopStatistics.eventCount) * 100).toFixed(0) + '%' : '-'
}
},
{
label: '操作',
prop: 'options',
addHtml: 'options'
addHtml: 'options',
width: 180
}
]
}
}
},
mounted() {
//没数据的时候要算高度
setTimeout(() => {
if (!this.$refs.marketingPlan.data.length) {
this.loading = true
this.$refs.marketingPlan.setTableHeightFun()
this.loading = false
}
}, 200)
},
mounted() {},
methods: {
// 结束
handleEnd(row) {
......@@ -121,29 +153,25 @@ export default {
})
},
// 跳转SOP分析
goSOPAnalysis(id) {
this.$history.push(`/marketing/sop/sopAnalysisList?fromPage=${encodeURI('/custom/clientDataOverview/marketingPeople?selectTab=second')}&id=${id}`)
handleJump(id) {
let query = JSON.stringify({
crowdId: this.crowdGroupId,
selectTab: 'second'
})
this.$history.push(`/marketing/sop/sopAnalysisList?fromPage=${encodeURI(`/custom/clientDataOverview/marketingPeople?crowQuery=${query}`)}&id=${id}`)
},
// 跳转SOP编辑页面
// goSOPEdit(id) {
// var params = {
// addOrEdit: 'edit',
// fromPage: '/custom/clientDataOverview/marketingPeople?selectTab=second',
// $title: encodeURI('编辑SOP')
// }
// // addOrEdit != 'add' && (params.id = row.id)
// this.$router.push({
// path: '/sop/editSop',
// query: params
// })
// },
// 跳转到营销SOP
goSOPEdit() {
let marketQuery
handleEdit(info) {
console.log(info)
let marketQuery = {
crowdDesc: info.crowdDesc,
crowdId: info.crowdId,
crowdName: info.crowdName,
total: info.customerCount
}
var params = {
addOrEdit: 'edit',
fromPage: `/custom/clientDataOverview/marketingPeople?crowdId=${this.crowdGroupId}&selectTab=2`,
fromPage: `/custom/clientDataOverview/marketingPeople?crowdId=${this.crowdGroupId}&selectTab=second`,
$title: encodeURI('编辑SOP'),
info: {
// 人群
......@@ -158,26 +186,7 @@ export default {
path: 'marketing/sop/editSop'
})
},
// 确认删除或结束
confirm(type) {
this.$confirm(`是否确认${type == 'delete' ? '删除' : '结束'}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$message({
type: 'success',
message: '操作成功!'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
setTableFinishFun() {
this.$refs.marketingPlan.data.length ? (this.$refs.marketingPlan.tableHeightValues = '') : this.$refs.marketingPlan.setTableHeightFun()
},
......@@ -192,8 +201,7 @@ export default {
//重置表格
resetTable() {
this.searchForm = {
status: '',
type: ''
crowdGroupId: this.crowdGroupId
}
this.$refs.marketingPlan.refreshTable()
}
......
......@@ -22,15 +22,15 @@
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> -->
<el-button type="text" @click="goDetail(scope.scope.id)" class="blue-text">
<el-button type="text" @click="goDetail(scope.scope.crowdGroupId)" class="blue-text">
查看客户
</el-button>
<el-button type="text" @click="handleAdd(scope.scope)" class="blue-text">
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.scope)" class="blue-text">
<!-- <el-button type="text" @click="handleDelete(scope.scope)" class="blue-text">
删除
</el-button>
</el-button> -->
<!-- <GLButton @click="goDetail(scope.scope.id, scope.scope.custGroupName)" fn="客户群详情" type="text">详情</GLButton> -->
</template>
</GLTable>
......@@ -247,7 +247,7 @@ export default {
})
},
goDetail(id) {
this.$router.push(`/clientDataOverview/marketingPeople?crowdId=${id}`)
this.$router.push(`/clientDataOverview/marketingPeople?crowdId=${id}`)
}
}
}
......
......@@ -14,7 +14,10 @@
</map>
</div>
<div class="topmsg">
<span class="normalTitle">客户分层</span>
<span class="normalTitle">
客户分层
<span>| 数据统计截止时间:{{ updateTime }}</span>
</span>
<div style="display: flex">
<div class="leftPieEcharts">
<div class="leftIntro">
......@@ -227,23 +230,14 @@
<div class="settiongBox">
<span class="normalTitle">
客户分群
<span class="setting" @click="goToGrouping()">设置</span>
<span>| 数据统计截止时间:{{ updateTime }}</span>
</span>
<div class="set">
<span v-if="customerSegmentation && customerSegmentation.length > 4 && !closeFlag" @click="expandClick('expand')">
展开
<i class="el-icon-arrow-down color-58"></i>
</span>
<span v-if="closeFlag" @click="expandClick('close')">
收起
<i class="el-icon-arrow-up color-58"></i>
</span>
</div>
<span class="setting" @click="goToGrouping()">设置</span>
</div>
<div class="itembox">
<template v-for="(item, index) in customerSegmentation">
<!-- fn="人群客户列表" mode="div" -->
<div class="item" @click="goToGroupOperating(item.crowdGroupId)" :key="index" v-if="index < displayNum">
<div class="item" @click="goToGroupOperating(item.crowdGroupId)" :key="index" v-if="index < displayNum">
<div class="itemTitle">
<span class="itemName">{{ item.crowdGroupName }}</span>
<el-popover placement="top" trigger="hover" :content="item.crowdGroupDesc">
......@@ -276,10 +270,24 @@
</div>
</template>
</div>
<div class="set">
<span v-if="customerSegmentation && customerSegmentation.length > 4 && !closeFlag" @click="expandClick('expand')">
展开
<i class="el-icon-arrow-down color-58"></i>
</span>
<span v-if="closeFlag" @click="expandClick('close')">
收起
<i class="el-icon-arrow-up color-58"></i>
</span>
</div>
</div>
<!-- <h3 class="pageSubTitle">客户增长趋势</h3> -->
<div class="bottommsg">
<span class="normalTitle">客户增长趋势</span>
<span class="normalTitle">
客户增长趋势
<span>| 数据统计截止时间:{{ updateTime }}</span>
</span>
<no-data :type="'hasIconText'" v-if="!isShowBarMap"></no-data>
<template v-if="isShowBarMap">
<span class="timeDuring">{{ allMapList[0].dateTime }}~{{ allMapList[allMapList.length - 1].dateTime }}</span>
......@@ -328,6 +336,7 @@ import pieEchart from '@/components/echarts/pieEchart'
// import pieEchartCopy from '@/components/echarts/pieEchartCopy'
import multipleEchart from '@/components/echarts/multipleEchart'
import noData from '@/components/noData/noData'
import { formatDate } from '@/utils'
export default {
name: 'clientDataOverview',
components: {
......@@ -499,6 +508,7 @@ export default {
}
customerClusterListShow(param).then(res => {
this.customerSegmentation = res.crowdGroupUnitList
this.updateTime = formatDate(res.updateTime)
console.log(this.customerSegmentation)
})
},
......@@ -712,7 +722,15 @@ export default {
.person-text {
font-size: 16px !important;
}
.normalTitle {
span {
margin-left: 6px;
font-size: 14px;
color: #666666;
letter-spacing: 0;
font-weight: 400;
}
}
.modalLayer {
position: fixed;
z-index: 99;
......@@ -1135,21 +1153,22 @@ export default {
border-bottom: 1px solid #e5e5e5;
.normalTitle {
border-bottom: none;
.setting {
font-size: 16px;
color: #5850ff;
margin-right: 20px;
font-weight: 500;
}
}
.set {
.setting {
font-size: 16px;
color: #5850ff;
margin-right: 20px;
font-weight: 500;
}
}
.set {
text-align: center;
font-size: 16px;
color: #5850ff;
margin-bottom: 20px;
}
.itembox {
margin: 20px;
margin: 20px 20px 0 20px;
// display: flex;
// justify-content: space-between;
display: grid;
......
......@@ -32,7 +32,7 @@
<span>人</span>
</p>
<p class="peopledesc">{{ item.crowdDesc }}</p>
<el-button class="createSOP" @click.stop="createMarketSOP(item)" :disabled="item.type">创建营销SOP</el-button>
<el-button :class="['createSOP', { isDisableSOP: item.sop == 'Y' }]" @click.stop="createMarketSOP(item)" :disabled="item.sop == 'Y' ? true : false">创建营销SOP</el-button>
</div>
</template>
</div>
......@@ -50,7 +50,7 @@
<span>人</span>
</p>
<p class="peopledesc">{{ item.crowdDesc }}</p>
<el-button class="createSOP" @click.stop="createMarketSOP(item)" :disabled="item.type">创建营销SOP</el-button>
<el-button :class="['createSOP', { isDisableSOP: item.sop == 'Y' }]" @click.stop="createMarketSOP(item)" :disabled="item.sop == 'Y' ? true : false">创建营销SOP</el-button>
</div>
</div>
</div>
......@@ -98,7 +98,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="营销计划" name="second">
<template v-if="activeName == 'second'"><marketing-plan></marketing-plan></template>
<template v-if="activeName == 'second'"><marketing-plan :crowdGroupId="crowdGroupId"></marketing-plan></template>
</el-tab-pane>
</el-tabs>
</div>
......@@ -299,6 +299,12 @@ export default {
if (this.queryTab) {
this.activeName = this.queryTab == 'first' ? 'first' : 'second'
}
// 判断分析SOP回来的页面
if (this.$route.query.crowQuery) {
let crowInfo = JSON.parse(this.$route.query.crowQuery)
this.crowdGroupId = crowInfo.crowdId
this.activeName = crowInfo.selectTab == 'first' ? 'first' : 'second'
}
this.getStaffList()
},
mounted() {
......@@ -334,8 +340,7 @@ export default {
},
// 处理时间参数
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(params)
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.carBuyDate) {
params.beginCarBuyDate = this.searchForm.carBuyDate[0]
params.endCarBuyDate = this.searchForm.carBuyDate[1]
......@@ -356,10 +361,10 @@ export default {
if (this.status) {
this.status = false
let params = {
'req.crowdGroupId': this.crowdGroupId
croupGroupId: this.crowdGroupId
}
await marketingPeopleListShow(params).then(res => {
this.itemArr = res.crowdUnitList
this.itemArr = res
this.showTitle = this.itemArr[0].crowdName
this.searchForm.crowdId = this.itemArr[0].crowdId
})
......@@ -553,6 +558,10 @@ export default {
color: #5850ff;
padding: 9px 20px;
}
.isDisableSOP {
color: #c0bcff;
border: 1px solid #c0bcff;
}
}
}
}
......@@ -643,6 +652,10 @@ export default {
color: #5850ff;
padding: 9px 20px;
}
.isDisableSOP {
color: #c0bcff;
border: 1px solid #c0bcff;
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!