client.vue
4.39 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<template>
<div class="client">
<div class="container">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="clientRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="delFlag" slot-scope="scope">
<div :class="['task_icon', scope.scope.delFlag == 0 ? 'task_icon1' : 'task_icon2']">{{ scope.scope.delFlag == 0 ? '待发送' : '已发送' }}</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleContent(scope.scope)">短信内容</el-button>
</div>
</GLTable>
</div>
<!-- 外呼短信 -->
<GLDialog mode="small" title="短信内容" :visible.sync="messageVisible" cancelText="取消" okText="确定" @onCancel="messageVisible = false" @onOk="handleMessageConfirm" >
<div class="market-note">{{ messageContext }}</div>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
data() {
return {
messageVisible: false,
messageContext: '',
url: url,
searchForm: {
phone: '',
delFlag: '',
merchantName: '',
imId: ''
},
// 搜索
searchFormData: [
{
label: '手机号',
name: 'phone ',
type: 'input'
},
{
label: '状态',
name: 'delFlag',
type: 'select',
optionList: [
{ text: '待发送', id: 0 },
{ text: '已发送', id: 1 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '所属门店',
name: 'merchantName',
type: 'input'
}
],
getListApi: this.$apis.marketing.findAllCustomerByPage,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '客户姓名',
prop: 'customerName'
},
{
label: '所属门店',
prop: 'merchantName'
},
{
label: '状态',
prop: 'delFlag',
addHtml: 'delFlag'
},
{
label: '发送时间',
prop: 'sendTime'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
props: {
imId: {
type: String,
default: ''
}
},
methods: {
handleContent(data) {
this.messageContext = data.messageContext
this.messageVisible = true
},
handleMessageConfirm() {
this.messageVisible = false
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.imId = this.imId
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.clientRef.data.length ? (this.$refs.clientRef.tableHeightValues = '') : this.$refs.clientRef.setTableHeightFun()
},
handleSearch() {
console.log(111)
this.$refs.clientRef.refreshTable()
},
handleReset() {
this.searchForm = {
phone: '',
delFlag: '',
merchantName: '',
imId: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.client {
margin: 16px 0;
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #fdb757;
}
}
&.task_icon2 {
&::after {
background: #2cca74;
}
}
}
.market-note {
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 24px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
// text-align: center;
width: 448px;
white-space: wrap;
}
}
</style>