| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
- <div slot="header">
- <div>
- <span>拼团等级</span>
- <div style="float: right; margin: -5px 10px">
- <el-button type="primary" size="small" @click="storage">创建等级</el-button>
- </div>
- <div style="float: right; margin: -5px 10px">
- <el-button type="primary" @click="$navigate({r: 'lucky-group/group-level/condition'})" size="small">升级条件设置</el-button>
- </div>
- </div>
- </div>
- <div class="table-body">
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column prop="id" label="ID" width="80" align="center">
- </el-table-column>
- <el-table-column prop="level" label="拼团等级" width="80" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">等级 {{scope.row.level}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="拼团等级名称" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.name}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="渠道奖佣金" align="center">
- <template slot-scope="scope">
- <!-- {{scope.row.team_commission}}{{scope.row.is_percent_team == 1?'%':'元'}} -->
- {{scope.row.team_commission}}
- </template>
- </el-table-column>
- <el-table-column label="平级奖佣金" align="center">
- <template slot-scope="scope">
- <!-- {{scope.row.equal_commission}}{{scope.row.is_percent_equal == 1?'%':'元'}} -->
- {{scope.row.equal_commission}}
- </template>
- </el-table-column>
- <el-table-column label="越级奖佣金" align="center">
- <template slot-scope="scope">
- {{scope.row.over_commission}}
- </template>
- </el-table-column>
- <!-- <el-table-column label="权益" align="center">
- <template slot-scope="scope">
- {{scope.row.desc?scope.row.desc:'--'}}
- </template>
- </el-table-column> -->
- <!-- <el-table-column label="是否启用" align="center">
- <template slot-scope="scope">
- <i style="color: #67C23A; font-size:24px" v-if="scope.row.enable == 1" class="el-icon-success"></i>
- <i style="color: #F56C6C; font-size:24px" v-if="scope.row.enable == 0" class="el-icon-error"></i>
- </template>
- </el-table-column> -->
- <el-table-column label="创建时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column label="操作" width="180" align="center">
- <template slot-scope="scope">
- <el-button circle size="small" type="text" @click="storage(scope.row.id)">编辑</el-button>
- <el-button circle size="small" type="text" @click="deleteLevel(scope.row.id, scope.$index)">删除</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>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- list: [],
- keyword: '',
- listLoading: false,
- page: 1,
- level: 1,
- pageCount: 0
- };
- },
- mounted: function() {
- this.getList();
- },
- methods: {
- search() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList() {
- this.listLoading = true;
- request({
- params: {
- r: 'lucky-group/group-level/index',
- limit: 10,
- page: this.page,
- },
- method: 'get',
- }).then(e => {
- //console.log('等级列表=='+JSON.stringify(e))
- this.listLoading = false;
- if (e.data.code == 0) {
- this.list = e.data.data.list;
- this.pageCount = e.data.data.page_count;
- } else {
- this.$message.error(e.data.msg)
- }
- }).catch(e => {
- console.log(e);
- });
- },
- storage(id=null){
- let request_url ={r: 'lucky-group/group-level/storage'};
- if(id) request_url.id = id;
- navigateTo(request_url);
- },
- deleteLevel(id, index) {
- // console.log(id, index);return null;
- let self = this;
- self.$confirm('删除该拼团等级, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.listLoading = true;
- request({
- params: {
- r: 'lucky-group/group-level/delete',
- },
- method: 'post',
- data: {
- id: 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('已取消删除')
- console.log('已取消删除');
- });
- },
- }
- });
- </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>
|