tb-manager-list.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. <sa-item type="text" name="姓名" v-model="p.name"></sa-item>
  25. <sa-item type="text" name="联系号码" v-model="p.phone"></sa-item>
  26. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  27. <el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-manager-add')">
  28. 新增</el-button>
  29. <el-button type="info" icon="el-icon-refresh" @click="f5">重置</el-button>
  30. <br />
  31. </el-form>
  32. <!-- ------------- 快捷按钮 ------------- -->
  33. <!-- ------------- 数据列表 ------------- -->
  34. <el-table class="data-table" ref="data-table" :data="dataList">
  35. <sa-td name="序号" type="index"></sa-td>
  36. <sa-td name="姓名" prop="name"></sa-td>
  37. <sa-td name="联系号码" prop="phone"></sa-td>
  38. <sa-td name="组织" prop="deptName"></sa-td>
  39. <sa-td name="职能" prop="position"></sa-td>
  40. <sa-td name="执勤场所" prop="venuesName"></sa-td>
  41. <sa-td name="值班开始时间" prop="workStartTime"></sa-td>
  42. <sa-td name="值班结束时间" prop="workEndTime"></sa-td>
  43. <sa-td name="备注" prop="remark"></sa-td>
  44. <el-table-column label="操作" fixed="right" width="240px">
  45. <template slot-scope="s">
  46. <!-- <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  47. </el-button> -->
  48. <el-button v-if="sa.isAuth('tb-manager-edit')" class="c-btn" type="primary"
  49. icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  50. <el-button v-if="sa.isAuth('tb-manager-del')" class="c-btn" type="danger"
  51. icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <!-- ------------- 分页 ------------- -->
  56. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  57. </sa-item>
  58. </div>
  59. </div>
  60. <script>
  61. var app = new Vue({
  62. components: {
  63. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  64. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  65. },
  66. el: '.vue-box',
  67. data: {
  68. p: { // 查询参数
  69. id: '', // 主键
  70. name: '', // 姓名
  71. phone: '', // 联系号码
  72. deptId: '', // 单位ID
  73. position: '', // 职能
  74. venuesId: '', // 场所ID
  75. venuesName: '', // 值班地点
  76. workStartTime: '', // 值班开始时间
  77. workEndTime: '', // 值班结束时间
  78. remark: '', // 备注
  79. createTime: '', // 创建时间
  80. createBy: '', // 创建人
  81. updateTime: '', // 更新时间
  82. updateBy: '', // 更新人
  83. pageNo: 1, // 当前页
  84. pageSize: 10, // 页大小
  85. sortType: 0 // 排序方式
  86. },
  87. dataCount: 0,
  88. dataList: [], // 数据集合
  89. deptList: [],
  90. },
  91. methods: {
  92. getDeptList() {
  93. sa.ajax('/TbDept/getList', function(resp) {
  94. this.deptList = resp.data;
  95. }.bind(this))
  96. },
  97. // 刷新
  98. f5: function() {
  99. sa.ajax('/TbManager/getList', sa.removeNull(this.p), function(res) {
  100. this.dataList = res.data; // 数据
  101. this.dataCount = res.dataCount; // 数据总数
  102. sa.f5TableHeight(); // 刷新表格高度
  103. }.bind(this));
  104. },
  105. // 查看
  106. get: function(data) {
  107. sa.showIframe('数据详情', 'tb-manager-info.html?id=' + data.id, '750px', '70%');
  108. },
  109. // 查看 - 根据选中的
  110. getBySelect: function(data) {
  111. var selection = this.$refs['data-table'].selection;
  112. if (selection.length == 0) {
  113. return sa.msg('请选择一条数据')
  114. }
  115. this.get(selection[0]);
  116. },
  117. // 修改
  118. update: function(data) {
  119. sa.showIframe('修改数据', 'tb-manager-add.html?id=' + data.id, '850px', '60%');
  120. },
  121. // 新增
  122. add: function(data) {
  123. sa.showIframe('新增数据', 'tb-manager-add.html?id=-1', '850px', '60%');
  124. },
  125. // 删除
  126. del: function(data) {
  127. sa.confirm('是否删除,此操作不可撤销', function() {
  128. sa.ajax('/TbManager/delete?id=' + data.id, function(res) {
  129. sa.arrayDelete(this.dataList, data);
  130. sa.ok('删除成功');
  131. sa.f5TableHeight(); // 刷新表格高度
  132. }.bind(this))
  133. }.bind(this));
  134. },
  135. // 批量删除
  136. deleteByIds: function() {
  137. // 获取选中元素的id列表
  138. let selection = this.$refs['data-table'].selection;
  139. let ids = sa.getArrayField(selection, 'id');
  140. if (selection.length == 0) {
  141. return sa.msg('请至少选择一条数据')
  142. }
  143. // 提交删除
  144. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  145. sa.ajax('/TbManager/deleteByIds', {
  146. ids: ids.join(',')
  147. }, function(res) {
  148. sa.arrayDelete(this.dataList, selection);
  149. sa.ok('删除成功');
  150. sa.f5TableHeight(); // 刷新表格高度
  151. }.bind(this))
  152. }.bind(this));
  153. },
  154. },
  155. created: function() {
  156. this.f5();
  157. sa.onInputEnter();
  158. }
  159. })
  160. </script>
  161. </body>
  162. </html>