tb-business-car-list.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.carNo"></sa-item>
  24. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  25. <br />
  26. </sa-item>
  27. </el-form>
  28. <!-- ------------- 快捷按钮 ------------- -->
  29. <sa-item type="fast-btn" show="reset"></sa-item>
  30. <!-- ------------- 数据列表 ------------- -->
  31. <el-table class="data-table" ref="data-table" :data="dataList" >
  32. <sa-td type="selection"></sa-td>
  33. <sa-td name="车牌号" prop="carNo" ></sa-td>
  34. <!-- <sa-td name="预计入场时间" prop="preInTime" ></sa-td>-->
  35. <!-- <sa-td name="预计出场时间" prop="preOutTime" ></sa-td>-->
  36. <sa-td name="入场时间" prop="realInTime" ></sa-td>
  37. <sa-td name="出场时间" prop="realOutTime" ></sa-td>
  38. <el-table-column label="停车费">
  39. <template slot-scope="s">
  40. <label v-if="s.row.money">{{s.row.money}}</label>
  41. <label v-else>{{s.row.basePartMoney}}</label>
  42. </template>
  43. </el-table-column>
  44. <sa-td name="联系人" prop="driverName" ></sa-td>
  45. <sa-td name="联系电话" prop="driverPhone" ></sa-td>
  46. <el-table-column label="操作" fixed="right" width="240px">
  47. <template slot-scope="s">
  48. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  49. <!-- <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
  50. <!-- <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <!-- ------------- 分页 ------------- -->
  55. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  56. </div>
  57. </div>
  58. <script>
  59. var app = new Vue({
  60. components: {
  61. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  62. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  63. },
  64. el: '.vue-box',
  65. data: {
  66. p: { // 查询参数
  67. id: '', //
  68. businessId: '', //
  69. carNo: '', //
  70. preInTime: '', //
  71. preOutTime: '', //
  72. realInTime: '', //
  73. realOutTime: '', //
  74. money: '', //
  75. driverName: '', //
  76. driverPhone: '', //
  77. pageNo: 1, // 当前页
  78. pageSize: 10, // 页大小
  79. sortType: 0 // 排序方式
  80. },
  81. dataCount: 0,
  82. dataList: [], // 数据集合
  83. currentCustomerId: '1',
  84. },
  85. methods: {
  86. // 刷新
  87. f5: function() {
  88. sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
  89. this.dataList = res.data; // 数据
  90. this.dataCount = res.dataCount; // 数据总数
  91. sa.f5TableHeight(); // 刷新表格高度
  92. }.bind(this));
  93. },
  94. // 查看
  95. get: function(data) {
  96. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id, '600px', '90%');
  97. },
  98. // 查看 - 根据选中的
  99. getBySelect: function(data) {
  100. var selection = this.$refs['data-table'].selection;
  101. if(selection.length == 0) {
  102. return sa.msg('请选择一条数据')
  103. }
  104. this.get(selection[0]);
  105. },
  106. // 修改
  107. update: function(data) {
  108. sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id, '1000px', '90%');
  109. },
  110. // 新增
  111. add: function(data) {
  112. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1', '1000px', '90%');
  113. },
  114. // 删除
  115. del: function(data) {
  116. sa.confirm('是否删除,此操作不可撤销', function() {
  117. sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
  118. sa.arrayDelete(this.dataList, data);
  119. sa.ok('删除成功');
  120. sa.f5TableHeight(); // 刷新表格高度
  121. }.bind(this))
  122. }.bind(this));
  123. },
  124. // 批量删除
  125. deleteByIds: function() {
  126. // 获取选中元素的id列表
  127. let selection = this.$refs['data-table'].selection;
  128. let ids = sa.getArrayField(selection, 'id');
  129. if(selection.length == 0) {
  130. return sa.msg('请至少选择一条数据')
  131. }
  132. // 提交删除
  133. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  134. sa.ajax('/TbBusinessCar/deleteByIds', {ids: ids.join(',')}, function(res) {
  135. sa.arrayDelete(this.dataList, selection);
  136. sa.ok('删除成功');
  137. sa.f5TableHeight(); // 刷新表格高度
  138. }.bind(this))
  139. }.bind(this));
  140. },
  141. getCurrendCustomer() {
  142. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  143. this.currentCustomerId = resp.data;
  144. }.bind(this));
  145. },
  146. },
  147. created: function() {
  148. this.getCurrendCustomer();
  149. sa.onInputEnter();
  150. },
  151. mounted() {
  152. this.f5();
  153. },
  154. })
  155. </script>
  156. </body>
  157. </html>