tb-dept-list.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>组织管理-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <div class="c-item">
  25. <label class="c-label">场所:</label>
  26. <el-select v-model="p.venuesId">
  27. <el-option label="请选择" v-for="(item,index) in venuesList" :key="item.id"
  28. :label="item.name" :value="item.id"></el-option>
  29. </el-select>
  30. </div>
  31. <sa-item type="text" name="名称" v-model="p.name"></sa-item>
  32. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  33. <el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-dept-add')">新增
  34. </el-button>
  35. <el-button type="info" icon="el-icon-refresh" @click="p.name='';p.venuesId='';f5()">重置</el-button>
  36. <br />
  37. </el-form>
  38. <!-- ------------- 数据列表 ------------- -->
  39. <el-table class="data-table" ref="data-table" :data="dataList">
  40. <sa-td name="序号" type="index"></sa-td>
  41. <sa-td name="组织名称" prop="name"></sa-td>
  42. <sa-td name="备案场所" prop="venuesName"></sa-td>
  43. <sa-td name="审核单位" prop="departmentName"></sa-td>
  44. <sa-td name="通行条件" prop="passType" type="enum" :jv="{1: '人车均备案', 2: '满足其一'}"></sa-td>
  45. <sa-td name="备案审核" prop="needJudge" type="enum" :jv="{0: '自动审核', 1: '人工审核'}"></sa-td>
  46. <sa-td name="创建时间" prop="createTime"></sa-td>
  47. <el-table-column label="操作" fixed="right" width="240px">
  48. <template slot-scope="s">
  49. <el-button v-if="sa.isAuth('tb-dept-edit')" class="c-btn" type="primary" icon="el-icon-edit"
  50. @click="update(s.row)">修改</el-button>
  51. <el-button v-if="sa.isAuth('tb-dept-del')" class="c-btn" type="danger" icon="el-icon-delete"
  52. @click="del(s.row)">删除</el-button>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <!-- ------------- 分页 ------------- -->
  57. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  58. </sa-item>
  59. </div>
  60. </div>
  61. <script>
  62. var app = new Vue({
  63. components: {
  64. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  65. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  66. },
  67. el: '.vue-box',
  68. data: {
  69. p: { // 查询参数
  70. name: '', // 名称
  71. venuesId: '', // 备注
  72. pageNo: 1, // 当前页
  73. pageSize: 20, // 页大小
  74. sortType: 0 // 排序方式
  75. },
  76. dataCount: 0,
  77. venuesList:[],
  78. dataList: [], // 数据集合
  79. },
  80. methods: {
  81. getVenuesList() {
  82. sa.ajax('/TbVenues/getParentList', function(res) {
  83. this.venuesList=res.data;
  84. }.bind(this));
  85. },
  86. // 刷新
  87. f5: function() {
  88. sa.ajax('/TbDept/getList', sa.removeNull(this.p), function(res) {
  89. this.dataList = res.data; // 数据
  90. this.dataCount = res.dataCount; // 数据总数
  91. sa.f5TableHeight(); // 刷新表格高度
  92. }.bind(this));
  93. },
  94. // 查看
  95. get: function(data) {
  96. sa.showIframe('数据详情', 'tb-dept-info.html?id=' + data.id, '1050px', '90%');
  97. },
  98. // 查看 - 根据选中的
  99. getBySelect: function(data) {
  100. var selection = this.$refs['data-table'].selection;
  101. if (selection.length == 0) {
  102. return sa.msg('请选择一条数据')
  103. }
  104. this.get(selection[0]);
  105. },
  106. // 修改
  107. update: function(data) {
  108. sa.showIframe('修改数据', 'tb-dept-add.html?id=' + data.id, '650px', '70%');
  109. },
  110. // 新增
  111. add: function(data) {
  112. sa.showIframe('新增数据', 'tb-dept-add.html?id=-1', '650px', '75%');
  113. },
  114. // 删除
  115. del: function(data) {
  116. sa.confirm('是否删除,此操作不可撤销', function() {
  117. sa.ajax('/TbDept/delete?id=' + data.id, function(res) {
  118. sa.arrayDelete(this.dataList, data);
  119. sa.ok('删除成功');
  120. sa.f5TableHeight(); // 刷新表格高度
  121. }.bind(this))
  122. }.bind(this));
  123. },
  124. // 批量删除
  125. deleteByIds: function() {
  126. // 获取选中元素的id列表
  127. let selection = this.$refs['data-table'].selection;
  128. let ids = sa.getArrayField(selection, 'id');
  129. if (selection.length == 0) {
  130. return sa.msg('请至少选择一条数据')
  131. }
  132. // 提交删除
  133. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  134. sa.ajax('/TbDept/deleteByIds', {
  135. ids: ids.join(',')
  136. }, function(res) {
  137. sa.arrayDelete(this.dataList, selection);
  138. sa.ok('删除成功');
  139. sa.f5TableHeight(); // 刷新表格高度
  140. }.bind(this))
  141. }.bind(this));
  142. },
  143. },
  144. created: function() {
  145. this.f5();
  146. sa.onInputEnter();
  147. this.getVenuesList();
  148. }
  149. })
  150. </script>
  151. </body>
  152. </html>