tb-business-car-list.html 5.7 KB

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