| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- @extends('layouts.base')
- @section('title', '代理商等级管理')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
- <div id='re_content'>
- <div class="con">
- <div class="setting">
- <div class="block">
- <div class="title" style="justify-content: space-between;">
- <div style="display:flex;align-items:center;">
- <span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>代理商等级</b>
- </div>
- <a href="{!! yzWebFullUrl('plugin.agency.admin.level.add-page') !!} ">
- <el-button size="mini" type="primary">添加代理商等级</el-button>
- </a>
- </div>
- </div>
- <template style="margin-top:-10px;">
- <el-table
- :data="tableData"
- style="padding:0 10px"
- >
- <el-table-column
- prop="id"
- align="center"
- label="代理商等级ID"
- >
- </el-table-column>
- <el-table-column
- prop="weight"
- align="center"
- label="代理商等级权重"
- >
- </el-table-column>
- <el-table-column
- prop="title"
- align="center"
- label="代理商等级名称"
- >
- </el-table-column>
- <el-table-column
- prop="agency_count"
- align="center"
- label="代理商等级人数"
- >
- </el-table-column>
- <el-table-column
- align="center"
- label="操作"
- >
- <template slot-scope="scope">
- <el-button size="mini" style="margin-right: 10px;" @click="goEdit(scope.row)">编辑
- </el-button>
- <el-button size="mini" style="margin-right: 10px;" @click="del(scope, tableData)">删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-row style="background-color:#fff;">
- <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0" v-loading="loading">
- <el-pagination background @current-change="currentChange"
- :current-page="current_page"
- layout="prev, pager, next"
- :page-size="Number(page_size)" :current-page="current_page"
- :total="page_total"></el-pagination>
- </el-col>
- </el-row>
- </template>
- </div>
- </div>
- </div>
- <script>
- let vm = new Vue({
- el: "#re_content",
- delimiters: ['[[', ']]'],
- data() {
- return {
- obj: {},
- activeName: 'one',
- loading: false,
- page_total: 0,
- page_size: 0,
- current_page: 0,
- dialogVisible: false,
- report_id: '',
- times: [],
- search_loading: false,
- all_loading: false,
- info: {},
- search_form: {
- name: '',
- rank_type: ''
- },
- real_search_form: {},
- tableData: []
- }
- },
- mounted() {
- this.search();
- },
- methods: {
- del(scope, rows) {
- this.$confirm('是否删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- rows.splice(scope.$index, 1);
- let json = {
- id: scope.row.id
- }
- this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.delete') !!}', json).then(function (response) {
- if (response.data.result) {
- this.$message({message: "删除成功", type: "success"});
- this.loading = false;
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- console.log(response);
- this.loading = false;
- }
- );
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消操作'
- });
- });
- },
- goEdit(item) {
- window.location.href = `{!! yzWebFullUrl('plugin.agency.admin.level.add-page') !!}` + `&id=` + item.id;
- },
- search() {
- this.search_loading = true;
- let json = {
- search: this.search_form,
- }
- this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.get-list') !!}', json
- ).then(function (response) {
- if (response.data.result) {
- let datas = response.data.data;
- this.tableData = datas.data;
- this.page_total = datas.total;
- this.page_size = datas.per_page;
- this.current_page = datas.current_page;
- this.loading = false;
- this.real_search_form = Object.assign({}, this.search_form);
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- this.search_loading = false;
- }, function (response) {
- this.search_loading = false;
- this.$message({message: response.data.msg, type: 'error'});
- }
- );
- },
- currentChange(val) {
- this.loading = true;
- this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.get-list') !!}', {
- page: val,
- search: this.real_search_form
- }).then(function (response) {
- if (response.data.result) {
- let datas = response.data.data;
- this.tableData = datas.data;
- this.page_total = datas.total;
- this.page_size = datas.per_page;
- this.current_page = datas.current_page;
- this.loading = false;
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- console.log(response);
- this.loading = false;
- }
- );
- },
- },
- });
- </script>
- @endsection
|