|
|
@@ -0,0 +1,382 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <layout>
|
|
|
+ <layout-header>
|
|
|
+ <div class="">
|
|
|
+ <!-- 按钮部分-->
|
|
|
+ <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" >
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
|
|
|
+ <el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel(汇总)</el-button>
|
|
|
+ <el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button>
|
|
|
+ <el-button type="primary" class="bt" icon="download" @click="sdToExcel" >按时段导出明细</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </layout-header>
|
|
|
+
|
|
|
+ <layout>
|
|
|
+ <!-- 左侧树侧形结构-->
|
|
|
+ <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
|
+ <div class="JKWTree-tree" style="height: 200px">
|
|
|
+ <h3>设备生产效率达成统计</h3>
|
|
|
+ <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </layout-sider>
|
|
|
+
|
|
|
+ <!-- 右侧区域 -->
|
|
|
+ <layout-content >
|
|
|
+ <el-main>
|
|
|
+ <div class="gva-table-box">
|
|
|
+ <!-- 表格数据 -->
|
|
|
+ <!-- 非JP机台 -->
|
|
|
+ <el-table ref="multipleTable"
|
|
|
+ v-if="! ismachine"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="300"/>
|
|
|
+ <el-table-column fixed align="left" label="机台名称" prop="机台名称" width="170"/>
|
|
|
+ <el-table-column fixed align="left" label="班组" prop="班组" width="100"/>
|
|
|
+ <el-table-column align="left" label="近7天综合达成率" prop="近7天综合达成率" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际总产量" prop="实际总产量" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产总产量" prop="排产总产量" width="80"/>
|
|
|
+ <el-table-column align="left" label="实际产量1" prop="实际产量1" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量1" prop="排产产量1" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量2" prop="实际产量2" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量2" prop="排产产量2" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量3" prop="实际产量3" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量3" prop="排产产量3" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量4" prop="实际产量4" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量4" prop="排产产量4" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量5" prop="实际产量5" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量5" prop="排产产量5" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量6" prop="实际产量6" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量6" prop="排产产量6" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际产量7" prop="实际产量7" width="85"/>
|
|
|
+ <el-table-column align="left" label="排产产量7" prop="排产产量7" width="85"/>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-table ref="JPmultipleTable"
|
|
|
+ v-if="! ismachine"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="JPgytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column align="left" fixed label="日期" prop="日期" 机台编号="300"/>
|
|
|
+ <el-table-column align="left" fixed label="机台编号" prop="工序" width="150"/>
|
|
|
+ <el-table-column align="left" fixed label="班组" prop="班组" width="70"/>
|
|
|
+ <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
|
|
|
+ <el-table-column align="left" label="印件号" prop="印件号" width="90"/>
|
|
|
+ <el-table-column align="left" label="印件名称" prop="印件名称" width="80"/>
|
|
|
+ <el-table-column align="left" label="工序号" prop="工序号" width="80"/>
|
|
|
+ <el-table-column align="left" label="工序名称" prop="工序名称" width="90"/>
|
|
|
+ <el-table-column align="left" label="实际产量" prop="实际产量" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产标准产能" prop="排产标准产能" width="90"/>
|
|
|
+ <el-table-column align="left" label="排产产量" prop="排产产量" width="90"/>
|
|
|
+ <el-table-column align="left" label="上报运行工时" prop="上报运行工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="工序计划辅助工时" prop="工序计划辅助工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="打样工时" prop="打样工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="版距" prop="版距" width="170"/>
|
|
|
+ <el-table-column align="left" label="机台名称" prop="机台名称" width="90"/>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table ref="multipleTable"
|
|
|
+ v-else
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="300"/>
|
|
|
+ <el-table-column fixed align="left" label="班组" prop="班组" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量" prop="实际产量" width="85"/>
|
|
|
+ <el-table-column align="left" label="目标产量" prop="目标产量" width="85"/>
|
|
|
+ <el-table-column align="left" label="负荷产量" prop="负荷产量" width="80"/>
|
|
|
+ <el-table-column align="left" label="目标达成" prop="目标达成" width="85"/>
|
|
|
+ <el-table-column align="left" label="综合利用率" prop="综合利用率" width="85"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="打样总工时" prop="打样总工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常补时" prop="异常补时" width="85"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="85"/>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-table ref="JPmultipleTable"
|
|
|
+ v-else
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="JPgytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column align="left" fixed label="机台编号" prop="工序" width="150"/>
|
|
|
+ <el-table-column align="left" fixed label="日期" prop="日期" 机台编号="300"/>
|
|
|
+ <el-table-column align="left" fixed label="班组" prop="班组" width="70"/>
|
|
|
+ <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
|
|
|
+ <el-table-column align="left" label="印件名称" prop="印件名称" width="80"/>
|
|
|
+ <el-table-column align="left" label="印件工序" prop="工序名称" width="90"/>
|
|
|
+ <el-table-column align="left" label="实际产量" prop="实际产量" width="100"/>
|
|
|
+ <el-table-column align="left" label="目标产量" prop="排产标准产能" width="90"/>
|
|
|
+ <el-table-column align="left" label="负荷产量" prop="排产产量" width="90"/>
|
|
|
+ <el-table-column align="left" label="目标达成" prop="上报运行工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="综合利用率" prop="运行工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="打样总工时" prop="打样总工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常补时" prop="异常补时" width="85"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="小时产能" prop="工序计划辅助工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="最高限速" prop="装版实际工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="理论生产效率" prop="保养工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="难度系数" prop="打样工时" width="170"/>
|
|
|
+ <el-table-column align="left" label="版距" prop="版距" width="170"/>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-main>
|
|
|
+ </layout-content>
|
|
|
+ </layout>
|
|
|
+ </layout>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <script setup>
|
|
|
+ // 全量引入格式化工具 请按需保留
|
|
|
+ import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
+ import {PARLeftmenu,} from "@/api/mes/job.js"
|
|
|
+ import {ref, reactive} from 'vue'
|
|
|
+ import * as XLSX from 'xlsx'
|
|
|
+ import { exportExcelFile } from '@/utils/excel'
|
|
|
+ import {ElMessage} from "element-plus";
|
|
|
+ defineOptions({name: 'Company'})
|
|
|
+
|
|
|
+ const treeData = ref([]); // 响应式数据
|
|
|
+const defaultProps = {
|
|
|
+ label: 'label',
|
|
|
+ children: 'children'
|
|
|
+};
|
|
|
+
|
|
|
+const getTreeData = async () => {
|
|
|
+ try {
|
|
|
+ const response = await PARLeftmenu();
|
|
|
+ console.log('接口原始数据:', response);
|
|
|
+
|
|
|
+ if (!response) {
|
|
|
+ throw new Error('接口返回数据为空');
|
|
|
+ }
|
|
|
+
|
|
|
+ const rawData = response.data;
|
|
|
+ const newTreeData = [];
|
|
|
+
|
|
|
+ // 1. 处理排产计划达成率统计
|
|
|
+ if (rawData['排产计划达成率统计']) {
|
|
|
+ const planCompletionNode = {
|
|
|
+ label: '排产计划达成率统计',
|
|
|
+ children: rawData['排产计划达成率统计']
|
|
|
+ .map(item => ({
|
|
|
+ label: item['使用部门'].trim() || '未知部门',
|
|
|
+ }))
|
|
|
+ };
|
|
|
+ newTreeData.push(planCompletionNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 处理设备工时达成率统计
|
|
|
+ if (rawData['设备工时达成率统计']) {
|
|
|
+ const equipmentHoursNode = {
|
|
|
+ label: '设备工时达成率统计',
|
|
|
+ children: []
|
|
|
+ };
|
|
|
+
|
|
|
+ for (const year in rawData['设备工时达成率统计']) {
|
|
|
+ const yearData = rawData['设备工时达成率统计'][year];
|
|
|
+ if (!yearData) continue;
|
|
|
+
|
|
|
+ const yearNode = {
|
|
|
+ label: year,
|
|
|
+ children: []
|
|
|
+ };
|
|
|
+
|
|
|
+ for (const monthKey in yearData) {
|
|
|
+ const monthData = yearData[monthKey];
|
|
|
+ if (!monthData) continue;
|
|
|
+
|
|
|
+ const monthName = monthKey.length === 6
|
|
|
+ ? `${monthKey.substring(4)}月`
|
|
|
+ : monthKey;
|
|
|
+
|
|
|
+ const monthNode = {
|
|
|
+ label: `${year}年${monthName}`,
|
|
|
+ children: monthData
|
|
|
+ .filter(dept => dept) // 过滤空部门
|
|
|
+ .map(dept => ({
|
|
|
+ label: dept.trim() || '未知部门',
|
|
|
+ }))
|
|
|
+ };
|
|
|
+ yearNode.children.push(monthNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ equipmentHoursNode.children.push(yearNode);
|
|
|
+ }
|
|
|
+ newTreeData.push(equipmentHoursNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('最终树数据:', newTreeData);
|
|
|
+ treeData.value = newTreeData;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('加载树数据失败:', error);
|
|
|
+ treeData.value = [];
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 初始化加载数据
|
|
|
+getTreeData();
|
|
|
+
|
|
|
+// 节点点击事件处理
|
|
|
+const handleNodeClick = (nodeData) => {
|
|
|
+ console.log('节点点击:', nodeData)
|
|
|
+ // 根据节点数据加载对应的内容
|
|
|
+ // 可以在这里添加加载对应数据的逻辑
|
|
|
+}
|
|
|
+
|
|
|
+// 节点展开事件处理
|
|
|
+const handleNodeExpand = (nodeData, node) => {
|
|
|
+ console.log('节点展开:', nodeData)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <style scoped>
|
|
|
+ .form-container {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .form-column {
|
|
|
+ /*flex: 1;*/
|
|
|
+ margin-right: 15px; /* 调整列之间的间距 */
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 左侧输入框宽度调整 */
|
|
|
+ .form-column .el-form-item .el-input {
|
|
|
+ width: 150px; /* 调整左侧输入框的宽度 */
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.hui-plan-usage-lows div) {
|
|
|
+ color: #8c939d !important;
|
|
|
+ }
|
|
|
+ :deep(.lan-plan-usage-lows div) {
|
|
|
+ color: blue !important;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /* 媒体查询,根据需要调整断点 */
|
|
|
+ @media screen and (max-width: 768px) {
|
|
|
+ .form-column {
|
|
|
+ flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*:deep(.el-table td .cell) {*/
|
|
|
+ /* line-height: 30px !important;*/
|
|
|
+ /*}*/
|
|
|
+ .JKWTree-container {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .JKWTree-tree {
|
|
|
+ /*width: 300px;*/
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ .JKWTree-tree h3 {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+ .JKWTree-content {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /* 选中某行时的背景色 */
|
|
|
+ :deep(.el-table__body tr.current-row) > td {
|
|
|
+ background: #ff80ff !important;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <style scoped>
|
|
|
+ :deep(.el-table td .cell) {
|
|
|
+ line-height: 20px !important;
|
|
|
+ }
|
|
|
+ :deep(.el-tabs__header){
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .search{
|
|
|
+ margin-left: 0px !important;
|
|
|
+ margin-right: 10px !important;
|
|
|
+ }
|
|
|
+ .bt{
|
|
|
+ margin-left: 2px !important;
|
|
|
+ padding: 3px !important;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ .el-tabs__header{
|
|
|
+ margin: 0px !important;
|
|
|
+ }
|
|
|
+ .gva-table-box{
|
|
|
+ padding: 0px !important;
|
|
|
+ }
|
|
|
+ .mab{
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|