| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * Created by PhpStorm
- * Author: ganxiaohao
- * Date: 2020-05-08
- * Time: 16:11
- */
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('apply-edit', dirname(__DIR__) . '/components');
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="table-body">
- <el-table
- v-loading="listLoading"
- :data="list"
- stripe
- style="width: 100%">
- <el-table-column
- prop="id"
- label="ID"
- align="center"
- width="80">
- </el-table-column>
- <el-table-column label="基本信息" width="200">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 5px;" mode="aspectFill"
- :src="scope.row.user.avatar_url"></com-image>
- <div>{{scope.row.user.nickname}}</div>
- </template>
- </el-table-column>
- <el-table-column label="姓名" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.realname}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="电话" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.mobile}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column
- label="状态"
- width="120"
- align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.status==0">待处理</span>
- <span v-if="scope.row.status==1">通过</span>
- <span v-if="scope.row.status==2">未通过</span>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- width="180"
- align="center">
- <template slot-scope="scope">
- <el-button v-if="scope.row.status == 0" circle size="mini" type="text" @click="editApply(scope.row)">
- <el-tooltip class="item" effect="dark" content="审核" placement="top">
- <img style="width: 25px; border-radius:8px;" src="resources/img/common/audit.png" alt="">
- </el-tooltip>
- </el-button>
- <el-button circle size="mini" type="text" @click="applyDelete(scope.row, scope.$index)">
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
- <img src="resources/img/common/del.png" alt="">
- </el-tooltip>
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination
- @current-change="pagination"
- background
- layout="prev, pager, next"
- :page-count="pageCount">
- </el-pagination>
- </div>
- </div>
- </el-card>
- <apply-edit v-model="edit.show" :value="edit.show" :row="row"></apply-edit>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- list: [],
- keyword: '',
- listLoading: false,
- page: 1,
- user_id: 0,
- pageCount: 0,
- edit:{
- show: false,
- user_id:0,
- },
- row:{
- user_id:0
- }
- };
- },
- mounted: function () {
- this.getList();
- },
- methods: {
- search() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList() {
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'distribution/audit/apply',
- page: self.page,
- keyword: this.keyword
- },
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- self.pageCount = e.data.data.page_count;
- }).catch(e => {
- console.log(e);
- });
- },
- editApply(row) {
- this.edit.user_id = row.user_id
- this.edit.show = true;
- this.row.user_id=row.user_id;
- this.row.id=row.id;
- },
- applyDelete(row, index) {
- let self = this;
- self.$confirm('删除该经销商等级, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.listLoading = true;
- request({
- params: {
- r: 'distribution/audit/apply-delete',
- },
- method: 'post',
- data: {
- id: row.id,
- }
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- self.list.splice(index, 1);
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- }).catch(() => {
- self.$message.info('已取消删除')
- });
- },
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
-
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- }
- </style>
|