<template>
|
<!--
|
作者:yj
|
-->
|
<div class="user">
|
<!--搜索表单-->
|
<div class="common-seach-wrap">
|
<el-form size="small" :inline="true" :model="searchForm" class="demo-form-inline">
|
<!-- <el-form-item label="类目">
|
<el-select size="small" v-model="searchForm.category_id" placeholder="所有分类">
|
<el-option label="全部" value="0"></el-option>
|
<el-option v-for="(item, index) in categoryList" :key="index" :label="item.name" :value="item.category_id">
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<el-form-item label="用户id">
|
<el-input size="small" v-model="searchForm.user_id" placeholder="请输入用户id"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="small" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
<el-button size="small" type="info" @click="cancelFunc">返回上一页</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
<!--内容-->
|
<div class="product-content">
|
<div class="table-wrap">
|
<el-table size="small" :data="tableData" border style="width: 100%" v-loading="loading">
|
<el-table-column prop="id" label="ID" width="100"></el-table-column>
|
<el-table-column prop="user.nickName" label="评论用户" width="200"></el-table-column>
|
<el-table-column prop="nickName" label="微信头像" width="100">
|
<template slot-scope="scope">
|
<img :src="scope.row.user.avatarUrl" width="30px" height="30px" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="score_txt" label="评分" width="100"></el-table-column>
|
<el-table-column prop="status" label="图片" width="200">
|
<template slot-scope="scope">
|
<a style="margin-right:5px;" v-for="(item, index) in scope.row.image_list" target="_blank" :href="item.file_path"><img :src="item.file_path" width="30px" height="30px" /></a>
|
</template>
|
</el-table-column>
|
<el-table-column prop="evaluate_content" label="评语"></el-table-column>
|
<el-table-column fixed="right" label="操作" width="200">
|
<template slot-scope="scope">
|
<el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
|
<!--分页-->
|
<div class="pagination">
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background
|
:current-page="curPage" :page-size="pageSize" layout="total, prev, pager, next, jumper"
|
:total="totalDataNumber"></el-pagination>
|
</div>
|
|
</div>
|
|
</div>
|
</template>
|
|
<script>
|
import PlusApi from '@/api/plus/release.js';
|
import {deepClone} from '@/utils/base.js';
|
export default {
|
components: {
|
},
|
data() {
|
return {
|
/*是否加载完成*/
|
loading: true,
|
/*一页多少条*/
|
pageSize: 10,
|
/*一共多少条数据*/
|
totalDataNumber: 0,
|
/*当前是第几页*/
|
curPage: 1,
|
/*列表数据*/
|
tableData: [],
|
/*横向表单数据模型*/
|
/*搜索参数*/
|
searchForm: {
|
user_id: '',
|
category_id: ''
|
},
|
project_id:''
|
};
|
},
|
created() {
|
/*获取列表*/
|
this.getTableList();
|
|
},
|
methods: {
|
/*选择第几页*/
|
handleCurrentChange(val) {
|
let self = this;
|
self.loading = true;
|
self.curPage = val;
|
self.getTableList();
|
},
|
|
/*每页多少条*/
|
handleSizeChange(val) {
|
this.pageSize = val;
|
this.getTableList();
|
},
|
|
|
/*获取列表*/
|
getTableList() {
|
let self = this;
|
let Params = self.searchForm;
|
Params.page = self.curPage;
|
Params.list_rows = self.pageSize;
|
Params.project_id = self.$route.query.project_id;;
|
PlusApi.evaluate(Params, true)
|
.then(data => {
|
self.loading = false;
|
self.tableData = data.data.list.data;
|
self.totalDataNumber = data.data.list.total;
|
})
|
.catch(error => {
|
|
});
|
},
|
/*搜索查询*/
|
onSubmit() {
|
this.curPage = 1;
|
this.getTableList();
|
},
|
|
cancelFunc() {
|
this.$router.back(-1);
|
},
|
/*删除*/
|
deleteClick(row) {
|
let self = this;
|
self.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
self.loading = true;
|
PlusApi.evaluateDel({
|
id: row.id
|
}, true)
|
.then(data => {
|
self.loading = false;
|
if (data.code == 1) {
|
self.$message({
|
message: data.msg,
|
type: 'success'
|
});
|
self.getTableList();
|
} else {
|
self.$message.error('错了哦,这是一条错误消息');
|
}
|
})
|
.catch(error => {
|
self.loading = false;
|
});
|
|
}).catch(() => {
|
|
});
|
}
|
|
}
|
};
|
</script>
|
|
<style></style>
|