marketingPlan.vue
3.83 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
<template>
<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">
<template slot="options" slot-scope="scope">
<el-button class="blue-text" type="text" @click="goBasicInfo(scope.scope)">SOP分析</el-button>
<el-button class="blue-text" type="text" @click="goBasicInfo(scope.scope)">编辑</el-button>
<el-button class="blue-text" type="text" @click="confirm('delete')">删除</el-button>
<el-button class="blue-text" type="text" @click="confirm(scope.scope)">结束</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/clientManage'
export default {
data() {
return {
searchForm: {},
searchFormList: [
{
type: 'input',
inputType: 'text',
// name: 'keyword',
label: '人群名称'
},
{
type: 'select',
// name: 'type',
label: '营销状态',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
}
],
placeholder: '请选择'
}
],
getListApi: getTableList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
tableColumns: [
{
label: '人群名称',
prop: 'orderNo'
},
{
label: 'SOP名称',
prop: 'name'
},
{
label: '营销时间',
prop: 'phone'
},
{
label: '完成度',
prop: 'dsdasd'
},
{
label: '营销状态',
prop: 'dsdasds'
},
{
label: '操作',
prop: 'options',
addHtml: 'options'
}
]
}
}
},
mounted() {
//没数据的时候要算高度
setTimeout(() => {
if (!this.$refs.marketingPlan.data.length) {
this.loading = true
this.$refs.marketingPlan.setTableHeightFun()
this.loading = false
}
}, 200)
},
methods: {
// 确认删除或结束
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()
},
setTableHeightEvent() {
this.$refs.marketingPlan.setTableHeightFun()
},
// 搜索表格
searchTable() {
console.log(this.searchForm)
this.$refs.marketingPlan.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {
status: '',
type: ''
}
this.$refs.marketingPlan.refreshTable()
}
}
}
</script>
<style lang="scss" scoped>
.pageContent {
padding: 20px 20px 30px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
background-color: #fff;
}
</style>