Merge pull request '修改成本bug' (#147) from projects/mesxc-zwq into projects/mesxc-test

Reviewed-on: #147
Tento commit je obsažen v:
朱文强 2023-12-18 14:26:46 +08:00
revize c8219bd7ee
4 změnil soubory, kde provedl 42 přidání a 15 odebrání

Zobrazit soubor

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

Zobrazit soubor

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

Zobrazit soubor

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

Zobrazit soubor

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