123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <template>
- <div class="page-box" v-loading="loading > 0">
- <Header :title="title"></Header>
- <div class="container">
- <div class="content">
- <!-- 表格 -->
- <div class="filter-box">
- <div class="filter">
- <div class="filter-item">
- <div class="label">审核状态:</div>
- <el-select v-model="filter.way" size="small" class="select" placeholder="请选择">
- <el-option v-for="item in statusList" :key="item.value" :label="item.name" :value="item.value">
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="btn-box">
- <button class="search" @click="search">筛选</button>
- <button class="reset" @click="reset">重置</button>
- </div>
- </div>
- <el-table :data="list" class="table no-border-table" ref="table" :header-cell-style="{
- border: 'none',
- color: '#333',
- background: '#f6f6f6',
- borderBottom: '1px solid #E8E8E8',
- height: '54px',
- }" :row-style="{
- height: '54px',
- }">
- <el-table-column prop="uid" align="center" label="发布人ID"></el-table-column>
- <el-table-column prop="subject" align="center" label="主题"></el-table-column>
- <el-table-column prop="phone" align="center" label="联系电话"></el-table-column>
- <el-table-column prop="status" align="center" label="状态">
- <div slot-scope="scope">
- {{ statusMap[scope.row.way]}}
- </div>
- </el-table-column>
- <el-table-column label="操作" align="center" width="180">
- <div slot-scope="scope" style="display: flex; justify-content: center">
- <button size="mini" class="table-btn" @click="handleDelete(scope.row.id)" v-if="scope.row.way !== 1">
- 删除
- </button>
- <button size="mini" class="table-btn" @click="handlePass(scope.row.id)" v-if="scope.row.way === 1">
- 通过
- </button>
- <button size="mini" class="table-btn" @click="rejectModal(scope.row.id)" v-if="scope.row.way === 1">
- 驳回
- </button>
- <button size="mini" class="table-btn" @click="toDetail(scope.row.id)">
- 详情
- </button>
- </div>
- </el-table-column>
- </el-table>
- </div>
- <!-- 分页按钮 -->
- <div class="footer">
- <el-pagination @current-change="handleCurrentChange" :current-page.sync="currentPage" background
- layout="total, prev, pager, next, jumper" :page-size="size" :total="total"></el-pagination>
- </div>
- <el-dialog title="确认驳回该订单吗?" width="450px" :visible.sync="rejectVisible">
- <div class="reject-title"><span>*</span>请填写驳回理由</div>
- <div style="padding: 0 16px">
- <div class="remark-box">
- <textarea rows="8" class="remark" v-model="remark" placeholder="驳回理由"></textarea>
- </div>
- </div>
- <div slot="footer" class="dialog-footer">
- <!-- <el-button @click.native="reject()" class="cancel-btn">驳 回</el-button> -->
- <el-button @click.native="rejectVisible = false" class="cancel-btn btn">取 消</el-button>
- <el-button type="primary" @click.native="handleReject" class="confirm-btn btn">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </div>
- </template>
- <script type="text/ecmascript-6">
- import Header from '../../components/common/header';
- export default {
- components: {
- Header
- },
- name: 'balanceExamine',
- data() {
- return {
- currentPage: 1, // 当前页码
- size: 20, // 每页条数
- total: 0, // 总页数
- loading: 0, // 加载中
- title: {
- // 页面标题
- firstTitile: '消息管理',
- secondTitle: '消息管理'
- },
- filter: {
- way: -1
- },
- statusList: [
- {
- name: '全部',
- value: -1
- },
- {
- name: '审核中',
- value: 1
- },
- {
- name: '已通过',
- value: 2
- }
- ],
- statusMap: {
- 1: '审核中',
- 2: '已通过'
- },
- list: [], // 用户列表
- rejectVisible: false,
- id: null,
- remark: ''
- };
- },
- mounted() {
- // 获取列表
- this.getList();
- },
- computed: {},
- methods: {
- // 切换页码
- handleCurrentChange(page) {
- this.currentPage = page;
- this.getList();
- },
- // 获取列表
- getList() {
- this.loading++;
- this.httpGet(this.$root.getMessageList, {
- page: this.currentPage,
- size: this.size,
- ...this.filter
- }).then(
- (res) => {
- this.loading--;
- this.list = res.list;
- this.total = res.total;
- },
- (res) => {
- this.loading--;
- this.$message.error(res);
- }
- );
- },
- // 过滤
- search() {
- this.currentPage = 1;
- this.getList();
- },
- // 重置过滤
- reset() {
- this.filter = {
- way: -1
- };
- this.getList();
- },
- handleDelete(id) {
- this.$confirm(
- `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要删除吗?</p>`,
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- cancelButtonClass: 'cancel-btn',
- confirmButtonClass: 'confirm-btn',
- customClass: 'confirm-box',
- dangerouslyUseHTMLString: true,
- showClose: false,
- type: 'none'
- }
- ).then(() => {
- this.loading++;
- this.httpDelete(this.$root.deleteMessage, {
- id
- }).then(
- (res) => {
- this.$message({
- message: '操作成功',
- type: 'success'
- });
- this.loading--;
- this.getList();
- },
- (res) => {
- this.loading--;
- this.$message.error(res);
- }
- );
- });
- },
- handlePass(id) {
- this.$confirm(
- `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要通过吗?</p>`,
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- cancelButtonClass: 'cancel-btn',
- confirmButtonClass: 'confirm-btn',
- customClass: 'confirm-box',
- dangerouslyUseHTMLString: true,
- showClose: false,
- type: 'none'
- }
- ).then(() => {
- this.loading++;
- this.httpPut(this.$root.passMessage, {
- id
- }).then(
- (res) => {
- this.$message({
- message: '操作成功',
- type: 'success'
- });
- this.loading--;
- this.getList();
- },
- (res) => {
- this.loading--;
- this.$message.error(res);
- }
- );
- });
- },
- rejectModal(id) {
- this.rejectVisible = true;
- this.id = id;
- },
- handleReject() {
- this.loading++;
- this.httpPut(this.$root.refuseMessage, {
- id: this.id,
- remark: this.remark
- }).then(
- (res) => {
- this.rejectVisible = false;
- this.$message({
- message: '操作成功',
- type: 'success'
- });
- this.loading--;
- this.getList();
- },
- (res) => {
- this.loading--;
- this.$message.error(res);
- }
- );
- },
- toDetail(id) {
- this.$router.push({
- name: 'messageDetail',
- query: {
- id
- }
- });
- }
- }
- };
- </script>
- <style lang="stylus" rel="stylesheet/stylus">
- @import '~assets/public.styl';
- </style>
- <style lang="stylus" rel="stylesheet/stylus" scoped>
- @import '~assets/main.styl';
- .page-box {
- height: 100%;
- width: 100%;
- flex-y(flex-start, flex-start);
- overflow-y: hidden;
- background: bg-color;
- .container {
- box-sizing: border-box;
- height: 100%;
- width: 100%;
- overflow-y: auto;
- flex-y(flex-start, flex-start);
- padding: 10px;
- // content 表格
- .content {
- flex: 1;
- width: 100%;
- font-size: 14px;
- background: white;
- box-sizing: border-box;
- padding: 24px 32px;
- border-radius: 2px;
- // 按钮
- .btn {
- width: 100px;
- height: 32px;
- line-height: 32px;
- confirm-btn();
- font-size: 14px;
- margin: 16px 0;
- }
- // 表格按钮
- .table-btn {
- // width: 65px;
- height: 24px;
- line-height: 24px;
- color: gray3;
- font-size: 12px;
- margin-right: 8px;
- cancel-btn();
- padding: 0 8px;
- }
- .filter-item {
- margin-right: 12px;
- }
- .select, .input {
- width: 125px;
- }
- .date-input {
- width: 360px;
- }
- .btn-box {
- margin: 0;
- }
- .table {
- margin-top: 24px !important;
- }
- .table-img {
- height: 32px;
- width: 32px;
- border-radius: 4px;
- object-fit: fill;
- }
- }
- }
- .footer {
- width: 100%;
- padding: 24px;
- box-sizing: border-box;
- flex-x(flex-end);
- background: white;
- }
- .dialog-content {
- flex-y();
- }
- .form {
- width: 100%;
- flex-center();
- margin: 8px 0;
- }
- .reject-title {
- border-top: 1px solid #eee;
- padding: 12px 13px 0;
- word(14px, #666);
- span {
- color: #FD4545;
- display: inline-block;
- width: 15px;
- }
- }
- .remark-box {
- width: 100%;
- padding-left: 15px;
- box-sizing: border-box;
- }
- .remark {
- border: 1px solid #f1f1f1;
- width: 100%;
- margin: 12px 0;
- padding: 12px;
- box-sizing: border-box;
- }
- }
- </style>
|