| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:member:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <div ref="QueryFormRef" slot="search-form"> |
| | | <el-form ref="searchForm" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="" prop="code" title="车çå·"> |
| | | <el-input v-model="searchForm.code" clearable placeholder="车çå·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="memberName" title="车主信æ¯"> |
| | | <el-input v-model="searchForm.memberName" clearable placeholder="车主信æ¯" |
| | | @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="catePName" title="åç±»åç§°"> |
| | | <el-cascader v-model="searchForm.cateIds" @change="changeSel" placeholder="è¯·éæ©åç±»" clearable |
| | | :options="cateList" :props="{ |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'childCategoryList', |
| | | checkStrictly: true |
| | | }"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="companyName" title="车主ç»ç»åç§°"> |
| | | <el-input v-model="searchForm.companyName" clearable placeholder="车主ç»ç»åç§°" |
| | | @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="authStatus" title="æ¯å¦ææ"> |
| | | <el-select v-model="searchForm.authStatus" @change="search" clearable placeholder="æ¯å¦ææ"> |
| | | <el-option label="å·²ææ" value="1"></el-option> |
| | | <el-option label="æªææ" value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="type" title="ä¸å¡ç±»å"> |
| | | <el-select v-model="searchForm.type" @change="search" clearable placeholder="夿³¨"> |
| | | <el-option label="宿³°å
¬å¡è½¦" value="0"></el-option> |
| | | <el-option label="宿³°èªæç©æµè½¦" value="1"></el-option> |
| | | <el-option label="å
¶ä»" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" |
| | | v-permissions="['business:cars:create', 'business:cars:exportExcel', 'business:parkBook:create']"> |
| | | <li><el-button type="primary" @click="handleEdit" icon="el-icon-plus" |
| | | v-permissions="['business:cars:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.OperaCarsImportWindowRef.open('车è¾å¯¼å
¥', searchForm.companyType)" |
| | | v-permissions="['business:cars:create']">车è¾å¯¼å
¥</el-button> |
| | | </li> |
| | | <li><el-button type="primary" @click="exportExcel" v-permissions="['business:cars:exportExcel']">导åº</el-button> |
| | | </li> |
| | | <li><el-button type="primary" @click="startEmpowerBatch" icon="el-icon-plus" |
| | | v-permissions="['business:parkbook:create']">ä¸åææ</el-button></li> |
| | | </ul> |
| | | <el-table :height="tableHeightNew" 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="车çå·" fixed="left" min-width="100px"></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="catePName" label="ä¸çº§åç±»" min-width="120px"></el-table-column> |
| | | <el-table-column prop="cateName" label="äºçº§åç±»" min-width="120px"></el-table-column> |
| | | <el-table-column prop="companyName" label="车主ç»ç»" min-width="200px"></el-table-column> |
| | | <el-table-column label="æ¯å¦ææ" align="center" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.authStatus == 1" style="color: green">æ¯</span> |
| | | <span v-else style="color: red">å¦</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="parksName" align="center" label="å·²ææå车åº" min-width="200px"> |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.parkBookList && row.parkBookList.length"> |
| | | <span v-for="item in row.parkBookList" :key="item.id" style="display: block"> |
| | | <span |
| | | :style="(item.hkStatus == 0 ? 'color:#2080f7' : (item.hkStatus == 1 ? 'color:green' : (item.hkStatus == 2 ? 'color:red' : '')))">ã{{ |
| | | item.hkStatus == |
| | | 0 ? 'çå¾
ä¸å' : (item.hkStatus == 1 ? 'ä¸åæå' : (item.hkStatus == 2 ? 'ä¸å失败' : '')) }}ã </span>{{ |
| | | item.parksName }} |
| | | </span> |
| | | </div> |
| | | <span v-if="row.parkBookList == null || row.parkBookList.length == 0">-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸åæææ" align="center" min-width="170px"> |
| | | <template slot-scope="{row}"> |
| | | <div |
| | | v-if="row.authStatus != null && row.authStatus == 1 && row.parkBookList != null && row.parkBookList.length > 0"> |
| | | <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> |
| | | </div> |
| | | <div v-else>-</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="夿³¨" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.type == 0">宿³°å
¬å¡è½¦</span> |
| | | <span v-if="row.type == 1">宿³°èªæç©æµè½¦</span> |
| | | <span v-if="row.type == 2">å
¶ä»</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="editorName" label="æä½äºº" min-width="100px"></el-table-column> |
| | | <el-table-column prop="editDate" label="æä½æ¶é´" min-width="140px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:member:update', 'business:member:delete', 'business:empower:create'])" |
| | | label="æä½" min-width="200" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" icon="el-icon-edit" @click="handleEdit(row)" |
| | | v-permissions="['business:cars:update']">ç¼è¾</el-button> |
| | | <el-button type="text" icon="el-icon-edit" |
| | | @click="$refs.operaCarAuthWindow.open('ä¸åææ', [row.id], [row.code])" |
| | | v-permissions="['business:parkbook:create']">ä¸åææ</el-button> |
| | | <el-button type="text" icon="el-icon-delete" @click="deleteById(row)" style="color: red" |
| | | v-permissions="['business:empower:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCarAuthWindow ref="operaCarAuthWindow" @success="handlePageChange" /> |
| | | <OperaCarsImportWindow ref="OperaCarsImportWindowRef" @success="handlePageChange" /> |
| | | <OperaCarsWindow v-if="isShowEdit" ref="operaCarsWindow" @close="isShowEdit = false" @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 OperaCarAuthWindow from '@/components/business/OperaCarAuthWindow' |
| | | import OperaCarsImportWindow from './components/OperaCarsImportWindow' |
| | | import { fetchList } from '@/api/business/category.js' |
| | | export default { |
| | | name: 'Cars', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCarsWindow, OperaCarAuthWindow, OperaCarsImportWindow }, |
| | | data() { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | code: '', |
| | | memberName: '', |
| | | companyName: '', |
| | | cateIds: [], |
| | | catePId: '', |
| | | cateId: '', |
| | | type: null, |
| | | authStatus: null, |
| | | ids: '' |
| | | }, |
| | | isShowEdit: false, |
| | | cateList: [], |
| | | selIdsList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.config({ |
| | | module: '车è¾ä¿¡æ¯è¡¨', |
| | | api: '/business/cars', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | this.getCate() |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | this.tableHeight = document.body.scrollHeight - this.$refs.QueryFormRef.offsetHeight - 300 |
| | | }) |
| | | }, |
| | | methods: { |
| | | // handleSelectionChange(e) { |
| | | // this.searchForm.ids = e.map(i => i.id).join(',') |
| | | // }, |
| | | changeSel(e) { |
| | | console.log(e) |
| | | if (e && e.length == 1) { |
| | | this.$set(this.searchForm, 'catePId', e[0]) |
| | | this.$set(this.searchForm, 'cateId', '') |
| | | } else if (e && e.length == 2) { |
| | | this.$set(this.searchForm, 'catePId', e[0]) |
| | | this.$set(this.searchForm, 'cateId', e[1]) |
| | | } else { |
| | | this.$set(this.searchForm, 'catePId', '') |
| | | this.$set(this.searchForm, 'cateId', '') |
| | | } |
| | | this.search() |
| | | }, |
| | | getCate() { |
| | | fetchList({ |
| | | model: {}, |
| | | capacity: 1000, |
| | | page: 1, |
| | | }).then(res => { |
| | | this.cateList = res.records || [] |
| | | |
| | | }) |
| | | }, |
| | | handleEdit(row) { |
| | | this.isShowEdit = true |
| | | let str = row && row.id ? 'ç¼è¾è½¦è¾' : 'æ°å»ºè½¦è¾' |
| | | this.$nextTick(() => { |
| | | this.$refs.operaCarsWindow.open(str, row) |
| | | if (row && row.id) { |
| | | let form = { ...row, cateId: [] } |
| | | if (row.catePId) { form.cateId.push(row.catePId) } |
| | | if (row.cateId) { form.cateId.push(row.cateId) } |
| | | this.$refs.operaCarsWindow.form = form |
| | | this.$refs.operaCarsWindow.loadMember() |
| | | } |
| | | }) |
| | | }, |
| | | // åæ¥ä¿¡æ¯ |
| | | startEmpowerBatch() { |
| | | if (this.tableData.selectedRows.length === 0) { |
| | | this.$tip.warning('请è³å°éæ©ä¸æ¡æ°æ®') |
| | | return |
| | | } |
| | | var ids = [] |
| | | var codes = [] |
| | | this.tableData.selectedRows.forEach(item => { |
| | | ids.push(item.id) |
| | | codes.push(item.code) |
| | | }) |
| | | this.$refs.operaCarAuthWindow.open('车è¾ä¸åææ', ids, codes) |
| | | }, |
| | | } |
| | | } |
| | | </script> |