| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <?php
- use common\helpers\ComponentHelper;
- use common\helpers\AddonHelper;
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>会员核销码</span>
- <el-form size="small" :inline="true" :model="search" style="float: right;margin-top: -5px;">
- <el-form-item>
- </el-form-item>
- </el-form>
- </div>
- <div class="table-body">
- <div class="input-item">
- <el-input @keyup.enter.native="getList" size="small" placeholder="请输入用户ID" v-model="search.user_id"
- clearable @clear="toSearch">
- <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="getList" size="small" placeholder="请输入用户昵称/手机号" v-model="search.keyword"
- clearable @clear="toSearch">
- <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="getList" size="small" placeholder="核销码ID" v-model="search.code"
- clearable @clear="toSearch">
- <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
- </el-input>
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
- @selection-change="handleSelectionChange">
- <el-table-column align='center' type="selection" width="60" ></el-table-column>
- <el-table-column prop="user_id" width="80" label="用户ID" align="center"></el-table-column>
- <el-table-column label="基本信息">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 5px;" mode="aspectFill" :src="scope.row.user.avatar_url?scope.row.user.avatar_url:'/resources/img/common/default-avatar.png'"></com-image>
- <div>{{scope.row.user.nickname}}</div>
- </template>
- </el-table-column>
- <el-table-column label="手机号" prop="mobile" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.user.mobile}}</div>
- </template>
- </el-table-column>
- <!-- <el-table-column label="核销码" prop="code" align="center">
- </el-table-column> -->
- <el-table-column label="可核销次数" prop="num" align="center">
- </el-table-column>
- <el-table-column label="已核销次数" prop="used_num" align="center">
- </el-table-column>
- <!-- <el-table-column label="二维码" prop="code_url" align="center" style="width: 50px;height: 50px;">
- <template slot-scope="scope">
- <div>
- <el-image :src="scope.row.code_url" :preview-src-list="[scope.row.code_url]">
- </el-image>
- </div>
- </template>
- </el-table-column> -->
- <el-table-column
- fixed="right"
- label="操作"
- align="center"
- width="150">
- <template slot-scope="scope">
- <el-button @click="toDetails(scope.row.user_id)" type="text" size="small">查看详情</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>
- </el-tabs>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- activeName: '',
- loading: false,
- page: 1,
- pageCount: 0,
- disabledLevel: 0,
- list: [],
- choose_list: [],
- search: {},
- },
- mounted() {
- this.getList();
- },
- methods: {
- toDetails(user_id){
- this.$navigate({
- r: 'write-off/default/list',
- user_id: user_id
- })
- },
- getList() {
- let self = this;
- self.loading = true;
- let params = {
- r: 'write-off/default/index',
- page: self.page
- };
- params = Object.assign(params, this.search);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- self.loading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list.list;
- self.pageCount = e.data.data.list.page_count;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.loading = false;
- });
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- handleClick(tab, event) {
- this.search.page = 1;
- this.search.status = this.activeName;
- this.getList()
- },
- toSearch() {
- this.search.page = 1;
- this.getList();
- },
- handleSelectionChange(val) {
- let self = this;
- self.choose_list = [];
- val.forEach(function (item) {
- self.choose_list.push(item.id);
- })
- },
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- .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;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .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>
|