|
|
|
@ -155,6 +155,9 @@
|
|
|
|
|
<!-- <el-button type="primary" icon="el-icon-document" @click="handleComparativeStatement"> |
|
|
|
|
对比报表 |
|
|
|
|
</el-button> --> |
|
|
|
|
|
|
|
|
|
<!-- 导出 --> |
|
|
|
|
<el-button type="primary" icon="Download" @click="handleExport"> 导 出 </el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
@ -635,6 +638,7 @@ import {
|
|
|
|
|
postRemoveCarsLoadScan, |
|
|
|
|
postManualLoadingloadId, |
|
|
|
|
postFindLoadingListData, |
|
|
|
|
postExportLoadCarsPageList, |
|
|
|
|
} from '@/api/distribution/VehicleStowage'; |
|
|
|
|
import { getListName } from '@/api/basicdata/basicdataVehicle'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
@ -839,28 +843,33 @@ const onLoad = debounce(async (params = {}) => {
|
|
|
|
|
try { |
|
|
|
|
// 开启loading |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
const submitData = { ...details.query, ...params }; |
|
|
|
|
|
|
|
|
|
const { startArr, createTimeArr, arriveTimeArr } = details.query; |
|
|
|
|
|
|
|
|
|
// 发车时间 |
|
|
|
|
if (getObjType(startArr) === 'array' && startArr.length > 0) { |
|
|
|
|
params.startDate = startArr[0]; |
|
|
|
|
params.endDate = startArr[1]; |
|
|
|
|
submitData.startDate = startArr[0]; |
|
|
|
|
submitData.endDate = startArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 到车时间 |
|
|
|
|
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) { |
|
|
|
|
params.arriveTimeStartStr = arriveTimeArr[0]; |
|
|
|
|
params.arriveTimeEndStr = arriveTimeArr[1]; |
|
|
|
|
submitData.arriveTimeStartStr = arriveTimeArr[0]; |
|
|
|
|
submitData.arriveTimeEndStr = arriveTimeArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 创建时间 |
|
|
|
|
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) { |
|
|
|
|
params.createTimeStartStr = createTimeArr[0]; |
|
|
|
|
params.createTimeEndStr = createTimeArr[1]; |
|
|
|
|
submitData.createTimeStartStr = createTimeArr[0]; |
|
|
|
|
submitData.createTimeEndStr = createTimeArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
delete submitData.startArr; |
|
|
|
|
delete submitData.createTimeArr; |
|
|
|
|
delete submitData.arriveTimeArr; |
|
|
|
|
// 请求页面数据 |
|
|
|
|
const res = await postloadCarsPageList(details.page, { ...details.query, ...params }); |
|
|
|
|
const res = await postloadCarsPageList(details.page, submitData); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.data = data.records; |
|
|
|
@ -1555,6 +1564,62 @@ const handleShowVehicleImgs = async ({ row }) => {
|
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 导出 */ |
|
|
|
|
const handleExport = () => { |
|
|
|
|
ElMessageBox.confirm('确定导出吗?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
const submitData = { ...details.query }; |
|
|
|
|
|
|
|
|
|
const { startArr, createTimeArr, arriveTimeArr } = details.query; |
|
|
|
|
|
|
|
|
|
// 发车时间 |
|
|
|
|
if (getObjType(startArr) === 'array' && startArr.length > 0) { |
|
|
|
|
submitData.startDate = startArr[0]; |
|
|
|
|
submitData.endDate = startArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 到车时间 |
|
|
|
|
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) { |
|
|
|
|
submitData.arriveTimeStartStr = arriveTimeArr[0]; |
|
|
|
|
submitData.arriveTimeEndStr = arriveTimeArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 创建时间 |
|
|
|
|
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) { |
|
|
|
|
submitData.createTimeStartStr = createTimeArr[0]; |
|
|
|
|
submitData.createTimeEndStr = createTimeArr[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
delete submitData.startArr; |
|
|
|
|
delete submitData.createTimeArr; |
|
|
|
|
delete submitData.arriveTimeArr; |
|
|
|
|
|
|
|
|
|
if (details.selectionList.length > 0) |
|
|
|
|
submitData.ids = details.selectionList.map(val => val.id).join(','); |
|
|
|
|
|
|
|
|
|
const res = await postExportLoadCarsPageList(submitData); |
|
|
|
|
|
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
const { status, data } = res; |
|
|
|
|
|
|
|
|
|
if (status !== 200) return ElMessage.error({ message: '导出失败' }); |
|
|
|
|
console.log('data :>> ', data); |
|
|
|
|
|
|
|
|
|
downloadXls(data, `车辆配载数据 - ${dateNow()}.xlsx`); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|