<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 :loading="exLoading" @click="handleEx" v-permissions="['business:platformjob:exportExcel']">导出</el-button>
|
</div>
|
<el-table :height="tableHeightNew" v-loading="loading" :data="list" stripe>
|
<el-table-column prop="billCode" 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="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="confirmTaskDate" label="确认时间" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="signDate" label="签到时间" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="callDate" label="叫号时间" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="startDate" label="作业开始时间" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="doneDate" label="作业完成时间" min-width="150" show-overflow-tooltip />
|
<el-table-column prop="workTime" label="作业时长" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="platformNames" label="叫号月台" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="createDate" label="创建时间" min-width="150" show-overflow-tooltip />
|
<el-table-column label="作业情况" fixed="right" min-width="100" show-overflow-tooltip>
|
<template v-slot="scope">
|
<span>{{ statusMap[scope.row.status] }}</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
<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, 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'
|
import duration from 'dayjs/plugin/duration'
|
import BasePage from '@/components/base/BasePage'
|
dayjs.extend(duration);
|
export default {
|
extends: BasePage,
|
components: {
|
Pagination,
|
QueryForm,
|
DriverDetail,
|
GlobalWindow,
|
UploadFaceImg
|
},
|
data() {
|
return {
|
statusMap,
|
isShowDriver: false,
|
exLoading: false,
|
loading: false,
|
pagination: {
|
pageSize: 10,
|
page: 1,
|
total: 0
|
},
|
filters: {
|
selDate: [],
|
fastdate: 0
|
},
|
list: [],
|
queryFormConfig: {
|
formItems: [
|
{
|
filed: 'billCode',
|
type: 'input',
|
label: '运单号'
|
},
|
{
|
filed: 'carCodeFront',
|
type: 'input',
|
label: '车牌号'
|
},
|
{
|
filed: 'driverName',
|
type: 'input',
|
label: '驾驶员'
|
},
|
{
|
filed: 'selDate',
|
type: 'datetimerange',
|
label: '',
|
pickerOptions: {}
|
},
|
{
|
type: 'slot',
|
filed: 'fastdate',
|
label: '作业时间'
|
}
|
],
|
online: true
|
},
|
}
|
},
|
created() {
|
this.changeRadio('0')
|
this.getList()
|
},
|
methods: {
|
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',
|
createDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
|
createDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
|
},
|
sorts: [{ direction: 'DESC', property: 'create_date' }],
|
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 ? '整托盘' : '件烟'
|
item.taskOrigin = 'WMS获取'
|
if(item.workTime && item.workTime>=24*60*60 ){
|
item.workTime = dayjs.duration(item.workTime, 'seconds').format('D天H时m分s秒');
|
}else{
|
item.workTime = dayjs.duration(item.workTime, 'seconds').format('H时m分s秒');
|
}
|
})
|
this.pagination.total = res.total || 0
|
}, () => {
|
this.loading = false
|
})
|
},
|
handleDel(row) {
|
this.$dialog.exportConfirm('确认删除吗?').then(() => {
|
platformJobDel({ id: row.id }).then(res => {
|
Message.success('删除成功')
|
this.getList()
|
})
|
})
|
},
|
handleEx() {
|
this.$dialog.exportConfirm('确认导出吗?')
|
.then(() => {
|
this.exLoading = true
|
const { filters } = this
|
platformJobExport({
|
model: {
|
...filters,
|
jobType: 0,
|
createDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
|
createDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
|
},
|
sorts: [{ direction: 'DESC', property: 'create_date' }],
|
capacity: 10000,
|
page: 1,
|
})
|
.then(response => {
|
this.download(response)
|
})
|
.catch(e => {
|
this.$tip.apiFailed(e)
|
})
|
.finally(() => {
|
this.exLoading = false
|
})
|
})
|
},
|
clear() {
|
this.pagination.page = 1
|
this.filters = {
|
selDate: [],
|
}
|
this.getList()
|
},
|
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
|
})
|
},
|
handleSizeChange(capacity) {
|
this.pagination.pageSize = capacity
|
this.getList()
|
}
|
}
|
}
|
</script>
|
<style lang="scss" scoped>
|
.param_title {
|
font-size: 18px;
|
font-weight: 600;
|
color: #000000;
|
margin-bottom: 15px;
|
}
|
</style>
|