zck hace 10 meses
padre
commit
6570fa3ac6

+ 382 - 0
src/view/DecisionSupport/ProductionAchievementRate.vue

@@ -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>
+  

+ 186 - 5
src/view/equipment/Inspectionstatistics.vue

@@ -1,8 +1,189 @@
 <template>
-</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-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">
+              <!-- 表格数据 -->
+              <el-table ref="multipleTable" style="width: 100%;height: 75vh" tooltip-effect="dark"
+                        :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
+                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                        :data="hztableData"  border row-key="ID"
+                        size="small"
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="tableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column  sortable align="center" label="工单编号" prop="工单编号"  width="120" />
+               <el-table-column  sortable align="center" label="领用日期" prop="领用日期"  width="130" />
+               <el-table-column   align="center" label="卷宽" prop="卷宽"  width="60" />
+               <el-table-column   align="center" label="卷长" prop="卷长"  width="70" />
+               <el-table-column   align="center" label="领用宽度" prop="领用宽度"  width="90" />
+               <el-table-column   align="center" label="领用数量" prop="领用数量"  width="90" />
+               <el-table-column   align="center" label="机台" prop="机台"  width="90" />
+               <el-table-column   align="center" label="采购单号" prop="采购单号"  width="110" />
+               <el-table-column   align="center" label="供方批次" prop="供方批次"  width="110" />
+               <el-table-column   align="center" label="物料代码" prop="物料代码"  width="140" />
+               <el-table-column   align="center" label="物料名称" prop="物料名称"  width="200" />
+               <el-table-column   align="center" label="备注" prop="备注"  width="110" />
+               <el-table-column   align="center" label="成品代号" prop="成品代号"  width="200" />
+               <el-table-column   align="center" label="成品名称" prop="成品名称"  width="200" />
+               <el-table-column   align="center" label="创建用户" prop="创建用户"  width="200" />
+               <el-table-column   align="center" label="创建时间" prop="创建时间"  width="200" />
+              </el-table>
+  
+              <!-- 分页 -->
+              <div class="gva-pagination">
+                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
+                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
+              </div>
+            </div>
 
-<script>
-</script>
 
-<style>
-</style>
+
+  
+          </el-main>
+        </layout-content>
+        </layout>
+      </layout>
+    </div>
+  </template>
+  <script setup>
+  // 全量引入格式化工具 请按需保留
+  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+  
+  import {ref, reactive} from 'vue'
+  import { exportExcelFile } from '@/utils/excel'
+  import {ElMessage} from "element-plus";
+  defineOptions({name: 'Company'})
+  // =========== 获取左侧树侧形结构 ===========
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+  
+  
+  
+  </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>
+  

+ 186 - 5
src/view/equipment/maintenance.vue

@@ -1,8 +1,189 @@
 <template>
-</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-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">
+              <!-- 表格数据 -->
+              <el-table ref="multipleTable" style="width: 100%;height: 75vh" tooltip-effect="dark"
+                        :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
+                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                        :data="hztableData"  border row-key="ID"
+                        size="small"
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="tableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column  sortable align="center" label="工单编号" prop="工单编号"  width="120" />
+               <el-table-column  sortable align="center" label="领用日期" prop="领用日期"  width="130" />
+               <el-table-column   align="center" label="卷宽" prop="卷宽"  width="60" />
+               <el-table-column   align="center" label="卷长" prop="卷长"  width="70" />
+               <el-table-column   align="center" label="领用宽度" prop="领用宽度"  width="90" />
+               <el-table-column   align="center" label="领用数量" prop="领用数量"  width="90" />
+               <el-table-column   align="center" label="机台" prop="机台"  width="90" />
+               <el-table-column   align="center" label="采购单号" prop="采购单号"  width="110" />
+               <el-table-column   align="center" label="供方批次" prop="供方批次"  width="110" />
+               <el-table-column   align="center" label="物料代码" prop="物料代码"  width="140" />
+               <el-table-column   align="center" label="物料名称" prop="物料名称"  width="200" />
+               <el-table-column   align="center" label="备注" prop="备注"  width="110" />
+               <el-table-column   align="center" label="成品代号" prop="成品代号"  width="200" />
+               <el-table-column   align="center" label="成品名称" prop="成品名称"  width="200" />
+               <el-table-column   align="center" label="创建用户" prop="创建用户"  width="200" />
+               <el-table-column   align="center" label="创建时间" prop="创建时间"  width="200" />
+              </el-table>
+  
+              <!-- 分页 -->
+              <div class="gva-pagination">
+                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
+                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
+              </div>
+            </div>
 
-<script>
-</script>
 
-<style>
-</style>
+
+  
+          </el-main>
+        </layout-content>
+        </layout>
+      </layout>
+    </div>
+  </template>
+  <script setup>
+  // 全量引入格式化工具 请按需保留
+  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+  
+  import {ref, reactive} from 'vue'
+  import { exportExcelFile } from '@/utils/excel'
+  import {ElMessage} from "element-plus";
+  defineOptions({name: 'Company'})
+  // =========== 获取左侧树侧形结构 ===========
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+  
+  
+  
+  </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>
+  

+ 154 - 19
src/view/equipment/powerconsumption.vue

@@ -6,7 +6,7 @@
             <!--          按钮部分-->
             <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-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-form-item>
@@ -36,19 +36,19 @@
                         :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                         :data="hztableData"  border row-key="ID"
-                        size="small"
+                        size="small" id="hztable"
                         :cell-class-name="gxbgCellClass"
                         highlight-current-row="true" @row-dblclick="updateCompanyFunc"
-                        @row-click="tableRowClick" :show-overflow-tooltip="true"
+                        @row-click="hztableRowClick" :show-overflow-tooltip="true"
                         @selection-change="handleSelectionChange">
-               <el-table-column  sortable align="center" label="设备编号" prop="设备编号"  width="120" />
-               <el-table-column  sortable align="center" label="设备名称" prop="设备名称"  width="120" />
-               <el-table-column   align="center" label="上月末主电表读数" prop="上月末主电表读数"  width="200" />
-               <el-table-column   align="center" label="本月末主电表读数" prop="本月末主电表读数"  width="200" />
-               <el-table-column   align="center" label="主电表耗电量" prop="主电表耗电量"  width="110" />
-               <el-table-column   align="center" label="上月末辅电表读数" prop="上月末辅电表读数"  width="200" />
-               <el-table-column   align="center" label="本月末本电表读数" prop="本月末本电表读数"  width="200" />
-               <el-table-column   align="center" label="辅电表耗电量" prop="辅电表耗电量"  width="110" />
+               <el-table-column  sortable align="center" label="设备编号" prop="MachineCode"  width="110" />
+               <el-table-column  sortable align="center" label="设备名称" prop="MachineName"  width="400" />
+               <el-table-column   align="center" label="上月末主电表读数" prop="lastMain"  width="130" />
+               <el-table-column   align="center" label="本月末主电表读数" prop="newMain"  width="130" />
+               <el-table-column   align="center" label="主电表耗电量" prop="mainNumber"  width="110" />
+               <el-table-column   align="center" label="上月末辅电表读数" prop="lastAuxiliary"  width="130" />
+               <el-table-column   align="center" label="本月末本电表读数" prop="newAuxiliary"  width="130" />
+               <el-table-column   align="center" label="辅电表耗电量" prop="auxiliaryNumber"  width="110" />
               </el-table>
   
               <!-- 分页 -->
@@ -65,13 +65,13 @@
                         :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                         :data="mxtableData"  border row-key="ID"
-                        size="small"
+                        size="small" id="mxtable"
                         :cell-class-name="gxbgCellClass"
                         highlight-current-row="true" @row-dblclick="updateCompanyFunc"
-                        @row-click="tableRowClick" :show-overflow-tooltip="true"
+                        @row-click="mxtableRowClick" :show-overflow-tooltip="true"
                         @selection-change="handleSelectionChange">
                <el-table-column  sortable align="center" label="机台编号" prop="机台编号"  width="120" />
-               <el-table-column  sortable align="center" label="开工时间" prop="开工时间"  width="120" />
+               <el-table-column  sortable align="center" label="开工时间" prop="开工时间"  width="115" />
                <el-table-column  sortable align="center" label="主电表" prop="主电表"  width="200" />
                <el-table-column  sortable align="center" label="辅电表" prop="辅电表"  width="100" />
               </el-table>
@@ -92,24 +92,159 @@
   <script setup>
   // 全量引入格式化工具 请按需保留
   import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-  
