Commit aff4cde3 by 前端

任务管理

1 parent f775eb85
This diff could not be displayed because it is too large.
......@@ -19,7 +19,7 @@
"node-sass": "4.14.1",
"sass-loader": "7.3.1",
"sha1": "^1.1.1",
"vue": "^2.5.17"
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
......@@ -29,6 +29,6 @@
"eslint-plugin-html": "^4.0.5",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"vue-template-compiler": "^2.7.11"
"vue-template-compiler": "^2.6.11"
}
}
// import request from './request'
// const path = 'scrm.api.renewal.insurance.customer.name.list.'
// const defaultPath = 'scrm.api.renewal.order.'
const taskApi = {
// searchCustomerList(data = {}) {
// data.method = `${path}get`
// return request(data)
// },
}
export { taskApi }
<template>
<div class="task-contentbox">
<div>
<div>
<el-form :inline="true" :model="searchForm">
<el-form-item label="业务场景:">
<el-select v-model="searchForm.scene" size="small">
<el-option label="全部" value=""></el-option>
<el-option label="1.0新车权益销售" value="0"></el-option>
<el-option label="1.1次新车精品升级" value="1"></el-option>
<el-option label="1.2次新车线上转化" value="2"></el-option>
<el-option label="1.3存量用户众筹" value="3"></el-option>
<el-option
v-for="(item, index) in sceneOption"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="商户:">
<el-input v-model="searchForm.name" size="small" placeholder="请输入商户名称"></el-input>
<el-input
v-model="searchForm.name"
size="small"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
<el-form-item label="活动/产品:">
<el-input v-model="searchForm.code" size="small" placeholder="请输入活动/产品名称"></el-input>
<el-input
v-model="searchForm.code"
size="small"
placeholder="请输入活动/产品名称"
></el-input>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="searchForm.status" size="small">
<el-option label="全部" value=""></el-option>
<el-option label="未发布" value="0"></el-option>
<el-option label="已发布" value="1"></el-option>
<el-option label="已结束" value="2"></el-option>
<el-option
v-for="(item, index) in taskStatus"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="handleSearch">查询</el-button>
<el-button type="primary" size="small" @click="handleSearch"
>查询</el-button
>
<el-button plain size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-top">
<div>订单列表</div>
<el-button class="output-btn" size="small" style="margin-bottom: 20px" @click="handleEdit">添加任务</el-button>
<el-button
class="output-btn"
size="small"
style="margin-bottom: 20px"
@click="handleEdit"
>添加任务</el-button
>
</div>
<div>
<d2-table
ref="taskTable"
:searchForm="searchForm"
:getListApi="getListApi"
:tableParams="tableParams"
:pageConf="pageConf"
>
<template slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="scope.scope.status == 0" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" v-if="scope.scope.status !== 0" @click="handleViewDetail(scope.scope)">任务分析</el-button>
<el-button type="text" v-if="scope.scope.status == 0" @click="handleDelete(scope.scope)">删除</el-button>
<el-button type="text" v-if="scope.scope.status == 0" @click="handleActive(scope.scope)">发布</el-button>
<el-button type="text" v-if="scope.scope.status == 1" @click="handleInactive(scope.scope)">结束</el-button>
<el-button type="text" @click="handleClone(scope.scope)">复制</el-button>
<el-button type="text" v-if="scope.scope.status !== 0" @click="handleClone(scope.scope)">查看</el-button>
</template>
</d2-table>
ref="taskTable"
:searchForm="searchForm"
:getListApi="getListApi"
:tableParams="tableParams"
:pageConf="pageConf"
:tableData="tableData"
>
<div slot="status" slot-scope="scope">
<span v-if="scope.scope.status == statusNum.UNPUBLISH">未发布</span>
<span v-if="scope.scope.status == statusNum.PUBLISHED">已发布</span>
<span v-if="scope.scope.status == statusNum.FINISHIED">已结束</span>
</div>
<template slot="auth-button" slot-scope="scope">
<el-button
type="text"
v-if="scope.scope.status == statusNum.UNPUBLISH"
@click="handleEdit(scope.scope)"
>编辑</el-button
>
<el-button
type="text"
v-if="scope.scope.status != statusNum.UNPUBLISH"
@click="handleAnalyze(scope.scope)"
>任务分析</el-button
>
<el-button
type="text"
v-if="scope.scope.status == statusNum.UNPUBLISH"
@click="handleDelete(scope.scope)"
style="color: red"
>删除</el-button
>
<el-button
type="text"
v-if="scope.scope.status == statusNum.UNPUBLISH"
@click="handleActive(scope.scope)"
>发布</el-button
>
<el-button
type="text"
v-if="scope.scope.status == statusNum.PUBLISHED"
@click="handleInactive(scope.scope)"
>结束</el-button
>
<el-button type="text" @click="handleClone(scope.scope)"
>复制</el-button
>
<el-button
type="text"
v-if="scope.scope.status != statusNum.UNPUBLISH"
@click="handleViewDetail(scope.scope)"
>查看</el-button
>
</template>
</d2-table>
</div>
</div>
</template>
<script>
const sceneOption = [
{
label: '全部',
value: '',
},
{
label: '1.0新车权益销售',
value: '0',
},
{
label: '1.1次新车精品升级',
value: '1',
},
{
label: '1.2次新车线上转化',
value: '2',
},
{
label: '1.3存量用户众筹',
value: '3',
},
]
const statusNum = {
UNPUBLISH: '0',
PUBLISHED: '1',
FINISHIED: '2',
}
const taskStatus = [
{
label: '全部',
value: '',
},
{
label: '未发布',
value: statusNum.UNPUBLISH,
},
{
label: '已发布',
value: statusNum.PUBLISHED,
},
{
label: '已结束',
value: statusNum.FINISHIED,
},
]
import { taskApi } from '../../../api/task'
export default {
data() {
return {
// 业务场景选项
sceneOption,
// 状态选项
taskStatus,
statusNum,
searchForm: {
scene: '',
name: '',
code: '',
status: ''
status: '',
},
// 表格参数
tableParams: {
......@@ -75,41 +184,74 @@ export default {
{
label: '业务场景',
prop: 'scene',
width: 200
width: 200,
},
{
label: '商户',
prop: 'merchant',
width: 250
width: 250,
},
{
label: '活动/产品',
prop: 'activity'
prop: 'activity',
},
{
label: '任务数',
prop: 'taskNum'
prop: 'taskNum',
},
{
label: '创建人',
prop: 'creatPerson'
prop: 'creatPerson',
},
{
label: '创建时间',
prop: 'creatTime',
width: 150
width: 150,
},
{
label: '状态',
prop: 'status'
}
]
prop: 'status',
addHtml: 'status',
},
],
},
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.total'
}
totalCount: 'data.total',
},
tableData: [
{
id: 11,
scene: '1.3业务场景',
merchant: '我是商户名称',
activity: '氛围灯众筹活动',
taskNum: '10',
creatPerson: '用户名',
creatTime: '2021-10-27 16:00:00',
status: '0',
},
{
id: 22,
scene: '1.3业务场景',
merchant: '我是商户名称',
activity: '360众筹活动',
taskNum: '10',
creatPerson: '用户名',
creatTime: '2021-10-27 16:00:00',
status: '1',
},
{
id: 33,
scene: '1.1业务场景',
merchant: '我是商户名称',
activity: 'AR导航',
taskNum: '10',
creatPerson: '用户名',
creatTime: '2021-10-27 16:00:00',
status: '2',
},
],
// 获取订单列表
// getListApi: customerApi.getOrderList
}
......@@ -125,7 +267,7 @@ export default {
this.searchForm = {
name: '',
code: '',
status: ''
status: '',
}
this.$nextTick(() => {
this.$refs.taskTable.refreshTable()
......@@ -139,29 +281,85 @@ export default {
'任务平台',
'任务管理',
'任务模板管理',
'*添加任务模板'
'*添加任务模板',
])
}
// this.$root.close('任务模板管理列表')
},
// 删除
handleDelete() {},
// 启用
handleActive() {},
// 禁用
handleInactive() {},
handleDelete(scope) {
this.secondConfirm(
'提示',
'任务计划删除后,无法恢复。是否确定删除?',
'',
scope.id
)
},
// 发布
handleActive(scope) {
this.secondConfirm(
'提示',
'任务计划发布后,任务会自动下发给对应的员工。是否确定发布?',
'',
scope.id
)
},
// 结束
handleInactive(scope) {
this.secondConfirm(
'提示',
'任务计划结束后,整个任务计划将无法再使用。是否确定结束?',
'',
scope.id
)
},
// 克隆
handleClone() {},
// 跳转查看详情
handleViewDetail(scope) {
console.log(scope)
// this.$root.to(
// ['UBI续保', '续保', '保险渠道管理', '订单管理', '*订单管理详情'],
// scope.id
// )
}
}
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'*查看任务',
])
},
// 任务分析
handleAnalyze(scope) {
console.log(scope)
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'*任务分析',
])
},
// 二次确认
secondConfirm(title, txt, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (action) => {
if (action == 'confirm') {
taskApi[apiName](apiParams).then((res) => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error',
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
},
})
},
},
}
</script>
<style scoped>
</style>
<style scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!