Commit d720e0ee by chenwq Committed by 杨北旺

列表-调接口

1 parent b74cd6cc
......@@ -22,6 +22,28 @@ const getSopInfoListApi = params => {
})
}
// sop分析-触达率列表
const getSopCustomerStatisticsListApi = params => {
params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop分析-员工完成率列表
const getSopStaffTaskListApi = params => {
params.method = 'scrm.api.sop.staffTaskStatistics.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop营销事件次数分析
const parseEventCountApi = params => {
params.method = 'scrm.api.sop.sopEvent.parseEventCount'
......@@ -54,4 +76,4 @@ const getSopInfoDetailApi = params => {
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, parseEventCountApi, insertOrUpdateSopApi, getSopInfoDetailApi }
export default { getCustomerByTagListApi, getSopInfoListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, insertOrUpdateSopApi, getSopInfoDetailApi }
......@@ -287,7 +287,21 @@ export default {
params.eventList[index].eventEndDate = item.eventEndDate
}
if (item.object) {
params.eventList[index].object = item.object
params.eventList[index].objectId = item.object.objectId
params.eventList[index].additionalType = item.object.additionalType
params.eventList[index].objectType = item.object.objectType
delete params.eventList[index].object
}
})
} else {
params.eventList = []
this.editForm.eventList.forEach((item, index) => {
params.eventList.push(item)
if (item.object) {
params.eventList[index].objectId = item.object.objectId
params.eventList[index].additionalType = item.object.additionalType
params.eventList[index].objectType = item.object.objectType
delete params.eventList[index].object
}
})
}
......
......@@ -121,11 +121,13 @@ export default {
4: 7,
5: 8
}
console.log()
// this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
this.$emit('selectActivity', {
objectId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId,
objectType: typeToObj[this.activeName],
objectName: this.activeName == 3 ? 2 : this.activeName == 4 ? 2 : this.activeName == 5 ? 2 : this.activeName == 2 ? 3 : this.selectItem.equityName
objectName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName,
additionalType: this.activeName == 3 ? 2 : this.activeName == 4 ? 2 : this.activeName == 5 ? 2 : this.activeName == 2 ? 3 : this.selectItem.equityName
})
},
handleSizeChange(val) {
......
......@@ -34,7 +34,7 @@
<p class="m-b-10">日营销事件明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -54,7 +54,7 @@ export default {
url: url,
searchForm: {},
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getListApi,
tableParams: {
listName: 'list',
tableColumns: [
......@@ -99,6 +99,13 @@ export default {
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
},
......@@ -126,6 +133,13 @@ export default {
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.sopId = this.sopId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
......
......@@ -34,7 +34,7 @@
<p class="m-b-10">员工任务明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -44,7 +44,6 @@
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',
......@@ -54,7 +53,7 @@ export default {
url: url,
searchForm: {},
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getSopStaffTaskListApi,
tableParams: {
listName: 'list',
tableColumns: [
......@@ -99,6 +98,13 @@ export default {
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
},
......@@ -126,6 +132,13 @@ export default {
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.sopId = this.sopId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
......
......@@ -42,7 +42,7 @@
<p class="m-b-10">客户触达明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :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>
......@@ -66,22 +66,20 @@ export default {
size: 'small',
url: url,
searchForm: {
name: '',
staffName: '',
createDate: []
sopName: ''
},
tableSearchForm: {},
// tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '营销事件',
name: 'name',
name: 'sopName',
type: 'select',
width: '415px'
}
],
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getSopCustomerStatisticsListApi,
tableParams: {
listName: 'list',
tableColumns: [
......@@ -126,6 +124,13 @@ export default {
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
this.getOptionsList('searchFormData')
......@@ -143,7 +148,8 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
this.searchForm.sopId = this.sopId
// this.tableSearchForm = this.getParams()
resolve()
})
},
......
......@@ -3,13 +3,13 @@
<div class="sop-analysis">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="完成率分析" name="compleList">
<complete-list v-if="activeName == 'compleList'"></complete-list>
<complete-list v-if="activeName == 'compleList'" :sopId="routeInfo.id"></complete-list>
</el-tab-pane>
<el-tab-pane label="触达率分析" name="touchList">
<touch-list v-if="activeName == 'touchList'"></touch-list>
<touch-list v-if="activeName == 'touchList'" :sopId="routeInfo.id"></touch-list>
</el-tab-pane>
<el-tab-pane label="员工完成率分析" name="staffList">
<staff-list v-if="activeName == 'staffList'"></staff-list>
<staff-list v-if="activeName == 'staffList'" :sopId="routeInfo.id"></staff-list>
</el-tab-pane>
</el-tabs>
<el-button :size="size" class="sop-back-btn" type="primary" @click="handleBack">返回</el-button>
......@@ -25,7 +25,10 @@ export default {
data() {
return {
activeName: 'compleList',
size: 'small'
size: 'small',
routeInfo: {
id: ''
}
}
},
......@@ -35,7 +38,9 @@ export default {
staffList
},
mounted() { },
created() {
this.routeInfo = this.$route.query
},
methods: {
handleTabClick() { },
......
......@@ -39,53 +39,64 @@ export default {
size: 'small',
url: url,
searchForm: {
zoneName: '',
status: []
sopName: '',
sopStatus: ''
},
// tableSearchForm: {},
// 搜索
searchFormData: [
{
label: 'sop名称',
name: 'zoneName',
name: 'sopName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '营销状态',
name: 'status',
type: 'select'
name: 'sopStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'sopStatusList'
}
],
// 表格
getListApi: this.$apis.proManage.getListApi,
getListApi: this.$apis.sop.getSopInfoListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: 'sop名称',
prop: 'goodsName'
prop: 'sopName'
},
{
label: '营销时间',
prop: 'createdDate',
width: '180',
prop: 'startDate',
width: '220',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
return dayjs(cellValue.startDate).format('YYYY-MM-DD') + (cellValue.endDate ? '-' + dayjs(cellValue.endDate).format('YYYY-MM-DD') : '')
}
},
{
label: '营销状态',
prop: 'goodsName'
prop: 'sopStatus',
formatter: cellValue => {
return this.baseData.sopStatusList.find(item => item.confId == cellValue.sopStatus).confName
}
},
{
label: '完成度',
prop: 'goodsName'
prop: 'sopStatistics',
formatter: cellValue => {
return cellValue.sopStatistics ? Math.round((cellValue.sopStatistics.finishEventCount / cellValue.sopStatistics.eventCount) * 100).toFixed(0) + '%' : '-'
}
},
{
label: '创建人',
prop: 'goodsName'
prop: 'createdBy'
},
{
label: '创建时间',
......@@ -97,11 +108,29 @@ export default {
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
sopStatusList: [
{
confId: '1',
confName: '未开始'
},
{
confId: '2',
confName: '进行中'
},
{
confId: '3',
confName: '已结束'
}
]
}
}
},
mounted() { },
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
handleJump(path) {
......@@ -170,6 +199,32 @@ export default {
this.secondConfirm('删除', 'sop删除后,不可恢复。是否确定删除?', 'proManage', 'deleteZoneApi', { id: row.id })
},
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.sopListRef.data.length ? (this.$refs.sopListRef.tableHeightValues = '') : this.$refs.sopListRef.setTableHeightFun()
......@@ -181,8 +236,8 @@ export default {
handleReset() {
this.searchForm = {
zoneName: '',
status: []
sopName: '',
sopStatus: ''
}
this.handleSearch()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!