修改
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
<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 size="psi" top-title="单项包装辅材分析" :is-full-screen="isFullScreen" @screenfullChange="screenfullChange" />
|
||||
<ReportHeader size="psi" top-title="单项包装辅材分析" :is-full-screen="isFullScreen" @screenfullChange="screenfullChange"
|
||||
@timeRangeChange="handleTimeChange" />
|
||||
<div class="main-body" style="
|
||||
margin-top: -20px;
|
||||
flex: 1;
|
||||
@@ -16,7 +17,7 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 1624px;
|
||||
">
|
||||
<singleTopSelect typeName="包装辅材" />
|
||||
<singleTopSelect :defaultType="'包装物辅材成本'" :typeList="typeList" @query="handleGetData" typeName="包装辅材" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="top" style="display: flex; gap: 16px;margin-top: 8px;">
|
||||
@@ -25,8 +26,8 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 804px 804px;
|
||||
">
|
||||
<topLeftChart :name=" '采购单价·元/只' " />
|
||||
<topRightChart :name="'消耗量·只'" />
|
||||
<topLeftChart :dateData="dateData" :pupList="pupList" :name=" '采购单价·元/只' " />
|
||||
<topRightChart :dateData="dateData" :consumptionList="consumptionList" :name="'消耗量·只'" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,8 +37,8 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 804px 804px;
|
||||
">
|
||||
<bottomLeftChart :name="'单耗趋势·只/㎡'" />
|
||||
<bottomLeftChart :name="'产量·㎡'" />
|
||||
<bottomLeftChart :dateData="dateData" :unitConsumptionList="unitConsumptionList" :name="'单耗趋势·只/㎡'" />
|
||||
<bottomRightChart :dateData="dateData" :outputList="outputList" :name="'产量·㎡'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,6 +65,7 @@ import topLeftChart from "./costComponents/single/topLeftChart.vue";
|
||||
import topRightChart from "./costComponents/single/topRightChart.vue";
|
||||
import bottomLeftChart from "./costComponents/single/bottomLeftChart.vue";
|
||||
import bottomRightChart from "./costComponents/single/bottomRightChart.vue";
|
||||
import { getCostAnalysisXXCostList } from '@/api/cockpit'
|
||||
// import PSDO from "./components/PSDO.vue";
|
||||
// import psiLineChart from "./components/psiLineChart.vue";
|
||||
|
||||
@@ -94,32 +96,16 @@ export default {
|
||||
timer: null,
|
||||
beilv: 1,
|
||||
value: 100,
|
||||
coreProductVisualAlarmVO: [],
|
||||
defect: {},
|
||||
centerEqInfo: [
|
||||
{ title: "工单数量", num: 0 },
|
||||
{ title: "总产量/吨", num: 0 },
|
||||
{ title: "生产合格率", num: "0%" },
|
||||
{ title: "设备运行数量", num: 0 },
|
||||
{ title: "累计能耗/kwh", num: 0 },
|
||||
],
|
||||
outputTrend: {},
|
||||
coreProductVisualProcessVO: [],
|
||||
coreProductVisualWorkOrderVO: {},
|
||||
date: "",
|
||||
weekDay: "", // 导出报表用
|
||||
productNum: "",
|
||||
coreProductVisualLineVO: [],
|
||||
lineYieldVo: {}, // 产线良率
|
||||
productionOverviewVo: [], // 生产状况
|
||||
qualityDistributionVo: {}, // 本日不良分布
|
||||
equipmentUtilizationVo: {}, // 设备性能稼动率
|
||||
chipPowerDistributionVo: {}, // 芯片功率分布
|
||||
modulePowerDistributionVo: {}, // 组件功率分布
|
||||
chipPowerTrendVo: {},
|
||||
modulePowerTrendVo: {},
|
||||
equipmentProVo: [], // 表格
|
||||
equipmentStateVo: [], // 设备状态分布
|
||||
pupList: [],
|
||||
consumptionList: [],
|
||||
unitConsumptionList: [],
|
||||
outputList: [],
|
||||
dateData:{},
|
||||
analysisObject: [],
|
||||
typeList: [{
|
||||
name: '包装物辅材成本',
|
||||
id: 1,
|
||||
}]
|
||||
};
|
||||
},
|
||||
|
||||
@@ -177,14 +163,6 @@ export default {
|
||||
this.destroy();
|
||||
},
|
||||
mounted() {
|
||||
const startTime = moment().startOf("week").format("YYYY-MM-DD");
|
||||
const endTime = moment().format("YYYY-MM-DD");
|
||||
console.log(this.date, "date");
|
||||
this.date = [startTime, endTime];
|
||||
// this.weekDay = this.weekArr[moment(this.date).format('e')]
|
||||
// this.getData()
|
||||
this.loopTime();
|
||||
console.log(1111);
|
||||
const _this = this;
|
||||
_this.beilv = document.documentElement.clientWidth / 1920;
|
||||
window.onresize = () => {
|
||||
@@ -193,8 +171,57 @@ export default {
|
||||
this.beilv = _this.clientWidth / 1920;
|
||||
})();
|
||||
};
|
||||
if (this.$route.query.name) {
|
||||
this.analysisObject = [this.$route.query.name]
|
||||
} else {
|
||||
this.analysisObject = ['包装物辅材成本']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
// 基于选中的数据构建请求参数(根据实际接口需求调整)
|
||||
// let analysisObject = []
|
||||
|
||||
const requestParams = {
|
||||
// startTime: this.startTime,
|
||||
// endTime: this.endTime,
|
||||
// mode: this.mode,
|
||||
startTime: 1762704000000,
|
||||
endTime: 1762790400000,
|
||||
mode: 1,
|
||||
analysisObject: this.analysisObject,
|
||||
levelId: this.levelId ? this.levelId : 1
|
||||
};
|
||||
// 调用接口
|
||||
getCostAnalysisXXCostList(requestParams).then((res) => {
|
||||
this.pupList = res.data[0]
|
||||
this.consumptionList = res.data[1]
|
||||
this.unitConsumptionList = res.data[2]
|
||||
this.outputList = res.data[3]
|
||||
});
|
||||
},
|
||||
|
||||
handleTimeChange(obj) {
|
||||
console.log(obj, 'obj');
|
||||
this.dateData = {
|
||||
startTime: obj.startTime,
|
||||
endTime: obj.endTime,
|
||||
mode: obj.mode,
|
||||
}
|
||||
this.getData()
|
||||
},
|
||||
handleGetData(data) {
|
||||
console.log('从子组件接收的参数:', data);
|
||||
// params中包含type和levelId
|
||||
const { type, levelId } = data;
|
||||
this.analysisObject = []
|
||||
this.analysisObject.push(type)
|
||||
this.levelId = levelId
|
||||
// 在这里进行后续处理,如发起请求等
|
||||
if (this.dateData.startTime && this.dateData.endTime) {
|
||||
this.getData();
|
||||
}
|
||||
},
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
|
||||
},
|
||||
@@ -202,28 +229,6 @@ export default {
|
||||
this.clientWidth = value;
|
||||
this.beilv2 = this.clientWidth / 1920;
|
||||
},
|
||||
getToday8StartTimestamp() {
|
||||
const date = new Date(); // 获取当前时间
|
||||
// 将时设为8、分0、秒0、毫秒0
|
||||
date.setHours(8, 0, 0, 0);
|
||||
return date.getTime(); // 转换为时间戳(毫秒)
|
||||
},
|
||||
|
||||
// 获取第二天早上八点的时间戳
|
||||
getTomorrow8EndTimestamp() {
|
||||
const date = new Date(); // 获取当前时间
|
||||
// 先加一天,再设置为早上八点
|
||||
date.setDate(date.getDate() + 1);
|
||||
date.setHours(8, 0, 0, 0);
|
||||
return date.getTime(); // 转换为时间戳(毫秒)
|
||||
},
|
||||
|
||||
loopTime() {
|
||||
const _this = this;
|
||||
_this.timer = setInterval(function () {
|
||||
// _this.getData()
|
||||
}, 60000);
|
||||
},
|
||||
change() {
|
||||
this.isFullScreen = screenfull.isFullscreen;
|
||||
},
|
||||
@@ -260,16 +265,6 @@ export default {
|
||||
}
|
||||
screenfull.toggle(this.$refs.dayReportB);
|
||||
},
|
||||
changeDate(val) {
|
||||
this.date = val;
|
||||
// this.weekDay = this.weekArr[moment(this.date).format('e')]
|
||||
// this.getData()
|
||||
if (this.date === moment().format("yyyy-MM-DD")) {
|
||||
this.loopTime();
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
},
|
||||
// 导出
|
||||
// exportPDF() {
|
||||
// this.$message.success('正在导出,请稍等!')
|
||||
|
||||
Reference in New Issue
Block a user