You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

319 lines
10 KiB

<template>
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="车位预约" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<el-input style="width: 200px;" v-model="searchFields.keyword" placeholder="关键字搜索" />
<el-date-picker v-model="searchFields.date" value-format="yyyy-MM-dd" type="date" placeholder="预约日期"
style="margin-left: 10px;">
</el-date-picker>
<el-select style="margin-left: 10px;margin-right: 10px;" v-model="searchFields.type" placeholder="请选择类型">
<el-option value="">
</el-option>
<el-option v-for="item in parameters.parkType" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<el-select style="margin-right: 10px;width: 120px;" v-model="searchFields.status" placeholder="请选择状态">
<el-option value="">
</el-option>
<el-option v-for="(item,key) in parameters.status_list" :key="key" :label="item" :value="key">
{{item}}
</el-option>
</el-select>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" align="center" fixed="left" label="序号"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="show(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button>
</div>
<div v-else-if="column.type=='type'">
<div v-if="scope.row[column.field]==1">小车位</div>
<div v-if="scope.row[column.field]==2">大车位</div>
<div v-if="scope.row[column.field]==3">残疾人车位</div>
</div>
<div v-else-if="column.type=='format'">
<div v-if="column.field=='orderType'">
{{scope.row["visit_order"]?"参观预约":"活动预约"}}
</div>
<div v-if="column.field=='teamType'">
{{scope.row["visit_order"].type=="1"?"团队":"个人"}}
</div>
<div v-if="column.field=='teamunit'">
{{scope.row["visit_order"].unit?scope.row["visit_order"].unit:"无"}}
</div>
<div v-else-if="column.field=='status'">
<el-tag
:type="(scope.row[column.field]=='2'?'success':(scope.row[column.field]=='1'?'warning':'info'))">
{{parameters.status_list[scope.row[column.field]]}}</el-tag>
</div>
</div>
<div v-else>
{{scope.row[column.field]}}
</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
</div>
<el-dialog title="预约信息查看" :visible.sync="dialogViewVisible" width="60%">
<div class="dialogConcent">
<el-scrollbar style="flex: 1">
<el-form :model="form" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="预约时间" prop="time">
<div>
{{form.time}}
</div>
</el-form-item>
<el-form-item label="车牌号" prop="plate">
<div>
{{form.plate}}
</div>
</el-form-item>
<el-form-item label="联系方式" prop="mobile">
<div>
{{form.mobile}}
</div>
</el-form-item>
<el-form-item label="车位类型" prop="type">
<div v-if="form.type==1">
小车位
</div>
<div v-if="form.type==2">
大车位
</div>
<div v-if="form.type==3">
残疾人车位
</div>
</el-form-item>
<el-form-item label="车辆类型" prop="car_type">
<div v-if="form.car_type==1">
普通车
</div>
<div v-if="form.car_type==2">
新能源车
</div>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
listparkorder,
get
} from "../../api/order/parkorder.js";
export default {
components: {
LxHeader
},
data() {
return {
dialogViewVisible: false,
formLabelWidth: "120px",
parameters: {
parkType: [{
id: 1,
value: "小车位"
}, {
id: 2,
value: "大车位"
}, {
id: 3,
value: "残疾人车位"
}],
carType: [{
id: 1,
value: "普通车"
}, {
id: 2,
value: "新能源车"
}],
status_list: {
1: "待完成",
2: "已完成",
0: "已取消",
3: "已过期"
}
},
tableHeight: 0,
clientHeight: 0,
//查询条件字段
searchFields: {
keyword: "",
date: "",
type: ""
},
tableData: [],
paginations: {
page: 1,
page_size: 15,
total: 0
},
form: {
time: "",
car_park_id: "",
plate: "",
type: "",
car_type: "",
mobile: "",
},
columns: [{
field: "time",
title: "预约时间",
type: "string",
width: 220,
},
{
field: "plate",
title: "车牌号",
type: "string",
width: 120,
},
{
field: "type",
title: "车位类型",
type: "type",
width: 120,
},
{
field: "mobile",
title: "联系方式",
type: "string",
width: 120,
},
{
field: "orderType",
title: "关联类型",
type: "format",
},
{
field: "teamType",
title: "类型",
type: "format",
},
{
field: "in_date",
title: "入场时间",
type: "string",
width: 220,
},
{
field: "out_date",
title: "出场时间",
type: "string",
width: 220,
},
{
field: "teamunit",
title: "团队名称",
type: "format",
},
{
field: "status",
title: "状态",
type: "format",
},
{
field: "操作",
title: "操作",
width: 220,
type: "opt",
fixed: "right"
}
]
}
},
created() {
this.initLoad();
this.load();
},
mounted() {},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //查询 头部
var paginationHeight = 37; //分页的高度
var topHeight = 50; //页面 头部
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
load() {
var that = this;
var query = this.$route.query;
let carId = ""
if (query.car_park_id)
carId = query.car_park_id
listparkorder({
page: this.paginations.page,
page_size: this.paginations.page_size,
car_park_id: carId,
...this.searchFields
}).then(res => {
this.tableData = res.data;
this.paginations.total = res.total
}).catch(error => {
})
},
show(obj) {
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
this.dialogViewVisible = true;
this.info(obj);
},
info(obj) {
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
that.form = result;
}).catch(error => {
//reject(error)
})
},
resetForm(formName) {
var that = this;
that.dialogViewVisible = false;
this.$refs[formName].resetFields();
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
}
}
};
</script>