| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:driverInfo:query']"> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="叿ºä¿¡æ¯" prop="keyword"> |
| | | <el-input v-model="searchForm.keyword" clearable placeholder="请è¾å
¥å¸æºå§å/ææºå·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车çå·" prop="carNo"> |
| | | <el-input v-model="searchForm.carNo" clearable placeholder="请è¾å
¥è½¦çå·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="searchForm.status" clearable placeholder="è¯·éæ©ç¶æ" @change="search"> |
| | | <el-option label="ç¦ç¨" :value="1"></el-option> |
| | | <el-option label="å¯ç¨" :value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ§å«" prop="sex"> |
| | | <el-select v-model="searchForm.sex" clearable placeholder="è¯·éæ©æ§å«" @change="search"> |
| | | <el-option label="ç·" :value="1"></el-option> |
| | | <el-option label="女" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´" prop="createTime"> |
| | | <el-date-picker type="daterange" v-model="searchForm.createTime" clearable value-format="yyyy-MM-dd" |
| | | range-separator="-" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" @change="handleDateChange" /> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | <el-button :loading="isWorking.export" @click="exportExcel">导åº</el-button> |
| | | </section> |
| | | </el-form> |
| | | <template v-slot:table-wrap> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="name" label="叿ºå§å" min-width="100px"></el-table-column> |
| | | <el-table-column label="æ§å«" min-width="60px"> |
| | | <template slot-scope="{row}">{{ row.gender === 1 ? 'ç·' : row.gender === 2 ? '女' : '-' }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="telephone" label="æ³¨åææºå·" min-width="120px"></el-table-column> |
| | | <el-table-column prop="idcard" label="身份è¯å·" min-width="160px"></el-table-column> |
| | | <el-table-column label="è´¦æ·ä½é¢" min-width="100px"> |
| | | <template slot-scope="{row}">Â¥{{ (row.memberAmount / 100).toFixed(2) }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="carCode" label="车çå·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" min-width="160px"></el-table-column> |
| | | <el-table-column label="ç¶æ" min-width="80px"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | @change="handleStatusChange($event, row)" |
| | | v-model="row.status" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="0" |
| | | :inactive-value="1" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100" fixed="right"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="handleDetail(row)">详æ
</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | <OperaDriverDetail ref="operaDriverDetail" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDriverDetail from '@/components/business/OperaDriverDetail' |
| | | import { updateStatus, exportExcel } from '@/api/business/driver' |
| | | |
| | | export default { |
| | | name: 'DriverList', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDriverDetail }, |
| | | data () { |
| | | return { |
| | | searchForm: { |
| | | keyword: '', |
| | | carNo: '', |
| | | status: '', |
| | | sex: '', |
| | | createTime: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | auditStatus: 1 |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/driver', |
| | | 'field.id': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | handleDateChange (val) { |
| | | this.searchForm.startTime = val ? val[0] : '' |
| | | this.searchForm.endTime = val ? val[1] : '' |
| | | this.search() |
| | | }, |
| | | reset () { |
| | | this.searchForm = { |
| | | keyword: '', |
| | | carNo: '', |
| | | status: '', |
| | | sex: '', |
| | | createTime: '', |
| | | startTime: '', |
| | | endTime: '' |
| | | } |
| | | this.search() |
| | | }, |
| | | handleDetail (row) { |
| | | this.$refs.operaDriverDetail.open('叿ºè¯¦æ
', row) |
| | | }, |
| | | handleStatusChange (val, row) { |
| | | updateStatus({ id: row.id, status: val }).then(res => { |
| | | this.$tip.apiSuccess(res || 'ä¿®æ¹æå') |
| | | }).catch(e => { |
| | | row.status = val === 1 ? 0 : 1 |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | handleExport () { |
| | | this.isWorking.export = true |
| | | exportExcel(this.getTableParams()) |
| | | .then(res => { |
| | | this.download(res) |
| | | this.$tip.apiSuccess('å¯¼åºæå') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.export = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |