Compare commits

..

No commits in common. "c8219bd7eea2122a028f3530a10bc08f60c06cd4" and "e039a3992dea371ab45353d7c331e2dec105f75c" have entirely different histories.

4 changed files with 15 additions and 42 deletions

View File

@ -30,7 +30,6 @@ import {
} from '@/api/cost/costEneryAutoReport'; } from '@/api/cost/costEneryAutoReport';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
const tableProps = [ const tableProps = [
{ {
@ -110,7 +109,7 @@ export default {
label: '时间范围', label: '时间范围',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
@ -148,25 +147,15 @@ export default {
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.reportType = val.reportType; this.listQuery.reportType = val.reportType;
this.listQuery.energyTypeId = val.energyTypeId; this.listQuery.energyTypeId = val.energyTypeId;
this.listQuery.reportTime = val.searchTime this.listQuery.reportTime = val.searchTime ? val.searchTime : null;
? [
moment(val.searchTime[0]).startOf('day').format('x'),
moment(val.searchTime[1]).endOf('day').format('x'),
]
: null;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':
const data = { const data = {
reportType: val.reportType, reportType: val.reportType,
energyTypeId: val.energyTypeId, energyTypeId: val.energyTypeId,
reportTime: val.searchTime reportTime: val.searchTime ? val.searchTime : null
? [ }
moment(val.searchTime[0]).startOf('day').format('x'),
moment(val.searchTime[1]).endOf('day').format('x'),
]
: null,
};
this.handleExport(data); this.handleExport(data);
break; break;
default: default:

View File

@ -70,7 +70,7 @@ const tableProps = [
}, },
{ {
prop: 'dailyUse', prop: 'dailyUse',
label: '单日消耗量()', label: '单日消耗量(天)吨',
width: 130, width: 130,
}, },
{ {

View File

@ -30,7 +30,6 @@ import {
} from '@/api/cost/costMaterialAutoReport'; } from '@/api/cost/costMaterialAutoReport';
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
const tableProps = [ const tableProps = [
{ {
@ -88,7 +87,7 @@ export default {
label: '时间范围', label: '时间范围',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
@ -141,12 +140,8 @@ export default {
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.materialId = val.materialId; this.listQuery.materialId = val.materialId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null; this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
? moment(val.searchTime[0]).startOf('day').format('x') this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
: null;
this.listQuery.endTime = val.searchTime
? moment(val.searchTime[1]).endOf('day').format('x')
: null;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':

View File

@ -30,7 +30,6 @@ import {
} from '@/api/cost/costMaterialAutoReport'; } from '@/api/cost/costMaterialAutoReport';
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
const tableProps = [ const tableProps = [
{ {
@ -74,7 +73,7 @@ export default {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getCostMaterialAutoReportPage, getDataListURL: getCostMaterialAutoReportPage,
exportURL: exportCostMaterialAutoReportExcel, exportURL: exportCostMaterialAutoReportExcel
}, },
tableData: [], tableData: [],
tableProps, tableProps,
@ -109,7 +108,7 @@ export default {
label: '时间范围', label: '时间范围',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
@ -147,23 +146,13 @@ export default {
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.reportType = val.reportType; this.listQuery.reportType = val.reportType;
this.listQuery.materialId = val.materialId; this.listQuery.materialId = val.materialId;
this.listQuery.times = val.searchTime this.listQuery.times = val.searchTime ? val.searchTime : null;
? [
moment(val.searchTime[0]).startOf('day').format('x'),
moment(val.searchTime[1]).endOf('day').format('x'),
]
: null;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':
this.listQuery.reportType = val.reportType; this.listQuery.reportType = val.reportType;
this.listQuery.materialId = val.materialId; this.listQuery.materialId = val.materialId;
this.listQuery.times = val.searchTime this.listQuery.times = val.searchTime ? val.searchTime : null;
? [
moment(val.searchTime[0]).startOf('day').format('x'),
moment(val.searchTime[1]).endOf('day').format('x'),
]
: null;
this.handleExport(); this.handleExport();
break; break;
default: default: