tb-people-profit-list.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>边民收益设置-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
  11. <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
  12. <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
  13. <script src="../../static/js/layer.js"></script>
  14. <script src="../../static/sa.js"></script>
  15. </head>
  16. <body>
  17. <div class="vue-box" style="display: none;" :style="'display: block;'">
  18. <div class="c-panel">
  19. <!-- ------------- 检索参数 ------------- -->
  20. <div class="c-title">检索参数</div>
  21. <el-form ref="form" :model='p' @submit.native.prevent>
  22. <div class="c-item">
  23. <label class="c-label">主键:</label>
  24. <el-input size="mini" v-model="p.id" type="number"></el-input>
  25. </div>
  26. <div class="c-item">
  27. <label class="c-label">类型:</label>
  28. <el-input size="mini" v-model="p.type"></el-input>
  29. </div>
  30. <div class="c-item">
  31. <label class="c-label">类型名称:</label>
  32. <el-input size="mini" v-model="p.typeName"></el-input>
  33. </div>
  34. <div class="c-item">
  35. <label class="c-label">状态:</label>
  36. <el-radio-group v-model="p.status" size="mini" class="s-radio-text" >
  37. <el-radio label="">不限</el-radio>
  38. <el-radio :label="0">启用</el-radio>
  39. <el-radio :label="1">禁用</el-radio>
  40. </el-radio-group>
  41. </div>
  42. <div class="c-item">
  43. <label class="c-label">数值:</label>
  44. <el-input size="mini" v-model="p.num" type="number"></el-input>
  45. </div>
  46. <div class="c-item" style="min-width: 0px;">
  47. <el-button size="mini" type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  48. </div>
  49. <br />
  50. <div class="c-item s-radio-text">
  51. <label class="c-label">综合排序:</label>
  52. <el-radio-group v-model="p.sortType">
  53. <el-radio :label="0">默认</el-radio>
  54. <el-radio :label="1">主键</el-radio>
  55. <el-radio :label="2">类型</el-radio>
  56. <el-radio :label="3">类型名称</el-radio>
  57. <el-radio :label="4">状态</el-radio>
  58. <el-radio :label="5">数值</el-radio>
  59. </el-radio-group>
  60. </div>
  61. </el-form>
  62. <!-- ------------- 快捷按钮 ------------- -->
  63. <div class="fast-btn">
  64. <el-button size="mini" type="primary" icon="el-icon-plus" @click="add()">新增</el-button>
  65. <el-button size="mini" type="success" icon="el-icon-view" @click="getBySelect()">查看</el-button>
  66. <el-button size="mini" type="danger" icon="el-icon-delete" @click="deleteByIds()">删除</el-button>
  67. <el-button size="mini" type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button>
  68. <el-button size="mini" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  69. </div>
  70. <!-- ------------- 数据列表 ------------- -->
  71. <el-table class="data-table" ref="data-table" :data="dataList" size="small">
  72. <el-table-column align="center" type="selection" width="45px"></el-table-column>
  73. <el-table-column align="center" label="主键" prop="id" class-name="tc-num"></el-table-column>
  74. <el-table-column align="center" label="类型" prop="type" ></el-table-column>
  75. <el-table-column align="center" label="类型名称" prop="typeName" ></el-table-column>
  76. <el-table-column align="center" label="状态">
  77. <template slot-scope="s">
  78. <b v-if="s.row.status == 0">启用</b>
  79. <b v-if="s.row.status == 1">禁用</b>
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center" label="数值" prop="num" class-name="tc-num"></el-table-column>
  83. <el-table-column align="center" label="操作" fixed="right" width="240px">
  84. <template slot-scope="s">
  85. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  86. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  87. <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <!-- ------------- 分页 ------------- -->
  92. <div class="page-box">
  93. <el-pagination background
  94. layout="total, prev, pager, next, sizes, jumper"
  95. :current-page.sync="p.pageNo"
  96. :page-size.sync="p.pageSize"
  97. :total="dataCount"
  98. :page-sizes="[1, 10, 20, 30, 40, 50, 100, 1000]"
  99. @current-change="f5()"
  100. @size-change="f5()">
  101. </el-pagination>
  102. </div>
  103. </div>
  104. </div>
  105. <script>
  106. var app = new Vue({
  107. el: '.vue-box',
  108. data: {
  109. p: { // 查询参数
  110. id: '', // 主键
  111. type: '', // 类型(0=均分,1=按笔数算,2=交易比例)
  112. typeName: '', // 类型名称
  113. status: '', // 状态(0=启用,1=禁用)
  114. num: '', // 数值
  115. pageNo: 1, // 当前页
  116. pageSize: 10, // 页大小
  117. sortType: 0 // 排序方式
  118. },
  119. dataCount: 0,
  120. dataList: [], // 数据集合
  121. },
  122. methods: {
  123. // 刷新
  124. f5: function() {
  125. sa.ajax('/levelone-server/TbPeopleProfit/getList', sa.removeNull(this.p), function(res) {
  126. this.dataList = res.data; // 数据
  127. this.dataCount = res.dataCount; // 数据总数
  128. sa.f5TableHeight(); // 刷新表格高度
  129. }.bind(this));
  130. },
  131. // 查看
  132. get: function(data) {
  133. sa.showIframe('数据详情', 'tb-people-profit-info.html?id=' + data.id, '950px', '90%');
  134. },
  135. // 查看 - 根据选中的
  136. getBySelect: function(data) {
  137. var selection = this.$refs['data-table'].selection;
  138. if(selection.length == 0) {
  139. return sa.msg('请选择一条数据')
  140. }
  141. this.get(selection[0]);
  142. },
  143. // 修改
  144. update: function(data) {
  145. sa.showIframe('修改数据', 'tb-people-profit-add.html?id=' + data.id, '900px', '90%');
  146. },
  147. // 新增
  148. add: function(data) {
  149. sa.showIframe('新增数据', 'tb-people-profit-add.html?id=-1', '900px', '90%');
  150. },
  151. // 删除
  152. del: function(data) {
  153. sa.confirm('是否删除,此操作不可撤销', function() {
  154. sa.ajax('/levelone-server/TbPeopleProfit/delete?id=' + data.id, function(res) {
  155. sa.arrayDelete(this.dataList, data);
  156. sa.ok('删除成功');
  157. sa.f5TableHeight(); // 刷新表格高度
  158. }.bind(this))
  159. }.bind(this));
  160. },
  161. // 批量删除
  162. deleteByIds: function() {
  163. // 获取选中元素的id列表
  164. let selection = this.$refs['data-table'].selection;
  165. let ids = sa.getArrayField(selection, 'id');
  166. if(selection.length == 0) {
  167. return sa.msg('请至少选择一条数据')
  168. }
  169. // 提交删除
  170. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  171. sa.ajax('/levelone-server/TbPeopleProfit/deleteByIds', {ids: ids.join(',')}, function(res) {
  172. sa.arrayDelete(this.dataList, selection);
  173. sa.ok('删除成功');
  174. sa.f5TableHeight(); // 刷新表格高度
  175. }.bind(this))
  176. }.bind(this));
  177. },
  178. },
  179. created: function() {
  180. this.f5();
  181. sa.onInputEnter();
  182. }
  183. })
  184. </script>
  185. </body>
  186. </html>