ll
liukangdong
2024-10-09 05cd6a216ba17cfe357bbe52e4a9e53494d5717c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
    <TableLayout :permissions="['business:visitpark:query']">
        <!-- 搜索表单 -->
        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
            <el-form-item title="车牌号" prop="carCode">
                <el-input v-model="searchForm.carCode" placeholder="车牌号" @keypress.enter.native="search"></el-input>
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
            </section>
        </el-form>
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:visitpark:create', 'business:visitpark:delete']">
            </ul>
            <el-table
                v-loading="isWorking.search"
                :data="tableData.list"
                stripe
                @selection-change="handleSelectionChange"
            >
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column prop="carCode" label="车牌号" fixed min-width="100px"></el-table-column>
                <el-table-column prop="parksName" label="停车场" fixed min-width="100px"></el-table-column>
              <el-table-column prop="startTime" label="有效期"  align="center" fixed min-width="150px">
                <template slot-scope="{row}">
                  <div v-if="!row.startTime || !row.endTime">长期有效</div>
                  <div v-else>
                    <span style="color: green">起:{{row.startTime}}</span><br/>
                    <span style="color: red">止:{{row.endTime}}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="startTime" label="状态" fixed min-width="100px">
                <template slot-scope="{row}">
                  <div v-if="row.isdeleted==1"  style="color: red">已删除</div>
                  <div v-else style="color: green">
                    <span v-if="row.hkStatus==0"  style="color: #435EBE">待下发</span>
                    <span v-if="row.hkStatus==1"  style="color: green">预约成功</span>
                    <span v-if="row.hkStatus==2"  style="color: red">预约失败</span>
                    <span v-if="row.hkStatus==2"  style="color: red">已取消</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="remark" label="备注" min-width="100px">
                <template slot-scope="{row}">
                  <span v-if="row.isdeleted !=2">{{row.remark}}</span>
                </template>
              </el-table-column>
                <el-table-column prop="createDate" label="创建时间" min-width="140px"></el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
                @current-change="handlePageChange"
                :pagination="tableData.pagination"
            >
            </pagination>
        </template>
        <!-- 新建/修改 -->
        <OperaCarsWindow ref="operaCarsWindow" @success="handlePageChange"/>
    </TableLayout>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaCarsWindow from '@/components/business/OperaCarsWindow'
import { validity } from '@/utils/util'
export default {
  name: 'parkBook',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaCarsWindow },
  data () {
    return {
      // 搜索
      searchForm: {
        carCode: '',
        memberName: '',
        parksName: '',
        companyName: ''
      }
    }
  },
  created () {
    this.config({
      module: '车辆信息表',
      api: '/business/visitPark',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    validity (startTime, endTime) {
      return validity(startTime, endTime)
    }
  }
}
</script>