| | |
| | | <template> |
| | | <div class="main_app"> |
| | | <QueryForm |
| | | v-model="filters" |
| | | :query-form-config="queryFormConfig" |
| | | @handleQuery="getList(1)" |
| | | @clear="clear" |
| | | /> |
| | | <div class="mb10 mt20"> |
| | | <el-button type="primary" @click="handleEdit()">新增</el-button> |
| | | <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 :loading="exLoading" @click="handleEx" v-permissions="['business:platformJob:exportExcel']">导出</el-button> |
| | | </div> |
| | | <el-table v-loading="loading" :data="list" stripe> |
| | | <el-table-column |
| | | prop="name" |
| | | label="车牌前照号" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="任务来源" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="运输公司" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="驾驶员" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="联系方式" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="作业类型" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="运输单号" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="操作时间" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="操作" |
| | | min-width="80" |
| | | align="center" |
| | | show-overflow-tooltip |
| | | > |
| | | <el-table class="mb20" v-loading="loading" :data="list" stripe> |
| | | <el-table-column prop="code" 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="taskOrigin" label="任务来源" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="carrierName" label="运输公司" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="driverName" label="司机" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="drivierPhone" label="司机电话" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="inTypeTemp" label="作业类型" min-width="100" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <el-button type="text" @click="handleEdit(scope.row)">运单详情</el-button> |
| | | <el-button type="text" class="red" @click="handleDel(scope.row)" |
| | | >删除</el-button |
| | | > |
| | | <span v-if="scope.row.type == '0'">自有车卸货</span> |
| | | <span v-if="scope.row.type == '1'">自有车装货</span> |
| | | <span v-if="scope.row.type == '2'">外协车卸货</span> |
| | | <span v-if="scope.row.type == '3'">外协车装货</span> |
| | | <span v-if="scope.row.type == '4'">市公司外协车卸货</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" min-width="150" show-overflow-tooltip /> |
| | | <el-table-column prop="name" label="作业状态" min-width="100" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <span>{{ statusMap[scope.row.status] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="操作" min-width="120" align="center" fixed="right" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <el-button v-if="scope.row.status == 12" type="text" class="red" v-permissions="['business:platformJob:delete']" |
| | | @click="handleDel(scope.row)">删除</el-button> |
| | | <el-button type="text" v-permissions="['business:platformJob:query']" |
| | | @click="handleDetail(scope.row)">预约详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="getList" |
| | | :pagination="pagination" |
| | | /> |
| | | <el-dialog |
| | | :title="param.id ? '编辑作业任务' : '新增作业任务'" |
| | | :visible.sync="isShowEdit" |
| | | width="480px" |
| | | > |
| | | <el-form :model="param" :rules="rules" ref="ruleForm" label-width="100px"> |
| | | <el-form-item label="入园原因" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="合同号" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="到场时间" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车前牌照号" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="驾驶员" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系方式" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="入园事由" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="总运输量" prop="name"> |
| | | <el-input v-model="param.aaa" placeholder="请输入" class="w300"></el-input> |
| | | <span class="ml10">万支</span> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowEdit = false">取消</el-button> |
| | | <el-button type="primary" @click="handleSub">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> |
| | | <!-- --> |
| | | <!-- --> |
| | | <DriverDetail v-if="isShowDriver" ref="DriverDetailRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/common/Pagination' |
| | | import QueryForm from '@/components/common/QueryForm' |
| | | import { platformJobPage } from '@/api' |
| | | import { platformJobPage, platformJobExport,platformJobDel } from '@/api' |
| | | import { statusMap } from '../config' |
| | | import DriverDetail from "@/views/task/driverDetail" |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadFaceImg from '@/components/common/UploadFaceImg' |
| | | import { Message } from 'element-ui' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | components: { |
| | | Pagination, |
| | | QueryForm |
| | | QueryForm, |
| | | DriverDetail, |
| | | GlobalWindow, |
| | | UploadFaceImg |
| | | }, |
| | | data () { |
| | | return { |
| | | statusMap, |
| | | isShowDriver: false, |
| | | exLoading: false, |
| | | loading: false, |
| | | pagination: { |
| | | pageSize: 10, |
| | | page: 1, |
| | | total: 0 |
| | | }, |
| | | filters: {}, |
| | | filters: { |
| | | selDate: [], |
| | | fastdate: 0 |
| | | }, |
| | | list: [], |
| | | isShowEdit: false, |
| | | param: {}, |
| | | rules: {}, |
| | | queryFormConfig: { |
| | | formItems: [ |
| | | { |
| | | filed: 'carCodeFront', |
| | | filed: 'code', |
| | | type: 'input', |
| | | label: '车牌号' |
| | | label: '运单号' |
| | | }, |
| | | { |
| | | filed: 'driverName', |
| | |
| | | label: '驾驶员' |
| | | }, |
| | | { |
| | | filed: 'code', |
| | | filed: 'carCodeFront', |
| | | type: 'input', |
| | | label: '运输单号' |
| | | label: '车牌号' |
| | | }, |
| | | { |
| | | filed: 'selDate', |
| | | type: 'daterange', |
| | | label: '操作时间' |
| | | type: 'datetimerange', |
| | | label: '操作时间', |
| | | pickerOptions: {} |
| | | }, |
| | | { |
| | | type: 'slot', |
| | | filed: 'fastdate', |
| | | label: '' |
| | | } |
| | | ], |
| | | online: true |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.changeRadio('0') |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | handleSub () { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | alert('submit!') |
| | | changeRadio (day) { |
| | | const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD') + ' 00:00:00', dayjs().format('YYYY-MM-DD') + ' 23:59:59'] |
| | | this.$set(this.filters, 'selDate', arr) |
| | | this.getList() |
| | | }, |
| | | changeForm (str) { |
| | | if (str === 'selDate') { |
| | | this.$set(this.filters, 'fastdate', null) |
| | | this.getList() |
| | | } |
| | | }) |
| | | }, |
| | | getList (page) { |
| | | const { pagination, filters } = this |
| | | this.loading = true |
| | | platformJobPage({ |
| | | model: { ...filters, jobType: 0 }, |
| | | model: { |
| | | ...filters, |
| | | jobType: '0', |
| | | beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null, |
| | | beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null, |
| | | }, |
| | | capacity: pagination.pageSize, |
| | | page: pagination.page, |
| | | page: page || pagination.page, |
| | | }).then(res => { |
| | | this.loading = false |
| | | this.list = res.records || [] |
| | | this.list.forEach(item => { |
| | | item.inTypeTemp = item.inType == 0 ? '整托盘' : '件烟' |
| | | item.taskOrigin = 'WMS获取' |
| | | }) |
| | | this.pagination.total = res.total || 0 |
| | | }, () => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | handleDel(row) { |
| | | this.$dialog.exportConfirm('确认删除吗?').then(() => { |
| | | platformJobDel(row.id).then(res => { |
| | | Message.success('删除成功') |
| | | this.getList() |
| | | }) |
| | | }) |
| | | }, |
| | | handleEx() { |
| | | this.$dialog.exportConfirm('确认导出吗?') |
| | | .then(() => { |
| | | this.exLoading = true |
| | | platformJobExport({ |
| | | page: this.pagination.page, |
| | | capacity: 1000000, |
| | | jobType: '0', |
| | | model: this.filters |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.exLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | | clear () { |
| | | this.pagination.page = 1 |
| | | this.filters = {} |
| | | this.filters = { |
| | | selDate: [], |
| | | fastdate: 0 |
| | | } |
| | | this.getList() |
| | | }, |
| | | handleEdit (row) { |
| | | this.isShowEdit = true |
| | | 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 () { }, |
| | | handleSizeChange (capacity) { |
| | | this.pagination.pageSize = capacity |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .param_title { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #000000; |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |