| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 | <!DOCTYPE html><html>	<head>		<title>-列表</title>		<meta charset="utf-8">		<meta name="viewport"			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />		<!-- 所有的 css & js 资源 -->		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">		<link rel="stylesheet" href="../../static/sa.css">		<script src="../../static/kj/vue.min.js"></script>		<script src="../../static/kj/element-ui/index.js"></script>		<script src="../../static/kj/httpVueLoader.js"></script>		<script src="../../static/kj/jquery.min.js"></script>		<script src="../../static/kj/layer/layer.js"></script>		<script src="../../static/sa.js"></script>	</head>	<body>		<div class="vue-box" style="display: none;" :style="'display: block;'">			<div class="c-panel">				<el-form ref="form" :model='p' @submit.native.prevent>					<sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>					<div class="c-item">						<label class="c-label">入场时间:</label>						<el-date-picker :clearable="false" v-model="inTime" type="datetimerange" range-separator="至"							start-placeholder="开始日期" end-placeholder="结束日期">						</el-date-picker>					</div>					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>				</el-form>				<!-- ------------- 数据列表 ------------- -->				<el-table class="data-table" ref="data-table" :data="dataList">					<sa-td type="selection"></sa-td>					<sa-td name="车牌号" prop="carNo" width=120></sa-td>					<el-table-column label="车牌颜色">						<template slot-scope="s">							<label v-if="!s.row.color">-</label>							<label v-else>{{s.row.color}}</label>						</template>					</el-table-column>					<sa-td name="入场通道" prop="inChannel"></sa-td>					<sa-td name="入场时间" prop="realInTime"></sa-td>					<sa-td name="离场时间" prop="realOutTime"></sa-td>					<el-table-column label="停车费">						<template slot-scope="s">							<label v-if="s.row.money">{{s.row.money}}</label>							<label v-else>-</label>						</template>					</el-table-column>					<sa-td name="支付状态" prop="payType">						<template slot-scope="s">							<label v-if="s.row.payType.indexOf('免')!==-1">{{s.row.payType}}</label>							<label v-else>								<label v-if="s.row.money">已支付</label>								<label v-else>未支付</label>							</label>						</template>					</sa-td>					<el-table-column label="操作"  fixed="right">						<template slot-scope="s">							<el-button class="c-btn" type="primary" @click="sureFn(s.row)">选择							</el-button>						</template>					</el-table-column>				</el-table>				<!-- ------------- 分页 ------------- -->				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">				</sa-item>			</div>		</div>		<script>			var app = new Vue({				components: {					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),				},				el: '.vue-box',				data: {					leveTime: [],					inTime: [],					businessId:sa.p('id','-1'),					businessCarId:sa.p('businessCarId',''),					carNo:sa.p('carNo',''),					p: { // 查询参数						carNo: decodeURIComponent(sa.p('carNo','')), //  						inStart:'',						inEnd:'',						limitDay:1,						pageNo: 1, // 当前页 						pageSize: 10, // 页大小 						sortType: 10 ,// 排序方式					},					dataCount: 0,					dataList: [], // 数据集合 					colorList: []				},				methods: {					sureFn(data) {						let id=data.id;						let businessCarId=this.businessCarId;						let content = '是否将[' + data.carNo + ']绑定到此业务';						if (businessCarId&&id!=businessCarId) {							content = '此业务已绑定车辆【' + decodeURIComponent(this.carNo) + '】,是否覆盖?';						}						if (id === businessCarId) {							sa.error('该车已绑定此业务,无需绑定');							return;						}						let obj = {							id: this.businessId,							businessCarId: id						};						sa.confirm(content, function() {							sa.ajax('/TbBusiness/bindCar', obj, function(resp) {								sa.alert('绑定成功');								setTimeout(() => {									sa.closeCurrIframe(); // 关闭本页 									parent.app.f5(); // 刷新父页面列表								}, 1000)							}.bind(this))						}.bind(this));										},					// 刷新					f5: function() {						if (this.inTime && this.inTime.length > 0) {							this.p.inStart = sa.forDatetime(this.inTime[0]);							this.p.inEnd = sa.forDatetime(this.inTime[1]);						} else {							this.p.inStart = '';							this.p.inEnd = '';						}						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {							let list = res.data;							this.dataList = list; // 数据							this.dataCount = res.dataCount; // 数据总数 							let businessCarId = this.businessCarId;							list.forEach(row => {								if (businessCarId == row.id) {									this.$nextTick(() => {										this.$refs['data-table'].toggleRowSelection(row,											true)									})								}							})							sa.f5TableHeight(); // 刷新表格高度 						}.bind(this));					},					// 查看					get: function(data) {						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p							.businessId, '800px', '80%');					},					// 修改					update: function(data) {						sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p							.businessId, '500px', '80%');					},					// 新增					add: function(data) {						sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,							'550px', '80%');					},					// 删除					del: function(data) {						sa.confirm('是否删除,此操作不可撤销', function() {							sa.ajax('/TbBusinessCar/deleteRecord?id=' + data.id, function(res) {								sa.arrayDelete(this.dataList, data);								sa.ok('删除成功');								sa.f5TableHeight(); // 刷新表格高度 							}.bind(this))						}.bind(this));					},				},				created: function() {					this.f5();					sa.onInputEnter();				}			})		</script>	</body></html>
 |