zck 6 месяцев назад
Родитель
Сommit
99a537d7b4

+ 35 - 0
src/api/mes/job.js

@@ -503,6 +503,41 @@ export const Productmonthlist = (params) => {
   })
 }
 
+//年度质检废品率统计左侧菜单
+export const QIGetTab = (params) => {
+  return service({
+    url: '/mes_server/decision/QualityInspectionGetTab',
+    method: 'get',
+    params
+  })
+}
+
+//年度质检废品统计右侧上方列表
+export const QIList = (params) => {
+  return service({
+    url: '/mes_server/decision/QualityInspectionList',
+    method: 'get',
+    params
+  })
+}
+
+//创建月度废品率系数
+export const QIAdd = (params) => {
+  return service({
+    url: '/mes_server/decision/QualityInspectionAdd',
+    method: 'get',
+    params
+  })
+}
+
+//年度质检废品率统计下方列表
+export const QIDetailList = (params) => {
+  return service({
+    url: '/mes_server/decision/QualityInspectionDetailList',
+    method: 'get',
+    params
+  })
+}
 
 /*
 	设备管理

+ 357 - 0
src/view/DecisionSupport/MonthProductOutputRate.vue

@@ -0,0 +1,357 @@
+<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="搜索成品名称" @keyup.enter="onsearch" clearable style="width: 200px;margin: 5px"></el-input>
+                <el-button type="primary" class="bt" icon="search" @click="onsearch">查询</el-button> -->
+                <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>
+            </el-form>
+  
+        
+  
+          </div>
+        </layout-header>
+  
+        <layout>
+          <!--    左侧树侧形结构-->
+          <layout-sider :resize-directions="['right']" :width="210" 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: 38vh" 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" id="hztable"
+
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="hztableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column   align="center" label="成品代号" prop="成品编码"  width="120" />
+               <el-table-column   align="center" label="印件代号" prop="印件代号"  width="100" />
+               <el-table-column   align="center" label="印件名称" prop="印件名称"  width="300" />
+               <el-table-column   align="center" label="订单数量" prop="订单数量"  width="90" />
+               <el-table-column   align="center" label="实际投料" prop="实际投料"  width="120" />
+               <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="110" />
+               <el-table-column   align="center" label="客户名称" prop="客户名称"  width="110" />
+              </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>
+
+              <el-table ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
+                        :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" id="mxtable"
+
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="mxtableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column   align="center" label="工单编号" prop="工单编号"  width="120" />
+               <el-table-column   align="center" label="印件号" prop="印件号"  width="100" />
+               <el-table-column   align="center" label="印件代号" prop="印件代号"  width="100" />
+               <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="90" />
+               <el-table-column   align="center" label="入仓数量" prop="入仓数量"  width="90" />
+               <el-table-column   align="center" label="完工时间" prop="完工时间"  width="120" />
+               <el-table-column   align="center" label="投入产出率" prop="投入产出率"  width="130" />
+               <el-table-column   align="center" label="客户编号" prop="客户编号"  width="120" />
+               <el-table-column   align="center" label="客户名称" prop="客户名称"  width="120" />
+              </el-table>
+            </div>
+          </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";
+  import * as XLSX from 'xlsx'
+import FileSaver from 'file-saver'
+import LuckyExcel from 'luckyexcel';
+  import {Productyearleft,Productyearlist,Productmonthlist,} from "@/api/mes/job.js"
+
+  defineOptions({name: 'Company'})
+  // =========== 获取左侧树侧形结构 ===========
+const treeData = ref([]);
+const defaultProps = {
+  children: 'children',
+  label: 'label'
+};
+const getTreeData = async () => {
+  try {
+    const res = await Productyearleft(); 
+    if (res.code === 0 && res.data) {
+      // 转换数据结构
+      treeData.value = Object.entries(res.data).map(([workshopType, yearsData]) => {
+        // 创建父节点(工单类型)
+        const parentNode = {
+          label: workshopType,
+          value: workshopType,
+          children: []
+        };
+        
+        // 处理每个年份的数据
+        Object.entries(yearsData).forEach(([year, workshops]) => {
+          // 创建年份节点
+          const yearNode = {
+            label: year,
+            value: `${workshopType}-${year}`,
+            children: workshops.map(workshop => ({
+              label: workshop.trim(),
+              value: `${workshopType}-${year}-${workshop.trim()}`,
+              type: 'workshop'
+            }))
+          };
+          
+          parentNode.children.push(yearNode);
+        });
+        
+        // 对年份节点按年份倒序排序
+        parentNode.children.sort((a, b) => b.label.localeCompare(a.label));
+        
+        return parentNode;
+      });
+      
+      console.log('生成的树形数据:', treeData.value);
+    } else {
+      console.error('获取数据失败:', res.msg);
+    }
+  } catch (error) {
+    console.error('请求出错:', error);
+  }
+};
+getTreeData();
+
+const searchInfo = ref('')
+const _noderq = ref('')
+const onsearch = async () => {
+  _noderq.value = treeData.value[0].children[0].label
+  if(searchInfo.value){
+    const res = await Productyearlist({search:searchInfo.value,rq:_noderq.value})
+
+    hztableData.value = res.data
+  }
+}
+
+
+const hztableData = ref([])
+const handleNodeClick = async (nodeData) => {
+  if(!nodeData.children){
+    _noderq.value = nodeData.value.split('-')[1]
+    const res = await Productyearlist({khdh:nodeData.value.split('-')[2].split('【')[0],rq:nodeData.value.split('-')[1]})
+    mxtableData.value = []
+    hztableData.value = res.data
+
+  }
+};
+
+const mxtableData = ref([])
+const hztableRowClick =  async (row, event, column) => {
+  console.log('点击了行:', row,);
+  const res = await Productmonthlist({product_code:row.成品编码,year:_noderq.value})
+  mxtableData.value = res.data
+};
+
+
+  
+//汇总导出按钮
+const hzToExcel = async () => { 
+  try {
+    const el = document.getElementById('hztable');
+    //  使用table_to_sheet获取工作表对象
+    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.000'; // 数字格式
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const workbook = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+    XLSX.writeFile(workbook, '年度产出率汇总.xlsx');
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+  
+//明细导出按钮
+const mxToExcel = async () => { 
+  try {
+    const el = document.getElementById('mxtable');
+    // 使用table_to_sheet获取工作表对象
+    const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
+    
+    // 指定需要转换为数字的列索引(0-based索引)
+    const numericColumns = [1, 2, 4]; 
+    
+    // 获取工作表范围
+    const range = XLSX.utils.decode_range(worksheet['!ref']);
+    
+    // 遍历所有指定的列
+    numericColumns.forEach(colIndex => {
+      for (let row = range.s.r + 1; row <= range.e.r; row++) { // 跳过表头行
+        const cellAddress = XLSX.utils.encode_cell({ r: row, c: colIndex });
+        if (worksheet[cellAddress]) {
+          // 尝试转换为数字
+          const cellValue = worksheet[cellAddress].v;
+          const numValue = Number(cellValue);
+          
+          if (!isNaN(numValue) && cellValue !== '') {
+            worksheet[cellAddress].t = 'n'; // 数字类型
+            worksheet[cellAddress].v = numValue; // 更新值
+          }
+        }
+      }
+    });
+    
+    // 创建并导出工作簿
+    const workbook = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+    XLSX.writeFile(workbook, '年度产出率明细.xlsx');
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+  
+
+  
+  
+  
+  
+  
+  </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>
+  

+ 55 - 22
src/view/DecisionSupport/ProductOutputRate.vue

@@ -6,7 +6,8 @@
             <!--          按钮部分-->
             <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="搜索成品名称" @keyup.enter="onsearch" clearable style="width: 200px;margin: 5px"></el-input>
+                <el-button type="primary" class="bt" icon="search" @click="onsearch">查询</el-button>
                 <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>
@@ -42,23 +43,23 @@
                         highlight-current-row="true" @row-dblclick="updateCompanyFunc"
                         @row-click="hztableRowClick" :show-overflow-tooltip="true"
                         @selection-change="handleSelectionChange">
-               <el-table-column   align="center" label="成品代号" prop="成品编码"  width="120" />
-               <el-table-column   align="center" label="成品名称" prop="成品名称"  width="300" />
+               <el-table-column   sortable align="center" label="成品代号" prop="成品编码"  width="120" />
+               <el-table-column   sortable align="center" label="成品名称" prop="成品名称"  width="300" />
                <el-table-column   align="center" label="投料数量" prop="实际投料"  width="100" />
                <el-table-column   align="center" label="入仓数量" prop="入仓数量"  width="90" />
-               <el-table-column   align="center" label="综合合格率" prop="综合合格率"  width="120" />
-               <el-table-column   align="center" label="月份01" prop="1月"  width="90" />
-               <el-table-column   align="center" label="月份02" prop="2月"  width="90" />
-               <el-table-column   align="center" label="月份03" prop="3月"  width="90" />
-               <el-table-column   align="center" label="月份04" prop="4月"  width="90" />
-               <el-table-column   align="center" label="月份05" prop="5月"  width="90" />
-               <el-table-column   align="center" label="月份06" prop="6月"  width="90" />
-               <el-table-column   align="center" label="月份07" prop="7月"  width="90" />
-               <el-table-column   align="center" label="月份08" prop="8月"  width="90" />
-               <el-table-column   align="center" label="月份09" prop="9月"  width="90" />
-               <el-table-column   align="center" label="月份10" prop="10月"  width="90" />
-               <el-table-column   align="center" label="月份11" prop="11月"  width="90" />
-               <el-table-column   align="center" label="月份12" prop="12月"  width="90" />
+               <el-table-column   sortable align="center" label="综合合格率" prop="综合合格率"  width="120" />
+               <el-table-column   align="center" label="月份01" prop="1月"  width="70" />
+               <el-table-column   align="center" label="月份02" prop="2月"  width="70" />
+               <el-table-column   align="center" label="月份03" prop="3月"  width="70" />
+               <el-table-column   align="center" label="月份04" prop="4月"  width="70" />
+               <el-table-column   align="center" label="月份05" prop="5月"  width="70" />
+               <el-table-column   align="center" label="月份06" prop="6月"  width="70" />
+               <el-table-column   align="center" label="月份07" prop="7月"  width="70" />
+               <el-table-column   align="center" label="月份08" prop="8月"  width="70" />
+               <el-table-column   align="center" label="月份09" prop="9月"  width="70" />
+               <el-table-column   align="center" label="月份10" prop="10月"  width="70" />
+               <el-table-column   align="center" label="月份11" prop="11月"  width="70" />
+               <el-table-column   align="center" label="月份12" prop="12月"  width="70" />
               </el-table>
   
               <!-- 分页 -->
@@ -77,17 +78,17 @@
                         highlight-current-row="true" @row-dblclick="updateCompanyFunc"
                         @row-click="mxtableRowClick" :show-overflow-tooltip="true"
                         @selection-change="handleSelectionChange">
+               <el-table-column   align="center" label="销售订单号" prop="销售订单号"  width="90" />
                <el-table-column   align="center" label="工单编号" prop="工单编号"  width="120" />
-               <el-table-column   align="center" label="订单数量" prop="订单数量"  width="120" />
+               <el-table-column   align="center" label="订单数量" prop="订单数量"  width="100" />
                <el-table-column   align="center" label="实际投料" prop="实际投料"  width="100" />
-               <el-table-column   align="center" label="工单完工日期" prop="sys_rq"  width="110" />
-               <el-table-column   align="center" label="工单入仓数量" prop="入仓数量"  width="120" />
+               <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="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="120" />
                <el-table-column   align="center" label="成品代号" prop="产品代号"  width="130" />
                <el-table-column   align="center" label="成品名称" prop="产品名称"  width="330" />
-               <el-table-column   align="center" label="销售订单号" prop="销售订单号"  width="90" />
               </el-table>
             </div>
           </el-main>
@@ -160,12 +161,44 @@ const getTreeData = async () => {
 };
 getTreeData();
 
-const hztableData = ref([])
+const searchInfo = ref('')
 const _noderq = ref('')
+const onsearch = async () => {
+  _noderq.value = treeData.value[0].children[0].label
+  if(searchInfo.value){
+    const res = await Productyearlist({search:searchInfo.value,rq:_noderq.value})
+
+    hztableData.value = res.data
+  }
+}
+
+
+const hztableData = ref([])
 const handleNodeClick = async (nodeData) => {
+  const nodeValue = nodeData.value 
+  const parts = nodeValue.split('-') // 分割节点值
+  if (parts.length === 1) {
+    // 点击翌星or美浓节点
+    return
+  }
+
+  // 第二层:分类节点 (如 "202410-2、水电气直接费用")
+  if (parts.length === 2) {
+    _noderq.value = nodeData.value.split('-')[1]
+    const res = await Productyearlist({rq:nodeData.value.split('-')[1]})
+    mxtableData.value = []
+    hztableData.value = res.data
+    return;
+  }
+
+  // 第三层:具体项目节点 (如 "202410-2、水电气直接费用-胶印车间")
+  if (parts.length === 3) {
+  }
+
   if(!nodeData.children){
     _noderq.value = nodeData.value.split('-')[1]
     const res = await Productyearlist({khdh:nodeData.value.split('-')[2].split('【')[0],rq:nodeData.value.split('-')[1]})
+    mxtableData.value = []
     hztableData.value = res.data
 
   }

+ 5 - 5
src/view/DecisionSupport/ProductionAchievementRate.vue

@@ -115,8 +115,8 @@
 				<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="95"/>
-        <el-table-column align="left" label="装版实际工时" prop="装实际工时"  width="110"/>
-        <el-table-column align="left" label="装版补产工时" prop="装补产工时"  width="110"/>
+        <el-table-column align="left" label="装版实际工时" prop="装实际工时"  width="110"/>
+        <el-table-column align="left" label="装版补产工时" prop="装补产工时"  width="110"/>
         <el-table-column align="left" label="保养工时" prop="保养工时"  width="110"/>
         <el-table-column align="left" label="打样总工时" prop="打样总工时"  width="110"/>
         <el-table-column align="left" label="打样补产工时" prop="打样补产工时"  width="110"/>
@@ -155,10 +155,10 @@
           <el-table-column  align="left" label="异常补时" prop="异常补时"  width="100"/>
           <el-table-column  align="left" label="运行工时" prop="运行工时"  width="100"/>
           <el-table-column  align="left" label="小时产能" prop="小时产能"  width="100"/>
-          <el-table-column  align="left" label="最高限速" prop="最高限速"  width="100"/>
-          <el-table-column  align="left" label="理论生产效率" prop="理论生产效率"  width="110"/>
+          <el-table-column  align="left" label="最高限速" prop="平均车速"  width="100"/>
+          <!-- <el-table-column  align="left" label="理论生产效率" prop="理论生产效率"  width="110"/> -->
           <el-table-column  align="left" label="难度系数" prop="难度系数"  width="100"/>
-          <el-table-column  align="left" label="版距" prop="版距"  width="100"/>
+          <!-- <el-table-column  align="left" label="版距" prop="版距"  width="100"/> -->
 			  </el-table>
             </div>
 

+ 433 - 0
src/view/DecisionSupport/YearQualityRate.vue

@@ -0,0 +1,433 @@
+<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="搜索成品名称" @keyup.enter="onsearch" clearable style="width: 200px;margin: 5px"></el-input>
+                <el-button type="primary" class="bt" icon="search" @click="onsearch">查询</el-button> -->
+                <el-button type="primary" class="bt" icon="edit" @click="onzjcreate">月度质检废品数据处理</el-button> 
+                <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>
+            </el-form>
+  
+        
+  
+          </div>
+        </layout-header>
+  
+        <layout>
+          <!--    左侧树侧形结构-->
+          <layout-sider :resize-directions="['right']" :width="210" 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: 38vh" 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" id="hztable"
+
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="hztableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column   align="center" label="废品类别" prop="废品类别"  width="120" />
+               <el-table-column   align="center" label="实际投料" prop="实际投料"  width="120" />
+               <el-table-column   align="center" label="废品数量" prop="废品数量"  width="120" />
+               <el-table-column   align="center" label="质检废品率" prop="质检废品率"  width="120" />
+              </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>
+
+              <el-table ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
+                        :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" id="mxtable"
+
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="mxtableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column   align="center" label="年月" prop="年月"  width="90" />
+               <el-table-column   align="center" label="产品名称" prop="产品名称"  width="120" />
+               <el-table-column   align="center" label="工单编号" prop="工单编号"  width="120" />
+               <el-table-column   align="center" label="印件号" prop="印件号"  width="100" />
+               <!-- <el-table-column   align="center" label="产品编号" prop="产品编号"  width="100" /> -->
+               <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="90" />
+               <el-table-column   align="center" label="质检废品率" prop="质检废品率"  width="120" />
+               <el-table-column   align="center" label="质检完工时间" prop="质检完工时间"  width="130" />
+               <el-table-column   align="center" label="年周数" prop="年周数"  width="120" />
+              </el-table>
+            </div>
+
+            <el-dialog v-model="zjcreate"  title="月度工单质检废品汇总处理" destroy-on-close style="height: 20%;width: 30%;">
+              <el-form-item label="完工年月" label-width="100px">
+                <el-date-picker
+                v-model="startMonth"
+                type="date"
+                placeholder="选择年月"
+                :default-value="new Date()"
+                style="width: 200px;" 
+                />
+                至
+                <el-date-picker
+                v-model="endMonth"
+                type="date"
+                placeholder="选择年月"
+                :default-value="new Date()"
+                style="width: 200px;" 
+                />
+                </el-form-item>
+
+
+              <template #footer>
+                <div class="dialog-footer" style="text-align: right;">
+                  <el-button @click="zjcreatecloseDialog">取消</el-button>
+                  <el-button type="primary" @click="zjcreateonDialog">确定</el-button>
+                </div>
+              </template>
+            </el-dialog>
+
+          </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 { useUserStore } from '@/pinia/modules/user'
+  import {ElMessage} from "element-plus";
+  import * as XLSX from 'xlsx'
+  import dayjs, { Dayjs } from 'dayjs';
+import FileSaver from 'file-saver'
+import LuckyExcel from 'luckyexcel';
+  import {QIGetTab,QIList,QIAdd,QIDetailList} from "@/api/mes/job.js"
+
+  defineOptions({name: 'Company'})
+  const userStore = useUserStore()
+  const _username = ref('')
+  _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+  // =========== 获取左侧树侧形结构 ===========
+const treeData = ref([]);
+const defaultProps = {
+  children: 'children',
+  label: 'label'
+};
+const getTreeData = async () => {
+  try {
+    const res = await QIGetTab(); 
+    if (res.code === 0 && res.data) {
+      // 转换数据结构
+      treeData.value = [{
+        label: '年度质检废品率统计表',
+        value: 'root',
+        children: Object.values(res.data).map(yearData => {
+          // 创建年份节点
+          const yearNode = {
+            label: yearData.year,
+            value: `year-${yearData.year}`,
+            children: yearData.children.map(monthData => {
+              // 创建月份节点
+              return {
+                label: `${monthData.month}`,
+                value: `month-${monthData.month}`,
+              };
+            })
+          };
+          
+          // 对月份节点按月份倒序排序(最新的月份在前)
+          yearNode.children.sort((a, b) => b.value.localeCompare(a.value));
+          
+          return yearNode;
+        })
+      }];
+      
+      // 对年份节点按年份倒序排序(最新的年份在前)
+      treeData.value[0].children.sort((a, b) => b.label.localeCompare(a.label));
+      
+      console.log('生成的树形数据:', treeData.value);
+    } else {
+      console.error('获取数据失败:', res.msg);
+    }
+  } catch (error) {
+    console.error('请求出错:', error);
+  }
+};
+getTreeData();
+
+const _noderq = ref('')
+
+
+
+const hztableData = ref([])
+// const handleNodeClick = async (nodeData) => {
+//   console.log(nodeData)
+
+//   if(!nodeData.children){
+//     _noderq.value = nodeData.value.split('-')[1]
+//     const res = await QIList({month:nodeData.value.split('-')[1]})
+//     mxtableData.value = []
+//     hztableData.value = res.data
+
+//   }
+// };
+const handleNodeClick = async (nodeData) => {
+const nodeValue = nodeData.value 
+  const parts = nodeValue.split('-') // 分割节点值
+  if (parts.length === 1) {
+    return
+  }
+
+  // 第二层:
+  if (parts.length === 2) {
+    _noderq.value = nodeData.value.split('-')[1]
+    const res = await QIList({month:nodeData.value.split('-')[1]})
+    mxtableData.value = []
+    hztableData.value = res.data
+    return;
+  }
+
+  // 第三层:
+  if (parts.length === 3) {
+    _noderq.value = nodeData.value.split('-')[1]
+    const res = await QIList({month:nodeData.value.split('-')[1]})
+    mxtableData.value = []
+    hztableData.value = res.data
+  }
+
+};
+
+const mxtableData = ref([])
+const hztableRowClick =  async (row, event, column) => {
+  console.log('点击了行:', row,);
+  const res = await QIDetailList({month:_noderq.value,class:row.废品类别})
+  mxtableData.value = res.data
+};
+
+
+const zjcreate = ref(false)
+const startMonth = ref('')
+const endMonth = ref('')
+
+
+const onzjcreate = () => {
+  zjcreate.value = true
+}
+
+ const zjcreateonDialog =  async () => {
+  startMonth.value = dayjs(startMonth.value).format('YYYY-MM-DD');
+  endMonth.value = dayjs(endMonth.value).format('YYYY-MM-DD');
+  console.log(startMonth.value,endMonth.value)
+
+  const res = await QIAdd({startMonth:startMonth.value,endMonth:endMonth.value,sys_id:userStore.userInfo.nickName});
+  if(res.code === 0){
+    ElMessage({type: 'success',message: '创建成功'});
+  }else{
+    ElMessage({type: 'error',message: '创建失败'});
+  }
+
+  zjcreatecloseDialog()
+}
+
+const zjcreatecloseDialog = () => {
+  zjcreate.value = false
+  startMonth.value = ''
+}
+
+
+  
+//汇总导出按钮
+const hzToExcel = async () => { 
+  try {
+    const el = document.getElementById('hztable');
+    //  使用table_to_sheet获取工作表对象
+    const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
+    //设置从B列开始为数字格式
+    const range = XLSX.utils.decode_range(worksheet['!ref']);
+    for (let col = 1; col <= range.e.c; col++) { // 从B列(索引1)开始
+      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; // 更新值
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const workbook = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+    XLSX.writeFile(workbook, '年度质检废品率汇总.xlsx');
+
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+  
+//明细导出按钮
+const mxToExcel = async () => { 
+  try {
+    const el = document.getElementById('mxtable');
+    // 使用table_to_sheet获取工作表对象
+    const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
+    
+    // 指定需要转换为数字的列索引(0-based索引)
+    const numericColumns = [2,6]; 
+    
+    // 获取工作表范围
+    const range = XLSX.utils.decode_range(worksheet['!ref']);
+    
+    // 遍历所有指定的列
+    numericColumns.forEach(colIndex => {
+      for (let row = range.s.r + 1; row <= range.e.r; row++) { // 跳过表头行
+        const cellAddress = XLSX.utils.encode_cell({ r: row, c: colIndex });
+        if (worksheet[cellAddress]) {
+          // 尝试转换为数字
+          const cellValue = worksheet[cellAddress].v;
+          const numValue = Number(cellValue);
+          
+          if (!isNaN(numValue) && cellValue !== '') {
+            worksheet[cellAddress].t = 'n'; // 数字类型
+            worksheet[cellAddress].v = numValue; // 更新值
+          }
+        }
+      }
+    });
+    
+    // 创建并导出工作簿
+    const workbook = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+    XLSX.writeFile(workbook, '年度产出率明细.xlsx');
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+  
+
+  
+  
+  
+  
+  
+  </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>
+  

+ 1 - 1
src/view/DecisionSupport/operation/operation.vue

@@ -72,7 +72,7 @@
                   <el-table-column align="left" sortable label="设备编号" prop="设备编号"  width="110"/>
                   <el-table-column align="left" sortable label="设备名称" prop="设备名称"  width="340"/>
                   <el-table-column align="left" sortable label="日期" prop="日期"  width="110"/>
-				  <el-table-column align="left" sortable label="工单编号" prop="工单编号"  width="110"/>
+				          <el-table-column align="left" sortable label="工单编号" prop="工单编号"  width="110"/>
                   <el-table-column align="left" sortable label="印件名称" prop="印件名称"  width="340"/>
                   <el-table-column align="left" sortable label="工序名称" prop="工序名称"  width="110"/>
                   <el-table-column align="left" sortable label="产量" prop="产量"  width="110"/>

+ 543 - 0
src/view/DecisionSupport/operation/operationPersonnel.vue

@@ -0,0 +1,543 @@
+<template>
+  <div>
+    <layout>
+      <layout-header>
+        <div class="">
+          <!--          按钮部分-->
+          <el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
+            <el-form-item>
+              <el-button  type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出到Excel(汇总)</el-button>
+              <!-- <el-button  type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">月度明细</el-button> -->
+              <el-button  type="primary" icon="Download" @click="exportToExcel3" style="margin: 5px;float: right;">导出到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" class="treecolor"   @node-click="handleNodeClick"></el-tree>
+          </div>
+        </layout-sider>
+
+        <!-- 右侧内容区域 -->
+        <layout-content >
+          <el-main>
+
+            <!-- 工单表格列表 -->
+            <div class="gva-table-box" >
+              <el-table ref="multipleTable"
+                        id="tab"
+                        style="width: 100%;height: 28vh"
+                        :row-style="{ height: '20px' }"
+                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                        :header-cell-style="{ padding: '0px' }"
+                        border
+                        show-summary
+                        tooltip-effect="dark"
+                        :data="tabledate2" row-key="ID"
+                        @row-click="tableRowClick"
+                        highlight-current-row="true"
+                        :cell-class-name="tableDataCellClass"
+                        @row-dblclick="updateCompanyFunc"
+                        @selection-change="handleSelectionChange"
+                        :show-overflow-tooltip="true">
+                <el-table-column align="left" label="设备编号"   prop="设备编号"  width="110" />
+                <el-table-column align="left" sortable label="设备名称"   prop="设备名称"  width="280" />
+                <el-table-column align="left" sortable label="产量"   prop="产量" width="110" />
+                <el-table-column align="left" sortable label="设备运行工时" prop="设备运行工时" width="150" />
+                <el-table-column align="left" sortable label="保养工时"   prop="保养工时" width="120" />
+                <el-table-column align="left" sortable label="打样总工时"   prop="打样总工时"  width="120" />
+                <el-table-column align="left" sortable label="打样补产工时"   prop="打样补产工时" width="150" />
+                <el-table-column align="left" sortable label="装版总工时"   prop="装版总工时" width="130" />
+                <el-table-column align="left" sortable label="装版补产工时"       prop="装版补产工时"   width="140"/>
+                <el-table-column align="left" sortable label="异常停机工时"   prop="异常停机工时" width="140" />
+              </el-table>
+
+            <!-- 月度设备运行统计->机台生产工单数据详情列表  -->
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-table ref="multipleTable"
+                          id="tab2"
+                          :row-style="{ height: '20px' }"
+                          show-summary
+                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                          :header-cell-style="{ padding: '0px' }"
+                          :show-overflow-tooltip="true"
+                          highlight-current-row="true"
+                          @selection-change="selectionChange($event, '印件资料')"
+                          style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jqtabledata" row-key="ID">
+                  <el-table-column type="selection" width="30" />
+                  <el-table-column align="left" sortable label="设备编号" prop="设备编号"  width="110"/>
+                  <el-table-column align="left" sortable label="设备名称" prop="设备名称"  width="340"/>
+                  <el-table-column align="left" sortable label="日期" prop="日期"  width="110"/>
+				          <el-table-column align="left" sortable label="工单编号" prop="工单编号"  width="110"/>
+                  <el-table-column align="left" sortable label="印件名称" prop="印件名称"  width="340"/>
+                  <el-table-column align="left" sortable label="工序名称" prop="工序名称"  width="110"/>
+                  <el-table-column align="left" sortable label="产量" prop="产量"  width="110"/>
+                  <el-table-column align="left" sortable label="计件系数" prop="工价系数"  width="110"/>
+                  <el-table-column align="left" sortable label="补产标准" prop="补产标准"  width="110"/>
+                  <el-table-column align="left" sortable label="设备运行工时" prop="设备运行工时"  width="140"/>
+                  <el-table-column align="left" sortable label="保养工时" prop="保养工时"  width="110"/>
+                  <el-table-column align="left" sortable label="打样总工时" prop="打样总工时"  width="140"/>
+                  <el-table-column align="left" sortable label="打样补产工时" prop="打样补产工时"  width="140"/>
+                  <el-table-column align="left" sortable label="装版总工时" prop="装板总工时"  width="140"/>
+                  <el-table-column align="left" sortable label="装版补产工时" prop="装板补产工时"  width="160"/>
+                  <el-table-column align="left" sortable label="异常停机工时" prop="异常停机工时"  width="160"/>
+                  <el-table-column align="left" sortable label="墨色数" prop="墨色数"  width="160"/>
+                </el-table>
+            </el-tabs>
+          </div>
+		
+
+          </el-main>
+        </layout-content>
+      </layout>
+    </layout>
+
+    <PrintPage ref="printPageRef" />
+
+    <AddGongYi ref="addGongYiRef" />
+  </div>
+</template>
+<script>
+//点击按钮显示下方表格
+export default {
+  data() {
+    return {
+      currentTable: '', // 当前展示的表格
+      activeName: 'first',
+    };
+  },
+  methods: {
+    showTable(tableName) {
+      this.currentTable = tableName;
+    },
+    showTableChange() {
+      // 处理表格选中事件
+    },
+  }
+};
+</script>
+<script setup>
+// 全量引入格式化工具 请按需保留
+import $script from 'scriptjs'
+import $ from 'jquery';
+import * as XLSX from 'xlsx'
+import FileSaver from 'file-saver'
+import LuckyExcel from 'luckyexcel';
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { ref, reactive, computed, nextTick, watch } from 'vue'
+// import InfiniteLoading from 'vue-infinite-loading';
+import { Loading } from '@element-plus/icons-vue';
+import {OutputSstatisticsMenu,MachineOperation,MachineOperationProductDetail} from "@/api/DecisionSupport/decision.js"
+import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
+
+const userStore = useUserStore()
+const _username = ref('')
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+
+// =========== 左侧树侧形结构 ===========
+const treeData = ref([]);
+
+//工单资料菜单列表
+const DataListdata = async () => {
+  try {
+	  
+	  const response = await OutputSstatisticsMenu();
+	  const dataList = response.data;
+	  dataList.forEach((item) => {
+	      let obj = {};
+	      obj.label = item.date;
+	      obj.children = [];
+	      item.sbbh.forEach((child, index) => {
+	          obj.children.push({
+	              label: child,
+	              parentDate: item.date // 添加上级日期并避免重复
+	          });
+	      });
+	      console.log(obj);
+	      treeData.value.push(obj);
+
+});
+  } catch (error) {
+    console.error(error);
+  }
+};
+
+// const DataListdata = async () => {
+//   try {
+//     const data = await DataList();
+//     for (let key in data.data) {
+//       // 忽略 "productingAll" 和 "progressAll"
+//       if (key !== "productingAll" && key !== "progressAll") {
+//         let temp = data.data[key];
+//         let object = {};
+//         object.id = temp[0];
+//         object.label = data.data[key];
+//         object.children = [];
+//         treeData.data.push(object);
+//       }
+//     }
+//   } catch (error) {
+//     console.error(error);
+//   }
+// };
+DataListdata();
+
+
+
+//点击左侧树形获取编号
+const tableData = reactive([])
+const _Gd_khdh = ref(null)
+const params = ref({})
+const params2 = ref({})
+//左侧
+const tabledate2 = ref([])
+//右侧
+const jqtabledata = ref()
+const exportTableRef = ref(null);
+const handleNodeClick = async (node) => {
+  // 取消所有节点的颜色
+  const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
+  allNodes.forEach(node => {
+    node.querySelector('.el-tree-node__label').style.color = '';
+  });
+  // 获取点击的节点
+  const clickedNodeId = node['$treeNodeId'];
+  const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
+  if (clickedNode) {
+    // 给当前点击的节点改变颜色
+    clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
+  }
+  console.log(node)
+  tabledate2.value=[]
+  if(node.children !==undefined ){
+    jqtabledata.value = []
+    tabledate2.value = []
+    params.value.mouth= node.label
+    params2.value.mouth= node.label
+    MachineList(params.value)
+    const Machineoutput = await MachineOperationProductDetail ({mouth:params2.value.mouth})
+    jqtabledata.value = Machineoutput.data
+  }
+ if (node.children === undefined){
+	 params.value.mouth = node.parentDate
+   params.value.sist = node.label
+    //清空表格数据
+    jqtabledata.value = []
+    tabledate2.value = []
+    MachineList(params.value)
+ }
+ // console.log();
+  // _WorkList_page(); 
+};
+  const MachineList = async(params)=>{
+  try {
+	  console.log(params)
+	  console.log(12312312321)
+    const MachineListData = await MachineOperation(params);
+    let data = MachineListData.data
+    for (var key in data){
+       if (data.hasOwnProperty(key) && key !== 'total') {  
+        // 将每个设备对象添加到新数组中  
+        tabledate2.value.push(data[key]);  
+        }  
+    }
+console.log(tabledate2.value);
+  } catch (error) {
+    console.error(error);
+  }
+  }
+
+
+//导出按钮(汇总)
+const exportToExcel = async () => { 
+  try {
+    //  获取数据
+    const response = await MachineOperation({ mouth: params.value.mouth });
+    const originalData = response.data;
+    
+    // 转换并过滤数据
+    const processedData = Object.values(originalData).map(item => {
+      // 创建新对象,排除"印刷方式"字段
+      const { 印刷方式, ...rest } = item;
+      return rest;
+    });
+    
+    // 创建工作表
+    const worksheet = XLSX.utils.json_to_sheet(processedData);
+    //从某列开始转化成数字
+    //设置从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.0'; // 数字格式
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const workbook = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+    XLSX.writeFile(workbook, '设备数据.xlsx');
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+// //月度明细
+// const exportToExcel2 = () => {
+//   if (jqtabledata.value){
+//   const el = document.getElementById('tab2');
+//   console.log(el);
+//   // 文件名
+//   const filename = '月度明细.xlsx';
+//   const wb = XLSX.utils.table_to_book(el, { raw: true });
+//   const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
+//   try {
+//     FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
+//   } catch (e) {
+//     console.log(e);
+//   }
+//   return wbout;
+// }
+//     }
+//导出到EXCEL(明细)
+const exportToExcel3 = async () => {
+  try {
+    //  获取数据
+    const el = document.getElementById('tab2');
+    const filename = '导出到EXCEL(明细).xlsx';
+    
+    //  使用table_to_sheet获取工作表对象
+    const ws = XLSX.utils.table_to_sheet(el, { raw: true });
+    // 从某字段开始转化成数字格式
+    // 确定"产量"列的位置)
+    const headerRow = XLSX.utils.sheet_to_json(ws, { header: 1 })[0];
+    const startColIndex = headerRow.indexOf('产量');
+    
+    if (startColIndex >= 0) {
+      const range = XLSX.utils.decode_range(ws['!ref']);
+      
+      for (let col = startColIndex; col <= range.e.c; col++) {
+        for (let row = range.s.r + 1; row <= range.e.r; row++) {
+          const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
+          
+          if (ws[cellAddress]) {
+            // 尝试转换为数字
+            const cellValue = ws[cellAddress].v;
+            const numValue = Number(cellValue);
+            
+            if (!isNaN(numValue)) {
+              ws[cellAddress].t = 'n';  // 设置为数字类型
+              ws[cellAddress].v = numValue;  // 更新值
+              ws[cellAddress].z = '0.0';  // 设置数字格式
+            }
+          }
+        }
+      }
+    }
+    
+    // 创建并导出工作簿
+    const wb = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
+    XLSX.writeFile(wb, filename);
+    
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出数据失败,请重试');
+  }
+};
+
+//查询
+const searchInfo = ref('')
+//查询按钮
+const onSubmit = () => {
+  _cha_WorkList();
+};
+const handleSearch = () => {
+  console.log(1231)
+  _cha_WorkList();
+};
+
+const _cha_WorkList = async (node) => {
+  if(searchInfo.value === ''){
+    ElMessage({type: 'warning',message: '请输入搜索的信息'})
+    return false;
+  }
+  const search = searchInfo.value;
+  var regex = /^[a-zA-Z0-9]+$/;
+  try {
+    if (regex.test(search)) {
+      // 符合条件,执行搜索操作
+      console.log('搜索内容为纯数字加字母');
+      const WorkListdata = await WorkList({search:search,limit:100,page:1});//接口调用函数
+      if(WorkListdata.data.total === 0){
+        ElMessage({type: 'warning',message: '未搜索具体查询条件'})
+      }
+      tableData.splice(0,tableData.length,...WorkListdata.data.data);//表格数据
+      total.value = WorkListdata.data.total;//共多少条
+    } else {
+      // 不符合条件,给出提示
+      console.log('搜索内容包含非字母和数字的字符');
+      const WorkListdata = await WorkList({Gd_khdh:'',search:search,limit:100,page:1});//接口调用函数
+      if(WorkListdata.data.total === 0){
+        ElMessage({type: 'warning',message: '未搜索具体查询条件'})
+      }
+      tableData.splice(0,tableData.length,...WorkListdata.data.data);//表格数据
+    }
+  } catch (error) {
+    console.error(error);
+  }
+};
+
+// 分页
+const page = ref(1)
+const pageSize = ref(50)
+const handleCurrentChange = (val) => {
+  page.value = val;
+  _WorkList_page();
+};
+
+// 修改页面容量 点击多少条/页
+const handleSizeChange = (val) => {
+  // page.value = 10;
+  pageSize.value = val;
+  _WorkList_page();
+};
+
+//点击行
+const tableRowClick = async (row) => {
+  jqtabledata.value=null
+  params2.value.machine= row.设备编号
+  params2.value.mouth = params.value.mouth
+   const Machineoutput = await MachineOperationProductDetail (params2.value)
+   jqtabledata.value = Machineoutput.data
+   console.log(jqtabledata.value);
+  let tmp = yjtableData.value.map(item => item.印件号)
+  tmp = tmp.sort((a,b)=>b-a)
+  yjzuidahaoma.value = Number(tmp[0]) + 1
+};
+
+
+// 行为控制标记(弹窗内部需要增还是改)
+const type = ref('')
+
+
+</script>
+<style scoped>
+/* 在样式表中使用媒体查询 */
+@media (max-width: 768px) {
+  /* 在小屏幕下的样式设置 */
+  .dialog-footer {
+    text-align: center;
+  }
+}
+/*工序产量核查*/
+:deep(.gxclhc—color-column-red div) {
+  color: red !important;
+}
+:deep(.lan-plan-usage-lows div) {
+  color: blue !important;
+  font-weight: bold;
+}
+:deep(.lan-plan-usage-lowshui div) {
+  color: #8c939d !important;
+}
+
+/*背景颜色*/
+/*印件背景颜色变黄*/
+:deep(.el-table__body .warning-row) {
+  background: #FFFF80 !important;
+}
+/*修正工单核算参数背景*/
+:deep(.el-table__body .background-plan-usage-low div div div) {
+  background: #80FA80 !important;
+}
+/* 选中某行时的背景色 */
+:deep(.el-table__body tr.current-row) > td {
+  background: #ff80ff !important;
+}
+/*文字颜色*/
+/*bom计划用量文字变色【表格中单独文字变色】*/
+:deep(.plan-usage-low div) {
+  color: red !important;
+}
+/*根据工艺状态文字变色*/
+:deep(.status-plan-usage-low div) {
+  color: blue !important;
+}
+:deep(.statusy-plan-usage-low div) {
+  color: #8c939d !important;
+}
+/* 在样式表中添加以下样式 */
+.el-input__textarea {
+  resize: none; /* 禁止调整大小 */
+}
+.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;
+}
+/*关闭拖拽功能*/
+.el-textarea textarea {
+  resize: none !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;
+}
+.el-pagination{
+  margin-top: 0px !important;
+}
+.mab{
+  margin-bottom: 5px;
+}
+</style>

+ 2 - 2
src/view/v23financial/v23Costmaintenance.vue

@@ -790,10 +790,10 @@ const UtilitiesListdata = async ()=>{
     const UtilitiesListdata = await UtilitiesList({month:Sys_ny});
     console.log(UtilitiesListdata.data[0])
     if(UtilitiesListdata.data.耗电量 === undefined){
-      sdqfttableData.value = SDQFT_WORKSHOPS.map(workshop => ({
+      sdqfttableData.value = SDQFT_WORKSHOPS.map((workshop, index) => ({
       年月: _noderq.value,
       部门名称: workshop,
-      科目名称: SDQFT_kmmc,
+      科目名称: SDQFT_kmmc[index],
       耗电量: '',
       单位电价: 0.690,
       耗气量: '',

+ 5 - 0
src/view/yunyin/shengchanguanli/PrintingPlateRequisition.vue

@@ -889,5 +889,10 @@ const rowClassStyle = ({row, rowIndex}) => {
   .mab{
     margin-bottom: 5px;
   }
+  :deep( .el-checkbox.el-checkbox--small .el-checkbox__inner){
+    width: 20px !important;
+    height: 20px !important;
+  }
+
   </style>