tb-person-visit-record-list.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. <el-row>
  25. <el-col :span="20">
  26. <div>
  27. <div class="c-item" v-if="sa.isAdmin()">
  28. <label class="c-label">所属组织:</label>
  29. <el-select v-model="p.deptId">
  30. <el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
  31. :label="item.name" :value="item.id"></el-option>
  32. </el-select>
  33. </div>
  34. <sa-item type="text" name="姓名" v-model="p.name"></sa-item>
  35. <sa-item type="enum" name="健康码" v-model="p.healthStatus"
  36. :jv="{'绿码': '绿码', '黄码': '黄码', '红码': '红码'}" jtype="4" def="全部">
  37. </sa-item>
  38. <sa-item type="enum" name="是否放行" v-model="p.allowPass" :jv="{1: '放行', 0: '禁止'}"
  39. jtype="4" def="全部">
  40. </sa-item>
  41. </div>
  42. <div>
  43. <sa-item type="datetime" name="开始时间" v-model="p.startTime"></sa-item>
  44. <sa-item type="datetime" name="结束时间" v-model="p.endTime"></sa-item>
  45. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询
  46. </el-button>
  47. <el-button type="info" icon="el-icon-refresh"
  48. @click="p.deptId='';p.name='';p.allowPass='';p.healthStatus='';p.startTime='';p.endTime='';f5()">
  49. 重置</el-button>
  50. <el-button type="primary" icon="el-icon-plus" @click="add"
  51. v-if="sa.isAuth('tb-person-visit-record-add')">新增</el-button>
  52. <el-button type="primary" v-if="sa.isAuth('tb-person-visit-record-export')"
  53. icon="el-icon-s-unfold" @click="exportFn">导出</el-button>
  54. </div>
  55. </el-col>
  56. <el-col :span="4">
  57. </el-col>
  58. </el-row>
  59. </el-form>
  60. <!-- ------------- 快捷按钮 ------------- -->
  61. <el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
  62. <sa-td name="序号" type="index"></sa-td>
  63. <sa-td name="管理单位" prop="departmentName" width="120"></sa-td>
  64. <sa-td name="所属组织" prop="deptName" width="120"></sa-td>
  65. <sa-td name="姓名" prop="name"></sa-td>
  66. <sa-td name="联系号码" prop="phone" width="120"></sa-td>
  67. <sa-td name="图片" prop="picture" type="img"></sa-td>
  68. <sa-td name="场所/通道" prop="channel"></sa-td>
  69. <sa-td name="出/入" prop="direction" type="enum" :jv="{1: '入场', 2: '离场'}"></sa-td>
  70. <sa-td name="体温" prop="temperature"></sa-td>
  71. <sa-td name="健康码" prop="healthStatus"></sa-td>
  72. <sa-td name="检测设备" prop="terminalName"></sa-td>
  73. <sa-td name="检测时间" prop="visitDate" width="160"></sa-td>
  74. <sa-td name="是否放行" prop="allowPass">
  75. <template slot-scope="s">
  76. <label v-if="s.row.allowPass">放行</label>
  77. <label v-else>禁止通行</label>
  78. </template>
  79. </sa-td>
  80. <sa-td name="禁行原因" prop="reason" width="130"></sa-td>
  81. <sa-td name="分类" prop="type" type="enum" :jv="{1: '补录', 2: '设备上传'}"></sa-td>
  82. <el-table-column label="操作" fixed="right" width="240px">
  83. <template slot-scope="s">
  84. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  85. </el-button>
  86. <el-button v-if="sa.isAuth('tb-person-visit-record-edit')" class="c-btn" type="primary"
  87. icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  88. <el-button v-if="sa.isAuth('tb-person-visit-record-del')" class="c-btn" type="danger"
  89. icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <!-- ------------- 分页 ------------- -->
  94. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  95. </sa-item>
  96. </div>
  97. </div>
  98. <script>
  99. var app = new Vue({
  100. components: {
  101. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  102. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  103. },
  104. el: '.vue-box',
  105. data: {
  106. deptList: [],
  107. healthStatusList: [{
  108. name: '全部',
  109. value: ''
  110. },
  111. {
  112. name: '绿码',
  113. value: '绿码'
  114. },
  115. {
  116. name: '红码',
  117. value: '红码'
  118. },
  119. {
  120. name: '黄码',
  121. value: '黄码'
  122. },
  123. ],
  124. p: { // 查询参数
  125. id: '', // 主键
  126. direction: '', // 出入(1=入场,2=离场)
  127. deptName: '', // 单位名称
  128. allowPass: '',
  129. startTime: '',
  130. endTime: '',
  131. name: '', // 姓名
  132. idCard: '', // 身份证
  133. deptId: '', // 通过通道
  134. healthStatus: '', // 健康码
  135. pageNo: 1, // 当前页
  136. pageSize: 15, // 页大小
  137. sortType: 0 // 排序方式
  138. },
  139. dataCount: 0,
  140. dataList: [], // 数据集合
  141. },
  142. methods: {
  143. getDeptList() {
  144. sa.ajax('/TbDept/getList', {
  145. pageNo: 1,
  146. pageSize: 100
  147. }, function(resp) {
  148. let list = resp.data;
  149. this.deptList = list;
  150. }.bind(this))
  151. },
  152. exportFn() {
  153. sa.confirm('是否导出符合条件的记录?', function() {
  154. sa.ajax('/TbPersonVisitRecord/export', sa.removeNull(this.p), function(res) {
  155. window.location.href = res.data;
  156. }.bind(this));
  157. }.bind(this));
  158. },
  159. // 刷新
  160. f5: function() {
  161. sa.ajax('/TbPersonVisitRecord/getList', sa.removeNull(this.p), function(res) {
  162. this.dataList = res.data; // 数据
  163. this.dataCount = res.dataCount; // 数据总数
  164. sa.f5TableHeight(); // 刷新表格高度
  165. }.bind(this));
  166. },
  167. add() {
  168. sa.showIframe('新增数据', 'tb-person-visit-record-add.html?id=-1', '1200px', '70%');
  169. },
  170. // 查看
  171. get: function(data) {
  172. sa.showIframe('数据详情', 'tb-person-visit-record-info.html?id=' + data.id, '700px', '70%');
  173. },
  174. // 查看 - 根据选中的
  175. getBySelect: function(data) {
  176. var selection = this.$refs['data-table'].selection;
  177. if (selection.length == 0) {
  178. return sa.msg('请选择一条数据')
  179. }
  180. this.get(selection[0]);
  181. },
  182. // 修改
  183. update: function(data) {
  184. sa.showIframe('修改数据', 'tb-person-visit-record-edit.html?id=' + data.id, '900px', '70%');
  185. },
  186. // 删除
  187. del: function(data) {
  188. sa.confirm('是否删除,此操作不可撤销', function() {
  189. sa.ajax('/TbPersonVisitRecord/delete?id=' + data.id, function(res) {
  190. sa.arrayDelete(this.dataList, data);
  191. sa.ok('删除成功');
  192. sa.f5TableHeight(); // 刷新表格高度
  193. }.bind(this))
  194. }.bind(this));
  195. },
  196. },
  197. created: function() {
  198. this.f5();
  199. sa.onInputEnter();
  200. if (sa.isAdmin()) {
  201. this.getDeptList();
  202. }
  203. }
  204. })
  205. </script>
  206. </body>
  207. </html>