tb-business-car-list.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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.payType" placeholder="请选择">
  26. <el-option label="-全部-" value=""></el-option>
  27. <el-option label="未支付" value="未支付"></el-option>
  28. <el-option label="已支付" value="已支付"></el-option>
  29. <el-option label="免费" value="免费"></el-option>
  30. </el-select>
  31. </div>
  32. <div class="c-item" style="width: 120px;">
  33. <label class="c-label">是否离场:</label>
  34. <el-select v-model="p.leave" placeholder="请选择">
  35. <el-option label="-全部-" value="1"></el-option>
  36. <el-option label="已离场" value="2"></el-option>
  37. <el-option label="未离场" value="3"></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.color" placeholder="请选择">
  43. <el-option label="-全部-" value=""></el-option>
  44. <el-option v-for="(item,index) in colorList" :key="index" :label="item.carNoColor"
  45. :value="item.carNoColor"></el-option>
  46. </el-select>
  47. </div>
  48. </el-form>
  49. <el-form>
  50. <div class="c-item">
  51. <label class="c-label">入场时间:</label>
  52. <el-date-picker :clearable="false" v-model="inTime" type="datetimerange" range-separator="至"
  53. start-placeholder="开始日期" end-placeholder="结束日期">
  54. </el-date-picker>
  55. </div>
  56. <div class="c-item">
  57. <label class="c-label">离场时间:</label>
  58. <el-date-picker :clearable="false" v-model="leveTime" type="datetimerange" range-separator="至"
  59. start-placeholder="开始日期" end-placeholder="结束日期">
  60. </el-date-picker>
  61. </div>
  62. <div class="c-item" style="width: 120px;">
  63. <label class="c-label">是否计费:</label>
  64. <el-select v-model="p.isFree" placeholder="请选择">
  65. <el-option label="-全部-" value=""></el-option>
  66. <el-option label="业务车" value="0"></el-option>
  67. <el-option label="免费车" value="1"></el-option>
  68. </el-select>
  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')">
  72. 导出
  73. </el-button>
  74. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  75. <el-button size="mini" type="primary" @click="add()" v-if="sa.isAuth('tb-business-car-add')">
  76. 入场补录
  77. </el-button>
  78. <br />
  79. <sa-item name="综合排序">
  80. <el-radio-group v-model="p.sortType" class="s-radio-text">
  81. <el-radio :label="10">默认</el-radio>
  82. <el-radio :label="6">入场时间</el-radio>
  83. <el-radio :label="7">离场时间</el-radio>
  84. </el-radio-group>
  85. </sa-item>
  86. </el-form>
  87. <!-- ------------- 数据列表 ------------- -->
  88. <el-table class="data-table" ref="data-table" :data="dataList">
  89. <sa-td name="业务单号" prop="no" width=140></sa-td>
  90. <sa-td name="车牌号" prop="carNo" width=120></sa-td>
  91. <el-table-column label="车牌颜色">
  92. <template slot-scope="s">
  93. <label v-if="!s.row.color">-</label>
  94. <label v-else>{{s.row.color}}</label>
  95. </template>
  96. </el-table-column>
  97. <!-- <el-table-column label="重量(吨)">
  98. <template slot-scope="s">
  99. <label v-if="!s.row.netWeight">未过磅</label>
  100. <label v-else>{{s.row.netWeight}}</label>
  101. </template>
  102. </el-table-column> -->
  103. <sa-td name="入场通道" prop="inChannel" width="180"></sa-td>
  104. <sa-td name="离场通道" prop="outChannel" width="180"></sa-td>
  105. <el-table-column label="入场时间" width=180>
  106. <template slot-scope="s">
  107. <span>{{s.row.realInTime}}<span style="color: coral;"
  108. v-if="s.row.inTimeSupplement===1">(补)</span></span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="离场时间" width=180>
  112. <template slot-scope="s">
  113. <span>{{s.row.realOutTime}}<span style="color: coral;"
  114. v-if="s.row.outTimeSupplement===1">(补)</span></span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="停车费">
  118. <template slot-scope="s">
  119. <label v-if="s.row.payType==='免费'">-</label>
  120. <label v-else>
  121. <label v-if="s.row.money">{{s.row.money}}</label>
  122. <label v-else>-</label>
  123. </label>
  124. </template>
  125. </el-table-column>
  126. <sa-td name="支付状态" prop="payType"></sa-td>
  127. <sa-td name="支付时间" prop="payTime" width="140"></sa-td>
  128. <sa-td name="出场确认说明" prop="outRemark" width="180"></sa-td>
  129. <sa-td name="备注" prop="remark" width="180"></sa-td>
  130. <el-table-column label="操作" width="280px" fixed="right">
  131. <template slot-scope="s">
  132. <el-button class="c-btn" type="success" @click="get(s.row)">查看
  133. </el-button>
  134. <el-button class="c-btn" type="success"
  135. v-if="sa.isAuth('tb-business-car-out')&&!s.row.realOutTime" @click="outFn(s.row)">手动离场
  136. </el-button>
  137. <el-button v-if="sa.isAuth('tb-business-car-edit')" class="c-btn" type="primary"
  138. icon="el-icon-edit" @click="update(s.row)">修改
  139. </el-button>
  140. <el-button v-if="sa.isAuth('tb-business-car-del')&&s.row.money==0" class="c-btn"
  141. type="danger" icon="el-icon-delete" @click="del(s.row)">删除
  142. </el-button>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <!-- ------------- 分页 ------------- -->
  147. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  148. </sa-item>
  149. </div>
  150. <el-dialog :title="out.title" :visible="out.visible" width="400px">
  151. <div class="c-item">
  152. <label class="c-label" ><span style="color: red;">*</span>离场时间:</label>
  153. <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="out.form.realOutTime">
  154. </el-date-picker>
  155. </div>
  156. <sa-item type="text" name="离场通道" v-model="out.form.outChannel" br need></sa-item>
  157. <span slot="footer" class="dialog-footer">
  158. <el-button @click="out.visible=false">取 消</el-button>
  159. <el-button type="primary" @click="sureOutFn">确 定</el-button>
  160. </span>
  161. </el-dialog>
  162. </div>
  163. <script>
  164. var app = new Vue({
  165. components: {
  166. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  167. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  168. },
  169. el: '.vue-box',
  170. data: {
  171. out: {
  172. title: '',
  173. visible: false,
  174. form: {
  175. id: '',
  176. realOutTime: ''
  177. }
  178. },
  179. leveTime: [],
  180. inTime: [],
  181. p: { // 查询参数
  182. id: '', //
  183. businessId: sa.p('id', ''), //
  184. confirmJudge: '',
  185. color: '',
  186. carNo: '', //
  187. leave: '1',
  188. pay: '',
  189. payType: '',
  190. leaveStart: '',
  191. leaveEnd: '',
  192. isFree: '',
  193. pageNo: 1, // 当前页
  194. pageSize: 10, // 页大小
  195. sortType: 10 // 排序方式
  196. },
  197. dataCount: 0,
  198. dataList: [], // 数据集合
  199. colorList: []
  200. },
  201. methods: {
  202. outFn(data) {
  203. this.out = {
  204. title: '【' + data.carNo + '】手动离场',
  205. visible: true,
  206. form: {
  207. id: data.id,
  208. realOutTime: '',
  209. outChannel:''
  210. }
  211. }
  212. },
  213. sureOutFn() {
  214. let data=this.out.form;
  215. if(!data.realOutTime){
  216. sa.error('请选择离场时间');
  217. return;
  218. }
  219. if(!data.outChannel){
  220. sa.error('请选输入离场通道');
  221. return;
  222. }
  223. sa.ajax('/TbBusinessCar/handlerOut', this.out.form, function(resp) {
  224. this.out.visible=false;
  225. this.f5()
  226. }.bind(this))
  227. },
  228. payChange(value) {
  229. console.log(e);
  230. },
  231. getCarColor() {
  232. sa.ajax('/TbCarNoColor/getList', {
  233. pageNo: 1,
  234. pageSize: 20,
  235. status: 1
  236. }, function(resp) {
  237. this.colorList = resp.data;
  238. }.bind(this))
  239. },
  240. exportFn() {
  241. this.$confirm('确定导出符合条件的数据?', '提示', {
  242. confirmButtonText: '确定',
  243. cancelButtonText: '取消',
  244. type: 'warning'
  245. }).then(() => {
  246. sa.ajax('/TbBusinessCar/export', sa.removeNull(this.p), function(resp) {
  247. window.location.href = resp.data;
  248. }.bind(this))
  249. }).catch(() => {
  250. });
  251. },
  252. // 刷新
  253. f5: function() {
  254. if (this.inTime && this.inTime.length > 0) {
  255. this.p.inStart = sa.forDatetime(this.inTime[0]);
  256. this.p.inEnd = sa.forDatetime(this.inTime[1]);
  257. } else {
  258. this.p.inStart = '';
  259. this.p.inEnd = '';
  260. }
  261. if (this.leveTime && this.leveTime.length > 0) {
  262. this.p.leaveStart = sa.forDatetime(this.leveTime[0]);
  263. this.p.leaveEnd = sa.forDatetime(this.leveTime[1]);
  264. } else {
  265. this.p.leaveStart = '';
  266. this.p.leaveEnd = '';
  267. }
  268. sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
  269. this.dataList = res.data; // 数据
  270. this.dataCount = res.dataCount; // 数据总数
  271. sa.f5TableHeight(); // 刷新表格高度
  272. }.bind(this));
  273. },
  274. // 查看
  275. get: function(data) {
  276. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
  277. .businessId, '1080px', '90%');
  278. },
  279. // 修改
  280. update: function(data) {
  281. sa.showIframe('修改数据', 'tb-business-car-edit.html?id=' + data.id + '&businessId=' + this.p
  282. .businessId, '500px', '80%');
  283. },
  284. // 新增
  285. add: function(data) {
  286. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,
  287. '550px', '90%');
  288. },
  289. // 删除
  290. del: function(data) {
  291. sa.confirm('是否删除,此操作不可撤销', function() {
  292. sa.ajax('/TbBusinessCar/deleteRecord?id=' + data.id, function(res) {
  293. sa.arrayDelete(this.dataList, data);
  294. sa.ok('删除成功');
  295. sa.f5TableHeight(); // 刷新表格高度
  296. }.bind(this))
  297. }.bind(this));
  298. },
  299. },
  300. created: function() {
  301. this.f5();
  302. sa.onInputEnter();
  303. this.getCarColor();
  304. }
  305. })
  306. </script>
  307. </body>
  308. </html>