tb-business-sort-list.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. </head>
  17. <body>
  18. <div class="vue-box" style="display: none;" :style="'display: block;'">
  19. <div class="c-panel">
  20. <!-- ------------- 检索参数 ------------- -->
  21. <div class="c-title">检索参数</div>
  22. <!-- ------------- 快捷按钮 ------------- -->
  23. <sa-item type="fast-btn" show="add,reset"></sa-item>
  24. <!-- ------------- 数据列表 ------------- -->
  25. <el-table class="data-table" ref="data-table" :data="dataList" >
  26. <sa-td name="名称" prop="name" ></sa-td>
  27. <sa-td name="业务类型" prop="typeName" ></sa-td>
  28. <sa-td name="顺序" prop="sort" ></sa-td>
  29. <sa-td name="距离上一业务间隔" prop="intervalTime" ></sa-td>
  30. <el-table-column label="操作" fixed="right" width="240px">
  31. <template slot-scope="s">
  32. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  33. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  34. <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <!-- ------------- 分页 ------------- -->
  39. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  40. </div>
  41. </div>
  42. <script>
  43. var app = new Vue({
  44. components: {
  45. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  46. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  47. },
  48. el: '.vue-box',
  49. data: {
  50. p: { // 查询参数
  51. id: '', //
  52. name: '', //
  53. typeName: '', //
  54. sort: '', //
  55. pageNo: 1, // 当前页
  56. pageSize: 10, // 页大小
  57. sortType: 0 // 排序方式
  58. },
  59. dataCount: 0,
  60. dataList: [], // 数据集合
  61. },
  62. methods: {
  63. // 刷新
  64. f5: function() {
  65. sa.ajax('/TbBusinessOrder/getList', sa.removeNull(this.p), function(res) {
  66. this.dataList = res.data; // 数据
  67. this.dataCount = res.dataCount; // 数据总数
  68. sa.f5TableHeight(); // 刷新表格高度
  69. }.bind(this));
  70. },
  71. // 查看
  72. get: function(data) {
  73. sa.showIframe('数据详情', 'tb-business-sort-info.html?id=' + data.id, '1050px', '90%');
  74. },
  75. // 查看 - 根据选中的
  76. getBySelect: function(data) {
  77. var selection = this.$refs['data-table'].selection;
  78. if(selection.length == 0) {
  79. return sa.msg('请选择一条数据')
  80. }
  81. this.get(selection[0]);
  82. },
  83. // 修改
  84. update: function(data) {
  85. sa.showIframe('修改数据', 'tb-business-sort-add.html?id=' + data.id, '800px', '80%');
  86. },
  87. // 新增
  88. add: function(data) {
  89. sa.showIframe('新增数据', 'tb-business-sort-add.html?id=-1', '700px', '80%');
  90. },
  91. // 删除
  92. del: function(data) {
  93. sa.confirm('是否删除,此操作不可撤销', function() {
  94. sa.ajax('/TbBusinessOrder/delete?id=' + data.id, function(res) {
  95. sa.arrayDelete(this.dataList, data);
  96. sa.ok('删除成功');
  97. sa.f5TableHeight(); // 刷新表格高度
  98. }.bind(this))
  99. }.bind(this));
  100. },
  101. // 批量删除
  102. deleteByIds: function() {
  103. // 获取选中元素的id列表
  104. let selection = this.$refs['data-table'].selection;
  105. let ids = sa.getArrayField(selection, 'id');
  106. if(selection.length == 0) {
  107. return sa.msg('请至少选择一条数据')
  108. }
  109. // 提交删除
  110. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  111. sa.ajax('/TbBusinessOrder/deleteByIds', {ids: ids.join(',')}, function(res) {
  112. sa.arrayDelete(this.dataList, selection);
  113. sa.ok('删除成功');
  114. sa.f5TableHeight(); // 刷新表格高度
  115. }.bind(this))
  116. }.bind(this));
  117. },
  118. },
  119. created: function() {
  120. this.f5();
  121. sa.onInputEnter();
  122. }
  123. })
  124. </script>
  125. </body>
  126. </html>