level.blade.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. @extends('layouts.base')
  2. @section('title', '代理商等级管理')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
  5. <div id='re_content'>
  6. <div class="con">
  7. <div class="setting">
  8. <div class="block">
  9. <div class="title" style="justify-content: space-between;">
  10. <div style="display:flex;align-items:center;">
  11. <span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>代理商等级</b>
  12. </div>
  13. <a href="{!! yzWebFullUrl('plugin.agency.admin.level.add-page') !!} ">
  14. <el-button size="mini" type="primary">添加代理商等级</el-button>
  15. </a>
  16. </div>
  17. </div>
  18. <template style="margin-top:-10px;">
  19. <el-table
  20. :data="tableData"
  21. style="padding:0 10px"
  22. >
  23. <el-table-column
  24. prop="id"
  25. align="center"
  26. label="代理商等级ID"
  27. >
  28. </el-table-column>
  29. <el-table-column
  30. prop="weight"
  31. align="center"
  32. label="代理商等级权重"
  33. >
  34. </el-table-column>
  35. <el-table-column
  36. prop="title"
  37. align="center"
  38. label="代理商等级名称"
  39. >
  40. </el-table-column>
  41. <el-table-column
  42. prop="agency_count"
  43. align="center"
  44. label="代理商等级人数"
  45. >
  46. </el-table-column>
  47. <el-table-column
  48. align="center"
  49. label="操作"
  50. >
  51. <template slot-scope="scope">
  52. <el-button size="mini" style="margin-right: 10px;" @click="goEdit(scope.row)">编辑
  53. </el-button>
  54. <el-button size="mini" style="margin-right: 10px;" @click="del(scope, tableData)">删除
  55. </el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <el-row style="background-color:#fff;">
  60. <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0" v-loading="loading">
  61. <el-pagination background @current-change="currentChange"
  62. :current-page="current_page"
  63. layout="prev, pager, next"
  64. :page-size="Number(page_size)" :current-page="current_page"
  65. :total="page_total"></el-pagination>
  66. </el-col>
  67. </el-row>
  68. </template>
  69. </div>
  70. </div>
  71. </div>
  72. <script>
  73. let vm = new Vue({
  74. el: "#re_content",
  75. delimiters: ['[[', ']]'],
  76. data() {
  77. return {
  78. obj: {},
  79. activeName: 'one',
  80. loading: false,
  81. page_total: 0,
  82. page_size: 0,
  83. current_page: 0,
  84. dialogVisible: false,
  85. report_id: '',
  86. times: [],
  87. search_loading: false,
  88. all_loading: false,
  89. info: {},
  90. search_form: {
  91. name: '',
  92. rank_type: ''
  93. },
  94. real_search_form: {},
  95. tableData: []
  96. }
  97. },
  98. mounted() {
  99. this.search();
  100. },
  101. methods: {
  102. del(scope, rows) {
  103. this.$confirm('是否删除?', '提示', {
  104. confirmButtonText: '确定',
  105. cancelButtonText: '取消',
  106. type: 'warning'
  107. }).then(() => {
  108. rows.splice(scope.$index, 1);
  109. let json = {
  110. id: scope.row.id
  111. }
  112. this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.delete') !!}', json).then(function (response) {
  113. if (response.data.result) {
  114. this.$message({message: "删除成功", type: "success"});
  115. this.loading = false;
  116. } else {
  117. this.$message({message: response.data.msg, type: 'error'});
  118. }
  119. }, function (response) {
  120. console.log(response);
  121. this.loading = false;
  122. }
  123. );
  124. }).catch(() => {
  125. this.$message({
  126. type: 'info',
  127. message: '已取消操作'
  128. });
  129. });
  130. },
  131. goEdit(item) {
  132. window.location.href = `{!! yzWebFullUrl('plugin.agency.admin.level.add-page') !!}` + `&id=` + item.id;
  133. },
  134. search() {
  135. this.search_loading = true;
  136. let json = {
  137. search: this.search_form,
  138. }
  139. this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.get-list') !!}', json
  140. ).then(function (response) {
  141. if (response.data.result) {
  142. let datas = response.data.data;
  143. this.tableData = datas.data;
  144. this.page_total = datas.total;
  145. this.page_size = datas.per_page;
  146. this.current_page = datas.current_page;
  147. this.loading = false;
  148. this.real_search_form = Object.assign({}, this.search_form);
  149. } else {
  150. this.$message({message: response.data.msg, type: 'error'});
  151. }
  152. this.search_loading = false;
  153. }, function (response) {
  154. this.search_loading = false;
  155. this.$message({message: response.data.msg, type: 'error'});
  156. }
  157. );
  158. },
  159. currentChange(val) {
  160. this.loading = true;
  161. this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.level.get-list') !!}', {
  162. page: val,
  163. search: this.real_search_form
  164. }).then(function (response) {
  165. if (response.data.result) {
  166. let datas = response.data.data;
  167. this.tableData = datas.data;
  168. this.page_total = datas.total;
  169. this.page_size = datas.per_page;
  170. this.current_page = datas.current_page;
  171. this.loading = false;
  172. } else {
  173. this.$message({message: response.data.msg, type: 'error'});
  174. }
  175. }, function (response) {
  176. console.log(response);
  177. this.loading = false;
  178. }
  179. );
  180. },
  181. },
  182. });
  183. </script>
  184. @endsection