|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div class="main_app"> | 
|---|
|  |  |  | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @changeForm='changeForm' @handleQuery="getList(1)" @clear="clear"> | 
|---|
|  |  |  | <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-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> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <el-button :loading="exLoading" @click="handleEx" | 
|---|
|  |  |  | v-permissions="['business:platformbooks:exportExcel']">导出</el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table class="mb20" v-loading="loading" :data="list" stripe> | 
|---|
|  |  |  | <el-table-column prop="contractNum" label="合同单号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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 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-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> | 
|---|
|  |  |  | <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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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-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> | 
|---|
|  |  |  | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import QueryForm from '@/components/common/QueryForm' | 
|---|
|  |  |  | import { platformBooksPage, platformReasonList, platformBooksApply, platformBooksExport } from '@/api' | 
|---|
|  |  |  | import { checkSurplusNum } from '@/api/platform/platform' | 
|---|
|  |  |  | import { checkSurplusNum } from '@/api/platform/platform' | 
|---|
|  |  |  | import DriverDetail from "@/views/task/driverDetail" | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import UploadAvatarImage from '@/components/common/UploadAvatarImage' | 
|---|
|  |  |  | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | checkSurplus() { | 
|---|
|  |  |  | const { arriveDate, reasonId, totalNum } = this.param | 
|---|
|  |  |  | if(!arriveDate || !reasonId || !totalNum) return | 
|---|
|  |  |  | if (!arriveDate || !reasonId || !totalNum) return | 
|---|
|  |  |  | checkSurplusNum({ | 
|---|
|  |  |  | arriveDate, | 
|---|
|  |  |  | reasonId, | 
|---|
|  |  |  | totalNum | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | console.log('res', res); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if( res == 0 ||  res < Number(totalNum)){ | 
|---|
|  |  |  | console.log('res', res) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (res == 0 || res < Number(totalNum)) { | 
|---|
|  |  |  | Message.error(`当日剩余可预约作业量${res}万支不足请选择其他到场日期`) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeRadio (day) { | 
|---|
|  |  |  | 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) { | 
|---|
|  |  |  | changeForm(str) { | 
|---|
|  |  |  | if (str === 'selDate') { | 
|---|
|  |  |  | this.$set(this.filters, 'fastdate', null) | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | 
|---|
|  |  |  | handleEx() { | 
|---|
|  |  |  | this.$dialog.exportConfirm('确认导出吗?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | const { filters } = this | 
|---|
|  |  |  | this.exLoading = true | 
|---|
|  |  |  | platformBooksExport({ | 
|---|
|  |  |  | page: this.pagination.page, | 
|---|
|  |  |  | capacity: 1000000, | 
|---|
|  |  |  | model: this.filters | 
|---|
|  |  |  | model: { | 
|---|
|  |  |  | ...filters, | 
|---|
|  |  |  | arriveDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null, | 
|---|
|  |  |  | arriveDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(response => { | 
|---|
|  |  |  | this.download(response) | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | this.pagination.page = 1 | 
|---|
|  |  |  | this.filters = { | 
|---|
|  |  |  | selDate: [], | 
|---|
|  |  |  | fastdate: 0, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.changeRadio('0') | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | // this.changeRadio('0') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleDetail(row) { | 
|---|
|  |  |  | this.isShowDriver = true | 
|---|
|  |  |  | 
|---|
|  |  |  | handleDel() { }, | 
|---|
|  |  |  | handleSizeChange(capacity) { | 
|---|
|  |  |  | this.pagination.pageSize = capacity | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | color: #000000; | 
|---|
|  |  |  | margin-bottom: 15px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </style> | 
|---|