tb-business-car-list.html 5.2 KB

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