| <template> | 
|     <TableLayout :permissions="['business:member:query']"> | 
|         <!-- 搜索表单 --> | 
|         <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="120px" inline> | 
|             <el-form-item label="车牌号" prop="code"> | 
|                 <el-input v-model="searchForm.code" placeholder="请输入车牌号" @keypress.enter.native="search"></el-input> | 
|             </el-form-item> | 
|             <el-form-item label="员工姓名/手机号" prop="memberName"> | 
|                 <el-input v-model="searchForm.memberName" placeholder="请输入员工姓名/手机号" @keypress.enter.native="search"></el-input> | 
|             </el-form-item> | 
|             <el-form-item label="部门" prop="companyName"> | 
|                 <el-input v-model="searchForm.companyName" 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:member:create', 'business:member:delete']"> | 
| <!--                <li><el-button type="primary" @click="$refs.operaCarsWindow.open('新建车辆信息表')" icon="el-icon-plus" v-permissions="['business:member:create']">新建</el-button></li>--> | 
|                 <li><el-button type="primary" @click="syncCars"   v-permissions="['business:cars:sync']">同步</el-button></li> | 
|             </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="code" label="车牌号" min-width="100px"></el-table-column> | 
|                 <el-table-column label="用户类型" min-width="100px"> | 
|                     <template slot-scope="{row}"> | 
|                         <span v-if="row.memberType === 0">劳务访客</span> | 
|                         <span v-if="row.memberType === 1">普通访客</span> | 
|                         <span v-if="row.memberType === 2">内部人员</span> | 
|                     </template> | 
|                 </el-table-column> | 
|                 <el-table-column prop="memberName" label="姓名" min-width="100px"></el-table-column> | 
|                 <el-table-column prop="memberPhone" label="手机号" min-width="100px"></el-table-column> | 
|                 <el-table-column prop="companyName" label="组织" min-width="100px"></el-table-column> | 
|                 <el-table-column prop="createDate" label="创建时间" min-width="100px"></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 { sync } from '@/api/business/cars' | 
| export default { | 
|   name: 'Cars', | 
|   extends: BaseTable, | 
|   components: { TableLayout, Pagination, OperaCarsWindow }, | 
|   data () { | 
|     return { | 
|       // 搜索 | 
|       searchForm: { | 
|         code: '', | 
|         memberName: '', | 
|         companyName: '' | 
|       } | 
|     } | 
|   }, | 
|   created () { | 
|     this.config({ | 
|       module: '车辆信息表', | 
|       api: '/business/cars', | 
|       'field.id': 'id', | 
|       'field.main': 'id' | 
|     }) | 
|     this.search() | 
|   }, | 
|   methods: { | 
|     // 同步信息 | 
|     async syncCars () { | 
|       const message = await sync({}) | 
|       this.$message.success(message) | 
|       this.search() | 
|     } | 
|   } | 
| } | 
| </script> |