| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:carusebook:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <div ref="QueryFormRef" slot="search-form"> |
| | | <el-form ref="searchForm" :model="searchForm" label-width="100px" inline> |
| | | <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="请è¾å
¥ç³è¯·äººç»ç»" clearable |
| | | @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车çå·" prop="carCode"> |
| | | <el-input v-model="searchForm.carCode" placeholder="请è¾å
¥è½¦çå·" clearable |
| | | @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="searchForm.status" @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-option label="审æ¹ä¸éè¿" value="3"></el-option> |
| | | <el-option label="å·²æ¤é" value="4"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç®çå°ç±»å" prop="type"> |
| | | <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-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·æ¶é´" prop="startTime"> |
| | | <!-- <el-date-picker @change="seleTime" v-model="time" @keypress.enter.native="search" type="datetimerange" |
| | | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" |
| | | range-separator="è³" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ"> |
| | | </el-date-picker> --> |
| | | <el-date-picker type="datetime" v-model="searchForm.queryStartTime" value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="è¯·éæ©å¼å§æ¶é´" @change="changeRadio" /> |
| | | <el-date-picker type="datetime" v-model="searchForm.queryEndTime" value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="è¯·éæ©ç»ææ¶é´" @change="changeRadio" /> |
| | | </el-form-item> |
| | | <el-radio-group v-model="searchForm.radio" size="small" @input="changeRadio"> |
| | | <el-radio-button label="0">å½å¤©</el-radio-button> |
| | | <el-radio-button label="1">è¿7天</el-radio-button> |
| | | <el-radio-button label="2">è¿30天</el-radio-button> |
| | | </el-radio-group> |
| | | <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:carusebook:create', |
| | | 'business:carusebook:exportExcel', |
| | | ]"> |
| | | <li> |
| | | <el-button type="primary" @click="handleEdit" icon="el-icon-plus" |
| | | v-permissions="['business:carusebook:create']">æ°å»º</el-button> |
| | | </li> |
| | | <li> |
| | | <el-button type="primary" @click="handleEx" v-permissions="['business:carusebook:exportExcel']">导åº</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="carCode" label="车çå·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="memberName" label="ææ¥äºº" min-width="80px"></el-table-column> |
| | | <el-table-column prop="memberNames" label="ä¹è½¦äºº" min-width="180px"></el-table-column> |
| | | <el-table-column prop="companyName" label="æå±ç»ç»" min-width="150px"></el-table-column> |
| | | <el-table-column label="ç¨è½¦æ¶é´" min-width="170px"> |
| | | <template slot-scope="{ row }"> |
| | | <span v-if="row.startTime">èµ·:{{ row.startTime.slice(0, 16) }}</span><br /> |
| | | <span v-if="row.endTime">æ¢:{{ row.endTime.slice(0, 16) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="planUseDate" label="åºåæ¶é´" min-width="150px"> |
| | | <template slot-scope="{ row }"> |
| | | <span v-if="row.planUseDate">{{ row.planUseDate.slice(0, 16) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç®çå°" min-width="200px"> |
| | | <template slot-scope="{ row }"> |
| | | <span class="status-green" v-if="row.type === 0">ãå¸å
ã</span> |
| | | <span class="status-red" v-if="row.type === 1">ãå¸å¤ã</span> |
| | | <span>{{ row.addr }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" min-width="100px"> |
| | | <template slot-scope="{ row }"> |
| | | <span class="status-blue" v-if="row.status === 0">ç³è¯·ä¸</span> |
| | | <span class="status-blue" v-if="row.status === 1">å®¡æ ¸ä¸</span> |
| | | <span class="status-green" v-if="row.status === 2">审æ¹éè¿</span> |
| | | <span class="status-red" v-if="row.status === 3">审æ¹ä¸éè¿</span> |
| | | <span class="status-red" v-if="row.status === 4">å·²æ¤é</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="createDate" label="ç³è¯·æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column prop="editDate" label="æä½æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column label="æä½" min-width="180" align="center" fixed="right"> |
| | | <template slot-scope="{ row }"> |
| | | <el-button type="text" icon="el-icon-edit" |
| | | @click="$refs.OperaDetailsWindow.open('å
¬å¡è½¦ç³è¯·è¯¦æ
', row)">æ¥ç详æ
</el-button> |
| | | <!-- <el-button v-if="(row.status === 1 || row.status === 2) && new Date().getTime() < new Date(row.startTime).getTime()" type="text" icon="el-icon-delete" @click="rowRevokeClick(row)" >æ¤é</el-button> --> |
| | | <el-button style="color: red" v-if="row.hasRole == 1" type="text" icon="el-icon-delete" |
| | | @click="rowRevokeClick(row)">æ¤é</el-button> |
| | | <!-- <el-button style="color: red" v-if="(row.status === 0 && row.creator == userInfo.id)||((row.status === 0 || row.status === 1 ) || ( row.status === 2 && new Date().getTime() < new Date(row.startTime).getTime() ))" type="text" icon="el-icon-delete" @click="rowRevokeClick(row)" >æ¤é</el-button>--> |
| | | <el-button style="color: red" type="text" icon="el-icon-delete" |
| | | v-permissions="['business:carusebook:delete']" @click="deleteById(row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | <!-- --> |
| | | <el-dialog title="ç¨è½¦æ¤é" :visible.sync="isShowBack" width="520px"> |
| | | <el-form :model="backParam" :rules="rules" ref="backForm" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="说æ" prop="info"> |
| | | <el-input type="textarea" :rows="4" v-model="backParam.info" placeholder="请è¾å
¥æ¤é说æ"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowBack = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="backSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <OperaCarUseBookWindow ref="OperaDetailsWindow" @success="handlePageChange" /> |
| | | <OperaCarUseBookParamWindow ref="OperaParamWindow" @success="search" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCarUseBookWindow from '@/components/business/OperaCarUseBookWindow' |
| | | import OperaCarUseBookParamWindow from '@/components/operation/OperCarUseBookParamWindow.vue' |
| | | import { timeForMat } from '@/utils/util' |
| | | import { allList } from '@/api/business/hiddenDangerParam' |
| | | import { carUseBookRecordEx, revokeById } from '@/api/business/carUseBook' |
| | | export default { |
| | | name: 'Empower', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCarUseBookWindow, OperaCarUseBookParamWindow }, |
| | | data() { |
| | | return { |
| | | // userInfo: this.$store.state.userInfo, |
| | | // æç´¢ |
| | | searchForm: { |
| | | memberName: '', |
| | | companyName: '', |
| | | queryStartTime: '', |
| | | queryEndTime: '', |
| | | type: null, |
| | | status: null, |
| | | radio: 0 |
| | | }, |
| | | cateList: [], |
| | | areaList: [], |
| | | time: [], |
| | | |
| | | isShowBack: false, |
| | | backParam: {}, |
| | | rules: { |
| | | info: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.config({ |
| | | module: 'ç¨è½¦ç³è¯·ç®¡ç', |
| | | api: '/business/carUseBook', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | // this.search() |
| | | this.changeRadio('0') |
| | | this.loadParams() |
| | | }, |
| | | methods: { |
| | | rowRevokeClick(row) { |
| | | this.isShowBack = true |
| | | this.backParam = {} |
| | | this.$set(this.backParam, 'id', row.id) |
| | | this.$nextTick(() => { |
| | | this.$refs.backForm.clearValidate() |
| | | }) |
| | | }, |
| | | backSubmit() { |
| | | revokeById({ ...this.backParam }).then(res => { |
| | | this.$tip.success('æ¤éæå') |
| | | this.isShowBack = false |
| | | this.search() |
| | | }) |
| | | }, |
| | | handleEx() { |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | this.exLoading = true |
| | | carUseBookRecordEx({ |
| | | model: this.searchForm |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.exLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | | changeRadio(e) { |
| | | if (e === '0') { |
| | | this.searchForm.queryStartTime = timeForMat(0)[0] |
| | | this.searchForm.queryEndTime = timeForMat(0)[1] |
| | | } else if (e === '1') { |
| | | this.searchForm.queryStartTime = timeForMat(6)[0] |
| | | this.searchForm.queryEndTime = timeForMat(6)[1] |
| | | } else if (e === '2') { |
| | | this.searchForm.queryStartTime = timeForMat(29)[0] |
| | | this.searchForm.queryEndTime = timeForMat(29)[1] |
| | | } else { |
| | | this.searchForm.radio = '' |
| | | } |
| | | if (this.searchForm.queryStartTime && this.searchForm.queryEndTime && new Date(this.searchForm.queryStartTime).getTime() > new Date(this.searchForm.queryEndTime).getTime()) { |
| | | this.$message.error('å¼å§æ¶é´ä¸è½å¤§äºç»ææ¶é´') |
| | | this.searchForm.queryStartTime = '' |
| | | return |
| | | } |
| | | this.search() |
| | | }, |
| | | handleEdit() { |
| | | this.$refs.OperaParamWindow.open() |
| | | }, |
| | | loadParams() { |
| | | allList({ |
| | | }) |
| | | .then(res => { |
| | | if (res != null && res.length) { |
| | | res.forEach(item => { |
| | | if (item && item.type != null && item.type === 0) { |
| | | this.areaList.push(item) |
| | | } |
| | | if (item && item.type != null && item.type === 1) { |
| | | this.cateList.push(item) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | }) |
| | | }, |
| | | seleTime(e) { |
| | | this.searchForm.queryStartTime = null |
| | | this.searchForm.queryEndTime = null |
| | | if (e != null && e.length >= 2) { |
| | | this.searchForm.queryStartTime = e[0] |
| | | this.searchForm.queryEndTime = e[1] |
| | | } |
| | | this.searchForm.radio = null |
| | | this.search() |
| | | }, |
| | | reset() { |
| | | this.$refs.searchForm.resetFields() |
| | | this.searchForm = { |
| | | memberName: '', |
| | | companyName: '', |
| | | queryStartTime: '', |
| | | queryEndTime: '', |
| | | type: null, |
| | | status: null, |
| | | radio: '' |
| | | } |
| | | // this.changeRadio(0) |
| | | this.search() |
| | | } |
| | | } |
| | | } |
| | | </script> |