index.vue
4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
<div class="task-contentbox">
<div>
<el-form :inline="true" :model="searchForm">
<el-form-item label="商户:">
<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-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-select>
</el-form-item>
<el-form-item>
<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>
</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" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleViewDetail(scope.scope)">任务分析</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button type="text" @click="handleActive(scope.scope)">发布</el-button>
<el-button type="text" @click="handleInactive(scope.scope)">复制</el-button>
<el-button type="text" @click="handleClone(scope.scope)">克隆</el-button>
</template>
</d2-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {
name: '',
code: '',
status: ''
},
// 表格参数
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.list',
tableOption: true,
tableColumns: [
{
label: '模板名称',
prop: 'templateName',
width: 200
},
{
label: '模板编码',
prop: 'templateCode',
width: 250
},
{
label: '任务数',
prop: 'taskNum'
},
{
label: '总收益',
prop: 'income'
},
{
label: '使用门店',
prop: 'merchantNumber'
},
{
label: '使用活动',
prop: 'activity',
width: 150
},
{
label: '创建人',
prop: 'creatPerson'
},
{
label: '创建时间',
prop: 'creatTime'
},
{
label: '状态',
prop: 'status'
}
]
},
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.total'
}
// 获取订单列表
// getListApi: customerApi.getOrderList
}
},
methods: {
// 搜索框搜索
handleSearch() {
console.log(this.searchForm)
this.$refs.taskTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
name: '',
code: '',
status: ''
}
this.$nextTick(() => {
this.$refs.taskTable.refreshTable()
})
},
// 编辑
handleEdit(scope, type) {
if (!type) {
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'*添加任务模板'
])
}
// this.$root.close('任务模板管理列表')
},
// 删除
handleDelete() {},
// 启用
handleActive() {},
// 禁用
handleInactive() {},
// 克隆
handleClone() {},
// 跳转查看详情
handleViewDetail(scope) {
console.log(scope)
// this.$root.to(
// ['UBI续保', '续保', '保险渠道管理', '订单管理', '*订单管理详情'],
// scope.id
// )
}
}
}
</script>
<style scoped>
</style>