tb-car-visit-record-handler.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. <el-form ref="form" :model='p' @submit.native.prevent>
  23. <sa-item type="text" name="场所名称" v-model="p.name"></sa-item>
  24. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  25. <el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-venues-add')">新增场所</el-button>
  26. <el-button type="info" icon="el-icon-refresh" @click="p.name='',f5()">重置</el-button>
  27. </el-form>
  28. <!-- ------------- 快捷按钮 ------------- -->
  29. <!-- ------------- 数据列表 ------------- -->
  30. <el-table class="data-table" ref="data-table" :data="dataList" row-key="id" border @expand-change="sa.f5TableHeight()">
  31. <sa-td name="序号" type="index"></sa-td>
  32. <sa-td name="单位" prop="deptName" ></sa-td>
  33. <sa-td name="名称" prop="name" ></sa-td>
  34. <sa-td name="创建时间" prop="createTime" ></sa-td>
  35. <sa-td name="更新时间" prop="updateTime" ></sa-td>
  36. <el-table-column label="操作" fixed="right" width="320px">
  37. <template slot-scope="s">
  38. <el-button v-if="s.row.pId===-1&&sa.isAuth('tb-venues-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  39. <el-button v-if="s.row.pId!==-1&&sa.isAuth('tb-venues-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="updateChild(s.row)">修改</el-button>
  40. <el-button v-if="s.row.pId===-1&&sa.isAuth('tb-venues-add')" class="c-btn" type="primary" icon="el-icon-plus" @click="addChildren(s.row)">添加通道</el-button>
  41. <el-button v-if="sa.isAuth('tb-venues-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <!-- ------------- 分页 ------------- -->
  46. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()" :sizes="[1000]"></sa-item>
  47. </div>
  48. </div>
  49. <script>
  50. var app = new Vue({
  51. components: {
  52. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  53. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  54. },
  55. el: '.vue-box',
  56. data: {
  57. p: { // 查询参数
  58. id: '', //
  59. deptId: '', // 单位ID
  60. deptName: '', // 单位
  61. pId: '', // 父ID
  62. name: '', // 名称
  63. createTime: '', // 创建时间
  64. createBy: '', // 创建人
  65. updateTime: '', // 更新时间
  66. updateBy: '', // 更新人
  67. pageNo: 1, // 当前页
  68. pageSize: 10, // 页大小
  69. sortType: 0 // 排序方式
  70. },
  71. dataCount: 0,
  72. dataList: [], // 数据集合
  73. },
  74. methods: {
  75. // 刷新
  76. f5: function() {
  77. sa.ajax('/TbVenues/getTree', sa.removeNull(this.p), function(res) {
  78. this.dataList = res.data; // 数据
  79. this.dataCount = res.dataCount; // 数据总数
  80. sa.f5TableHeight(); // 刷新表格高度
  81. }.bind(this));
  82. },
  83. // 查看
  84. get: function(data) {
  85. sa.showIframe('数据详情', 'tb-venues-info.html?id=' + data.id, '1050px', '90%');
  86. },
  87. // 查看 - 根据选中的
  88. getBySelect: function(data) {
  89. var selection = this.$refs['data-table'].selection;
  90. if(selection.length == 0) {
  91. return sa.msg('请选择一条数据')
  92. }
  93. this.get(selection[0]);
  94. },
  95. // 修改
  96. update: function(data) {
  97. sa.showIframe('修改场所', 'tb-venues-add.html?id=' + data.id, '600px', '60%');
  98. },
  99. updateChild(data){
  100. sa.showIframe('修改通道', 'tb-venues-addchildren.html?id=' + data.id+'&deptId='+data.deptId, '500px', '60%');
  101. },
  102. // 新增
  103. add: function(data) {
  104. sa.showIframe('新增场所', 'tb-venues-add.html?id=-1', '500px', '50%');
  105. },
  106. // 新增子级
  107. addChildren: function(data) {
  108. sa.showIframe('新增通道', 'tb-venues-addchildren.html?id=-1&pId=' + data.id+'&deptId='+data.deptId, '500px', '50%');
  109. },
  110. // 删除
  111. del: function(data) {
  112. sa.confirm('是否删除,此操作不可撤销', function() {
  113. sa.ajax('/TbVenues/delete?id=' + data.id, function(res) {
  114. this.f5();
  115. }.bind(this))
  116. }.bind(this));
  117. },
  118. // 批量删除
  119. deleteByIds: function() {
  120. // 获取选中元素的id列表
  121. let selection = this.$refs['data-table'].selection;
  122. let ids = sa.getArrayField(selection, 'id');
  123. if(selection.length == 0) {
  124. return sa.msg('请至少选择一条数据')
  125. }
  126. // 提交删除
  127. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  128. sa.ajax('/TbVenues/deleteByIds', {ids: ids.join(',')}, function(res) {
  129. this.f5();
  130. }.bind(this))
  131. }.bind(this));
  132. },
  133. },
  134. created: function() {
  135. this.f5();
  136. sa.onInputEnter();
  137. }
  138. })
  139. </script>
  140. </body>
  141. </html>