tb-car-filing-list.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.carNo"></sa-item>
  25. <sa-item type="enum" name="类型" v-model="p.type" :jv="{1: '临时', 2: '内部'}" jtype="2" def="不限">
  26. </sa-item>
  27. <sa-item type="text" name="联系人" v-model="p.driverName"></sa-item>
  28. <sa-item type="text" name="联系电话" v-model="p.driverContact"></sa-item>
  29. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  30. <el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-car-filing-add')">新增</el-button>
  31. <el-button type="info" icon="el-icon-refresh" @click="p.carNo='',p.type='',p.driverName='',p.driverContact='',f5()">重置</el-button>
  32. </el-form>
  33. <!-- ------------- 数据列表 ------------- -->
  34. <el-table class="data-table" ref="data-table" :data="dataList">
  35. <sa-td type="selection"></sa-td>
  36. <sa-td name="部门" prop="deptName"></sa-td>
  37. <sa-td name="车牌号" prop="carNo"></sa-td>
  38. <sa-td name="类型" prop="type" type="enum" :jv="{1: '临时', 2: '内部'}"></sa-td>
  39. <sa-td name="联系人" prop="driverName"></sa-td>
  40. <sa-td name="联系电话" prop="driverContact"></sa-td>
  41. <sa-td name="联系人身份证" prop="driverIdCardStr" width="150"></sa-td>
  42. <sa-td name="创建时间" prop="createTime"></sa-td>
  43. <sa-td name="更新时间" prop="updateTime"></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-car-filing-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
  49. </el-button>
  50. <el-button v-if="sa.isAuth('tb-car-filing-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
  51. </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. carNo: '', // 车牌号
  70. type: '', // 类型(1=临时,2=内部)
  71. driverName: '', // 联系人
  72. driverContact: '', // 联系电话
  73. driverIdCard: '', // 联系人身份证
  74. visit: '', // 状态
  75. remark: '', // 备注
  76. pageNo: 1, // 当前页
  77. pageSize: 10, // 页大小
  78. sortType: 0 // 排序方式
  79. },
  80. dataCount: 0,
  81. dataList: [], // 数据集合
  82. },
  83. methods: {
  84. // 刷新
  85. f5: function() {
  86. sa.ajax('/TbCarFiling/getList', sa.removeNull(this.p), function(res) {
  87. this.dataList = res.data; // 数据
  88. this.dataCount = res.dataCount; // 数据总数
  89. sa.f5TableHeight(); // 刷新表格高度
  90. }.bind(this));
  91. },
  92. // 查看
  93. get: function(data) {
  94. sa.showIframe('数据详情', 'tb-car-filing-info.html?id=' + data.id, '700px', '90%');
  95. },
  96. // 查看 - 根据选中的
  97. getBySelect: function(data) {
  98. var selection = this.$refs['data-table'].selection;
  99. if (selection.length == 0) {
  100. return sa.msg('请选择一条数据')
  101. }
  102. this.get(selection[0]);
  103. },
  104. // 修改
  105. update: function(data) {
  106. sa.showIframe('修改数据', 'tb-car-filing-add.html?id=' + data.id, '700px', '90%');
  107. },
  108. // 新增
  109. add: function(data) {
  110. sa.showIframe('新增数据', 'tb-car-filing-add.html?id=-1', '700px', '80%');
  111. },
  112. // 删除
  113. del: function(data) {
  114. sa.confirm('是否删除,此操作不可撤销', function() {
  115. sa.ajax('/TbCarFiling/delete?id=' + data.id, function(res) {
  116. sa.arrayDelete(this.dataList, data);
  117. sa.ok('删除成功');
  118. sa.f5TableHeight(); // 刷新表格高度
  119. }.bind(this))
  120. }.bind(this));
  121. },
  122. // 批量删除
  123. deleteByIds: function() {
  124. // 获取选中元素的id列表
  125. let selection = this.$refs['data-table'].selection;
  126. let ids = sa.getArrayField(selection, 'id');
  127. if (selection.length == 0) {
  128. return sa.msg('请至少选择一条数据')
  129. }
  130. // 提交删除
  131. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  132. sa.ajax('/TbCarFiling/deleteByIds', {
  133. ids: ids.join(',')
  134. }, function(res) {
  135. sa.arrayDelete(this.dataList, selection);
  136. sa.ok('删除成功');
  137. sa.f5TableHeight(); // 刷新表格高度
  138. }.bind(this))
  139. }.bind(this));
  140. },
  141. },
  142. created: function() {
  143. this.f5();
  144. sa.onInputEnter();
  145. }
  146. })
  147. </script>
  148. </body>
  149. </html>