|  |  | 
 |  |  | <template> | 
 |  |  |   <div class="main_app"> | 
 |  |  |     <QueryForm v-model="filters" :query-form-config="queryFormConfig" @changeForm='changeForm' @handleQuery="getList(1)" | 
 |  |  |     <QueryForm ref="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"> | 
 |  |  | 
 |  |  |       </template> | 
 |  |  |     </QueryForm> | 
 |  |  |     <div class="pt16"> | 
 |  |  |       <el-button type="primary" @click="complete(ids)">完成作业</el-button> | 
 |  |  |       <el-button :loading="exLoading" @click="handleEx" | 
 |  |  |         v-permissions="['business:platformjob:exportExcel']">导出</el-button> | 
 |  |  |       <el-button :loading="updateLoading" @click="updateTotalNum" | 
 |  |  |         v-permissions="['business:platformjob:updateTotalNum']">重置总作业量</el-button> | 
 |  |  |     </div> | 
 |  |  |     <el-table class="mb20" v-loading="loading" :data="list" stripe> | 
 |  |  |     <el-table :height="tableHeightNew" v-loading="loading" :data="list" @selection-change="handleSelectionChange" stripe> | 
 |  |  |       <el-table-column type="selection" width="55"></el-table-column> | 
 |  |  |       <el-table-column prop="billCode" label="运单号" min-width="100" show-overflow-tooltip /> | 
 |  |  |       <el-table-column prop="totalNum" label="总作业量(万支)" min-width="130" 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> | 
 |  |  | <!--      <el-table-column prop="wmsContractNum" label="WMS合同号" min-width="100" show-overflow-tooltip > | 
 |  |  |       <template v-slot="scope"> | 
 |  |  |         <span v-if="scope.row.platformWmsJob">{{ scope.row.platformWmsJob.contractNum }}</span> | 
 |  |  |       </template> | 
 |  |  |       </el-table-column>--> | 
 |  |  |       <el-table-column label="作业类型" min-width="100" show-overflow-tooltip> | 
 |  |  |         <template v-slot="scope"> | 
 |  |  |           <span v-if="scope.row.type == '0'">自有车卸货</span> | 
 |  |  |           <span v-if="scope.row.type == '1'">自有车装货</span> | 
 |  |  | 
 |  |  |         </template> | 
 |  |  |       </el-table-column> | 
 |  |  |       <el-table-column prop="ioCreatedate" label="创建时间" min-width="150" show-overflow-tooltip /> | 
 |  |  |       <el-table-column prop="name" label="作业状态" min-width="100" show-overflow-tooltip> | 
 |  |  |       <el-table-column 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> | 
 |  |  |       <el-table-column prop="editUserName" label="最后操作人员" min-width="150" show-overflow-tooltip /> | 
 |  |  |       <el-table-column prop="name" label="操作" min-width="170" 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" @click="complete([scope.row.id])" v-if="[0,1,2].includes(scope.row.status)">完成作业</el-button> | 
 |  |  |           <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 v-if="scope.row != 12" type="text" v-permissions="['business:platformjob:query']" | 
 |  |  |             @click="handleDetail(scope.row)">运单详情</el-button> | 
 |  |  |         </template> | 
 |  |  | 
 |  |  | <script> | 
 |  |  | import Pagination from '@/components/common/Pagination' | 
 |  |  | import QueryForm from '@/components/common/QueryForm' | 
 |  |  | import { platformJobPage, platformJobExport, platformJobDel } from '@/api' | 
 |  |  | import { platformJobPage, platformJobExport, platformJobDel, dealJobFinish ,updateTotalNum} from '@/api' | 
 |  |  | import { statusMap } from '../config' | 
 |  |  | import WaybillDetailRef from "../components/WaybillDetail.vue" | 
 |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
 |  |  | import UploadFaceImg from '@/components/common/UploadFaceImg' | 
 |  |  | import { Message } from 'element-ui' | 
 |  |  | import dayjs from 'dayjs' | 
 |  |  | import BaseComputHeight from "@/components/base/BaseComputHeight"; | 
 |  |  | export default { | 
 |  |  |   extends: BaseComputHeight, | 
 |  |  |   components: { | 
 |  |  |     Pagination, | 
 |  |  |     QueryForm, | 
 |  |  | 
 |  |  |       statusMap, | 
 |  |  |       isShowDetail: false, | 
 |  |  |       exLoading: false, | 
 |  |  |       updateLoading: false, | 
 |  |  |       loading: false, | 
 |  |  |       pagination: { | 
 |  |  |         pageSize: 10, | 
 |  |  | 
 |  |  |       }, | 
 |  |  |       filters: { | 
 |  |  |         selDate: [], | 
 |  |  |         fastdate: 0 | 
 |  |  |         fastdate: 0, | 
 |  |  |         createDateStart: '', | 
 |  |  |         createDateEnd: '' | 
 |  |  |       }, | 
 |  |  |       list: [], | 
 |  |  |       queryFormConfig: { | 
 |  |  |         formItems: [ | 
 |  |  |           { | 
 |  |  |             filed: 'code', | 
 |  |  |             filed: 'billCode', | 
 |  |  |             type: 'input', | 
 |  |  |             label: '运单号' | 
 |  |  |           }, | 
 |  |  | 
 |  |  |             label: '驾驶员' | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             filed: 'wmsContractNum', | 
 |  |  |             type: 'input', | 
 |  |  |             label: '合同号' | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             filed: 'carCodeFront', | 
 |  |  |             type: 'input', | 
 |  |  |             label: '车牌号' | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             filed: 'selDate', | 
 |  |  |             type: 'datetimerange', | 
 |  |  |             label: '操作时间', | 
 |  |  |             pickerOptions: {} | 
 |  |  |             filed: 'status', | 
 |  |  |             type: 'select', | 
 |  |  |             label: '作业状态', | 
 |  |  |             options: [ | 
 |  |  |               { value: 0, label: '待确认' }, | 
 |  |  |               { value: 1, label: '待签到' }, | 
 |  |  |               { value: 2, label: '等待叫号' }, | 
 |  |  |               { value: 3, label: '入园等待' }, | 
 |  |  |               { value: 4, label: '月台等待' }, | 
 |  |  |               { value: 5, label: '作业中' }, | 
 |  |  |               { value: 6, label: '作业完成' }, | 
 |  |  |               { value: 7, label: '转移中' }, | 
 |  |  |               { value: 8, label: '异常挂起' }, | 
 |  |  |               { value: 9, label: '已授权离园' }, | 
 |  |  |               // { value: 10, label: '已离园' }, | 
 |  |  |               { value: 11, label: '已过号' }, | 
 |  |  |               { value: 12, label: '已取消' }, | 
 |  |  |             ] | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             filed: 'type', | 
 |  |  |             type: 'select', | 
 |  |  |             label: '作业类型', | 
 |  |  |             options: [ | 
 |  |  |               { value: 0, label: '自有车卸货' }, | 
 |  |  |               { value: 1, label: '自有车装货' }, | 
 |  |  |               { value: 2, label: '外协车卸货' }, | 
 |  |  |               { value: 3, label: '外协车装货' }, | 
 |  |  |               { value: 4, label: '市公司外协车卸货' } | 
 |  |  |             ] | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             filed1: 'createDateStart', | 
 |  |  |             filed2: 'createDateEnd', | 
 |  |  |             type: 'datetime', | 
 |  |  |             label: '操作时间' | 
 |  |  |           }, | 
 |  |  |           { | 
 |  |  |             type: 'slot', | 
 |  |  | 
 |  |  |         ], | 
 |  |  |         online: true | 
 |  |  |       }, | 
 |  |  |       ids: [] | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   created() { | 
 |  |  |     this.changeRadio('0') | 
 |  |  |     this.getList() | 
 |  |  |     this.$nextTick(() => { | 
 |  |  |       this.$refs.QueryForm.zkBtn() | 
 |  |  |     }) | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     handleSelectionChange(ids) { | 
 |  |  |       this.ids = ids.map(item => item.id) | 
 |  |  |     }, | 
 |  |  |     complete(ids) { | 
 |  |  |       var that = this; | 
 |  |  |       if (ids.length === 0) { | 
 |  |  |         return this.$message.warning('至少选择一项内容') | 
 |  |  |       } | 
 |  |  |       this.$confirm('是否确认完成作业?, 是否确认?', '提示', { | 
 |  |  |         confirmButtonText: '确认', | 
 |  |  |         cancelButtonText: '取消', | 
 |  |  |         type: 'warning' | 
 |  |  |       }).then(() => { | 
 |  |  |         dealJobFinish(ids) | 
 |  |  |           .then(res => { | 
 |  |  |             that.getList() | 
 |  |  |           }) | 
 |  |  |       }).catch(() => { | 
 |  |  |  | 
 |  |  |       }); | 
 |  |  |     }, | 
 |  |  |     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() | 
 |  |  |       this.filters.createDateStart = arr[0] | 
 |  |  |       this.filters.createDateEnd = arr[1] | 
 |  |  |       this.getList(1) | 
 |  |  |     }, | 
 |  |  |     changeForm(str) { | 
 |  |  |       if (str === 'selDate') { | 
 |  |  |         this.$set(this.filters, 'fastdate', null) | 
 |  |  |         this.getList() | 
 |  |  |       if(this.filters.createDateStart > this.filters.createDateEnd){ | 
 |  |  |         this.filters.createDateStart = this.filters.createDateEnd | 
 |  |  |         return this.$message.error('开始时间不能大于结束时间') | 
 |  |  |       } | 
 |  |  |       this.getList() | 
 |  |  |     }, | 
 |  |  |     getList(page) { | 
 |  |  |       const { pagination, filters } = this | 
 |  |  | 
 |  |  |       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, | 
 |  |  |         }, | 
 |  |  |           jobType: '0' | 
 |  |  |          }, | 
 |  |  |         capacity: pagination.pageSize, | 
 |  |  |         page: page || pagination.page, | 
 |  |  |       }).then(res => { | 
 |  |  | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     handleDel(row) { | 
 |  |  |       this.$dialog.exportConfirm('确认删除吗?').then(() => { | 
 |  |  |       this.$dialog.deleteConfirm('确认删除吗?').then(() => { | 
 |  |  |         platformJobDel(row.id).then(res => { | 
 |  |  |           Message.success('删除成功') | 
 |  |  |           this.getList() | 
 |  |  | 
 |  |  |       this.$dialog.exportConfirm('确认导出吗?') | 
 |  |  |         .then(() => { | 
 |  |  |           this.exLoading = true | 
 |  |  |           const { filters } = this | 
 |  |  |           platformJobExport({ | 
 |  |  |             page: this.pagination.page, | 
 |  |  |             capacity: 1000000, | 
 |  |  |             jobType: '0', | 
 |  |  |             model: this.filters | 
 |  |  |             model: { | 
 |  |  |               ...filters, | 
 |  |  |               jobType: '0' | 
 |  |  |             } | 
 |  |  |           }) | 
 |  |  |             .then(response => { | 
 |  |  |               this.download(response) | 
 |  |  | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     updateTotalNum() { | 
 |  |  |       this.$dialog.actionConfirm('确认进行该操作吗?','操作提示') | 
 |  |  |         .then(() => { | 
 |  |  |           this.updateLoading = true | 
 |  |  |           updateTotalNum('') | 
 |  |  |             .catch(e => { | 
 |  |  |               this.$tip.apiFailed(e) | 
 |  |  |             }) | 
 |  |  |             .finally(() => { | 
 |  |  |               this.updateLoading = false | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     clear() { | 
 |  |  |       this.pagination.page = 1 | 
 |  |  |       this.filters = { | 
 |  |  |         selDate: [], | 
 |  |  |         fastdate: 0 | 
 |  |  |       } | 
 |  |  |       this.getList() | 
 |  |  |       this.filters = {} | 
 |  |  |       this.getList(0) | 
 |  |  |       // this.changeRadio('0') | 
 |  |  |     }, | 
 |  |  |     handleDetail(row) { | 
 |  |  |       this.isShowDetail = true | 
 |  |  | 
 |  |  |     }, | 
 |  |  |     handleSizeChange(capacity) { | 
 |  |  |       this.pagination.pageSize = capacity | 
 |  |  |       this.getList() | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | 
 |  |  |   color: #000000; | 
 |  |  |   margin-bottom: 15px; | 
 |  |  | } | 
 |  |  | </style> | 
 |  |  | </style> |