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

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