+  import {getPMTab,PowerMachineList,PowerMachineDetail} 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 hztableData = ref([])
+  const mxtableData = ref([])
+const getTreeData = async() => {
+  const res = await getPMTab()
+  if (res.code === 0) {
+    const { data } = res
+    const transformedData = []
 
-  
-  
+    for (const [date, workshops] of Object.entries(data)) {
+      const transformedItem = {
+        label: date,
+        children: workshops.map((workshop) => ({
+          label: workshop.trim(),  // 添加trim()去除车间名称中的空格
+          date: date,
+        })),
+      }
+      transformedData.push(transformedItem)
+    }
+    treeData.value = transformedData
+  }
+}
+getTreeData()
 
   
+// 节点点击事件处理
+const noderq = ref('')
+const handleNodeClick = async (nodeData) => {
+  try {
+    console.log('节点点击:', nodeData);
+     noderq.value = nodeData.date?nodeData.date:nodeData.label
+    // 根据节点类型准备请求参数
+    const params = nodeData.date 
+      ? { mouth: nodeData.date, workShop: nodeData.label }
+      : { mouth: nodeData.label, workShop: '' };
+
+    // 发起请求并等待响应
+    const response = await PowerMachineList(params);
+    
+    // 检查响应有效性
+    if (response?.code === 0 && Array.isArray(response.data)) {
+      hztableData.value = response.data;
+      console.log('表格数据更新成功:', response.data);
+    } else {
+      console.warn('返回数据格式异常:', response);
+      hztableData.value = []; // 清空表格显示
+    }
+  } catch (error) {
+    console.error('请求发生错误:', error);
+    hztableData.value = []; // 清空表格显示
+  }
+};
+
+// 节点展开事件处理
+const handleNodeExpand = (nodeData, node) => {
+  console.log('节点展开:', nodeData)
+}
+
+// 表格行点击事件处理
+const hztableRowClick = async (row) => {
+  console.log('行点击:', row)
+  const response = await PowerMachineDetail({mouth:noderq.value,machine:row.MachineCode})
+  if (response?.code === 0 && Array.isArray(response.data)) {
+    mxtableData.value = response.data;
+    console.log('表格数据更新成功:', response.data); 
+  }
+}
 
-  
 
   
 
+  //导出按钮(汇总)
+const hzToExcel = async () => {
+  try {
+    //  获取数据
+    const el = document.getElementById('hztable');
+    const filename = '电量汇总导出.xlsx';
+    const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
+    //从某列开始转化成数字
+    //设置从C列开始为数字格式
+    const range = XLSX.utils.decode_range(worksheet['!ref']);
+    for (let col = 2; col <= range.e.c; col++) { // 从C列(索引2)开始
+      for (let row = range.s.r + 1; row <= range.e.r; row++) { // 跳过表头行
+        const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
+        if (worksheet[cellAddress]) {
+          // 尝试转换为数字
+          const cellValue = worksheet[cellAddress].v;
+          const numValue = Number(cellValue);
+          
+          if (!isNaN(numValue)) {
+            worksheet[cellAddress].t = 'n'; // 数字类型
+            worksheet[cellAddress].v = numValue; // 更新值
+            worksheet[cellAddress].z = '0'; // 数字格式
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const wb = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(wb, worksheet, 'Sheet1');
+    XLSX.writeFile(wb, filename);
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+
   
+
+  //导出按钮(汇总)
+  const mxToExcel = async () => {
+  try {
+    //  获取数据
+    const el = document.getElementById('mxtable');
+    const filename = '电量明细导出.xlsx';
+    const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
+    //从某列开始转化成数字
+    //设置从C列开始为数字格式
+    const range = XLSX.utils.decode_range(worksheet['!ref']);
+    for (let col = 2; col <= range.e.c; col++) { // 从C列(索引2)开始
+      for (let row = range.s.r + 1; row <= range.e.r; row++) { // 跳过表头行
+        const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
+        if (worksheet[cellAddress]) {
+          // 尝试转换为数字
+          const cellValue = worksheet[cellAddress].v;
+          const numValue = Number(cellValue);
+          
+          if (!isNaN(numValue)) {
+            worksheet[cellAddress].t = 'n'; // 数字类型
+            worksheet[cellAddress].v = numValue; // 更新值
+            worksheet[cellAddress].z = '0'; // 数字格式
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const wb = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(wb, worksheet, 'Sheet1');
+    XLSX.writeFile(wb, filename);
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};  
   
   
   

+ 6 - 3
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -686,11 +686,12 @@
 
 		<el-dialog
 		  v-model="yinbanVisible"
-		  title="选择"
+		  title="机台印版领用"
 		  destroy-on-close
 		  width="1300px"
-		  style="height: 110%;"
+		  style="height: 75%;"
 		>
+
 		  <el-row :gutter="24">
 		    <el-col :span="4">
 		      <el-form-item label="工单编号" prop="id">
@@ -707,6 +708,7 @@
 			    <el-input v-model="formData.产品名称" :clearable="true" />
 			  </el-form-item>
 			</el-col>
+			
 		  </el-row>
 
 		  <div style="display: flex;">
@@ -5200,6 +5202,7 @@ function ondianjian() {
 }
 
 const onyinban = async() => {
+	console.log(formData.value.productCode)
 	const res = await facilityPrintGetTab({productCode:formData.value.productCode})
 	if(res.code===0){
 		yinbantreeData.value=[{
@@ -5661,7 +5664,7 @@ const _StaGetOrderList = async (node) => {
 // 树形节点属性映射
 const treeDatalcd = reactive([]);
 const defaultProps = {
-  label: '流程单',
+  label: 'label',
   children: 'children',
 };
 //全局调用工单编号、印件号