制造成本分析下所有单项页面修改
This commit is contained in:
@@ -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,11 @@ export default {
|
||||
trend: [],
|
||||
relatedData: {},
|
||||
trendName: '采购单价',
|
||||
// monthRelatedData: [],
|
||||
// totalRelatedData: [],
|
||||
fuelName:'',
|
||||
fuelOptions: [
|
||||
{value:'电',label:'电'},
|
||||
{value:'水',label:'水'}
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
@@ -182,6 +187,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 +211,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,20 +219,36 @@ export default {
|
||||
// 调用接口
|
||||
getSingleMaterialAnalysis(requestParams).then((res) => {
|
||||
this.monData = res.data.currentMonthData.find(item => {
|
||||
return item.name === "原片电成本";
|
||||
if (this.fuelName === '电') {
|
||||
return item.name === '原片' + this.fuelName + '成本';
|
||||
}else{
|
||||
return item.name === this.fuelName + '成本';
|
||||
}
|
||||
|
||||
});
|
||||
console.log('this.monData', this.monData);
|
||||
|
||||
this.totalData = res.data.totalMonthData.find(item => {
|
||||
return item.name === "原片电成本";
|
||||
if (this.fuelName === '电') {
|
||||
return item.name === '原片' + this.fuelName + '成本';
|
||||
}else{
|
||||
return item.name === this.fuelName + '成本';
|
||||
}
|
||||
});
|
||||
// this.relatedMon = res.data.relatedMon
|
||||
this.relatedData = {
|
||||
relatedMon: res.data.currentMonthData.filter(item => {
|
||||
return item.name !== "原片电成本";
|
||||
if (this.fuelName === '电') {
|
||||
return item.name !== '原片' + this.fuelName + '成本';
|
||||
}else{
|
||||
return item.name !== this.fuelName + '成本';
|
||||
}
|
||||
}), // 兜底月度数据
|
||||
relatedTotal: res.data.totalMonthData.filter(item => {
|
||||
return item.name !== "原片电成本";
|
||||
if (this.fuelName === '电') {
|
||||
return item.name !== '原片' + this.fuelName + '成本';
|
||||
}else{
|
||||
return item.name !== this.fuelName + '成本';
|
||||
}
|
||||
}) // 兜底累计数据
|
||||
}
|
||||
|
||||
@@ -248,6 +268,10 @@ export default {
|
||||
|
||||
this.getData()
|
||||
},
|
||||
handleFuelChange(val) {
|
||||
this.fuelName = val
|
||||
this.getData()
|
||||
},
|
||||
selectChange(data) {
|
||||
console.log('选中的数据:', data);
|
||||
this.factory = data
|
||||
|
||||
Reference in New Issue
Block a user