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