| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <style>
- .label{
- margin-right: 10px;
- }
- .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;
- }
- .el-button--primary2 {
- color: #FFF;
- background-color: #03C5FF;
- border-color: #03C5FF;
- }
- /*头像样式 start*/
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .el-table_1_column_3 .cell { /*-2 表示在第二行*/
- display: flex;
- }
- /*头像样式 end*/
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>认领记录</span>
- </div>
- </template>
- </div>
- <div class="table-body">
- <div size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
- <div class="item-box" flex="dir:left cross:center" style="margin-left: 10px;">
- <div class="label">支付时间: </div>
- <el-date-picker
- size="small"
- v-model="search.create_time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
- <div class="label">会员ID: </div>
- <el-input size="small" style="width: 210px" v-model="search.user_id" placeholder="请输入会员ID"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
- <div class="label">会员: </div>
- <el-input size="small" style="width: 210px" v-model="search.user_keyword" placeholder="会员昵称/手机号码"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
- </el-button>
- <el-button type="danger" style="padding: 12px 34px !important;" size="small" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </div>
- </div>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
- <el-table-column label="会员ID" min-width="150" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.user_id}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="会员" >
- <template slot-scope="scope">
- <div class="user_img" v-if="scope.row.user_id>0">
- <el-image class="default-avatar" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- </div>
- <div class="user_img" v-else>
- <el-image class="default-avatar" :src="scope.row.user_avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- </div>
- <div>
- <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
- <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
- <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="领取证书" min-width="100" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.certificate.name}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="领取编号" min-width="100" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.number}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column prop="scope" width="180" label="创建时间">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination v-if="pagination" :page-size="pagination.pageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.total_count">
- </el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- list: [],
- listLoading: false,
- pagination:null,
- page: 1,
- pageCount: 0,
- search: {
- user_id:'',
- user_keyword:'',
- create_time:'',
- },
- };
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.search.user_id)
- ||!isEmpty(this.search.create_time)
- ||!isEmpty(this.search.user_keyword)
- }
- },
- methods: {
- resetSearch(){
- this.search = {
- user_id:'',
- create_time:'',
- user_keyword:'',
- }
- },
- searchs() {
- this.page = 1;
- this.getList();
- },
- pageChange(currentPage) {
- let self = this;
- self.page = currentPage; //console.log(currentPage,999999);
- self.getList();
- },
- getList() {
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'certificate/claim/index',
- page: self.page,
- user_id: this.search.user_id,
- create_time: this.search.create_time,
- user_keyword:this.search.user_keyword,
- },
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pagination.pageSize = e.data.data.page_size;
- this.pagination.total_count = e.data.data.count;
- }).catch(e => {
- console.log(e);
- });
- },
- },
- mounted: function () {
- this.getList();
- }
- });
- </script>
|