Commit c58b4402 by xinla

Merge remote-tracking branch 'origin/front_end_dev' into front_end_dev_1.0+

2 parents 35d6c97a 38a19190
...@@ -17,9 +17,10 @@ export function getList(params) { ...@@ -17,9 +17,10 @@ export function getList(params) {
}) })
} }
export function getTaskDetail (id) { export function getTaskDetail (id,type) {
let url = type?`${service}/getInfo/${id}/${type}`:`${service}/getInfo/${id}`
return request({ return request({
url: `${service}/getInfo/${id}`, url,
method: 'get', method: 'get',
}) })
} }
......
...@@ -470,40 +470,60 @@ export const constantRoutes = [ ...@@ -470,40 +470,60 @@ export const constantRoutes = [
// }, // },
// ] // ]
// }, // },
// { // {
// path: '/application', // path: '/application',
// component: Layout, // component: Layout,
// meta: { title: '', icon: 'wechat' }, // meta: { title: '', icon: 'wechat' },
// children: [ // children: [
// { // {
// path: 'taskGroup', // path: 'taskGroup',
// name: 'taskGroup', // name: 'taskGroup',
// component: (resolve) => require(['@/views/application/taskGroup'], resolve), // component: (resolve) => require(['@/views/application/taskGroup'], resolve),
// meta: { title: '任务宝', icon: '' } // meta: { title: '任务宝', icon: '' }
// }, // },
// { // {
// path: 'taskDetail', // path: 'taskDetail',
// name: 'taskDetail', // name: 'taskDetail',
// hidden: true, // hidden: true,
// component: (resolve) => require(['@/views/application/taskDetail'], resolve), // component: (resolve) => require(['@/views/application/taskDetail'], resolve),
// meta: { title: '任务详情', icon: '' } // meta: { title: '任务详情', icon: '' }
// }, // },
// { // {
// path: 'editTask', // path: 'editTask',
// name: 'editTask', // name: 'editTask',
// hidden: true, // hidden: true,
// component: (resolve) => require(['@/views/application/taskDetail/editTask'], resolve), // component: (resolve) => require(['@/views/application/taskDetail/editTask'], resolve),
// meta: { title: '编辑活动任务', icon: '' } // meta: { title: '编辑活动任务', icon: '' }
// }, // },
// { // {
// path: 'addTask', // path: 'addTask',
// name: 'addTask', // name: 'addTask',
// hidden: true, // hidden: true,
// component: (resolve) => require(['@/views/application/taskDetail/addTask'], resolve), // component: (resolve) => require(['@/views/application/taskDetail/addTask'], resolve),
// meta: { title: '新增活动任务', icon: '' } // meta: { title: '新增活动任务', icon: '' }
// }, // },
// ] // {
// }, // path: 'groupFission',
// name: 'groupFission',
// component: (resolve) => require(['@/views/application/groupFission'], resolve),
// meta: { title: '群裂变', icon: '' }
// },
// {
// path: 'addFission',
// name: 'addFission',
// hidden: true,
// component: (resolve) => require(['@/views/application/fissionDetail/addFission'], resolve),
// meta: { title: '新增群裂变', icon: '' }
// },
// {
// path: 'fissionDetail',
// name: 'fissionDetail',
// hidden: true,
// component: (resolve) => require(['@/views/application/fissionDetail'], resolve),
// meta: { title: '任务详情', icon: '' }
// },
// ]
// },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
......
<script>
import * as api from "@/api/task";
import echarts from 'echarts'
export default {
name: 'taskDetail',
data () {
return {
query: {
pageNum: 1,
pageSize: 10,
name: "", // "客户名称",
beginTime: "", // "开始时间",
endTime: "" // "结束时间"
},
dateRange: [],
tableData: [],
dateSelect: '近7日',
dateRange: [],
taskDetail: {},
statData:[]
}
},
created () {
this.getList(this.$route.query.id)
this.getChartsData({seven:true})
},
mounted () {
},
watch:{
statData:{
handler(newVal,oldVal){
let xData=[],attends=[],completes=[],increases=[]
for(let i =0;i<newVal.length;i++){
xData.push(newVal[i].day)
attends.push(newVal[i].attend)
completes.push(newVal[i].complete)
increases.push(newVal[i].increase)
}
// 指定图表的配置项和数据
let option = {
tooltip: { //设置tip提示
trigger: 'axis'
},
legend: { //设置区分(哪条线属于什么)
data: ['日新增客户数', '活动参与客户数','完成任务的客户数']
},
color: ['#8AE09F', '#FA6F53','#1890ff'], //设置区分(每条线是什么颜色,和 legend 一一对应)
xAxis: { //设置x轴
type: 'category',
boundaryGap: false, //坐标轴两边不留白
data: xData,
// name: '日期', //X轴 name
nameTextStyle: { //坐标轴名称的文字样式
fontSize: 16,
// padding: [0, 0, 0, 20]
},
// axisLine: { //坐标轴轴线相关设置。
// lineStyle: {
// color: '#FA6F53',
// }
// }
},
yAxis: {
nameTextStyle: {
color: '#FA6F53',
fontSize: 16,
padding: [0, 0, 10, 0]
},
// axisLine: {
// lineStyle: {
// color: '#FA6F53',
// }
// },
type: 'value'
},
series: [
{
name: '日新增客户数',
data: increases,
type: 'line', // 类型为折线图
lineStyle: { // 线条样式 => 必须使用normal属性
normal: {
color: '#8AE09F',
}
},
},
{
name: '活动参与客户数',
data: attends,
type: 'line',
lineStyle: {
normal: {
color: '#FA6F53',
}
},
},
{
name: '完成任务的客户数',
data: completes,
type: 'line',
lineStyle: {
normal: {
color: '#FA6F53',
}
},
}
]
}
this.initChart(option)
}
}
},
methods: {
getList (id) {
api.getTaskDetail(id)
.then(res => {
this.taskDetail = res.data
})
},
getChartsData(params){
params = Object.assign({},params,{taskFissionId:this.$route.query.id})
api.getStat(params)
.then(res => {
this.statData = res.data ? res.data.data : []
})
},
resetForm () {
},
exportCustomer () {
},
dateChange (event) {
console.log(event)
},
initChart (option) {
if(!this.chartLine){
this.chartLine = echarts.init(document.getElementById('chartLineBox'));
}
this.chartLine.setOption(option)
}
}
}
</script>
<template>
<div class="task-detail-container">
<div class="task-detail-model task-detail-left">
<h4 class="title">任务活动信息</h4>
<div class="task-row">
<div class="task-label" style="margin-bottom:30px">创建人:</div>
<div class="task-value">{{taskDetail.createBy}}</div>
</div>
<div class="task-row">
<div class="task-label">活动名称:</div>
<div class="task-value">{{taskDetail.taskName}}</div>
</div>
<div class="task-row">
<div class="task-label">裂变引导语:</div>
<div class="task-value">{{taskDetail.fissInfo}}</div>
</div>
<div class="task-row">
<div class="task-label">裂变客户数量:</div>
<div class="task-value">{{taskDetail.fissNum}}人</div>
</div>
<div class="task-row" style="margin-bottom:30px">
<div class="task-label">活动时间:</div>
<div class="task-value">{{taskDetail.startTime}}至{{taskDetail.overTime}}</div>
</div>
<div class="task-row">
<div class="task-label">活动发起成员:</div>
<div class="task-value"></div>
</div>
<div class="task-row" style="margin-bottom:30px">
<div class="task-label">客户标签:</div>
<div class="task-value">{{taskDetail.customerTag}}</div>
</div>
<div class="task-row" >
<div class="task-label">裂变海报:</div>
<img style="width:30px" :src="taskDetail.postersUrl"/>
</div>
<div class="task-row" style="margin-bottom:30px">
<div class="task-label">员工:</div>
<div class="task-value">{{taskDetail.fissionTarget}}</div>
</div>
<div class="task-row">
<div class="task-label">兑奖链接:</div>
<div class="task-value">{{taskDetail.rewardUrl}}</div>
</div>
<div class="task-row" style="margin-bottom:30px">
<div class="task-label">兑奖图片:</div>
<img style="width:30px" :src="taskDetail.rewardImageUrl"/>
</div>
<div class="task-row">
<div class="task-label">新客欢迎语:</div>
<div class="task-value">{{taskDetail.welcomeMsg}}</div>
</div>
</div>
<div class="task-detail-model task-detail-right">
<h4 class="title">关键数据</h4>
<div class="dateRang">
<el-radio-group
@change='dateChange'
v-model="dateSelect"
>
<el-radio-button label="近7日"></el-radio-button>
<el-radio-button label="近30日"></el-radio-button>
</el-radio-group>
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</div>
<div
id="chartLineBox"
style="width: 100%;height: 354px;"
> </div>
</div>
</div>
</template>
<style lang="scss" scoped>
.task-detail-container {
display: flex;
justify-content: space-between;
background: #efeff4;
height: calc(100vh - 84px);
box-sizing: border-box;
padding: 20px 10px;
.task-detail-model {
width: 48%;
height: 100%;
box-sizing: border-box;
background: #fff;
padding: 10px 20px;
.task-row {
display: flex;
color: #606266;
font-size: 14px;
margin-bottom: 10px;
}
.task-label {
width: 100px;
text-align: right;
margin-right: 10px;
}
.title {
color: #303133;
text-align: left;
}
.dateRang {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
#chartLineBox {
margin-top: 10px;
}
}
}
</style>
<script>
import * as api from "@/api/task";
export default {
name: 'Group',
data () {
return {
query: {
pageNum: 1,
pageSize: 10,
taskName: "",
startTime: "",
overTime: "",
fissionType:2
},
dateRange: [],
tableData: [],
total:0
}
},
created () {
this.getList()
},
methods: {
getList (data) {
let params = Object.assign({},this.query,data)
api.getList(params)
.then(({ rows, total }) => {
this.tableData = rows;
this.total = +total;
})
},
resetForm () {
},
toDetail(row){
this.$router.push({
path: `/application/fissionDetail?id=${row.id}`,
})
},
newAdd () {
this.$router.push({
path: '/application/addFission',
})
},
toEdit(row){
this.$router.push({
path: `/application/addFission?id=${row.id}`,
})
}
},
}
</script>
<template>
<div class="app-container">
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
size="small"
>
<el-form-item
label="裂变名"
prop="taskName"
>
<el-input
v-model="query.taskName"
placeholder="请输入"
></el-input>
</el-form-item>
<el-form-item label="添加日期">
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="getList({pageNum:1})"
>查询</el-button>
<el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="newAdd()"
>新增任务</el-button>
</el-form-item>
</el-form>
<el-table
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="taskName"
label="群裂变名称"
>
</el-table-column>
<el-table-column
prop="fissNum"
label="裂变客户数量"
>
</el-table-column>
<el-table-column
prop="fissStatus"
label="活动状态"
>
<template slot-scope="scope">
<p>{{ scope.row.fissStatus===1?'进行中':'已结束' }}</p>
</template>
</el-table-column>
<el-table-column
prop="startTime"
label="活动时间"
>
<template slot-scope="scope">
<p>{{ scope.row.startTime}}-{{scope.row.overTime}}</p>
</template>
</el-table-column>
<el-table-column
prop="operation"
label="操作"
>
<template slot-scope="scope">
<el-button
@click="toDetail(scope.row)"
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
>查看</el-button>
<el-button
v-if="scope.row.fissStatus!=2"
@click="toEdit(scope.row)"
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
>编辑</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!