| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main_app"> |
| | | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @changeForm='changeForm' @handleQuery="getList(1)" |
| | | @clear="clear"> |
| | | <template #fastdate> |
| | | <el-radio-group v-model="filters.fastdate" size="small" @input="changeRadio"> |
| | | <el-radio-button label="0">å½å¤©</el-radio-button> |
| | | <el-radio-button label="6">è¿7天</el-radio-button> |
| | | <el-radio-button label="29">è¿30天</el-radio-button> |
| | | </el-radio-group> |
| | | </template> |
| | | </QueryForm> |
| | | <div class="pt16"> |
| | | <el-button type="primary" @click="handleEdit" icon="el-icon-plus" |
| | | v-permissions="['business:platformbooks:create']">æ°å»º</el-button> |
| | | <el-button :loading="exLoading" @click="handleEx" |
| | | v-permissions="['business:platformbooks:exportExcel']">导åº</el-button> |
| | | </div> |
| | | <el-table :height="tableHeightNew" v-loading="loading" :data="list" stripe> |
| | | <el-table-column prop="contractNum" label="åååå·" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="inReason" label="å
¥ååå " min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="totalNum" label="æ»ä½ä¸é(䏿¯)" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="carCodeFront" label="车çåç
§å·" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="carCodeBack" label="车çåç
§å·" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="driverName" label="驾驶å" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="driverPhone" label="èç³»æ¹å¼" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="inTypeTemp" label="å
¥åºç±»å" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="arriveDate" label="é¢çº¦å°åºæ¶é´" min-width="150" show-overflow-tooltip /> |
| | | <el-table-column label="审æ¹ç»æ" min-width="100" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.status == '0'">å¾
审æ¹</span> |
| | | <span v-if="scope.row.status == '1'">审æ¹ä¸</span> |
| | | <span v-if="scope.row.status == '2'">审æ¹éè¿</span> |
| | | <span v-if="scope.row.status == '3'">审æ¹é©³å</span> |
| | | <span v-if="scope.row.status == '4'">已忶</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="auditName" label="å½å审æ¹äºº" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="editDate" label="æä½æ¶é´" min-width="150" show-overflow-tooltip /> |
| | | <el-table-column prop="name" label="æä½" min-width="120" align="center" fixed="right" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <el-button type="text" v-permissions="['business:platformbooks:detail']" |
| | | @click="handleDetail(scope.row)">é¢çº¦è¯¦æ
</el-button> |
| | | <el-button type="text" class="red" v-permissions="['business:platformbooks:delete']" |
| | | @click="handleDel(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> |
| | | <!-- --> |
| | | <GlobalWindow :title="param.id ? 'ç¼è¾ç©æµè½¦é¢çº¦' : 'æ°å¢ç©æµè½¦é¢çº¦'" center :visible.sync="isShowEdit" width="600px" |
| | | :confirm-working="subLoading" @confirm="onSubmit"> |
| | | <el-form :model="param" :rules="rules" ref="ruleForm" label-width="100px"> |
| | | <div class="param_title">è¿è¾ä¿¡æ¯</div> |
| | | <el-form-item label="å
¥ååå " prop="reasonId"> |
| | | <el-select v-model="param.reasonId" @change="checkSurplus" class="w300" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in reasonList" :key="item.id" :label="item.reason" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ååå·" prop="contractNum"> |
| | | <el-input v-model="param.contractNum" class="w300" placeholder="请è¾å
¥ååå·"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å°åºæ¶é´" prop="arriveDate"> |
| | | <el-date-picker v-model="param.arriveDate" @change="checkSurplus" value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetime" class="w300" placeholder="è¯·éæ©"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å
¥åºç±»å" prop="inType"> |
| | | <div> |
| | | <el-radio v-model="param.inType" :label="0">æ´ä»¶ç</el-radio> |
| | | <el-radio v-model="param.inType" :label="1">ä»¶ç</el-radio> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="æ»è¿è¾é" prop="totalNum"> |
| | | <el-input @blur="checkSurplus" oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 10)" |
| | | v-model="param.totalNum" placeholder="请è¾å
¥" class="w300"></el-input> |
| | | <span class="ml10">䏿¯</span> |
| | | </el-form-item> |
| | | <el-form-item label="åè¿è¯ç
§ç" prop="transportImg"> |
| | | <UploadAvatarImage :file="{ 'imgurlfull': param.transportImgFull, 'imgurl': param.transportImg }" |
| | | :uploadData="{ folder: 'platform' }" @uploadSuccess="uploadSuccess" @uploadEnd="isUploading = false" |
| | | @uploadBegin="isUploading = true" /> |
| | | </el-form-item> |
| | | <div class="param_title">叿º/车è¾ä¿¡æ¯</div> |
| | | <el-form-item label="叿ºå§å" prop="driverName"> |
| | | <el-input v-model="param.driverName" placeholder="请è¾å
¥" class="w300"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="叿ºææºå·" prop="driverPhone"> |
| | | <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="param.driverPhone" |
| | | placeholder="请è¾å
¥" class="w300"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车åçç
§å·" prop="carCodeFront"> |
| | | <el-input v-model="param.carCodeFront" placeholder="请è¾å
¥" class="w300"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车åçç
§å·" prop="carCodeBack"> |
| | | <el-input v-model="param.carCodeBack" placeholder="请è¾å
¥" class="w300"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | <!-- --> |
| | | <DriverDetail v-if="isShowDriver" @success="getList" @close="isShowDriver = false" ref="DriverDetailRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/common/Pagination' |
| | | import QueryForm from '@/components/common/QueryForm' |
| | | import { platformBooksPage, platformReasonList, platformBooksApply, platformBooksExport } from '@/api' |
| | | import { checkSurplusNum, deletebooksById } from '@/api/platform/platform' |
| | | import DriverDetail from '@/views/task/driverDetail' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | import { Message } from 'element-ui' |
| | | import dayjs from 'dayjs' |
| | | import BaseComputHeight from "@/components/base/BaseComputHeight" |
| | | export default { |
| | | extends: BaseComputHeight, |
| | | components: { |
| | | Pagination, |
| | | QueryForm, |
| | | DriverDetail, |
| | | GlobalWindow, |
| | | UploadAvatarImage |
| | | }, |
| | | data() { |
| | | return { |
| | | isShowDriver: false, |
| | | exLoading: false, |
| | | loading: false, |
| | | pagination: { |
| | | pageSize: 10, |
| | | page: 1, |
| | | total: 0 |
| | | }, |
| | | filters: { |
| | | arriveDateStart: '', |
| | | arriveDateEnd: '', |
| | | fastdate: 0 |
| | | }, |
| | | list: [], |
| | | |
| | | isShowEdit: false, |
| | | subLoading: false, |
| | | param: { |
| | | inType: 0 |
| | | }, |
| | | reasonList: [], |
| | | rules: { |
| | | contractNum: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | totalNum: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | driverPhone: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | carCodeFront: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | carCodeBack: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | |
| | | transportImg: [{ required: true, message: '请ä¸ä¼ ', trigger: 'blur' }], |
| | | reasonId: [{ required: true, message: 'è¯·éæ©', trigger: 'blur' }], |
| | | arriveDate: [{ required: true, message: 'è¯·éæ©', trigger: 'blur' }], |
| | | inType: [{ required: true, message: 'è¯·éæ©', trigger: 'blur' }], |
| | | driverName: [{ required: true, message: 'è¯·éæ©', trigger: 'blur' }] |
| | | }, |
| | | queryFormConfig: { |
| | | formItems: [ |
| | | { |
| | | filed: 'carCodeFront', |
| | | type: 'input', |
| | | label: '车çå·' |
| | | }, |
| | | { |
| | | filed: 'driverName', |
| | | type: 'input', |
| | | label: '驾驶å' |
| | | }, |
| | | { |
| | | filed: 'contractNum', |
| | | type: 'input', |
| | | label: 'åååå·' |
| | | }, |
| | | { |
| | | filed: 'status', |
| | | type: 'select', |
| | | label: '审æ¹ç»æ', |
| | | options: [ |
| | | { value: 0, label: 'å¾
审æ¹' }, |
| | | { value: 1, label: '审æ¹ä¸' }, |
| | | { value: 2, label: '审æ¹éè¿' }, |
| | | { value: 3, label: '审æ¹é©³å' }, |
| | | { value: 4, label: '已忶' } |
| | | ] |
| | | }, |
| | | { |
| | | filed1: 'arriveDateStart', |
| | | filed2: 'arriveDateEnd', |
| | | type: 'datetime', |
| | | label: 'æä½æ¶é´' |
| | | }, |
| | | { |
| | | type: 'slot', |
| | | filed: 'fastdate', |
| | | label: '' |
| | | } |
| | | ], |
| | | online: true |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.changeRadio('0') |
| | | // this.getList() |
| | | }, |
| | | methods: { |
| | | checkSurplus() { |
| | | const { arriveDate, reasonId, totalNum } = this.param |
| | | if (!arriveDate || !reasonId || !totalNum) return |
| | | checkSurplusNum({ |
| | | arriveDate, |
| | | reasonId, |
| | | totalNum |
| | | }).then(res => { |
| | | console.log('res', res) |
| | | |
| | | if (res == 0 || res < Number(totalNum)) { |
| | | Message.error(`彿¥å©ä½å¯é¢çº¦ä½ä¸é${res}䏿¯ä¸è¶³è¯·éæ©å
¶ä»å°åºæ¥æ`) |
| | | } |
| | | }) |
| | | }, |
| | | changeRadio(day) { |
| | | const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD') + ' 00:00:00', dayjs().format('YYYY-MM-DD') + ' 23:59:59'] |
| | | this.filters.arriveDateStart = arr[0] |
| | | this.filters.arriveDateEnd = arr[1] |
| | | this.getList(1) |
| | | }, |
| | | changeForm(str) { |
| | | if (this.filters.arriveDateStart > this.filters.arriveDateEnd) { |
| | | this.filters.arriveDateStart = this.filters.arriveDateEnd |
| | | return this.$message.error('å¼å§æ¶é´ä¸è½å¤§äºç»ææ¶é´') |
| | | } |
| | | this.getList() |
| | | }, |
| | | getList(page) { |
| | | const { pagination, filters } = this |
| | | this.loading = true |
| | | platformBooksPage({ |
| | | model: { |
| | | ...filters |
| | | }, |
| | | capacity: pagination.pageSize, |
| | | page: page || pagination.page |
| | | }).then(res => { |
| | | this.loading = false |
| | | this.list = res.records || [] |
| | | this.list.forEach(item => { |
| | | item.inTypeTemp = item.inType == 0 ? 'æ´æç' : 'ä»¶ç' |
| | | }) |
| | | this.pagination.total = res.total || 0 |
| | | }, () => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | handleEx() { |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | const { filters } = this |
| | | this.exLoading = true |
| | | platformBooksExport({ |
| | | page: this.pagination.page, |
| | | capacity: 1000000, |
| | | model: { |
| | | ...filters |
| | | } |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.exLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | | onSubmit() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | const param = this.param |
| | | param.inReason = this.reasonList.find(item => param.reasonId == item.id).reason |
| | | if (valid) { |
| | | this.subLoading = true |
| | | platformBooksApply({ ...param }).then(res => { |
| | | this.getList() |
| | | this.subLoading = false |
| | | this.isShowEdit = false |
| | | }, () => { |
| | | this.subLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | uploadSuccess(file) { |
| | | this.$set(this.param, 'transportImg', file.imgurl) |
| | | this.$set(this.param, 'transportImgFull', file.imgurlfull) |
| | | }, |
| | | handleEdit(row) { |
| | | this.isShowEdit = true |
| | | this.param = { |
| | | inType: 0 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.ruleForm.clearValidate() |
| | | }) |
| | | this.$set(this.param, 'arriveDate', dayjs().format('YYYY-MM-DD HH:mm:ss')) |
| | | this.getplatformReason() |
| | | }, |
| | | getplatformReason() { |
| | | platformReasonList().then(res => { |
| | | this.reasonList = res || [] |
| | | }) |
| | | }, |
| | | handleSub() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | alert('submit!') |
| | | } |
| | | }) |
| | | }, |
| | | clear() { |
| | | this.pagination.page = 1 |
| | | this.filters = {} |
| | | this.getList() |
| | | // this.changeRadio('0') |
| | | }, |
| | | handleDetail(row) { |
| | | this.isShowDriver = true |
| | | this.$nextTick(() => { |
| | | this.$refs.DriverDetailRef.id = row.id |
| | | this.$refs.DriverDetailRef.type = 6 |
| | | this.$refs.DriverDetailRef.getDetail() |
| | | this.$refs.DriverDetailRef.isShowModal = true |
| | | }) |
| | | }, |
| | | handleDel(row) { |
| | | this.$confirm('ç¡®å®å é¤è¯¥è®°å½å, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deletebooksById(row.id) |
| | | .then(res => { |
| | | this.$message.success('æä½æå') |
| | | this.page = 1 |
| | | this.getList() |
| | | }) |
| | | }).catch(() => { |
| | | }) |
| | | }, |
| | | handleSizeChange(capacity) { |
| | | this.pagination.pageSize = capacity |
| | | this.getList(1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .param_title { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #000000; |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |