修改bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<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="单项原片原料成本分析"
|
||||
<ReportHeader :dateData="dateData" size="psi" @timeRangeChange="handleTimeChange" @meterialChange='handleMeterialChange' :meterialName='meterialName' top-title="单项原片原料成本分析"
|
||||
:is-full-screen="isFullScreen" @screenfullChange="screenfullChange" :leftMargin=" '280px' " />
|
||||
<div class="main-body" style="
|
||||
margin-top: -20px;
|
||||
@@ -36,7 +36,6 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 1624px;
|
||||
">
|
||||
<!-- <monthlyRelatedMetrics :itemData="renderList" :title="'月度·相关指标分析'" /> -->
|
||||
<relateSingleFuelCostAnalysis :relatedData="relatedData" :title="'相关指标分析'" />
|
||||
|
||||
</div>
|
||||
@@ -51,38 +50,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="centerImg" style="
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1; /* 确保在 backp 之上、内容之下 */
|
||||
"></div> -->
|
||||
</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";
|
||||
import monthlyOverview from "../productionCostAnalysisComponents/monthlyOverview.vue";
|
||||
import totalOverview from "../productionCostAnalysisComponents/totalOverview.vue";
|
||||
// import totalOverview from "../operatingComponents/totalOverview.vue";
|
||||
// import monthlyRelatedMetrics from "../procurementGainAnalysisComponents/monthlyRelatedMetrics.vue";
|
||||
import relateSingleFuelCostAnalysis from "../productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue";
|
||||
import dataTrend from "../productionCostAnalysisComponents/dataTrendSingleFuel.vue";
|
||||
import { mapState } from "vuex";
|
||||
import { getSingleMaterialAnalysis } from '@/api/cockpit'
|
||||
// import PSDO from "./components/PSDO.vue";
|
||||
// import psiLineChart from "./components/psiLineChart.vue";
|
||||
|
||||
// import coreBottomLeft from "./components/coreBottomLeft.vue";
|
||||
// import orderProgress from "./components/orderProgress.vue";
|
||||
// import keyWork from "./components/keyWork.vue";
|
||||
import moment from "moment";
|
||||
// import html2canvas from 'html2canvas'
|
||||
// import JsPDF from 'jspdf'
|
||||
export default {
|
||||
name: "DayReport",
|
||||
components: {
|
||||
@@ -109,8 +90,7 @@ export default {
|
||||
trend: [],
|
||||
relatedData: {},
|
||||
trendName: '采购单价',
|
||||
// monthRelatedData: [],
|
||||
// totalRelatedData: [],
|
||||
meterialName:'',
|
||||
};
|
||||
},
|
||||
|
||||
@@ -144,13 +124,11 @@ export default {
|
||||
variables() {
|
||||
return variables;
|
||||
},
|
||||
// ...mapGetters(['sidebar']),
|
||||
styles() {
|
||||
const v = Math.floor(this.value * this.beilv * 100) / 10000;
|
||||
return {
|
||||
transform: `scale(${v})`,
|
||||
transformOrigin: "left top",
|
||||
// overflow: hidden;
|
||||
};
|
||||
},
|
||||
},
|
||||
@@ -182,7 +160,7 @@ export default {
|
||||
this.beilv = _this.clientWidth / 1920;
|
||||
})();
|
||||
};
|
||||
console.log(this.$route.query.name, 'name');
|
||||
this.meterialName = 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) {
|
||||
@@ -194,8 +172,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeItem(item) {
|
||||
console.log('item', item);
|
||||
|
||||
this.trendName = item
|
||||
this.getData()
|
||||
},
|
||||
@@ -203,63 +179,26 @@ export default {
|
||||
const requestParams = {
|
||||
startTime: this.dateData.startTime,
|
||||
endTime: this.dateData.endTime,
|
||||
// index: this.index,
|
||||
// sort: 1,
|
||||
|
||||
trendName: this.$route.query.name ? '原料' + this.$route.query.name + this.trendName : '原料硅砂采购单价',
|
||||
analysisObject: [
|
||||
this.$route.query.name ? '原料' + this.$route.query.name : '原料硅砂'
|
||||
],
|
||||
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
||||
trendName: '原料' + this.meterialName + this.trendName,
|
||||
analysisObject: ['原料' + this.meterialName],
|
||||
levelId: this.factory,
|
||||
// baseId: Number(this.factory),
|
||||
};
|
||||
// 调用接口
|
||||
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.meterialName;
|
||||
});
|
||||
console.log('this.monData', this.monData, this.$route.query.name ? '原料' + this.$route.query.name : '原料硅砂');
|
||||
|
||||
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.meterialName;
|
||||
});
|
||||
// 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.meterialName;
|
||||
}), // 兜底月度数据
|
||||
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.meterialName;
|
||||
}) // 兜底累计数据
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
this.trend = res.data.dataTrend
|
||||
});
|
||||
},
|
||||
@@ -274,8 +213,11 @@ export default {
|
||||
|
||||
this.getData()
|
||||
},
|
||||
handleMeterialChange(val) {
|
||||
this.meterialName = val
|
||||
this.getData()
|
||||
},
|
||||
selectChange(data) {
|
||||
console.log('选中的数据:', data);
|
||||
this.factory = data
|
||||
if (this.dateData.startTime && this.dateData.endTime) {
|
||||
this.getData();
|
||||
@@ -333,28 +275,7 @@ export default {
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
},
|
||||
// 导出
|
||||
// () {
|
||||
// this.$message.success('正在导出,请稍等!')
|
||||
// const element = document.getElementById('dayRepDom')
|
||||
// element.style.display = 'block'
|
||||
// const fileName = '株洲碲化镉生产日报' + moment().format('yyMMDD') + '.pdf'
|
||||
// html2canvas(element, {
|
||||
// dpi: 300, // Set to 300 DPI
|
||||
// scale: 3 // Adjusts your resolution
|
||||
// }).then(function(canvas) {
|
||||
// const imgWidth = 595.28
|
||||
// const imgHeight = 841.89
|
||||
// const pageData = canvas.toDataURL('image/jpeg', 1.0)
|
||||
// const PDF = new JsPDF('', 'pt', [imgWidth, imgHeight])
|
||||
// PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
|
||||
// setTimeout(() => {
|
||||
// PDF.save(fileName) // 导出文件名
|
||||
// }, 1000)
|
||||
// })
|
||||
// element.style.display = 'none'
|
||||
// }
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -201,12 +201,12 @@ export default {
|
||||
// 调用接口
|
||||
getSingleMaterialCostAnalysis(requestParams).then((res) => {
|
||||
this.monData = res.data.currentMonthData.find(item => {
|
||||
return item.name === "加工包材成本";
|
||||
return item.name === "包材成本";
|
||||
});
|
||||
console.log('this.monData', this.monData);
|
||||
|
||||
this.totalData = res.data.totalMonthData.find(item => {
|
||||
return item.name === "加工包材成本";
|
||||
return item.name === "包材成本";
|
||||
});
|
||||
// this.relatedMon = res.data.relatedMon
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user