|
@@ -0,0 +1,403 @@
|
|
1
|
+<template>
|
|
2
|
+ <div>
|
|
3
|
+ <el-form :inline="true" :model="listQuery" class="form-listQuery">
|
|
4
|
+ <el-form-item class="filter-item" label="商铺编号">
|
|
5
|
+ <el-input v-model="listQuery.id" placeholder="商铺编号"/>
|
|
6
|
+ </el-form-item>
|
|
7
|
+ <el-form-item class="filter-item" label="商铺名称">
|
|
8
|
+ <el-input v-model="listQuery.shopName" placeholder="商铺名称"/>
|
|
9
|
+ </el-form-item>
|
|
10
|
+ <el-form-item class="filter-item" label="评价分数">
|
|
11
|
+ <el-select v-model="listQuery.score" placeholder="评价分数">
|
|
12
|
+ <el-option label="请选择" value=""/>
|
|
13
|
+ <el-option label="1" value="1"/>
|
|
14
|
+ <el-option label="2" value="2"/>
|
|
15
|
+ <el-option label="3" value="3"/>
|
|
16
|
+ <el-option label="4" value="4"/>
|
|
17
|
+ <el-option label="5" value="5"/>
|
|
18
|
+ </el-select>
|
|
19
|
+ </el-form-item>
|
|
20
|
+ <el-form-item class="filter-item" label="评价内容">
|
|
21
|
+ <el-input v-model="listQuery.content" placeholder="评价内容"/>
|
|
22
|
+ </el-form-item>
|
|
23
|
+ <el-form-item class="filter-item" label="评价人">
|
|
24
|
+ <el-input v-model="listQuery.appraisalPeople" placeholder="评价人"/>
|
|
25
|
+ </el-form-item>
|
|
26
|
+ <el-form-item class="filter-item" label="评价人手机号">
|
|
27
|
+ <el-input v-model="listQuery.appraisalTel" placeholder="评价人手机号"/>
|
|
28
|
+ </el-form-item>
|
|
29
|
+ <el-form-item>
|
|
30
|
+ <el-button type="info" class="filter-item" @click="handleFilter">清空</el-button>
|
|
31
|
+ <el-button type="primary" @click="search">查询</el-button>
|
|
32
|
+ </el-form-item>
|
|
33
|
+
|
|
34
|
+ <el-row>
|
|
35
|
+ <el-button type="primary" @click=" replyAdd()">回复评价</el-button>
|
|
36
|
+ <el-button type="primary" @click="enditreply()">修改评价</el-button>
|
|
37
|
+ <el-button type="info" @click="enditandAdd(0)">下架评价</el-button>
|
|
38
|
+ <el-button type="info" @click="enditandAdd(1)">上架评价</el-button>
|
|
39
|
+ <span style="padding-left:20%;font-size:0.7vw;color:#C0C0C0;">注:权重越大,APP端展示越靠前(权重相同时按编辑时间从晚到早排序)</span>
|
|
40
|
+ </el-row>
|
|
41
|
+ </el-form>
|
|
42
|
+ <el-table
|
|
43
|
+ v-loading="listLoading"
|
|
44
|
+ ref="multipleTable"
|
|
45
|
+ :data="listData.records"
|
|
46
|
+ border
|
|
47
|
+ tooltip-effect="dark"
|
|
48
|
+ style="width: 100%; margin-top: 20px;"
|
|
49
|
+ @selection-change="handleSelectionChange">
|
|
50
|
+ <el-table-column
|
|
51
|
+ type="selection"
|
|
52
|
+ width="55"/>
|
|
53
|
+ <el-table-column prop="id" label="序号" align="center"/>
|
|
54
|
+ <el-table-column prop="roomName" label="商铺名称" align="center">
|
|
55
|
+ <template slot-scope="scope" >
|
|
56
|
+ <a>
|
|
57
|
+ <!-- <span :title="scope.row.roomName" @click="clickTitle(scope.row.id)" style="color: #009FCC"> -->
|
|
58
|
+ {{ scope.row.shopName}}
|
|
59
|
+ <!-- </span> -->
|
|
60
|
+ </a>
|
|
61
|
+ </template>
|
|
62
|
+ </el-table-column>
|
|
63
|
+ <el-table-column prop="score" label="评价分数" align="center"/>
|
|
64
|
+ <el-table-column prop="content" label="评价内容" align="center">
|
|
65
|
+ <template slot-scope="scope">
|
|
66
|
+ <a :title="scope.row.content">
|
|
67
|
+ <span style="color: #8B8378 ">
|
|
68
|
+ {{ scope.row.content.length>='15'?scope.row.content.substring(0,15)+'..':scope.row.content }}
|
|
69
|
+ </span>
|
|
70
|
+ <span v-if="scope.row.content==='null'">
|
|
71
|
+ {{ scope.row.content='' }}
|
|
72
|
+ </span>
|
|
73
|
+ </a>
|
|
74
|
+ </template>
|
|
75
|
+ </el-table-column>
|
|
76
|
+ <el-table-column prop="appraisalPeople" label="评价人" align="center"/>
|
|
77
|
+ <el-table-column prop="appraisalTel" label="评价人手机" align="center"/>
|
|
78
|
+ <el-table-column prop="sort" label="评价权重" align="center">
|
|
79
|
+ <template slot-scope="scope">
|
|
80
|
+ <a><span style="color: #009FCC " @click="sort(scope.row.id,scope.row.sort)">{{ scope.row.sort }}</span></a>
|
|
81
|
+ </template>
|
|
82
|
+ </el-table-column>
|
|
83
|
+ <el-table-column prop="replayContent" label="回复内容" align="center">
|
|
84
|
+ <template slot-scope="scope">
|
|
85
|
+ <a :title="scope.row.replayContent" v-if="scope.row.replayContent !=null">
|
|
86
|
+ <span style="color: #8B8378 ">
|
|
87
|
+ {{ scope.row.replayContent.length>='15'?scope.row.replayContent.substring(0,15)+'..':scope.row.replayContent }}
|
|
88
|
+ </span>
|
|
89
|
+ <span v-if="scope.row.replayContent==='null'">
|
|
90
|
+ {{ scope.row.replayContent='' }}
|
|
91
|
+ </span>
|
|
92
|
+ </a>
|
|
93
|
+ </template>
|
|
94
|
+ </el-table-column>
|
|
95
|
+ <el-table-column prop="replayPeople" label="回复人" align="center"/>
|
|
96
|
+ <el-table-column prop="createDate" label="时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
|
|
97
|
+ <el-table-column prop="replayContent" label="评论状态" align="center">
|
|
98
|
+ <template slot-scope="scope">
|
|
99
|
+ <span style="color: #8B8378 " v-if="scope.row.status==='0'">已下架</span>
|
|
100
|
+ <span v-if="scope.row.status==='1'">已上架</span>
|
|
101
|
+ </template>
|
|
102
|
+ </el-table-column>
|
|
103
|
+
|
|
104
|
+ </el-table>
|
|
105
|
+ <div class="block">
|
|
106
|
+ <el-pagination
|
|
107
|
+ :current-page.sync="listQuery.pageNum"
|
|
108
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
109
|
+ :page-size.sync="listQuery.pageSize"
|
|
110
|
+ :total="total"
|
|
111
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
112
|
+ @size-change="handleSizeChange"
|
|
113
|
+ @current-change="handleCurrentChange"/>
|
|
114
|
+ </div>
|
|
115
|
+ <el-dialog title="回复评价" :visible.sync="listQuery.dialogFormVisible" :show-close="listQuery.close">
|
|
116
|
+ <el-form :model="listQuery" label-position="left">
|
|
117
|
+ <el-form-item :label-width="listQuery.formLabelWidth" label="评价内容">
|
|
118
|
+ <span>{{ this.listQuery.content }}</span>
|
|
119
|
+ </el-form-item>
|
|
120
|
+ <el-form-item :label-width="listQuery.formLabelWidth" label="回复内容">
|
|
121
|
+ <textarea v-model="listQuery.replayContent" placeholder="输入对上方业主评价的回复,最多100字" class="textarea-inherit" rows="8"></textarea>
|
|
122
|
+ </el-form-item>
|
|
123
|
+ </el-form>
|
|
124
|
+ <div slot="footer" class="dialog-footer">
|
|
125
|
+ <el-button @click="TransactionReplyOff">取 消</el-button>
|
|
126
|
+ <el-button type="primary" @click="TransactionReplyAdd()">确 定</el-button>
|
|
127
|
+ </div>
|
|
128
|
+ </el-dialog>
|
|
129
|
+</div>
|
|
130
|
+
|
|
131
|
+</template>
|
|
132
|
+
|
|
133
|
+<script>
|
|
134
|
+export default {
|
|
135
|
+ data() {
|
|
136
|
+ return {
|
|
137
|
+ listQuery: {
|
|
138
|
+ id: '',
|
|
139
|
+ shopName: '',
|
|
140
|
+ score: '',
|
|
141
|
+ messageType:'',
|
|
142
|
+ content:'',
|
|
143
|
+ appraisalPeople:'',
|
|
144
|
+ replayContent:'',
|
|
145
|
+ code:'',
|
|
146
|
+ appraisalTel:'',
|
|
147
|
+ status:'',
|
|
148
|
+ pageNum: 1,
|
|
149
|
+ pageSize: 10,
|
|
150
|
+ roomStatusIds: [],
|
|
151
|
+ dialogFormVisible: false,
|
|
152
|
+ formLabelWidth: '120px',
|
|
153
|
+ close: false,
|
|
154
|
+ ides:[]
|
|
155
|
+ },
|
|
156
|
+ deleteIds: [], // 选择的id集合
|
|
157
|
+ total: 0,
|
|
158
|
+ listLoading: true, // 加载圈
|
|
159
|
+ listData: [],
|
|
160
|
+ }
|
|
161
|
+ },
|
|
162
|
+ mounted(){
|
|
163
|
+ this.dataQuery()
|
|
164
|
+ },
|
|
165
|
+ methods:{
|
|
166
|
+ dataQuery() { // 查询数据
|
|
167
|
+ this.listLoading = true
|
|
168
|
+ this.$store.dispatch('shopType/ShopAppraisalList', this.listQuery).then((res) => {
|
|
169
|
+ const resData = res.data
|
|
170
|
+ this.listData = resData.list
|
|
171
|
+ this.listQuery.pageNum = resData.list.current
|
|
172
|
+ this.listQuery.pageSize = resData.pageSize
|
|
173
|
+ this.total = resData.total
|
|
174
|
+ this.listLoading = false
|
|
175
|
+ }).catch(() => {
|
|
176
|
+ this.listLoading = false
|
|
177
|
+ console.log('error HotelRoom')
|
|
178
|
+ })
|
|
179
|
+ },
|
|
180
|
+ handleSizeChange(val) {
|
|
181
|
+ console.log(`每页 ${val} 条`)
|
|
182
|
+ this.listQuery.pageSize = val
|
|
183
|
+ this.dataQuery()
|
|
184
|
+ },
|
|
185
|
+ handleCurrentChange(val) {
|
|
186
|
+ console.log(`当前页: ${val}`)
|
|
187
|
+ this.listQuery.pageNum = val
|
|
188
|
+ this.dataQuery()
|
|
189
|
+ },
|
|
190
|
+ handleFilter() {
|
|
191
|
+ this.listQuery.id = ''
|
|
192
|
+ this.listQuery.shopName = ''
|
|
193
|
+ this.listQuery.score = ''
|
|
194
|
+ this.listQuery.content = ''
|
|
195
|
+ this.listQuery.appraisalPeople = ''
|
|
196
|
+ this.listQuery.appraisalTel = ''
|
|
197
|
+ this.listQuery.pageNum = 1
|
|
198
|
+ this.listQuery.pageSize = 10
|
|
199
|
+ this.dataQuery()
|
|
200
|
+ },
|
|
201
|
+ search() {
|
|
202
|
+ this.dataQuery()
|
|
203
|
+ },
|
|
204
|
+ handleSelectionChange(data) {
|
|
205
|
+ this.deleteIds = [] // 设置为 空
|
|
206
|
+ for (let i = 0; i < data.length; i++) {
|
|
207
|
+ this.deleteIds.push(data[i].id)
|
|
208
|
+ }
|
|
209
|
+ },
|
|
210
|
+ formatDate(val) {
|
|
211
|
+ if (val === null) {
|
|
212
|
+ return ''
|
|
213
|
+ }
|
|
214
|
+ var value = new Date(val)
|
|
215
|
+ var year = value.getFullYear()
|
|
216
|
+ var month = this.padDate(value.getMonth() + 1)
|
|
217
|
+ var day = this.padDate(value.getDate())
|
|
218
|
+ var hour = this.padDate(value.getHours())
|
|
219
|
+ var minutes = this.padDate(value.getMinutes())
|
|
220
|
+ var seconds = this.padDate(value.getSeconds())
|
|
221
|
+ return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
|
|
222
|
+ },
|
|
223
|
+ padDate(value) {
|
|
224
|
+ value = value < 10 ? '0' + value : value
|
|
225
|
+ return value
|
|
226
|
+ },
|
|
227
|
+ enditandAdd(state){
|
|
228
|
+ const ids = this.deleteIds
|
|
229
|
+ if (ids.length < 1) {
|
|
230
|
+ this.$message.error('请选择一行数据进行修改!')
|
|
231
|
+ return
|
|
232
|
+ }
|
|
233
|
+ if (ids.length > 1 ) {
|
|
234
|
+ this.$message.error('只能选择一行数据进行修改!')
|
|
235
|
+ return
|
|
236
|
+ }
|
|
237
|
+ this.shopAppraisalStatus(state)
|
|
238
|
+
|
|
239
|
+ },
|
|
240
|
+ clickTitle(ids){
|
|
241
|
+ this.$router.push({ name: 'grogshop-grogshopRoomEdit', query: { id: ids}})
|
|
242
|
+ },
|
|
243
|
+ // 弹出层
|
|
244
|
+ replyAdd(){
|
|
245
|
+ this.listQuery.code = 1
|
|
246
|
+ console.log('code',this.listQuery.code)
|
|
247
|
+ const ids = this.deleteIds
|
|
248
|
+ if (ids.length < 1) {
|
|
249
|
+ this.$message.error('请选择一行数据进行添加!')
|
|
250
|
+ return
|
|
251
|
+ }
|
|
252
|
+ if (ids.length > 1 ) {
|
|
253
|
+ this.$message.error('只能选择一行数据进行添加!')
|
|
254
|
+ return
|
|
255
|
+ }
|
|
256
|
+ this.listQuery.id = ids[0]
|
|
257
|
+ this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
|
|
258
|
+ if( res.data.shopAppraisalReplay !=null){
|
|
259
|
+ this.listQuery.id = ''
|
|
260
|
+ this.$message({
|
|
261
|
+ message: '您已回复当前评价',
|
|
262
|
+ type: 'warning'
|
|
263
|
+ });
|
|
264
|
+ return
|
|
265
|
+ }else{
|
|
266
|
+ this.listQuery.dialogFormVisible = true
|
|
267
|
+ this.ShopAppraisalDetails()
|
|
268
|
+ }
|
|
269
|
+ }).catch(() => {
|
|
270
|
+ console.log('error ShopAppraisalDetails')
|
|
271
|
+ })
|
|
272
|
+ },
|
|
273
|
+ // 查看详情
|
|
274
|
+ ShopAppraisalDetails(state){
|
|
275
|
+ this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
|
|
276
|
+ this.listQuery.content = res.data.shopAppraisal.content
|
|
277
|
+ }).catch(() => {
|
|
278
|
+ console.log('error ShopAppraisalDetails')
|
|
279
|
+ })
|
|
280
|
+ },
|
|
281
|
+ // 回复评论
|
|
282
|
+ TransactionReplyAdd(){
|
|
283
|
+ if (this.listQuery.replayContent ==='') {
|
|
284
|
+ this.$message.error('请输入您的回复内容')
|
|
285
|
+ return
|
|
286
|
+ }
|
|
287
|
+ this.$store.dispatch('shopType/ShopAppraisalReplayAddandEditor', this.listQuery).then((res) => {
|
|
288
|
+ this.$message({
|
|
289
|
+ message: '成功',
|
|
290
|
+ type: 'success'
|
|
291
|
+ })
|
|
292
|
+ this.listQuery.dialogFormVisible = false
|
|
293
|
+ this.listQuery.replayContent = ''
|
|
294
|
+ this.listQuery.id = ''
|
|
295
|
+ this.listQuery.content = ''
|
|
296
|
+ this.dataQuery()
|
|
297
|
+ }).catch(() => {
|
|
298
|
+ console.log('error ShopAppraisalDetails')
|
|
299
|
+ })
|
|
300
|
+ },
|
|
301
|
+ TransactionReplyOff(){
|
|
302
|
+ this.listQuery.dialogFormVisible = false
|
|
303
|
+ this.listQuery.replayContent = ''
|
|
304
|
+ this.listQuery.id = ''
|
|
305
|
+ this.listQuery.content = ''
|
|
306
|
+ },
|
|
307
|
+ // 修改回复
|
|
308
|
+ enditreply(){
|
|
309
|
+ this.listQuery.code = 2
|
|
310
|
+ const ids = this.deleteIds
|
|
311
|
+ if (ids.length < 1) {
|
|
312
|
+ this.$message.error('请选择一行数据进行修改!')
|
|
313
|
+ return
|
|
314
|
+ }
|
|
315
|
+ if (ids.length > 1 ) {
|
|
316
|
+ this.$message.error('只能选择一行数据进行修改!')
|
|
317
|
+ return
|
|
318
|
+ }
|
|
319
|
+ this.listQuery.id = ids[0]
|
|
320
|
+ this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
|
|
321
|
+ this.listQuery.content = res.data.shopAppraisal.content
|
|
322
|
+ if(res.data.shopAppraisalReplay == null){
|
|
323
|
+ this.listQuery.id = ''
|
|
324
|
+ this.$message({
|
|
325
|
+ message: '请先回复当前评价内容',
|
|
326
|
+ type: 'warning'
|
|
327
|
+ });
|
|
328
|
+ return
|
|
329
|
+ }
|
|
330
|
+ this.listQuery.replayContent = res.data.shopAppraisalReplay.replayContent
|
|
331
|
+ this.listQuery.dialogFormVisible = true
|
|
332
|
+ }).catch(() => {
|
|
333
|
+ console.log('error ShopAppraisalDetails')
|
|
334
|
+ })
|
|
335
|
+ },
|
|
336
|
+ // 上架和下架
|
|
337
|
+ shopAppraisalStatus(state){
|
|
338
|
+ const ids = this.deleteIds
|
|
339
|
+ this.listQuery.ides = ids
|
|
340
|
+ this.listQuery.status = state
|
|
341
|
+ this.$store.dispatch('shopType/ShopAppraisalStatuss', this.listQuery).then((res) => {
|
|
342
|
+ this.listQuery.id = ''
|
|
343
|
+ this.dataQuery()
|
|
344
|
+ }).catch(() => {
|
|
345
|
+ console.log('error ShopAppraisalStatuss')
|
|
346
|
+ })
|
|
347
|
+ },
|
|
348
|
+ // 修改权重
|
|
349
|
+ sort(id,sort) {
|
|
350
|
+ this.$prompt('请输入权重值', '提示', {
|
|
351
|
+ inputValue: sort,
|
|
352
|
+ confirmButtonText: '确定',
|
|
353
|
+ cancelButtonText: '取消',
|
|
354
|
+ inputPattern: /^[0-9]*$/,
|
|
355
|
+ inputErrorMessage: '请输入数字'
|
|
356
|
+ }).then(({ value }) => {
|
|
357
|
+ this.shopAppraisalStatus(value,id)
|
|
358
|
+ }).catch(() => {
|
|
359
|
+ });
|
|
360
|
+ },
|
|
361
|
+ shopAppraisalStatus(sort,id){
|
|
362
|
+ this.listQuery.sort = sort
|
|
363
|
+ this.listQuery.id = id
|
|
364
|
+ this.$store.dispatch('shopType/ShopAppraisalSort', this.listQuery).then((res) => {
|
|
365
|
+ this.$message({
|
|
366
|
+ message: '修改成功',
|
|
367
|
+ type: 'success'
|
|
368
|
+ })
|
|
369
|
+ this.listQuery.id = ''
|
|
370
|
+ this.dataQuery()
|
|
371
|
+ }).catch(() => {
|
|
372
|
+ console.log('error ShopAppraisalStatuss')
|
|
373
|
+ })
|
|
374
|
+ }
|
|
375
|
+ }
|
|
376
|
+}
|
|
377
|
+</script>
|
|
378
|
+
|
|
379
|
+<style>
|
|
380
|
+.form-listQuery{
|
|
381
|
+ margin-top: 20px;
|
|
382
|
+ margin-left: 30px;
|
|
383
|
+}
|
|
384
|
+.root{
|
|
385
|
+ display: flex;
|
|
386
|
+ flex-flow: column;
|
|
387
|
+}
|
|
388
|
+.block{
|
|
389
|
+ display: flex;
|
|
390
|
+ justify-content: flex-end;
|
|
391
|
+ margin-top: 10px;
|
|
392
|
+}
|
|
393
|
+.spanSize{
|
|
394
|
+ color:aqua
|
|
395
|
+}
|
|
396
|
+.textarea-inherit {
|
|
397
|
+ width: 100%;
|
|
398
|
+ overflow: auto;
|
|
399
|
+ word-break: break-all;
|
|
400
|
+ /* transform:translateY(5%); */
|
|
401
|
+ margin-left: -2.5%;
|
|
402
|
+ }
|
|
403
|
+</style>
|