tb-business-car-list.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. <el-form ref="form" :model='p' @submit.native.prevent>
  22. <sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
  23. <!-- <div class="c-item">-->
  24. <!-- <label class="c-label">支付状态:</label>-->
  25. <!-- <el-select v-model="p.pay" placeholder="请选择" @change="payChange">-->
  26. <!-- <el-option label="-全部-" value=""> </el-option>-->
  27. <!-- <el-option label="未支付" value="0"> </el-option>-->
  28. <!-- <el-option label="已支付" value="1"> </el-option>-->
  29. <!-- </el-select>-->
  30. <!-- </div>-->
  31. <div class="c-item">
  32. <label class="c-label">支付状态:</label>
  33. <el-select v-model="p.payType" placeholder="请选择">
  34. <el-option label="-全部-" value=""> </el-option>
  35. <el-option label="未支付" value="未支付"> </el-option>
  36. <el-option label="已支付" value="已支付"> </el-option>
  37. <el-option label="免费" value="免费"> </el-option>
  38. </el-select>
  39. </div>
  40. <div class="c-item" style="width: 120px;">
  41. <label class="c-label">是否离场:</label>
  42. <el-select v-model="p.leave" placeholder="请选择">
  43. <el-option label="-全部-" value="1"> </el-option>
  44. <el-option label="已离场" value="2"> </el-option>
  45. <el-option label="未离场" value="3"> </el-option>
  46. </el-select>
  47. </div>
  48. <div class="c-item" style="width: 120px;">
  49. <label class="c-label">车辆颜色:</label>
  50. <el-select v-model="p.color" placeholder="请选择">
  51. <el-option label="-全部-" value=""> </el-option>
  52. <el-option v-for="(item,index) in colorList" :key="index" :label="item.carNoColor"
  53. :value="item.carNoColor"> </el-option>
  54. </el-select>
  55. </div>
  56. </el-form>
  57. <el-form>
  58. <div class="c-item">
  59. <label class="c-label">入场时间:</label>
  60. <el-date-picker :clearable="false" v-model="inTime" type="datetimerange" range-separator="至"
  61. start-placeholder="开始日期" end-placeholder="结束日期">
  62. </el-date-picker>
  63. </div>
  64. <div class="c-item">
  65. <label class="c-label">离场时间:</label>
  66. <el-date-picker :clearable="false" v-model="leveTime" type="datetimerange" range-separator="至"
  67. start-placeholder="开始日期" end-placeholder="结束日期">
  68. </el-date-picker>
  69. </div>
  70. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  71. <el-button size="mini" type="primary" @click="exportFn" v-if="sa.isAuth('tb-business-car-export')">导出</el-button>
  72. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  73. <el-button size="mini" type="primary" @click="add()" v-if="sa.isAuth('tb-business-car-add')">
  74. 新增</el-button>
  75. <br/>
  76. <sa-item name="综合排序">
  77. <el-radio-group v-model="p.sortType" class="s-radio-text">
  78. <el-radio :label="10">默认</el-radio>
  79. <el-radio :label="6">入场时间</el-radio>
  80. <el-radio :label="7">离场时间</el-radio>
  81. </el-radio-group>
  82. </sa-item>
  83. </el-form>
  84. <!-- ------------- 数据列表 ------------- -->
  85. <el-table class="data-table" ref="data-table" :data="dataList">
  86. <sa-td name="业务单号" prop="no" width=140></sa-td>
  87. <sa-td name="车牌号" prop="carNo" width=120></sa-td>
  88. <!-- <el-table-column label="车辆规格">
  89. <template slot-scope="s">
  90. <label v-if="!s.row.carSize">-</label>
  91. <label v-else>{{s.row.carSize}}</label>
  92. </template>
  93. </el-table-column> -->
  94. <el-table-column label="车牌颜色">
  95. <template slot-scope="s">
  96. <label v-if="!s.row.color">-</label>
  97. <label v-else>{{s.row.color}}</label>
  98. </template>
  99. </el-table-column>
  100. <sa-td name="入场通道" prop="inChannel"></sa-td>
  101. <sa-td name="离场通道" prop="outChannel"></sa-td>
  102. <sa-td name="入场时间" prop="realInTime" width=180></sa-td>
  103. <sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
  104. <el-table-column label="停车费">
  105. <template slot-scope="s">
  106. <label v-if="s.row.money">{{s.row.money}}</label>
  107. <label v-else>-</label>
  108. </template>
  109. </el-table-column>
  110. <sa-td name="支付状态" prop="payType"></sa-td>
  111. <el-table-column label="操作" width="280px" fixed="right">
  112. <template slot-scope="s">
  113. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  114. </el-button>
  115. <el-button v-if="sa.isAuth('tb-business-car-edit')" class="c-btn" type="primary"
  116. icon="el-icon-edit" @click="update(s.row)">修改
  117. </el-button>
  118. <el-button v-if="sa.isAuth('tb-business-car-del')&&s.row.money==0" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <!-- ------------- 分页 ------------- -->
  123. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  124. </sa-item>
  125. </div>
  126. </div>
  127. <script>
  128. var app = new Vue({
  129. components: {
  130. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  131. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  132. },
  133. el: '.vue-box',
  134. data: {
  135. leveTime: [],
  136. inTime: [],
  137. p: { // 查询参数
  138. id: '', //
  139. businessId: sa.p('id', ''), //
  140. color: '',
  141. carNo: '', //
  142. leave: '1',
  143. pay: '',
  144. payType: '',
  145. leaveStart: '',
  146. leaveEnd: '',
  147. pageNo: 1, // 当前页
  148. pageSize: 10, // 页大小
  149. sortType: 10 // 排序方式
  150. },
  151. dataCount: 0,
  152. dataList: [], // 数据集合
  153. colorList: []
  154. },
  155. methods: {
  156. payChange(value) {
  157. console.log(e);
  158. },
  159. getCarColor() {
  160. sa.ajax('/TbCarNoColor/getList', {
  161. pageNo: 1,
  162. pageSize: 20,
  163. status: 1
  164. }, function(resp) {
  165. this.colorList = resp.data;
  166. }.bind(this))
  167. },
  168. exportFn() {
  169. this.$confirm('确定导出符合条件的数据?', '提示', {
  170. confirmButtonText: '确定',
  171. cancelButtonText: '取消',
  172. type: 'warning'
  173. }).then(() => {
  174. sa.ajax('/TbBusinessCar/export', sa.removeNull(this.p), function(resp) {
  175. window.location.href = resp.data;
  176. }.bind(this))
  177. }).catch(() => {
  178. });
  179. },
  180. // 刷新
  181. f5: function() {
  182. if (this.inTime && this.inTime.length > 0) {
  183. this.p.inStart = sa.forDatetime(this.inTime[0]);
  184. this.p.inEnd = sa.forDatetime(this.inTime[1]);
  185. } else {
  186. this.p.inStart = '';
  187. this.p.inEnd = '';
  188. }
  189. if (this.leveTime && this.leveTime.length > 0) {
  190. this.p.leaveStart = sa.forDatetime(this.leveTime[0]);
  191. this.p.leaveEnd = sa.forDatetime(this.leveTime[1]);
  192. } else {
  193. this.p.leaveStart = '';
  194. this.p.leaveEnd = '';
  195. }
  196. sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
  197. this.dataList = res.data; // 数据
  198. this.dataCount = res.dataCount; // 数据总数
  199. sa.f5TableHeight(); // 刷新表格高度
  200. }.bind(this));
  201. },
  202. // 查看
  203. get: function(data) {
  204. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
  205. .businessId, '800px', '80%');
  206. },
  207. // 修改
  208. update: function(data) {
  209. sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
  210. .businessId, '500px', '80%');
  211. },
  212. // 新增
  213. add: function(data) {
  214. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,
  215. '550px', '80%');
  216. },
  217. // 删除
  218. del: function(data) {
  219. sa.confirm('是否删除,此操作不可撤销', function() {
  220. sa.ajax('/TbBusinessCar/deleteRecord?id=' + data.id, function(res) {
  221. sa.arrayDelete(this.dataList, data);
  222. sa.ok('删除成功');
  223. sa.f5TableHeight(); // 刷新表格高度
  224. }.bind(this))
  225. }.bind(this));
  226. },
  227. },
  228. created: function() {
  229. this.f5();
  230. sa.onInputEnter();
  231. this.getCarColor();
  232. }
  233. })
  234. </script>
  235. </body>
  236. </html>