制造成本分析下所有单项页面修改

This commit is contained in:
2026-03-13 09:44:43 +08:00
parent 660bc4b58b
commit b36acbf1e6
12 changed files with 148 additions and 190 deletions

View File

@@ -2,7 +2,9 @@
<div id="dayReport" class="dayReport" :style="styles">
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
<ReportHeader :dateData="dateData" size="psi" @timeRangeChange="handleTimeChange" top-title="单项原片燃料成本分析" :is-full-screen="isFullScreen"
<ReportHeader :dateData="dateData" size="psi" @timeRangeChange="handleTimeChange"
@selectChange='handlefuelChange' :selectName='fuelName' :selectOptions='fuelOptions'
top-title="单项原片燃料成本分析" :is-full-screen="isFullScreen"
@screenfullChange="screenfullChange" :leftMargin="'280px'" />
<div class="main-body" style="
margin-top: -20px;
@@ -62,7 +64,7 @@
</div>
</template>
<script>
import ReportHeader from "../components/noRouterHeader.vue";
import ReportHeader from "../productionCostAnalysisComponents/noRouterHeader.vue";
import { Sidebar } from "../../../layout/components";
import screenfull from "screenfull";
import changeBase from "../components/changeBase.vue";
@@ -109,8 +111,13 @@ export default {
trend: [],
relatedData: {},
trendName: '采购单价',
// monthRelatedData: [],
// totalRelatedData: [],
fuelName:'',
fuelOptions: [
{value:'天然气',label:'天然气'},
{value:'LNG液化天然气',label:'LNG液化天然气'},
{value:'重油',label:'重油'},
{value:'水',label:'水'}
]
};
},
@@ -182,6 +189,7 @@ export default {
this.beilv = _this.clientWidth / 1920;
})();
};
this.fuelName = this.$route.query.name ? this.$route.query.name : '天然气'
if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
@@ -205,9 +213,7 @@ export default {
// index: this.index,
// sort: 1,
trendName: this.trendName,
analysisObject: [
this.$route.query.name ? this.$route.query.name + '成本' : '天然气成本'
],
analysisObject: [this.fuelName + '成本'],
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
levelId: this.factory,
// baseId: Number(this.factory),
@@ -215,53 +221,22 @@ export default {
// 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => {
this.monData = res.data.currentMonthData.find(item => {
if (this.$route.query.name) {
// 如果有查询参数,查找 "原料" + 查询参数 的项
return item.name === this.$route.query.name + '成本';
} else {
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
return item.name === '天然气成本';
}
return item.name === this.fuelName + '成本';
});
console.log('this.monData', this.monData);
this.totalData = res.data.totalMonthData.find(item => {
if (this.$route.query.name) {
// 如果有查询参数,查找 "原料" + 查询参数 的项
return item.name === this.$route.query.name + '成本';
} else {
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
return item.name === '天然气成本';
}
return item.name === this.fuelName + '成本';
});
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedMon: res.data.currentMonthData.filter(item => {
if (this.$route.query.name) {
// 如果有查询参数,查找 "原料" + 查询参数 的项
return item.name !== this.$route.query.name + '成本';
} else {
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
return item.name !== '天然气成本';
}
return item.name !== this.fuelName + '成本';
}), // 兜底月度数据
relatedTotal: res.data.totalMonthData.filter(item => {
if (this.$route.query.name) {
// 如果有查询参数,查找 "原料" + 查询参数 的项
return item.name !== this.$route.query.name + '成本';
} else {
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
return item.name !== '天然气成本';
}
return item.name !== this.fuelName + '成本';
}) // 兜底累计数据
}
;
this.trend = res.data.dataTrend
});
},
handleTimeChange(obj) {
this.month = obj.targetMonth
this.dateData = {
@@ -272,6 +247,10 @@ export default {
this.getData()
},
handlefuelChange(val) {
this.fuelName = val
this.getData()
},
selectChange(data) {
console.log('选中的数据:', data);
this.factory = data