123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <div class="recharge">
- <!-- 头部细节部分 -->
- <div class="title">
- <el-row>
- <el-col :span="24">
- <div class="top">
- <el-input placeholder="用户名称" class="input-demo" v-model="userName"></el-input>
- <el-input placeholder="手机号" class="input-demo" v-model="userPhone"></el-input>
- <el-input placeholder="用户所在公司" class="input-demo" v-model="userCompany"></el-input>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div class="top">
- <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 头部细节部分结束 -->
- <!-- 表格部分 -->
- <template>
- <el-table
- v-loading="loading"
- ref="multipleTable"
- :data="usertable"
- border
- tooltip-effect="dark">
- <el-table-column
- label="用户名"
- prop="userName"
- show-overflow-tooltip>
- </el-table-column>
- <el-table-column
- prop="userPhone"
- label="手机号"
- show-overflow-tooltip>
- </el-table-column>
- <el-table-column
- prop="userCompany"
- label="用户所在公司"
- show-overflow-tooltip>
- </el-table-column>
- <el-table-column
- label="创建时间"
- show-overflow-tooltip>
- <template slot-scope="scope" show-overflow-tooltip>
- <span>{{scope.row.createTime | fmtDate}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="充值前余额(元)"
- show-overflow-tooltip>
- <template slot-scope="scope" show-overflow-tooltip>
- <span>{{scope.row.beforeMoney / 100}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="充值金额(元)"
- show-overflow-tooltip>
- <template slot-scope="scope" show-overflow-tooltip>
- <span>{{scope.row.money / 100}}</span>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 分页 -->
- <div class="block">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="current"
- :page-sizes="[6, 8, 10]"
- :page-size="pagesize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import axios from 'axios';
- export default{
- data() {
- return {
- loading: true,
- usertable: [],
- userName: "",
- userPhone: "",
- userCompany: "",
- current: 1,
- pagesize: 8,
- // 总共有多少条数据
- total: 0,
- }
- },
- created() {
- this.loadData();
- },
- methods: {
- // 列表展示
- async loadData() {
- const formData = new FormData();
- formData.append('current', this.current);
- formData.append('size', this.pagesize);
- const response = await this.$http.post(`recharge/list`, formData);
- if (response.data.code === 0) {
- this.loading = false;
- this.usertable = response.data.data.records;
- this.total = response.data.data.total;
- }
- },
- //查询
- async queryLook() {
- const formData = new FormData();
- formData.append('current', this.current);
- formData.append('size', this.pagesize);
- formData.append('userName', this.userName);
- formData.append('userPhone', this.userPhone);
- formData.append('userCompany', this.userCompany);
- const response = await this.$http.post(`recharge/list`, formData);
- if (response.data.code === 0) {
- this.loading = false;
- this.usertable = response.data.data.records;
- this.total = response.data.data.total;
- }
- },
- // 分页方法
- handleSizeChange(val) {
- this.pagesize = val;
- if(this.userName !== '' || this.userPhone !== '' || this.userCompany !== '') {
- this.queryLook();
- }else{
- this.loadData();
- };
- console.log(`每页 ${val} 条`);
- },
- handleCurrentChange(val) {
- this.current = val;
- if(this.userName !== '' || this.userPhone !== '' || this.userCompany !== '') {
- this.queryLook();
- }else{
- this.loadData();
- };
- console.log(`当前页: ${val}`);
- },
- }
- };
- </script>
- <style>
- .recharge {
- border: 1px solid #d9d9d9;
- border-radius: 10px;
- }
- .recharge .title {
- font-size: 5px;
- margin-bottom: 20px;
- }
- .recharge .top {
- padding-top: 20px;
- padding-left: 20px;
- }
- .recharge .text {
- display: inline-block;
- color: #000;
- font-size: 16px ;
- margin-left: 1%;
- }
- .recharge .input-demo {
- display: inline-block;
- width: 20%;
- margin-left: 1%;
- }
- .recharge .block {
- font-size: 5px;
- text-align: center;
- margin-top: 15px;
- margin-bottom: 20px;
- }
- .recharge .tou {
- font-size: 20px;
- height: 30px;
- line-height: 30px;
- padding-top: 15px;
- }
- .recharge .line {
- margin-top: 15px;
- margin-bottom: 15px;
- width: 100%;
- height: 2px;
- background-color: #d9d9d9;
- }
- .recharge .xinxi {
- text-align: center;
- margin: 15px auto;
- font-size: 18px;
- }
- </style>
|