<template>
|
<div>
|
<list-condition-template ref="table" :form="listQuery" :formLabel="formLabel"
|
:tableData="tableData" :total="total"
|
@page-info-change="handlePageInfoChange">
|
<template slot="otherElement">
|
<el-col :span="24" :offset="0" class="buttonPosition">
|
<el-button size="mini" type="primary" @click="queryData">查询</el-button>
|
<el-button size="mini" @click="resetQuery">重置</el-button>
|
</el-col>
|
</template>
|
<template slot="columns">
|
<el-table-column label="订单编号" prop="busId" width="160px" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<!-- <span class="giftStyle" v-if="scope.row.orderTag">{{
|
scope.row.orderTag === 'returnPart' ? '部' : '退'
|
}}</span> -->
|
<el-link class="urlLink" @click="lookOrderInfo(scope.row)">{{ scope.row.busId }}
|
</el-link>
|
</template>
|
</el-table-column>
|
<el-table-column label="商品名称" prop="spuName" show-overflow-tooltip></el-table-column>
|
<el-table-column label="用户昵称">
|
<template slot-scope="scope">
|
{{scope.row.memberInfoVo && scope.row.memberInfoVo.memberNickName ? scope.row.memberInfoVo.memberNickName : '-' }}
|
</template>
|
</el-table-column>
|
<el-table-column label="评价类型">
|
<template slot-scope="scope">
|
<span v-if="getScoreType(scope.row.score).type == 'success'"
|
:style="{ color: '#10b434'}">{{getScoreType(scope.row.score).text}}</span>
|
<span v-if="getScoreType(scope.row.score).type == 'danger'"
|
:style="{ color: '#d0261e'}">{{getScoreType(scope.row.score).text}}</span>
|
<span v-if="getScoreType(scope.row.score).type == 'warning'"
|
:style="{ color: '#d0931e'}">{{getScoreType(scope.row.score).text}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="回复状态" prop="reply">
|
<template slot-scope="scope">
|
<span
|
:style="{ color: scope.row.reply ? '#10b434' : '#d0261e'}">{{scope.row.reply ? '已回复' : '未回复'}}</span>
|
</template>
|
</el-table-column>
|
<!-- 审核 -->
|
<el-table-column label="审核状态" prop="auditStatus" width="140px">
|
<template slot-scope="scope">
|
<span v-if="flagFn(scope.row).color == 'success'" class="statusTag"
|
:style="{ background: '#22d01e'}"></span>
|
<span v-if="flagFn(scope.row).color == 'danger'" class="statusTag"
|
:style="{ background: '#d0261e'}"></span>
|
<span v-if="flagFn(scope.row).color == 'warning'" class="statusTag"
|
:style="{ background: '#d0931e'}"></span>
|
<span>{{flagFn(scope.row).name}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="评价时间" prop="evalTime"></el-table-column>
|
<el-table-column label="操作" :width="`${3 * $store.getters.colSize}px`">
|
<template slot-scope="scope">
|
<wly-btn @click="lookInfo(scope.row)">详情</wly-btn>
|
<wly-btn :type="'warning'" v-show="!scope.row.reply" @click="replay(scope.row)">回复
|
</wly-btn>
|
<wly-btn style="margin-top:10px"
|
v-if="scope.row.auditStatus == null || scope.row.auditStatus == 0"
|
:type="'primary'" @click="auditingcheck(scope.$index, scope.row)">审核
|
</wly-btn>
|
</template>
|
</el-table-column>
|
</template>
|
</list-condition-template>
|
<el-dialog :visible.sync="dialogVisible" title="评价详情" :close-on-click-modal="false"
|
:modal-append-to-body="false" width="40%">
|
<evaluation-info :form="form"></evaluation-info>
|
<div slot="footer" class="dialog-footer">
|
<el-button size="mini" @click="dialogVisible=false">关闭</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog :visible.sync="innerVisible" title="评论审核" width="40%">
|
<audit-evaluation :form="form" @audit-operation="auditOperation"></audit-evaluation>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import evaluationApi from '@/api/evaluation'
|
import evaluationInfo from '@/views/evaluationMgt/components/detailsInfo.vue'
|
import auditEvaluation from '@/views/evaluationMgt/components/auditEvaluation.vue'
|
export default {
|
components: { evaluationInfo, auditEvaluation },
|
data () {
|
return {
|
// 保存当前点击的数据
|
listQuery: {
|
busId: null,
|
spuName: null,
|
evalStarTime: null,
|
evalType: null,
|
reply: null,
|
auditStatus: null
|
},
|
auditing: 1,
|
formLabel: [
|
{
|
model: 'busId',
|
label: '订单编号',
|
type: 'input'
|
// rule: /[^\w]/g // 可输入数字字母
|
},
|
{
|
model: 'spuName',
|
label: '商品名称',
|
type: 'input'
|
},
|
{
|
model: 'evalStarTime',
|
label: '评价时间',
|
type: 'date',
|
valueFormat: 'yyyy-MM-dd'
|
},
|
{
|
model: 'evalType',
|
label: '评价类型',
|
type: 'select',
|
opts: [
|
{
|
id: '01',
|
name: '好评'
|
},
|
{
|
id: '02',
|
name: '中评'
|
},
|
{
|
id: '03',
|
name: '差评'
|
}
|
]
|
},
|
{
|
model: 'reply',
|
label: '回复状态',
|
type: 'select',
|
opts: [
|
{
|
id: true,
|
name: '已回复'
|
},
|
{
|
id: false,
|
name: '未回复'
|
}
|
]
|
},
|
// 审核
|
{
|
model: 'auditStatus',
|
label: '审核状态',
|
type: 'select',
|
opts: [
|
{
|
id: '0',
|
name: '未审核'
|
},
|
{
|
id: '1',
|
name: '审核通过'
|
},
|
{
|
id: '2',
|
name: '审核拒绝'
|
}
|
]
|
}
|
],
|
tableData: [],
|
total: 0,
|
dialogVisible: false,
|
innerVisible: false,
|
form: {}
|
}
|
},
|
/**
|
* 数据变化后刷新列表
|
*/
|
activated () {
|
this.queryList(this.$refs.table.getPageInfo())
|
},
|
methods: {
|
// 审核操作
|
auditOperation (val) {
|
if (val) {
|
this.queryList(this.$refs.table.getPageInfo())
|
}
|
this.innerVisible = false
|
},
|
flagFn (row) {
|
switch (row.auditStatus) {
|
case '1': return {
|
name: '审核通过',
|
color: 'success'
|
}
|
case '2': return {
|
name: '审核拒绝',
|
color: 'danger'
|
}
|
default: return {
|
name: '未审核',
|
color: 'warning'
|
}
|
}
|
},
|
/**
|
* '分页信息改变时查询列表
|
*/
|
handlePageInfoChange (pageInfo) {
|
this.queryList(pageInfo)
|
},
|
/**
|
* 审核
|
*/
|
auditingcheck (idx, row) {
|
evaluationApi.detailsInfo({ evalId: row.id }).then(res => {
|
if (res.data) {
|
this.form = JSON.parse(JSON.stringify(res.data))
|
this.form.auditStatus = null
|
this.innerVisible = true
|
}
|
})
|
},
|
/**
|
* 重置
|
*/
|
resetQuery () {
|
this.$refs.table.reloadCurrent()
|
},
|
/**
|
* 点击查询按钮
|
*/
|
queryData () {
|
this.$refs.table.changeCondition()
|
},
|
/**
|
* 获取评价类型
|
*/
|
getScoreType (val) {
|
const str = {
|
text: null,
|
type: null
|
}
|
if (val === 1) {
|
str.text = '差评'
|
str.type = 'danger'
|
} else if (val > 1 && val <= 3) {
|
str.text = '中评'
|
str.type = 'warning'
|
} else {
|
str.text = '好评'
|
str.type = 'success'
|
}
|
return str
|
},
|
/**
|
* 跳到回复页面
|
*/
|
replay (row) {
|
this.$router.push({
|
name: 'evaluationInfo',
|
query: {
|
orderId: row.busId,
|
evalId: row.id
|
}
|
})
|
},
|
/**
|
* 查看详情
|
*/
|
lookInfo (row) {
|
evaluationApi.detailsInfo({ evalId: row.id }).then(res => {
|
if (res.data) {
|
this.form = JSON.parse(JSON.stringify(res.data))
|
this.dialogVisible = true
|
}
|
})
|
},
|
/**
|
* 查看订单详情
|
*/
|
lookOrderInfo (row) {
|
this.$router.push({
|
name: 'orderMgtInfo',
|
query: {
|
orderId: row.busId
|
// promotionStatus: row.promotionStatus
|
}
|
})
|
},
|
/**
|
* 查询列表
|
*/
|
queryList (pageInfo = { pageNum: 1, pageSize: 10 }) {
|
this.listQuery.bizId = 'B02'
|
this.listQuery.evalEndTime = this.listQuery.evalStarTime
|
evaluationApi.getList({ ...this.listQuery, ...pageInfo }).then((res) => {
|
if (res.data) {
|
this.tableData = res.data.list
|
this.total = res.data.total
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style>
|
.auditForm {
|
text-align: center;
|
}
|
.statusTag {
|
width: 6px;
|
height: 6px;
|
border-radius: 50%;
|
display: inline-block;
|
margin-right: 4px;
|
position: relative;
|
bottom: 2px;
|
}
|
</style>
|