tb-business-car-list.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <div class="fast-btn">
  22. <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
  23. </div>
  24. <!-- ------------- 数据列表 ------------- -->
  25. <el-table class="data-table" ref="data-table" :data="dataList">
  26. <sa-td name="车牌号" prop="carNo" width=120></sa-td>
  27. <sa-td name="车辆规格" prop="carSize"></sa-td>
  28. <sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
  29. </sa-td>
  30. <!-- <sa-td width="130" name="车辆状态" prop="pay" type="enum" :jv="{0: '锁定[#ff0000]', 1: '正常[#005500]'}">-->
  31. </sa-td>
  32. <sa-td name="联系人" prop="driverName"></sa-td>
  33. <sa-td name="联系号码" prop="driverPhone"></sa-td>
  34. <sa-td name="入场时间" prop="realInTime" width=180></sa-td>
  35. <sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
  36. <el-table-column label="预交停车费">
  37. <template slot-scope="s">
  38. <label>{{s.row.basePartMoney}}</label>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="实际停车费">
  42. <template slot-scope="s">
  43. <label v-if="s.row.money">{{s.row.money}}</label>
  44. <label v-else>未计算</label>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="操作" fixed="right" width="200px">
  48. <template slot-scope="s">
  49. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  50. </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()">
  56. </sa-item>
  57. </div>
  58. </div>
  59. <script>
  60. var app = new Vue({
  61. components: {
  62. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  63. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  64. },
  65. el: '.vue-box',
  66. data: {
  67. p: { // 查询参数
  68. id: '', //
  69. businessId: sa.p('id', ''), //
  70. carNo: '', //
  71. preInTime: '', //
  72. preOutTime: '', //
  73. realInTime: '', //
  74. realOutTime: '', //
  75. money: '', //
  76. driverPhone: '', //
  77. pageNo: 1, // 当前页
  78. pageSize: 10, // 页大小
  79. sortType: 0 // 排序方式
  80. },
  81. dataCount: 0,
  82. dataList: [], // 数据集合
  83. },
  84. methods: {
  85. // 刷新
  86. f5: function() {
  87. sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
  88. this.dataList = res.data; // 数据
  89. this.dataCount = res.dataCount; // 数据总数
  90. sa.f5TableHeight(); // 刷新表格高度
  91. }.bind(this));
  92. },
  93. // 查看
  94. get: function(data) {
  95. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
  96. .businessId, '800px', '80%');
  97. },
  98. // 修改
  99. update: function(data) {
  100. sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
  101. .businessId, '500px', '70%');
  102. },
  103. // 新增
  104. add: function(data) {
  105. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,
  106. '550px', '80%');
  107. },
  108. // 删除
  109. del: function(data) {
  110. sa.confirm('是否删除,此操作不可撤销', function() {
  111. sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
  112. sa.arrayDelete(this.dataList, data);
  113. sa.ok('删除成功');
  114. sa.f5TableHeight(); // 刷新表格高度
  115. }.bind(this))
  116. }.bind(this));
  117. },
  118. // 改 - 状态(0=否,1=是)
  119. updateStatus: function(data) {
  120. // 声明变量记录是否成功
  121. var isOk = false;
  122. var oldValue = data.isLock;
  123. var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
  124. id: data.id,
  125. value: data.isLock
  126. }, function(res) {
  127. isOk = true;
  128. sa.msg('修改成功');
  129. }.bind(this));
  130. // 如果未能修改成功, 则回滚
  131. $.when(ajax).done(function() {
  132. if (isOk == false) {
  133. data.isLock = oldValue;
  134. }
  135. })
  136. },
  137. },
  138. created: function() {
  139. this.f5();
  140. sa.onInputEnter();
  141. }
  142. })
  143. </script>
  144. </body>
  145. </html>