Jelajahi Sumber

first commit

liuhairui 2 bulan lalu
induk
melakukan
5a2da6033a
31 mengubah file dengan 5998 tambahan dan 2830 penghapusan
  1. 12 1
      src/api/ai/aiimg.js
  2. 271 13
      src/api/mes/job.js
  3. 681 0
      src/view/inventory/BomInformation.vue
  4. 54 13
      src/view/inventory/fabricsummary.vue
  5. 361 180
      src/view/inventory/pickinglist.vue
  6. 345 12
      src/view/inventory/ruku.vue
  7. 345 20
      src/view/inventory/tuihuan.vue
  8. 74 2
      src/view/material/Bomlog.vue
  9. 177 72
      src/view/material/bomproduct.vue
  10. 107 4
      src/view/material/technological.vue
  11. 277 139
      src/view/performance/MachineElectricity.vue
  12. 117 41
      src/view/performance/OrderElectricity.vue
  13. 4 33
      src/view/performance/QualityAssessment/QuestionClassification.vue
  14. 23 17
      src/view/performance/QualityAssessment/SemiFinishedRework.vue
  15. 23 17
      src/view/performance/QualityAssessment/cropdefective.vue
  16. 352 0
      src/view/performance/QualityAssessment/rework.vue
  17. 628 0
      src/view/performance/QualityAssessment/video.vue
  18. 35 27
      src/view/performance/Suborderdetailspage.vue
  19. 340 12
      src/view/performance/chukubaogong.vue
  20. 8 9
      src/view/yunyin/shengchanguanli/AIFashionModelLibrary.vue
  21. 34 34
      src/view/yunyin/shengchanguanli/AIGeneratedvue.vue
  22. 13 13
      src/view/yunyin/shengchanguanli/AIPromptManagement.vue
  23. 394 0
      src/view/yunyin/shengchanguanli/Finishedproduct.vue
  24. 778 0
      src/view/yunyin/shengchanguanli/Orderprogress.vue
  25. 4 4
      src/view/yunyin/shengchanguanli/ShippingManagement.vue
  26. 118 24
      src/view/yunyin/shengchanguanli/baogongshuju.vue
  27. 88 47
      src/view/yunyin/shengchanguanli/chengpinrucang.vue
  28. 24 18
      src/view/yunyin/shengchanguanli/gongdanziliao.vue
  29. 110 1681
      src/view/yunyin/shengchanguanli/shengchanpaichan.vue
  30. 133 387
      src/view/yunyin/shengchanguanli/yangyipihe.vue
  31. 68 10
      src/view/yunyin/shengchanguanli/yuedudahuoshengchanjindu.vue

+ 12 - 1
src/api/ai/aiimg.js

@@ -1,7 +1,17 @@
 import axios from 'axios';
 
+// 获取环境变量服务器IP地址
+const basePath = import.meta.env.VITE_BASE_PATH || 'http://192.168.28.22';
+const uploadsPort = import.meta.env.VITE_UPLOADS_PORT ?? '8082';
+console.log("basePath", basePath);
+console.log("uploadsPort", uploadsPort);
+// 动态生成路径
+let base = `${basePath}:${uploadsPort}`;
+console.log("api地址获取数据:", base);
+
 const api = axios.create({
-  baseURL: 'http://20.0.16.53:9093',
+  // baseURL: base,
+  baseURL: 'http://192.168.28.22:8082',
   timeout: 10000, 
 });
 
@@ -52,6 +62,7 @@ export const Template = (params) => {
     params
   })
 }
+//查询使用模版
 export const Template_ids = (params) => {
   return api({
     url: '/api/Ai_New/Template_ids',

+ 271 - 13
src/api/mes/job.js

@@ -1124,18 +1124,109 @@ export const Read_ListsData = (params) => {
 }
 
 
+//订单电量管理(左侧菜单)
+export const CustomerMenu = (params) => {
+  return service({
+	url: '/mes_server/work_order/CustomerMenu',
+    method: 'get',
+    params
+  })
+}
+//订单电量管理
+export const OrderElectricitySummary = (params) => {
+  return service({
+	url: '/mes_server/work_order/OrderElectricitySummary',
+    method: 'get',
+    params
+  })
+}
+//订单电量管理明细
+export const OrderElectricityDetail = (params) => {
+  return service({
+    url: '/mes_server/work_order/OrderElectricityDetail',
+    method: 'get',
+    params
+  })
+}
+
+export const Get_rework = (params) => {
+  return service({
+    url: '/mes_server/Facility/Get_rework',
+    method: 'get',
+    params
+  })
+}
+
+//订单发货管理左侧菜单
+export const Send_Out_Goods = (params) => {
+  return service({
+    url: '/mes_server/work_order/Send_Out_Goods',
+    method: 'get',
+    params
+  })
+}
+
+//成品入仓左侧菜单
+export const Finished_Datalist = (params) => {
+  return service({
+    url: '/mes_server/work_order/Finished_Datalist',
+    method: 'get',
+    params
+  })
+}
+
+//成品入仓列表
+export const Finished_Product = (params) => {
+  return service({
+    url: '/mes_server/work_order/Finished_Product',
+    method: 'get',
+    params
+  })
+}
+//面料库存信息
+export const GetFabric = (params) => {
+  return service({
+    url: '/mes_server/work_order/GetFabric',
+    method: 'get',
+    params
+  })
+}
+//面料库存汇总分析
+export const GetAPIFabric = (params) => {
+  return service({
+    url: '/mes_server/work_order/GetAPIFabric',
+    method: 'get',
+    params
+  })
+}
+//Bom资料列表
+export const Get_BomList = (params) => {
+  return service({
+    url: '/mes_server/work_order/Get_BomList',
+    method: 'get',
+    params
+  })
+}
+//订单生产进度跟踪
+export const GetOrderprogress = (params) => {
+  return service({
+    url: '/mes_server/work_order/GetOrderprogress',
+    method: 'get',
+    params
+  })
+}
 
 // 图片上传
 export const ImgUpload = (data) => {
   return service({
-    url: '/mes_server/Facility/ImgUpload',
+    url: '/mes_server/Ai_New/ImgUpload',
     method: 'post',
     data
   })
 }
 export const getUploadPath = (data) => {
   return service({
-    url: '/mes_server/Facility/getUploadPath',
+    url: '/mes_server/Ai_New/getUploadPath',
     method: 'get',
     data
   })
@@ -1143,14 +1234,14 @@ export const getUploadPath = (data) => {
 
 export const TemplateList = (params) => {
   return service({
-    url: '/mes_server/Facility/TemplateList',
+    url: '/mes_server/Ai_New/TemplateList',
     method: 'get',
     params
   })
 }
 export const setActiveTemplate = (params) => {
   return service({
-    url: '/mes_server/Facility/setActiveTemplate',
+    url: '/mes_server/Ai_New/setActiveTemplate',
     method: 'get',
     params
   })
@@ -1158,14 +1249,14 @@ export const setActiveTemplate = (params) => {
 //
 export const Template = (params) => {
   return service({
-    url: '/mes_server/Facility/Template',
+    url: '/mes_server/Ai_New/Template',
     method: 'get',
     params
   })
 }
 export const Template_ids = (params) => {
   return service({
-    url: '/mes_server/Facility/Template_ids',
+    url: '/mes_server/Ai_New/Template_ids',
     method: 'get',
     params
   })
@@ -1173,26 +1264,193 @@ export const Template_ids = (params) => {
 
 export const updatetemplate = (data) => {
   return service({
-    url: '/mes_server/Facility/updatetemplate',
+    url: '/mes_server/Ai_New/updatetemplate',
     method: 'post',
     data
   })
 }
 
-//订单电量管理
-export const OrderElectricitySummary = (params) => {
+
+// 获取原图目录名称
+export const getPreviewSubDirs = (params) => {
   return service({
-	url: '/mes_server/work_order/OrderElectricitySummary',
+    url: '/mes_server/Ai_New/getPreviewSubDirs',
     method: 'get',
     params
   })
 }
-//订单电量管理明细
-export const OrderElectricityDetail = (params) => {
+//获取图片
+export const getlsit = (params) => {
   return service({
-    url: '/mes_server/work_order/OrderElectricityDetail',
+    url: '/mes_server/Ai_New/getlsit',
     method: 'get',
     params
   })
 }
 
+//获取指定目录所有图片
+export const getPreviewimg = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/getPreviewimg',
+    method: 'post',
+    data
+  })
+}
+
+//出图接口
+export const imageToText = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/imageToText',
+    method: 'post',
+    data
+  })
+}
+//出图接口
+export const textToImage = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/textToImage',
+    method: 'post',
+    data
+  })
+}
+//压缩图片文件
+export const packImagess = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/packImagess',
+    method: 'post',
+    data
+  })
+}
+//查询总队列状态
+export const queueStats = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/queueStats',
+    method: 'get',
+    params
+  })
+}
+//清空队列
+export const stopQueueProcesses = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/stopQueueProcesses',
+    method: 'get',
+    params
+  })
+}
+
+//显示当前运行中的队列监听进程
+export const viewQueueStatus = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/viewQueueStatus',
+    method: 'get',
+    params
+  })
+}
+
+//查询队列列表
+export const get_queue_logs = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/get_queue_logs',
+    method: 'post',
+    data
+  })
+}
+//任务状态统计接口
+export const getTaskProgress = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/getTaskProgress',
+    method: 'get',
+    params
+  })
+}
+
+//通过店铺ID-查询对应店铺表数据
+export const PatternApi = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/PatternApi',
+    method: 'get',
+    params
+  })
+}
+
+
+export const sd_models = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/sd_models',
+    method: 'get',
+    params
+  })
+}
+
+
+
+export const getSide = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/getTab',
+    method: 'post',
+    data
+  })
+}
+export const getTable = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/getList',
+    method: 'get',
+    params
+  })
+}
+export const oversizedloss = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/oversizedloss',
+    method: 'post',
+    data
+  })
+}
+
+
+//获取文生图模型列表
+export const txttoimg_moxing = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/txttoimg_moxing',
+    method: 'get',
+    params
+  })
+}
+//修改默认文生图模型
+export const txttoimg_update = (data) => {
+  return service({
+    url: '/mes_server/Ai_New/txttoimg_update',
+    method: 'post',
+    data
+  })
+}
+
+
+export const getPreviewFolders = (params) => {
+  return service({
+    url: '/mes_server/Ai_New/getPreviewFolders',
+    method: 'get',
+    params
+  })
+}
+
+export const Getvideolist = (params) => {
+  return service({
+    url: '/mes_server/work_order/Getvideolist',
+    method: 'get',
+    params
+  })
+}
+export const video = (params) => {
+  return service({
+    url: '/mes_server/work_order/video',
+    method: 'get',
+    params
+  })
+}
+export const videoContent = (params) => {
+  return service({
+    url: '/mes_server/work_order/videoContent',
+    method: 'get',
+    params
+  })
+}

+ 681 - 0
src/view/inventory/BomInformation.vue

@@ -0,0 +1,681 @@
+<template>
+  <div>
+	  <layout>
+	    <layout-header>
+        <el-form>
+          <el-form-item>
+            <el-input v-model="searchInfo" placeholder="搜索" @keyup.enter="handleSearch()" style="width: 230px;height: 40px;" />
+            <el-button type="primary" icon="Search" class="search" @click="handleSearch"  style="height: 40px;">查询</el-button>
+            
+            <el-button type="primary" icon="Plus" class="" @click="handleAdd"  style="height: 40px;">新增</el-button>
+            <el-button type="primary" icon="Edit" class="" @click="handleEdit"  style="height: 40px;">修改</el-button>
+            <el-button type="danger" icon="Delete" class="" @click="handleDelete"  style="height: 40px;">删除</el-button>
+            <el-button type="primary" icon="MagicStick" class="" @click="aiFixBom"  style="height: 40px;">AI分析</el-button>
+            <el-button  type="primary" icon="Download" @click="exportToExcel" style="height: 40px;">导出物料Excel</el-button>            
+          </el-form-item>
+        </el-form>
+	    </layout-header>
+	    <layout>
+		  
+		  <!-- 左侧树形结构 -->
+		<!--  <layout-sider :resize-directions="['right']" :width="190" style="margin: 0px;">
+		    <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" style="width: 100%;height: 70vh" tooltip-effect="dark"
+						  :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
+              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						  :data="restableData"  border row-key="id" size="small"  
+						  :cell-class-name="tableDataCellClass" id="finished"
+						  highlight-current-row="true"  @row-dblclick="updateCompanyFunc"
+						  @row-click="tableRowClick" :show-overflow-tooltip="true"
+						  @selection-change="handleSelectionChange"
+						  show-summary :summary-method="getSummaries">
+				  <el-table-column type="selection" width="55" />
+				  <el-table-column  align="left" label="订单编号" prop="订单编号" width="110" />
+				  <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="140"/>
+				  <el-table-column  align="left" label="物料名称" prop="物料名称" width="300"/>
+				  <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="200"/>
+				</el-table>
+        <div class="gva-pagination">
+          <el-pagination
+              v-model:current-page="page"
+              v-model:page-size="pageSize"
+              :page-sizes="[10, 30, 50, 100, 500, 1000]"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange">
+          </el-pagination>
+        </div>
+			  </div>
+		  <!-- </el-main> -->
+      </layout-content>
+      </layout>
+    </layout>
+
+    <el-dialog
+      v-model="fabricAnalysisDialog"
+      title=""
+      width="80%"
+      @open="handleDialogOpen"
+      @close="handleDialogClose"
+    >
+      <div class="chart-container" ref="chartRef" style="width: 100%; height: 400px; margin-bottom: 30px;"></div>
+    </el-dialog>
+
+    <!-- 新增/修改对话框 -->
+    <el-dialog
+      v-model="bomDialogVisible"
+      :title="dialogTitle"
+      width="600px"
+      @close="resetForm"
+    >
+      <el-form ref="bomFormRef" :model="bomFormData" label-width="120px">
+        <el-form-item label="订单编号" prop="订单编号">
+          <el-input v-model="bomFormData.订单编号" placeholder="请输入订单编号" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="款式" prop="款式">
+          <el-input v-model="bomFormData.款式" placeholder="请输入款式" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="生产款号" prop="生产款号">
+          <el-input v-model="bomFormData.生产款号" placeholder="请输入生产款号" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="物料分类" prop="物料分类">
+          <el-input v-model="bomFormData.物料分类" placeholder="请输入物料分类" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="物料名称" prop="物料名称">
+          <el-input v-model="bomFormData.物料名称" placeholder="请输入物料名称" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="计划用料" prop="计划用料">
+          <el-input v-model.number="bomFormData.计划用料" type="number" placeholder="请输入计划用料" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="计划门幅" prop="计划门幅">
+          <el-input v-model.number="bomFormData.计划门幅" type="number" placeholder="请输入计划门幅" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="定额用料" prop="定额用料">
+          <el-input v-model.number="bomFormData.定额用料" type="number" placeholder="请输入定额用料" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="定额门幅" prop="定额门幅">
+          <el-input v-model.number="bomFormData.定额门幅" type="number" placeholder="请输入定额门幅" style="width: 100%;" />
+        </el-form-item>
+        <el-form-item label="备注" prop="备注">
+          <el-input v-model="bomFormData.备注" type="textarea" placeholder="请输入备注" style="width: 100%;" rows="3" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="bomDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="saveBom">保存</el-button>
+      </template>
+    </el-dialog>
+
+  </div>
+</template>
+<script>
+//点击按钮显示下方表格
+export default {
+  data() {
+    return {
+      currentTable: '', // 当前展示的表格
+      activeName: 'first',
+      _ddhval:'',
+	  add_gddialogFormVisible: true,
+    };
+  },
+  methods: {
+    updateCompanyFunc(row) {
+      console.log('双击行:', row);
+    }
+  }
+};
+</script>
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import {ref, reactive, onMounted, onUnmounted} from 'vue'
+import {Get_BomList} from '@/api/mes/job'
+import {ElMessage, ElMessageBox} from "element-plus";
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
+// import { get } from 'scriptjs';
+import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
+//获取用户登录信息
+const userStore = useUserStore()
+const _username = ref('')
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+console.log('获取用户名称',_username.value)
+//全局调用获取当前日期
+const today = new Date();
+const year = today.getFullYear();
+const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
+const day = String(today.getDate()).padStart(2, '0');
+const hours = String(today.getHours()).padStart(2, '0');
+const minutes = String(today.getMinutes()).padStart(2, '0');
+const seconds = String(today.getSeconds()).padStart(2, '0');
+const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+const currentDates = `${year}-${month}-${day}`;
+
+
+// =========== 左侧树侧形结构 =========== 
+const treeData = ref([]);
+const searchInfo = ref('');
+const _Machine_riqi = ref('');
+const _Machine = ref('');
+const page = ref(1);
+const pageSize = ref(50);
+const total = ref(0);
+const restableData = ref([]);
+
+const getStaffList = async () => {
+  try {
+    const params = {
+      search: searchInfo.value,
+      page: page.value,
+      limit: pageSize.value
+    };
+    console.log('请求参数:', params);
+    
+    const response = await Get_BomList(params);
+    
+    if (response.code === 0) {
+      restableData.value = response.data || [];
+      total.value = response.count || 0;
+      console.log('获取数据成功,共', total.value, '条记录');
+    } else {
+      console.warn('接口返回非成功状态:', response);
+      ElMessage.warning('获取数据时出现问题,请稍后重试');
+    }
+  } catch (error) {
+    ElMessage.error('获取数据失败');
+    console.error('获取数据失败:', error);
+  }
+};
+
+// 初始化数据加载
+const getReceiptTabs = async () => {
+  await getStaffList();
+};
+getReceiptTabs();
+
+// 搜索功能
+const handleSearch = () => {
+  page.value = 1;
+  getStaffList();
+};
+
+// 分页处理 - 使用v-model绑定后,这里只需要重新获取数据即可
+const handleSizeChange = () => {
+  console.log('页码大小改变为:', pageSize.value);
+  getStaffList();
+};
+
+const handleCurrentChange = () => {
+  console.log('当前页码改变为:', page.value);
+  getStaffList();
+};
+
+// 表格行点击事件
+const tableRowClick = (row) => {
+  console.log('选中行:', row);
+  // 行点击时设置为选中状态
+  selectedRow.value = row;
+  // 同时更新selectedRows数组,方便修改和删除操作
+  selectedRows.value = [row];
+  // 调用clearSelection和toggleRowSelection来更新表格选择状态
+  if (multipleTable.value) {
+    multipleTable.value.clearSelection();
+    multipleTable.value.toggleRowSelection(row);
+  }
+};
+
+// 表格单元格样式
+const tableDataCellClass = ({ row, column, rowIndex, columnIndex }) => {
+  return '';
+};
+
+// 处理选择变化
+const handleSelectionChange = (selection) => {
+  console.log('选中项:', selection);
+  selectedRows.value = selection;
+};
+
+// 新增/修改相关变量
+const bomDialogVisible = ref(false);
+const dialogTitle = ref('新增');
+const bomFormRef = ref(null);
+const selectedRows = ref([]);
+const selectedRow = ref(null);
+const bomFormData = reactive({
+  订单编号: '',
+  款式: '',
+  生产款号: '',
+  物料分类: '',
+  物料名称: '',
+  计划用料: '',
+  计划门幅: '',
+  定额用料: '',
+  定额门幅: '',
+  备注: ''
+});
+
+// 新增按钮点击事件
+const handleAdd = () => {
+  dialogTitle.value = '新增';
+  resetForm();
+  bomDialogVisible.value = true;
+};
+
+// 修改按钮点击事件
+const handleEdit = () => {
+  if (selectedRows.value.length !== 1) {
+    ElMessage.warning('请选择一条数据进行修改');
+    return;
+  }
+  dialogTitle.value = '修改';
+  selectedRow.value = selectedRows.value[0];
+  // 将选中行的数据赋值给表单
+  Object.keys(bomFormData).forEach(key => {
+    bomFormData[key] = selectedRow.value[key] || '';
+  });
+  bomDialogVisible.value = true;
+};
+
+// 删除按钮点击事件
+const handleDelete = () => {
+  if (selectedRows.value.length === 0) {
+    ElMessage.warning('请选择要删除的数据');
+    return;
+  }
+  
+  ElMessageBox.confirm(
+    `确定要删除选中的 ${selectedRows.value.length} 条记录吗?`,
+    '删除确认',
+    {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }
+  ).then(() => {
+    // 这里应该调用删除API,目前只是模拟删除
+    ElMessage.success('删除成功');
+    // 重新加载数据
+    getReceiptTabs();
+    // 清空选择
+    selectedRows.value = [];
+  }).catch(() => {
+    // 用户取消删除
+    console.log('用户取消删除');
+  });
+};
+
+// 重置表单
+const resetForm = () => {
+  if (bomFormRef.value) {
+    bomFormRef.value.resetFields();
+  }
+  // 清空表单数据
+  Object.keys(bomFormData).forEach(key => {
+    bomFormData[key] = '';
+  });
+  selectedRow.value = null;
+};
+
+// 保存BOM
+const saveBom = () => {
+  if (!bomFormRef.value) return;
+  
+  // 表单验证
+  bomFormRef.value.validate((valid) => {
+    if (valid) {
+      // 这里应该调用新增或修改API,目前只是模拟
+      if (selectedRow.value) {
+        // 修改操作
+        ElMessage.success('修改成功');
+      } else {
+        // 新增操作
+        ElMessage.success('新增成功');
+      }
+      
+      // 关闭对话框
+      bomDialogVisible.value = false;
+      // 重新加载数据
+      getReceiptTabs();
+      // 清空选择
+      selectedRows.value = [];
+    } else {
+      ElMessage.warning('请填写必要字段');
+      return false;
+    }
+  });
+};
+
+// 计算表格合计
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    
+    // 只对数值列计算合计
+    const prop = column.property;
+    if (['库存数量',].includes(prop)) {
+      const values = data.map(item => Number(item[prop]) || 0);
+      if (!values.every(value => isNaN(value))) {
+        sums[index] = values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!isNaN(value)) {
+            return prev + value;
+          } else {
+            return prev;
+          }
+        }, 0);
+        // 保留两位小数
+        sums[index] = sums[index].toFixed(2);
+      } else {
+        sums[index] = '-';
+      }
+    } else {
+      sums[index] = '-';
+    }
+  });
+  
+  return sums;
+};
+
+
+
+// 图表相关
+const chartRef = ref(null);
+const chartInstance = ref(null);
+// 弹窗控制
+const fabricAnalysisDialog = ref(false);
+// 图表数据
+const fabricChartData = ref([]);
+
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  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;
+};
+
+// 显示面料库存分析弹窗
+const showFabricAnalysis = async () => {
+  try {
+    // 调用GetAPIFabric接口获取面料分析数据
+    const response = await GetAPIFabric();
+    
+    if (response.code === 0) {
+      fabricChartData.value = response.data || [];
+      // 打开弹窗
+      fabricAnalysisDialog.value = true;
+    } else {
+      ElMessage.warning('获取面料分析数据失败');
+    }
+  } catch (error) {
+    ElMessage.error('获取面料分析数据时出现错误');
+    console.error('获取面料分析数据失败:', error);
+  }
+};
+
+// 初始化柱状图
+const initChart = () => {
+  if (chartRef.value && fabricChartData.value.length > 0) {
+    // 销毁已存在的图表实例
+    if (chartInstance.value) {
+      chartInstance.value.dispose();
+    }
+    
+    // 创建新的图表实例
+    chartInstance.value = echarts.init(chartRef.value);
+    
+    // 准备数据
+    const categories = fabricChartData.value.map(item => item['物料名称']);
+    const stockData = fabricChartData.value.map(item => item['库存数量']);
+    
+    // 设置图表配置
+    const option = {
+      title: {
+        text: '面料库存数量统计',
+        left: 'center'
+      },
+      tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+          type: 'shadow'
+        },
+        formatter: function(params) {
+          const data = params[0];
+          const item = fabricChartData.value[data.dataIndex];
+          return `${data.name}<br/>库存数量: ${data.value}${item['单位']}<br/>入仓总量: ${item['入仓总量']}${item['单位']}<br/>领用数量: ${item['领用数量']}${item['单位']}<br/>退还数量: ${item['退还数量']}${item['单位']}`;
+        }
+      },
+      grid: {
+        left: '3%',
+        right: '3%',
+        bottom: '3%',
+        containLabel: true
+      },
+      xAxis: {
+        type: 'category',
+        data: categories,
+        axisLabel: {
+          interval: 0,
+          rotate: 20,
+          color: '#000000'
+        }
+      },
+      yAxis: {
+        type: 'value',
+        axisLabel: {
+          formatter: function(value) {
+            const firstItem = fabricChartData.value[0];
+            return value + (firstItem ? firstItem['单位'] : '');
+          }
+        }
+      },
+      series: [{
+        data: stockData,
+        type: 'bar',
+        itemStyle: {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            { offset: 0, color: '#83bff6' },
+            { offset: 0.5, color: '#188df0' },
+            { offset: 1, color: '#188df0' }
+          ])
+        },
+        emphasis: {
+          itemStyle: {
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+              { offset: 0, color: '#2378f7' },
+              { offset: 0.7, color: '#2378f7' },
+              { offset: 1, color: '#83bff6' }
+            ])
+          }
+        },
+        label: {
+          show: true,
+          position: 'top',
+          formatter: function(params) {
+            const item = fabricChartData.value[params.dataIndex];
+            return params.value + (item ? item['单位'] : '');
+          }
+        }
+      }]
+    };
+    
+    // 设置图表配置
+    chartInstance.value.setOption(option);
+  }
+};
+
+// 监听窗口大小变化
+const handleResize = () => {
+  if (chartInstance.value) {
+    chartInstance.value.resize();
+  }
+};
+
+// 监听弹窗打开事件
+const handleDialogOpen = () => {
+  // 弹窗打开后初始化图表
+  setTimeout(() => {
+    initChart();
+    // 监听窗口大小变化
+    window.addEventListener('resize', handleResize);
+  }, 100);
+};
+
+// 监听弹窗关闭事件
+const handleDialogClose = () => {
+  // 移除窗口大小变化监听
+  window.removeEventListener('resize', handleResize);
+  // 销毁图表实例
+  if (chartInstance.value) {
+    chartInstance.value.dispose();
+    chartInstance.value = null;
+  }
+};
+
+// 组件卸载时清理资源
+onUnmounted(() => {
+  window.removeEventListener('resize', handleResize);
+  if (chartInstance.value) {
+    chartInstance.value.dispose();
+    chartInstance.value = null;
+  }
+});
+const aiFixBom = () => {
+  ElMessage.success('AI分析中');
+}
+// 引入echarts
+import * as echarts from 'echarts';
+</script>
+<style scoped>
+/* 根据出库状态文字颜色 */
+:deep(.status-plan-usage-low div) {
+  color: #8c939d  !important;
+}
+:deep(.statusy-plan-usage-low div) {
+  color: blue !important;
+}
+.form-container {
+  display: flex;
+  flex-wrap: wrap;
+}
+.form-column {
+  /*flex: 1;*/
+  margin-right: 15px; /* 调整列之间的间距 */
+}
+/* 左侧输入框宽度调整 */
+.form-column .el-form-item .el-input {
+  width: 150px; /* 调整左侧输入框的宽度 */
+}
+/* 媒体查询,根据需要调整断点 */
+@media screen and (max-width: 768px) {
+  .form-column {
+    flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
+    margin-right: 0;
+  }
+}
+.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-checkbox.el-checkbox--small .el-checkbox__inner) {
+    width: 30px; /* 复选框宽度 */
+    height: 20px; /* 复选框高度 */
+}
+/*bom参数背景*/
+: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;
+}
+:deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
+    transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
+    top: 5%; /* 调整对勾位置 */
+    left: 40%; /* 调整对勾位置 */
+    width: 5px; /* 调整对勾宽度 */
+    height: 9px; /* 调整对勾高度 */
+}
+/* 选中某行时的背景色 */
+: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;
+	margin-left: 5px !important;
+}
+.mab{
+  margin-bottom: 5px;
+}
+/* 搜索样式 */
+::v-deep .el-input__wrapper #searchInput {  
+  font-size: 16px; 
+}  
+::v-deep(.el-descriptions__table tbody tr .is-bordered-label){
+	width: 60px;
+}
+::v-deep(.el-descriptions__table tbody tr .el-descriptions__content){
+	width: 120px;
+}
+</style>

+ 54 - 13
src/view/inventory/fabricsummary.vue

@@ -2,16 +2,17 @@
   <div>
     <el-form>
         <el-form-item>
-          <el-input v-model="searchInfo" placeholder="搜索订单编号、款号、物料名称、颜色" @keyup.enter="handleSearch()" style="width: 460px;height: 50px;margin-left: 10px;" />
- 		  <el-button type="primary" icon="search" class="search"style="height: 50px;font-size: 20px;margin-left: 20px;" @click="handleSearch">搜索</el-button>
-          <el-button  type="primary" icon="Download" @click="exportToExcel" style="height: 50px;font-size: 20px;margin-left: 20px;">导出库存Excel</el-button>
-        </el-form-item>
+          <el-input v-model="searchInfo" placeholder="搜索订单编号、款号、物料名称、颜色" @keyup.enter="handleSearch()" style="width: 200px;height: 40px;margin-left: 10px;" />
+ 		  <el-button type="primary" icon="search" class="search"style="height: 40px;margin-left: 20px;" @click="handleSearch">搜索</el-button>
+          <el-button  type="primary" icon="Download" @click="exportToExcel" style="height: 40px;margin-left: 20px;">导出库存Excel</el-button>
+		   <span style="font-size: 20px; margin-left: 200px;color: red;">可以通过物料查询、款号查询、明细按照款号查询后导出</span>
+		</el-form-item>
     </el-form>
 
     <layout>
 			<layout-sider :resize-directions="['right']" :width="200" style="margin-right: 10px;">
 				<div class="JKWTree-tree" style="height: 70vh;">
-					<h3>面料库存</h3>
+					<h3>日期</h3>
 					<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick"  />
 				</div>
 			</layout-sider>
@@ -20,16 +21,17 @@
         <layout-content>
           <div class="gva-table-box">
            <el-table ref="multipleTable" style="width: 100%;height: 70vh" tooltip-effect="dark"
-                      :row-style="{ height: '40px' }"  :header-cell-style="{ padding: '0px' }"
-                      :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                      :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
+					  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                       :data="restableData"  border row-key="ID" size="small"  
 					            :cell-class-name="tableDataCellClass" id="Fabricinventory"
                       highlight-current-row="true"  @row-dblclick="updateCompanyFunc"
                       @row-click="tableRowClick" :show-overflow-tooltip="true"
+					  show-summary :summary-method="getSummaries"
                       @selection-change="handleSelectionChange1">
 			        <!-- <el-table-column type="selection" width="80" /> -->
-				<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="150" />
                 <el-table-column  align="left" label="物料名称" prop="物料名称" width="150"/>
                 <el-table-column  align="left" label="款号" prop="款号" width="150"/>
@@ -40,14 +42,14 @@
 				<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="90"/>
-                <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="90"/>
+                <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="100"/> -->
 				<el-table-column  align="left" label="单位" prop="单位" width="70"/>
                 <!-- <el-table-column  align="left" label="关联订单" prop="关联订单" width="150"/> -->
-				<el-table-column  align="left" label="操作人员" prop="入仓人员" width="100"/>
-				<el-table-column  align="left" label="操作日期" prop="入仓日期" width="160"/>
+				<!-- <el-table-column  align="left" label="操作人员" prop="入仓人员" width="100"/> -->
+				<!-- <el-table-column  align="left" label="操作日期" prop="入仓日期" width="160"/> -->
 				<el-table-column fixed="right" label="操作" width="130">
 				<template #default="{ row, $index }">
 				  <el-button @click="record_listRow(row,$index)" type="success" size="small" 
@@ -337,6 +339,45 @@ const exportToExcel = ()=>{
   }
   return wbout;
 }
+// 计算表格合计
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    
+    // 只对数值列计算合计
+    const prop = column.property;
+    if (['入仓总量','领用数量','裁切退还','库存数量'].includes(prop)) {
+      const values = data.map(item => Number(item[prop]) || 0);
+      if (!values.every(value => isNaN(value))) {
+        sums[index] = values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!isNaN(value)) {
+            return prev + value;
+          } else {
+            return prev;
+          }
+        }, 0);
+        // 保留两位小数
+        sums[index] = sums[index].toFixed(2);
+      } else {
+        sums[index] = '-';
+      }
+    } else {
+      sums[index] = '-';
+    }
+  });
+  
+  return sums;
+};
+
+const AIwuliao = ()=>{
+	ElMessage.success('AI面料修正中');
+}
+
 
 //自动聚焦光标input
 const getMachineMacdata = async () => {

+ 361 - 180
src/view/inventory/pickinglist.vue

@@ -3,92 +3,80 @@
 	  <layout>
 	    <layout-header>
         <el-form>
-        <el-form-item>
-          <el-input v-model="searchInfo" placeholder="搜索订单编号、单号、物料或款号" @keyup.enter="handleSearch()" style="width: 230px;" />
-          <el-button type="primary" icon="Search" class="search" @click="handleSearch"  />
-          <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;">导出单号(详情)Excel</el-button>
-        </el-form-item>
-    </el-form>
+          <el-form-item>
+            <el-input v-model="searchInfo" placeholder="搜索" @keyup.enter="handleSearch()" style="width: 230px;height: 40px;" />
+            <el-button type="primary" icon="Search" class="search" @click="handleSearch" style="height: 40px;">查询</el-button>
+            <!-- <el-button  type="primary" @click="showFabricAnalysis" style="height: 40px;margin-left: 20px;">面料库存数量统计</el-button> -->
+            <el-button  type="primary" icon="Download" @click="exportToExcel" style="height: 40px;margin-left: 20px;">导出面料库存Excel</el-button>
+          </el-form-item>
+        </el-form>
 	    </layout-header>
 	    <layout>
 		  
 		  <!-- 左侧树形结构 -->
-		  <layout-sider :resize-directions="['right']" :width="190" style="margin: 0px;">
+		<!--  <layout-sider :resize-directions="['right']" :width="190" style="margin: 0px;">
 		    <div class="JKWTree-tree" style="height: 200px">
-		      <h3>领用单记录</h3>
-		      <el-tree :data="treeData" class="treecolor" @node-click="handleNodeClick"></el-tree>
+		      <h3>成品入仓</h3>
+		      <el-tree :data="treeData" class="treecolor"  @node-click="handleNodeClick"></el-tree>
 		    </div>
-		  </layout-sider>
+		  </layout-sider> -->
 		  
         <layout-content >
-			<el-main>
+        <!-- 面料库存数量统计图表 -->
+        <div class="chart-container" ref="chartRef" style="width: 100%; height: 400px;"></div>
+  			<!-- <el-main> -->
 			  <div class="gva-table-box">
-			   <el-table ref="multipleTable" style="width: 100%;height: 28vh" tooltip-effect="dark"
-						  :row-style="{ height: '20px' }"
-						  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-						  :header-cell-style="{ padding: '0px' }"
-						  :data="restableData"  border row-key="ID" size="small"  
-						  :cell-class-name="tableDataCellClass" id="dhtable"
+			   <el-table ref="multipleTable" style="width: 100%;height: 30vh" tooltip-effect="dark"
+						  :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
+              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						  :data="restableData"  border row-key="id" size="small"  
+						  :cell-class-name="tableDataCellClass" id="finished"
 						  highlight-current-row="true"  @row-dblclick="updateCompanyFunc"
 						  @row-click="tableRowClick" :show-overflow-tooltip="true"
-						  @selection-change="handleSelectionChange">
-						<!-- <el-table-column type="selection" width="80" /> -->
-				  <el-table-column  align="left" label="订单编号" prop="订单编号" width="160" />
-				  <el-table-column  align="left" label="单号" 	 prop="出库单" 	width="160"/>
-				  <el-table-column  align="left" label="物料名称" prop="物料名称" width="160"/>
-				  <el-table-column  align="left" label="款号" prop="款号" width="100"/>
-          <el-table-column  align="left" label="单号类型" 	 prop="单号类型" 	width="160"/>
-				  <el-table-column  align="left" label="领料人员" prop="领料人员" width="160"/>
-				  <el-table-column  align="left" label="操作人员" 	 prop="操作机台" 	width="160"/>
-				  <el-table-column  align="left" label="日期" prop="日期" width="160"/> 
+						  @selection-change="handleSelectionChange"
+						  show-summary :summary-method="getSummaries">
+				  <el-table-column  align="left" label="批次号" prop="批次号" width="86" />
+				  <el-table-column  align="left" label="关联号" prop="关联号" width="86"/>
+				  <el-table-column  align="left" label="物料编号" prop="物料编号" width="330"/>
+				  <el-table-column  align="left" label="物料名称" prop="物料名称" width="400"/>
+				  <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="60"/>
+				  <!-- <el-table-column  align="left" label="实际门幅" prop="实际门幅" width="90"/> -->
+				  <el-table-column  align="left" label="部门" prop="departname" width="90"/>
+				  <el-table-column  align="left" label="备注" prop="remark" width="200"/>
 				</el-table>
         <div class="gva-pagination">
               <el-pagination
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange"
                   :current-page="page"
-                  :page-sizes="[10, 30, 50, 100]"
+                  :page-sizes="[10, 30, 50, 100,500]"
                   :page-size="pageSize"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="total">
               </el-pagination>
             </div>
 			  </div>
-		  
-		  <el-tabs v-model="activeName" @tab-click="handleClick">
-			<el-tab-pane label="单号详情"  @click="showTable('出库单详情')"  name="first">
-			  <el-table ref="multipleTable"
-						:row-style="{ height: '20px' }"
-						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-						:header-cell-style="{ padding: '0px' }"
-						:show-overflow-tooltip="true" id="dhtable2"
-						highlight-current-row="true"
-						@row-click="listtableclick"
-						@row-dblclick="ysupdateCompanyFunc"
-						@selection-change="selectionChange($event, '出库单详情')"
-						style="width: 100%;height: 36vh" border show-summary
-						:summary-method="getSummaries" tooltip-effect="dark" :data="listtableData" row-key="ID" >
-					<!-- <el-table-column type="selection" width="30" /> -->
-					<el-table-column  align="left" label="订单编号" prop="订单编号" width="160" />
-					<el-table-column  align="left" label="单号" 	 prop="出库单据编号" 	width="160"/>
-					<el-table-column  align="left" label="物料名称" prop="物料名称" width="220"/>
-					<el-table-column  align="left" label="款号" prop="款号" width="100"/>
-					<el-table-column  align="left" label="数量" prop="数量" width="160"/>
-					<el-table-column  align="left" label="领料人员" prop="领料人员" width="160"/>
-					<el-table-column  align="left" label="操作人员" 	 prop="操作机台" 	width="160"/>
-					<el-table-column  align="left" label="日期" prop="日期" width="160"/>
-			  </el-table>
-			</el-tab-pane>
-		  </el-tabs>
-		  
-		  </el-main>
+		  <!-- </el-main> -->
       </layout-content>
       </layout>
     </layout>
+
   </div>
-  
-  
+
+    <!-- 面料库存数量统计弹窗 -->
+    <el-dialog
+      v-model="fabricAnalysisDialog"
+      title=""
+      width="80%"
+      @open="handleDialogOpen"
+      @close="handleDialogClose"
+    >
+      <div class="chart-container" ref="dialogChartRef" style="width: 100%; height: 400px;"></div>
+    </el-dialog>
 </template>
 <script>
 //点击按钮显示下方表格
@@ -102,18 +90,17 @@ export default {
     };
   },
   methods: {
-    
+    updateCompanyFunc(row) {
+      console.log('双击行:', row);
+    }
   }
 };
 </script>
 <script setup>
 // 全量引入格式化工具 请按需保留
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-import {ref, reactive} from 'vue'
-import {getSpotList,getSpotTab,outReport,orderBomList,FabricDetail,getReceiptTab,
-ReceiptList,
-ReceiptDetail
-} from '@/api/mes/job'
+import {ref, reactive, onMounted, onUnmounted} from 'vue'
+import {GetFabric,GetAPIFabric} from '@/api/mes/job'
 import {ElMessage} from "element-plus";
 import * as XLSX from 'xlsx';
 import FileSaver from 'file-saver';
@@ -135,72 +122,136 @@ const minutes = String(today.getMinutes()).padStart(2, '0');
 const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
-//自动聚焦光标input
-const getMachineMacdata = async () => {
-	setTimeout(() => {
-		const inputElement = document.getElementById('searchInput');
-		if (inputElement) {
-			inputElement.focus();		
-		}
-	}, 100); // 延迟100毫秒
-}
-getMachineMacdata();
+
 
 // =========== 左侧树侧形结构 =========== 
-const treeData = ref([]); 
-const defaultProps = {  
-  children: 'children',  
-  label: 'label'  
-};  
+const treeData = ref([]);
+const searchInfo = ref('');
+const _Machine_riqi = ref('');
+const _Machine = ref('');
+const page = ref(1);
+const pageSize = ref(50);
+const total = ref(0);
+const restableData = ref([]);
 
-const getReceiptTabs = async () => {
+const getStaffList = async () => {
   try {
-    // 调用接口获取数据
-    const response = await getReceiptTab();
-    console.log(response);  // 查看接口返回的数据
-
-    // 将接口返回的数据格式化为树形结构
-    const formattedData = response.data.map(item => ({
-      label: item.month,  // 显示月份
-      children: []        // 如果需要,可以添加子节点,或者根据需求添加
-    }));
-
-    // 将格式化后的数据赋值给treeData
-    treeData.value = formattedData;
+    // 构建参数对象
+    const params = {
+      search: searchInfo.value, // 搜索参数
+      page: page.value,
+      limit: pageSize.value
+    };
+    
+    // 打印参数以便调试
+    console.log('请求参数:', params);
+    
+    // 调用GetFabric接口获取面料库存数据
+    const response = await GetFabric(params);
+    
+    if (response.code === 0) {
+      restableData.value = response.data || [];
+      total.value = response.count || 0;
+      console.log('获取数据成功,共', total.value, '条记录');
+    } else {
+      console.warn('接口返回非成功状态:', response);
+      ElMessage.warning('获取数据时出现问题,请稍后重试');
+    }
   } catch (error) {
-    console.error(error);
+    ElMessage.error('获取数据失败');
+    console.error('获取数据失败:', error);
   }
 };
+
+// 初始化数据加载
+const getReceiptTabs = async () => {
+  await getStaffList();
+};
 getReceiptTabs();
 
-const restableData = reactive([])
-const nodedata = ref('')
-//点击左侧树形获取编号
-const handleNodeClick = async (node) => {
-	 restableData.splice(0, restableData.length);//清空表格
-   nodedata.value = node.label;
-	 // 获取点击的节点的月份
-    const response = await ReceiptList({order:'',mouth:nodedata.value,page:page.value,limit:pageSize.value});
-	  console.log(response)
-	  restableData.splice(0,response.length,...response.data.table);
-    total.value = response.data.total;
-}
+// 搜索功能
+const handleSearch = () => {
+  page.value = 1;
+  getStaffList();
+};
 
-const searchInfo = ref('')
-  //查询按钮
-const handleSearch = async ()=>{
-	restableData.splice(0, restableData.length);//清空表格
-	//订单信息数据查询【接口】
-	const response = await ReceiptList({order:searchInfo.value,mouth:nodedata.value,page:page.value,limit:pageSize.value});
-  console.log(response)
-	restableData.splice(0,response.length,...response.data.table);
-  total.value = response.data.total;
+// 分页处理
+const handleSizeChange = (val) => {
+  pageSize.value = val;
+  getStaffList();
+};
+
+const handleCurrentChange = (val) => {
+  page.value = val;
+  getStaffList();
+};
+
+// 表格行点击事件
+const tableRowClick = (row) => {
+  console.log('选中行:', row);
+};
+
+// 表格单元格样式
+const tableDataCellClass = ({ row, column, rowIndex, columnIndex }) => {
+  return '';
 };
 
+// 处理选择变化
+const handleSelectionChange = (selection) => {
+  console.log('选中项:', selection);
+};
+
+// 计算表格合计
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    
+    // 只对数值列计算合计
+    const prop = column.property;
+    if (['库存数量',].includes(prop)) {
+      const values = data.map(item => Number(item[prop]) || 0);
+      if (!values.every(value => isNaN(value))) {
+        sums[index] = values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!isNaN(value)) {
+            return prev + value;
+          } else {
+            return prev;
+          }
+        }, 0);
+        // 保留两位小数
+        sums[index] = sums[index].toFixed(2);
+      } else {
+        sums[index] = '-';
+      }
+    } else {
+      sums[index] = '-';
+    }
+  });
+  
+  return sums;
+};
+
+
+
+// 图表相关
+const chartRef = ref(null);
+const dialogChartRef = ref(null);
+const chartInstance = ref(null);
+const dialogChartInstance = ref(null);
+// 弹窗控制
+const fabricAnalysisDialog = ref(false);
+// 图表数据
+const fabricChartData = ref([]);
+
 const exportToExcel = ()=>{
-  const el = document.getElementById('dhtable');
+  const el = document.getElementById('finished');
   // 文件名
-  const filename = '出入库单号.xlsx';
+  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 {
@@ -209,79 +260,209 @@ const exportToExcel = ()=>{
     console.log(e);
   }
   return wbout;
-}
+};
 
-const exportToExcel2 = ()=>{
-  const el = document.getElementById('dhtable2');
-  // 文件名
-  const filename = '出入库单号(详情).xlsx';
-  const wb = XLSX.utils.table_to_book(el, { raw: true });
-  const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
+// 加载面料库存分析数据
+const loadFabricAnalysisData = async () => {
   try {
-    FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
-  } catch (e) {
-    console.log(e);
+    // 调用GetAPIFabric接口获取面料分析数据
+    const response = await GetAPIFabric();
+    
+    if (response.code === 0) {
+      fabricChartData.value = response.data || [];
+      return true;
+    } else {
+      ElMessage.warning('获取面料分析数据失败');
+      return false;
+    }
+  } catch (error) {
+    ElMessage.error('获取面料分析数据时出现错误');
+    console.error('获取面料分析数据失败:', error);
+    return false;
   }
-  return wbout;
-}
+};
 
-const listtableData = reactive([])
-//表格行点击
-const tableRowClick = async (row)=>{
-  listtableData.splice(0, listtableData.length);//清空表格
-	console.log(row['出库单'])
-  if(row['单号类型'] != '退还'){
-    //单据详情
-    const response = await ReceiptDetail({receipt:row['出库单']});
-    console.log(response)
-    listtableData.splice(0,response.length,...response.data);
+// 初始化页面上的图表
+const initPageChart = () => {
+  if (chartRef.value && fabricChartData.value.length > 0) {
+    // 销毁已存在的图表实例
+    if (chartInstance.value) {
+      chartInstance.value.dispose();
+    }
+    
+    // 创建新的图表实例
+    chartInstance.value = echarts.init(chartRef.value);
+    
+    // 准备数据并设置图表配置
+    setupChart(chartInstance.value);
   }
-}
+};
 
-const getSummaries = (param) => {  
-    const { columns, data } = param;  
-    const sums = {};  
-	//选择你希望合计的列
-    const summableLabels = ["数量"];
-    columns.forEach((column, index) => {  
-        if (index === 0) {  
-            sums[index] = '总数量合计';  
-            return;  
-        }  
-        if (summableLabels.includes(column.label)) {  
-            const values = data.map(item => Number(item[column.property]));  
-            if (!values.every(value => isNaN(value))) {  
-                sums[index] = values.reduce((prev, curr) => {  
-                    const value = Number(curr);  
-                    if (!isNaN(value)) {  
-                        return prev + value; 
-                    }  
-                    return prev;  
-                }, 0);  
-            } else {  
-                 sums[index] = 'N/A';  
-            }  
-        }  
-    });  
-    return sums;  
-};  
+// 初始化弹窗中的图表
+const initDialogChart = () => {
+  if (dialogChartRef.value && fabricChartData.value.length > 0) {
+    // 销毁已存在的图表实例
+    if (dialogChartInstance.value) {
+      dialogChartInstance.value.dispose();
+    }
+    
+    // 创建新的图表实例
+    dialogChartInstance.value = echarts.init(dialogChartRef.value);
+    
+    // 准备数据并设置图表配置
+    setupChart(dialogChartInstance.value);
+  }
+};
 
-// =========== 分页 ===========
-// 分页相关的响应式变量
-const page = ref(1)
-const total = ref(0)
-const pageSize = ref(50)
-// 分页
-const handleCurrentChange = (val) => {
-  page.value = val;
-  handleSearch();
+// 设置图表配置的通用函数
+const setupChart = (chartInstance) => {
+  // 准备数据
+  const categories = fabricChartData.value.map(item => item['物料名称']);
+  const stockData = fabricChartData.value.map(item => item['库存数量']);
+  
+  // 设置图表配置
+  const option = {
+    title: {
+      text: '面料库存数量统计',
+      left: 'center'
+    },
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      },
+      formatter: function(params) {
+        const data = params[0];
+        const item = fabricChartData.value[data.dataIndex];
+        return `${data.name}<br/>库存数量: ${data.value}${item['单位']}<br/>入仓总量: ${item['入仓总量']}${item['单位']}<br/>领用数量: ${item['领用数量']}${item['单位']}<br/>退还数量: ${item['退还数量']}${item['单位']}`;
+      }
+    },
+    grid: {
+      left: '3%',
+      right: '3%',
+      bottom: '1%',
+      containLabel: true
+    },
+    xAxis: {
+      type: 'category',
+      data: categories,
+      axisLabel: {
+        interval: 0,
+        rotate: 20,
+        color: '#000000'
+      }
+    },
+    yAxis: {
+      type: 'value',
+      axisLabel: {
+        formatter: function(value) {
+          const firstItem = fabricChartData.value[0];
+          return value + (firstItem ? firstItem['单位'] : '');
+        }
+      }
+    },
+    series: [{
+      data: stockData,
+      type: 'bar',
+      itemStyle: {
+        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+          { offset: 0, color: '#83bff6' },
+          { offset: 0.5, color: '#188df0' },
+          { offset: 1, color: '#188df0' }
+        ])
+      },
+      emphasis: {
+        itemStyle: {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            { offset: 0, color: '#2378f7' },
+            { offset: 0.7, color: '#2378f7' },
+            { offset: 1, color: '#83bff6' }
+          ])
+        }
+      },
+      label: {
+        show: true,
+        position: 'top',
+        formatter: function(params) {
+          const item = fabricChartData.value[params.dataIndex];
+          return params.value + (item ? item['单位'] : '');
+        }
+      }
+    }]
+  };
+  
+  // 设置图表配置
+  chartInstance.setOption(option);
 };
 
-// 修改页面容量 点击多少条/页
-const handleSizeChange = (val) => {
-  pageSize.value = val;
-  handleSearch();
+// 监听窗口大小变化
+const handleResize = () => {
+  if (chartInstance.value) {
+    chartInstance.value.resize();
+  }
+  if (dialogChartInstance.value) {
+    dialogChartInstance.value.resize();
+  }
+};
+
+// 显示面料库存分析弹窗
+const showFabricAnalysis = async () => {
+  // 加载数据
+  const success = await loadFabricAnalysisData();
+  if (success) {
+    // 打开弹窗
+    fabricAnalysisDialog.value = true;
+  }
 };
+
+// 监听弹窗打开事件
+const handleDialogOpen = () => {
+  // 弹窗打开后初始化图表
+  setTimeout(() => {
+    initDialogChart();
+    // 监听窗口大小变化
+    window.addEventListener('resize', handleResize);
+  }, 100);
+};
+
+// 监听弹窗关闭事件
+const handleDialogClose = () => {
+  // 移除窗口大小变化监听
+  window.removeEventListener('resize', handleResize);
+  // 销毁图表实例
+  if (dialogChartInstance.value) {
+    dialogChartInstance.value.dispose();
+    dialogChartInstance.value = null;
+  }
+};
+
+// 组件挂载时初始化页面图表
+onMounted(async () => {
+  // 加载面料库存分析数据
+  await loadFabricAnalysisData();
+  // 初始化页面上的图表
+  initPageChart();
+  // 监听窗口大小变化
+  window.addEventListener('resize', handleResize);
+});
+
+// 组件卸载时清理资源
+onUnmounted(() => {
+  window.removeEventListener('resize', handleResize);
+  // 销毁页面上的图表实例
+  if (chartInstance.value) {
+    chartInstance.value.dispose();
+    chartInstance.value = null;
+  }
+  // 销毁弹窗中的图表实例
+  if (dialogChartInstance.value) {
+    dialogChartInstance.value.dispose();
+    dialogChartInstance.value = null;
+  }
+});
+
+// 引入echarts
+import * as echarts from 'echarts';
 </script>
 <style scoped>
 /* 根据出库状态文字颜色 */

+ 345 - 12
src/view/inventory/ruku.vue

@@ -1,20 +1,110 @@
 <template>
   <div>
     <layout>
-		<el-row :gutter="24" style="margin-bottom: 6px;">
+		<el-row :gutter="24" style="margin-bottom: 6px; display: flex; align-items: center;">
 			  <el-input v-model="records_searchInfo" placeholder="可搜索入库单号、订单编号、款号、款式、物料名称"  @input="records_handleInput"
 				@keyup.enter="search_onSubmit" id="searchInput"  style="width: 460px;height: 50px;margin-left: 10px;">
 			  </el-input>
 			  <el-button type="primary" @click="search_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">查询</el-button>
 			  <el-button type="primary" @click="Reporting_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">面料入库</el-button>
+			  <div style="flex: 1;"></div> 
+			  <el-button type="primary" @click="exportToExcel" style="height: 50px;font-size: 20px;margin-left: 20px;">导出Excel</el-button>
+			  <el-button type="primary" @click="cp_gdprintonClick" style="height: 50px;font-size: 20px;margin-left: 20px;">工单打印查询</el-button>
+			  <el-button type="primary" @click="workOrderCompletionQuery" style="height: 50px;font-size: 20px;margin-left: 20px;">工单完工查询</el-button>
+			  <el-button type="primary" @click="print" style="height: 50px;font-size: 20px;margin-left: 20px;margin-right: 20px;">入库单打印</el-button>
 		</el-row>
       <layout>
 		<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
-				<div class="JKWTree-tree" style="height: 70vh;">
-					<h3>日期</h3>
-					<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick"  />
-				</div>
-			</layout-sider>
+			<div class="JKWTree-tree" style="height: 70vh;">
+				<h3>日期</h3>
+				<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick"  />
+			</div>
+		</layout-sider>
+
+		<el-dialog
+      v-model="order_viewVisible"
+      title="选择打印格式"
+      width="30%"
+      top="10%"
+      :before-close="order_viewCloseDialog"
+      destroy-on-close>
+      <el-form>
+        <el-form-item label="打印方向" label-width="100px">
+          <el-radio-group v-model="printDirection">
+            <el-radio label="纵向">纵向</el-radio>
+            <el-radio label="横向">横向</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="order_viewCloseDialog">关闭</el-button>
+        <el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+      </template>
+    </el-dialog>
+
+    <!-- 工单完工查询弹窗 -->
+    <el-dialog 
+      v-model="workOrderCompletionDialogVisible" 
+      title="工单完工查询结果" 
+      width="80%"
+      :before-close="() => workOrderCompletionDialogVisible = false"
+      custom-class="work-order-dialog"
+    >
+      <div class="work-order-completion-container">
+        <!-- 核心信息展示区 -->
+        <div class="core-info-section" v-if="workOrderCompletionData && workOrderCompletionData.length > 0">
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">订单编号:</label>
+              <span class="info-value highlight">{{ workOrderCompletionData[0]['订单编号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">客户编号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['客户编号'] }}</span>
+            </div>
+          </div>
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">生产款号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['生产款号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">款式:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['款式'] }}</span>
+            </div>
+          </div>
+        </div>
+        
+        <!-- 表格区域 -->
+        <div class="table-section">
+          <el-table ref="multipleTable"
+            :data="workOrderCompletionData" 
+            style="width: 100%" 
+            border
+            :header-cell-style="tableHeaderStyle"
+            class="completion-table"
+          >
+		<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="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-column   align="center" label="订单状态" prop="订单状态"  width="130" />
+		<el-table-column   align="center" label="落货日期" prop="落货日期"  width="130" :formatter="dateFormatter" />
+		<el-table-column   align="center" label="日期" prop="日期"  width="90" />
+          </el-table>
+        </div>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="workOrderCompletionDialogVisible = false" size="large" class="close-btn">关闭</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
         <layout-content >
           <div class="gva-table-box">
 			<el-tabs v-model="activeName" @tab-click="handleClick">
@@ -22,7 +112,7 @@
                 <el-table ref="multipleTable"
                           :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
                           :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                          :show-overflow-tooltip="true" highlight-current-row="true"
+                          :show-overflow-tooltip="true" highlight-current-row="true" id="finished"
 						  @row-click="Recordclicks" @row-dblclick="Doubleclickrecord"
 						  @selection-change="detailSelectionChange" style="width: 100%;height: 65vh" border
                           :summary-method="getSummaries" tooltip-effect="dark" :data="recordtableData" row-key="ID" >
@@ -30,9 +120,9 @@
 				  <el-table-column align="left"  label="订单编号" prop="订单编号"  width="105"/>
 				  <el-table-column align="left"  label="款号" prop="款号"  width="140"/>
 				  <el-table-column align="left"  label="款式" prop="款式"  width="140"/>
-				  <el-table-column align="left"  label="物料名称" prop="物料名称"  width="140"/>
+				  <el-table-column align="left"  label="物料名称" prop="物料名称"  width="200"/>
 				  <el-table-column align="left"  label="入库总数" prop="总数"  width="90"/>
-				  <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="160"/>
 				  <el-table-column align="left"  label="类型" prop="单号类型"  width="90"/>
@@ -273,6 +363,53 @@
   </el-dialog>
   
 
+
+  <!-- 打印预览弹窗 -->
+  <el-dialog v-model="printPreviewVisible" :before-close="()=> printPreviewVisible = false" 
+    title="" width="60%">
+    <div id="printContent" style="padding: 20px;">
+      <h2 style="text-align: center; margin-bottom: 20px;">入库表</h2>
+      <div style="display: flex; justify-content: space-between; margin-bottom: 15px;">
+        <div style="display: flex; gap: 20px;">
+          <div>单据编号 :{{_danhao}}</div>
+          <div>订单编号 :{{_ordernuber}}</div>
+        </div>
+        <div>日期 :{{ new Date().toLocaleDateString('zh-CN') }}</div>
+      </div>
+      <!-- 主表格 -->
+      <table style="width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid #000;">
+        <thead>
+          <tr>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">序号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">款号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">材料(物品)名称</th>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">数量</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">备注</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(item, index) in printPreviewData" :key="index">
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ index + 1 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.款号 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.物料名称 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.入仓总量 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.remark }}</td>
+          </tr>
+        </tbody>
+      </table>
+      <div style="margin-top: 10px; text-align: right;">
+        入库人员:{{_renyuan}}
+      </div>
+     
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="printPreviewVisible = false">关闭</el-button>
+        <el-button type="primary" @click="printDocument">打印</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
   <!--单号详情记录 -->
   <el-dialog v-model="details_pickingaddvisible" :before-close="()=> details_pickingaddvisible = false" style="width: 100%; margin: 0% auto; height: 100%;" :title="单据详情"
 	destroy-on-close>
@@ -311,6 +448,9 @@
 		</div>
   </el-dialog>
   
+
+<!-- 打印订单表预览 -->
+<PrintPage ref="printPageRef" />
 </template>
 <script>
 //点击按钮显示下方表格
@@ -332,20 +472,26 @@ export default {
 // 全量引入格式化工具 请按需保留
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {ref, reactive} from 'vue'
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
 import {getInputDetail,
 inputStash,rApictedit,
 InputOrderSearch,outReport,FabricDetail,gitReceiptNumber,FabricDetaillist,
-FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords} from '@/api/mes/job'
+FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords,OrderYieldList} from '@/api/mes/job'
 import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
 import dayjs, { Dayjs } from 'dayjs';
 import { useUserStore } from '@/pinia/modules/user'
+import PrintPage from '../yunyin/shengchanguanli/components/print.vue'
 // import { get } from 'scriptjs';
 defineOptions({name: 'Company'})
+//定义打印跳转页面
+  const printPageRef = ref()
 //获取用户登录信息
 const userStore = useUserStore()
 const _username = ref('')
 _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
 console.log('获取用户名称',_username.value)
+
 //全局调用获取当前日期
 const today = new Date();
 const year = today.getFullYear();
@@ -932,12 +1078,136 @@ const record_deleteRow = async (row) => {
 	rkrq.value = row.日期
 	recorddialogFormVisible.value = true
 	rdetailstableData.splice(0,rdetailstableData.length);
-	_danhao.value = row['出库单']
-	console.log(_danhao.value)
+	// _danhao.value = row['出库单']
+	// console.log(_danhao.value)
 	const FabricDetaillists = await ReceiptDetail({receipt:row['出库单']});
 	rdetailstableData.splice(0,FabricDetaillists.length,...FabricDetaillists.data);
 }
 
+const selectedRow = ref('')
+const _renyuan = ref('')
+const _ordernuber = ref('')
+
+const Recordclicks = async (row) => {
+	selectedRow.value = row;
+	_Gd_gdbh.value = row.订单编号
+	_ordernuber.value = row['订单编号']
+	_danhao.value = row['出库单']
+	_renyuan.value = row['操作机台']
+	console.log(_danhao.value)
+	console.log('选中的行数据:', selectedRow.value);
+}
+
+// 工单完工查询相关
+const currentSelectedRow = ref({})
+const workOrderCompletionDialogVisible = ref(false)
+const workOrderCompletionData = ref([])
+
+// 工单完工查询
+const workOrderCompletionQuery = async () => {
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的数据后,再操作此功能'})
+		return false;
+	}
+  try {
+    // 调用OrderYieldList接口,传入订单编号作为search参数
+    const response = await OrderYieldList({ search: _Gd_gdbh.value})
+    
+    if (response.code === 0) {
+      // 保存查询结果
+      workOrderCompletionData.value = response.data
+      // 显示弹窗
+      workOrderCompletionDialogVisible.value = true
+    } else {
+      ElMessage({ type: 'error', message: '查询失败' })
+    }
+  } catch (error) {
+    console.error('工单完工查询失败:', error)
+    ElMessage({ type: 'error', message: '查询失败' })
+  }
+}
+
+// 日期格式化函数,只显示年月日
+const dateFormatter = (row, column, cellValue) => {
+  if (!cellValue) return ''
+  return dayjs(cellValue).format('YYYY-MM-DD')
+}
+
+// 表格头部样式
+const tableHeaderStyle = {
+  background: '#409EFF',
+  color: '#fff',
+  fontWeight: 'bold',
+  textAlign: 'center'
+}
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+//弹窗
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+const cp_gdprintonClick = () => {
+	order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+	console.log(_Gd_gdbh.value)
+	console.log(printDirection.value)
+	
+	if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+	ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+	return false;
+	}else{
+	if(recordtableData.length >=1){
+	printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+	}else{
+	ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+	return false;
+	}
+	}
+}
+const order_viewCloseDialog = () => {
+	order_viewVisible.value = false
+}
+
+// 入库单打印预览功能
+const printPreviewVisible = ref(false);
+const printPreviewData = ref([]);
+// 入库单打印功能
+const print =  async () => {
+	if(_danhao.value === '' || _danhao.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的入库单后,再操作此功能'})
+		return false;
+	}
+	printPreviewVisible.value = true;
+	// 获取入库单详情数据
+	const result = await ReceiptDetail({receipt: _danhao.value});
+	console.log(result)
+	printPreviewData.value = result.data;
+	
+}
+// 执行打印
+const printDocument = () => {
+	try {
+		// 创建打印区域的克隆
+		const printContent = document.getElementById('printContent');
+		const printWindow = window.open('', '_blank');
+		// 写入打印内容
+		printWindow.document.write('<html><head><title>入库表</title></head><body>');
+		printWindow.document.write(printContent.innerHTML);
+		printWindow.document.write('</body></html>');
+		printWindow.document.close();
+		
+		// 执行打印
+		printWindow.print();
+		printWindow.close();
+		printPreviewVisible.value = false;
+	} catch (error) {
+		console.error('打印失败:', error);
+		ElMessage({type: 'error', message: '打印失败'});
+	}
+}
+
 //关闭
 const record_closeDialog = async (row) => {
 	console.log(row)
@@ -1021,6 +1291,20 @@ const detailSelectionChange = (selection, type) => {
   details_Selection.value = ids.join(',')
   console.log("复选框",details_Selection.value)
 }
+//导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  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;
+};
 
 // // 删除详情按钮
 // const deldetail_delclick = async () => {
@@ -1177,4 +1461,53 @@ const detailSelectionChange = (selection, type) => {
   border-radius: 4px !important;
 }
 
+/* 工单完工查询核心信息区域样式 */
+.core-info-section {
+  background: #f9fafc;
+  border: 1px solid #ebeef5;
+  border-radius: 8px;
+  padding: 15px;
+  margin-bottom: 20px;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
+}
+
+.core-info-section .info-row {
+  display: flex;
+  flex-wrap: wrap;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-row:last-child {
+  margin-bottom: 0;
+}
+
+.core-info-section .info-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-label {
+  font-weight: 600;
+  color: #303133;
+  width: 100px;
+  margin-right: 10px;
+  text-align: right;
+}
+
+.core-info-section .info-value {
+  color: #606266;
+  flex: 1;
+  word-break: break-all;
+  font-size: 14px;
+}
+
+/* 响应式调整 */
+@media screen and (max-width: 768px) {
+  .core-info-section .info-item {
+    width: 100%;
+  }
+}
+
 </style>

+ 345 - 20
src/view/inventory/tuihuan.vue

@@ -8,14 +8,102 @@
                 <el-button type="primary" @click="search_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">查询</el-button>
                 <el-button type="primary" @click="Reporting_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">面料退还</el-button>
                 <!-- <el-button type="danger"  @click="deldetail_delclick" style="width: 80px;height: 50px;"	v-if="del_details=== true" :disabled="details_Selection === '' "  class="bt"   >删除</el-button> -->
-          </el-row>
+                <div style="flex: 1;"></div> 
+				        <el-button type="primary" @click="exportToExcel" style="height: 50px;font-size: 20px;margin-left: 20px;">导出Excel</el-button>
+				        <el-button type="primary" @click="cp_gdprintonClick" style="height: 50px;font-size: 20px;margin-left: 20px;">工单打印查询</el-button>
+                 <el-button type="primary" @click="workOrderCompletionQuery" style="height: 50px;font-size: 20px;margin-left: 20px;">工单完工查询</el-button>
+                <el-button type="primary" @click="print" style="height: 50px;font-size: 20px;margin-left: 20px;margin-right: 20px;">退还单打印</el-button>
+              </el-row>
         <layout>
           <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
 				<div class="JKWTree-tree" style="height: 70vh;">
-					<h3>面料库存</h3>
+					<h3>日期</h3>
 					<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick"  />
 				</div>
 			</layout-sider>
+      <el-dialog
+		      v-model="order_viewVisible"
+		      title="选择打印格式"
+		      width="30%"
+		      top="10%"
+		      :before-close="order_viewCloseDialog"
+		      destroy-on-close>
+		      <el-form>
+		        <el-form-item label="打印方向" label-width="100px">
+		          <el-radio-group v-model="printDirection">
+		            <el-radio label="纵向">纵向</el-radio>
+		            <el-radio label="横向">横向</el-radio>
+		          </el-radio-group>
+		        </el-form-item>
+		      </el-form>
+		      <template #footer>
+		        <el-button @click="order_viewCloseDialog">关闭</el-button>
+		        <el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+		      </template>
+		    </el-dialog>
+
+         <!-- 工单完工查询弹窗 -->
+    <el-dialog 
+      v-model="workOrderCompletionDialogVisible" 
+      title="工单完工查询结果" 
+      width="80%"
+      :before-close="() => workOrderCompletionDialogVisible = false"
+      custom-class="work-order-dialog"
+    >
+      <div class="work-order-completion-container">
+        <!-- 核心信息展示区 -->
+        <div class="core-info-section" v-if="workOrderCompletionData && workOrderCompletionData.length > 0">
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">订单编号:</label>
+              <span class="info-value highlight">{{ workOrderCompletionData[0]['订单编号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">客户编号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['客户编号'] }}</span>
+            </div>
+          </div>
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">生产款号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['生产款号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">款式:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['款式'] }}</span>
+            </div>
+          </div>
+        </div>
+        
+        <!-- 表格区域 -->
+        <div class="table-section">
+          <el-table ref="multipleTable"
+            :data="workOrderCompletionData" 
+            style="width: 100%" 
+            border
+            :header-cell-style="tableHeaderStyle"
+            class="completion-table"
+          >
+		<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="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-column   align="center" label="订单状态" prop="订单状态"  width="130" />
+		<el-table-column   align="center" label="落货日期" prop="落货日期"  width="130" :formatter="dateFormatter" />
+		<el-table-column   align="center" label="日期" prop="日期"  width="90" />
+          </el-table>
+        </div>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="workOrderCompletionDialogVisible = false" size="large" class="close-btn">关闭</el-button>
+        </div>
+      </template>
+    </el-dialog>
+    
           <layout-content >
             <div class="gva-table-box">
               <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -23,7 +111,7 @@
                   <el-table ref="multipleTable"
                             :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
                             :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                            :show-overflow-tooltip="true" highlight-current-row="true"
+                            :show-overflow-tooltip="true" highlight-current-row="true" id="finished"
                             @row-click="Recordclicks" @row-dblclick="Doubleclickrecord"
                             @selection-change="detailSelectionChange" style="width: 100%;height: 65vh" border
                             :summary-method="getSummaries" tooltip-effect="dark" :data="recordtableData" row-key="ID" >
@@ -32,9 +120,9 @@
                       <el-table-column align="left"  label="订单编号" prop="订单编号"  width="105"/>
                       <el-table-column align="left"  label="款号" prop="款号"  width="140"/>
                       <el-table-column align="left"  label="款式" prop="款式"  width="140"/>
-                      <el-table-column align="left"  label="物料名称" prop="物料名称"  width="140"/>
+                      <el-table-column align="left"  label="物料名称" prop="物料名称"  width="200"/>
                       <el-table-column align="left"  label="退还总数" prop="总数"  width="90"/>
-                      <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="160"/>
                       <el-table-column align="left"  label="类型" prop="单号类型"  width="90"/>
@@ -295,7 +383,52 @@
         </div>
     </el-dialog>
     
-  
+   <!-- 打印预览弹窗 -->
+  <el-dialog v-model="printPreviewVisible" :before-close="()=> printPreviewVisible = false" 
+    title="" width="60%">
+    <div id="printContent" style="padding: 20px;">
+      <h2 style="text-align: center; margin-bottom: 20px;">退还表</h2>
+      <div style="display: flex; justify-content: space-between; margin-bottom: 15px;">
+        <div style="display: flex; gap: 20px;">
+          <div>单据编号 :{{_danhao}}</div>
+          <div>订单编号 :{{_ordernuber}}</div>
+        </div>
+        <div>日期 :{{ new Date().toLocaleDateString('zh-CN') }}</div>
+      </div>
+      <!-- 主表格 -->
+      <table style="width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid #000;">
+        <thead>
+          <tr>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">序号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">款号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">材料(物品)名称</th>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">数量</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">备注</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(item, index) in printPreviewData" :key="index">
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ index + 1 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.款号 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.物料名称 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.数量 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.remark }}</td>
+          </tr>
+        </tbody>
+      </table>
+      <div style="margin-top: 10px; text-align: right;">
+        入库人员:{{_renyuan}}
+      </div>
+     
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="printPreviewVisible = false">关闭</el-button>
+        <el-button type="primary" @click="printDocument">打印</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
     <!--单号详情记录 -->
     <el-dialog v-model="details_pickingaddvisible" :before-close="()=> details_pickingaddvisible = false" style="width: 100%; margin: 0% auto; height: 100%;" :title="单据详情"
       destroy-on-close>
@@ -333,8 +466,10 @@
               </el-table>
           </div>
     </el-dialog>
-    
+      <!-- 打印订单表预览 -->
+<PrintPage ref="printPageRef" />
   </template>
+
   <script>
   //点击按钮显示下方表格
   export default {
@@ -351,18 +486,23 @@
     }
   };
   </script>
-  <script setup>
-  // 全量引入格式化工具 请按需保留
-  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-  import {ref, reactive} from 'vue'
-  import {getInputDetail,
-  TuihuoReport,
-  OutOrderSearch,outReport,FabricDetail,rApictedit,gitReceiptNumber,FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords} from '@/api/mes/job'
-  import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
-  import dayjs, { Dayjs } from 'dayjs';
-  import { useUserStore } from '@/pinia/modules/user'
-  // import { get } from 'scriptjs';
-  defineOptions({name: 'Company'})
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import {ref, reactive} from 'vue'
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
+import {getInputDetail,
+TuihuoReport,
+OutOrderSearch,outReport,FabricDetail,rApictedit,gitReceiptNumber,FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords,OrderYieldList} from '@/api/mes/job'
+import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
+import dayjs, { Dayjs } from 'dayjs';
+import { useUserStore } from '@/pinia/modules/user';
+import PrintPage from '../yunyin/shengchanguanli/components/print.vue'
+// import { get } from 'scriptjs';
+defineOptions({name: 'Company'})
+//定义打印跳转页面
+  const printPageRef = ref()
   //获取用户登录信息
   const userStore = useUserStore()
   const _username = ref('')
@@ -900,6 +1040,8 @@ const dj_Dialog = () => {
 const recorddialogFormVisible = ref(false)
 const rdetailstableData = reactive([])
 const _danhao = ref('')
+const _renyuan = ref('')
+const _ordernuber = ref('')
 //查看明细
 const record_deleteRow = async (row) => {
   console.log(row)
@@ -912,6 +1054,126 @@ const record_deleteRow = async (row) => {
   rdetailstableData.splice(0,FabricDetaillists.length,...FabricDetaillists.data);
 }
 
+
+const selectedRow = ref('')
+const Recordclicks = async (row) => {
+	selectedRow.value = row;
+  _Gd_gdbh.value = row.订单编号
+  _ordernuber.value = row['订单编号']
+	_danhao.value = row['出库单']
+	_renyuan.value = row['操作机台']
+	console.log(_danhao.value)
+	console.log('选中的行数据:', selectedRow.value);
+}
+
+// 工单完工查询相关
+const currentSelectedRow = ref({})
+const workOrderCompletionDialogVisible = ref(false)
+const workOrderCompletionData = ref([])
+
+// 工单完工查询
+const workOrderCompletionQuery = async () => {
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的数据后,再操作此功能'})
+		return false;
+	}
+  try {
+    // 调用OrderYieldList接口,传入订单编号作为search参数
+    const response = await OrderYieldList({ search: _Gd_gdbh.value})
+    
+    if (response.code === 0) {
+      // 保存查询结果
+      workOrderCompletionData.value = response.data
+      // 显示弹窗
+      workOrderCompletionDialogVisible.value = true
+    } else {
+      ElMessage({ type: 'error', message: '查询失败' })
+    }
+  } catch (error) {
+    console.error('工单完工查询失败:', error)
+    ElMessage({ type: 'error', message: '查询失败' })
+  }
+}
+
+// 日期格式化函数,只显示年月日
+const dateFormatter = (row, column, cellValue) => {
+  if (!cellValue) return ''
+  return dayjs(cellValue).format('YYYY-MM-DD')
+}
+
+// 表格头部样式
+const tableHeaderStyle = {
+  background: '#409EFF',
+  color: '#fff',
+  fontWeight: 'bold',
+  textAlign: 'center'
+}
+
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+//点击工单打印查询按钮
+const cp_gdprintonClick = () => {
+  //打开弹窗
+  order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+  console.log(_Gd_gdbh.value)
+  console.log(printDirection.value)
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+    return false;
+  }else{
+    if(recordtableData.length >=1){
+    printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+    }else{
+    ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+    return false;
+    }
+  }
+}
+const order_viewCloseDialog = () => {
+  order_viewVisible.value = false
+}
+// 打印预览功能
+const printPreviewVisible = ref(false);
+const printPreviewData = ref([]);
+// 打印功能
+const print =  async () => {
+	if(_danhao.value === '' || _danhao.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的退还单后,再操作此功能'})
+		return false;
+	}
+	printPreviewVisible.value = true;
+	const result = await ReceiptDetail({receipt: _danhao.value});
+	console.log(result)
+	printPreviewData.value = result.data;
+	
+}
+// 执行打印
+const printDocument = () => {
+	try {
+		// 创建打印区域的克隆
+		const printContent = document.getElementById('printContent');
+		const printWindow = window.open('', '_blank');
+		// 写入打印内容
+		printWindow.document.write('<html><head><title>退还表</title></head><body>');
+		printWindow.document.write(printContent.innerHTML);
+		printWindow.document.write('</body></html>');
+		printWindow.document.close();
+		
+		// 执行打印
+		printWindow.print();
+		printWindow.close();
+		printPreviewVisible.value = false;
+	} catch (error) {
+		console.error('打印失败:', error);
+		ElMessage({type: 'error', message: '打印失败'});
+	}
+}
 //关闭
 const record_closeDialog = async (row) => {
   console.log(row)
@@ -997,7 +1259,20 @@ const edit_closeDialog = async (row) => {
     details_Selection.value = ids.join(',')
     console.log("复选框",details_Selection.value)
   }
-  
+  //导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  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;
+};
   // // 删除详情按钮
   // const deldetail_delclick = async () => {
   //   try {
@@ -1149,5 +1424,55 @@ const edit_closeDialog = async (row) => {
   padding: 8px 12px !important;
   border-radius: 4px !important;
 }
+
+/* 工单完工查询核心信息区域样式 */
+.core-info-section {
+  background: #f9fafc;
+  border: 1px solid #ebeef5;
+  border-radius: 8px;
+  padding: 15px;
+  margin-bottom: 20px;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
+}
+
+.core-info-section .info-row {
+  display: flex;
+  flex-wrap: wrap;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-row:last-child {
+  margin-bottom: 0;
+}
+
+.core-info-section .info-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-label {
+  font-weight: 600;
+  color: #303133;
+  width: 100px;
+  margin-right: 10px;
+  text-align: right;
+}
+
+.core-info-section .info-value {
+  color: #606266;
+  flex: 1;
+  word-break: break-all;
+  font-size: 14px;
+}
+
+/* 响应式调整 */
+@media screen and (max-width: 768px) {
+  .core-info-section .info-item {
+    width: 100%;
+  }
+}
+
   </style>
   

+ 74 - 2
src/view/material/Bomlog.vue

@@ -4,6 +4,13 @@
 		<el-form-item>
 			<el-input v-model="searchInfo"  placeholder="搜索订单编号" style="width: 180px;" ></el-input>
 			<el-button type="primary" icon="search" @click="onSubmit" title="搜索"  ></el-button>
+      <el-button  type="primary" icon="Calendar" @click="dateFilter">日期筛选</el-button>
+      <el-button  type="primary" icon="Plus" @click="addonclick">新增</el-button>
+      <el-button  type="primary" icon="Edit" @click="updateCompanyFunc">修改</el-button>
+      <el-button  type="primary" icon="Delete" @click="handleDelete">删除</el-button>
+      <el-button  type="primary" icon="MagicStick" @click="aiFixBom">AI分析</el-button>
+      <el-button  type="primary" icon="Document" @click="viewWorkOrderData">查看工单资料</el-button>
+      <el-button  type="primary" icon="Download" @click="exportToExcel">导出Excel</el-button>
 		</el-form-item>
 	</el-form>	  
 
@@ -11,7 +18,7 @@
 	<el-container>
 		<layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" >
 			<div class="JKWTree-tree" style="height: 70vh;" >
-				<h3>BOM资料变更日志管理</h3>
+				<h3>工单BOM资料管理</h3>
 				<el-tree :data="treeData" class="treecolor" highlight-current @node-click="handleNodeClick" />
 			</div>
 		</layout-sider>
@@ -22,7 +29,7 @@
 
           <el-main>
             <el-tabs v-model="activeName" @tab-click="handleClick">
-			  <el-tab-pane label="BOM资料日志" name="first">
+			  <el-tab-pane label="工艺技术资料版本管理" name="first">
 			    <el-table ref="multipleTable"
 			      :row-style="{ height: '30px' }"
 			      :cell-style="{ padding: '0px' }"
@@ -227,6 +234,71 @@ const onSubmit = () => {
 		getfjtable();
 	}
   };
+
+  
+  // 日期筛选相关变量和方法
+const dateFilterDialogVisible = ref(false);
+const dateFilterForm = reactive({
+  startDate: '',
+  endDate: ''
+});
+//点击按钮日期筛选
+const dateFilter = () => {
+  dateFilterDialogVisible.value = true;
+}
+const closeDateFilterDialog = () => {
+  dateFilterDialogVisible.value = false;
+  // 清空日期选择
+  dateFilterForm.startDate = '';
+  dateFilterForm.endDate = '';
+}
+const confirmDateFilter = async () => {
+  if (!dateFilterForm.startDate || !dateFilterForm.endDate) {
+    ElMessage.warning('请选择开始日期和结束日期');
+    return;
+  }
+  // 调用接口根据日期筛选数据
+  const response = await Apibomlistarr({
+    search: searchinfo.value,
+    startDate: dateFilterForm.startDate,
+    endDate: dateFilterForm.endDate,
+    page: 1,
+    limit: 50
+  });
+  if (response.code === 0) {
+    tableData.value = response.data.list;
+    total.value = response.data.total;
+    ElMessage.success('日期筛选成功');
+  }
+  closeDateFilterDialog();
+}
+
+// 删除
+const handleDelete = () => {
+  ElMessage.success('删除成功');
+}
+// AI修正工单BOM信息
+const aiFixBom = () => {
+  ElMessage.success('AI分析中');
+}
+// 查看工单资料
+const viewWorkOrderData = () => {
+  // ElMessage.success('');
+}
+// 导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('Fabricinventory');
+  // 文件名
+  const filename = '工单BOM资料.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;
+}
 </script>
 
 

+ 177 - 72
src/view/material/bomproduct.vue

@@ -2,12 +2,18 @@
     <div style="padding: 0px;margin-left: -30px;">
       <layout>
         <layout-header>
-          <div class="gva-table-box" style="margin-left: 20px;width: 95%;">
             <el-form-item>
-              <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="输入工单编号或产品名称" style="width: 180px;" />
-              <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
+              <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="搜索" style="width: 180px;margin-left: 20px;" />
+              <el-button type="primary" icon="search" @click="onSearch"></el-button>
+              <el-button  type="primary" icon="Calendar" @click="dateFilter">日期筛选</el-button>
+              <el-button  type="primary" icon="Plus" @click="addonclick">新增</el-button>
+              <el-button  type="primary" icon="Edit" @click="updateCompanyFunc">修改</el-button>
+              <el-button  type="primary" icon="Delete" @click="handleDelete">删除</el-button>
+              <el-button  type="primary" icon="MagicStick" @click="aiFixBom">AI修正工单BOM信息</el-button>
+              <el-button  type="primary" icon="Document" @click="viewWorkOrderData">查看工单资料</el-button>
+              <el-button  type="primary" icon="Download" @click="exportToExcel">导出Excel</el-button>
+
             </el-form-item>
-          </div>
         </layout-header>
   
   
@@ -15,12 +21,78 @@
           <layout-content>
           <el-main>
             <div class="gva-table-box">
+            
+            <!-- 日期筛选弹窗 -->
+            <el-dialog v-model="dateFilterDialogVisible" :before-close="closeDateFilterDialog"
+              title="日期筛选" width="400px">
+              <el-form label-width="80px">
+                <el-form-item label="开始日期">
+                  <el-date-picker
+                    v-model="dateFilterForm.startDate"
+                    type="date"
+                    placeholder="选择开始日期"
+                    style="width: 100%"
+                  />
+                </el-form-item>
+                <el-form-item label="结束日期">
+                  <el-date-picker
+                    v-model="dateFilterForm.endDate"
+                    type="date"
+                    placeholder="选择结束日期"
+                    style="width: 100%"
+                  />
+                </el-form-item>
+              </el-form>
+              <template #footer>
+                <div class="dialog-footer">
+                  <el-button @click="closeDateFilterDialog">取消</el-button>
+                  <el-button type="primary" @click="confirmDateFilter">确定</el-button>
+                </div>
+              </template>
+            </el-dialog>
+            
+            <el-dialog v-model="viewDataDialogVisible" :before-close="closeViewDataDialog"
+              title="" width="600px">
+              <el-form label-width="120px">
+                <el-form-item label="订单编号">
+                  <el-input v-model="viewDataForm.订单编号" readonly />
+                </el-form-item>
+                <el-form-item label="生产款号">
+                  <el-input v-model="viewDataForm.生产款号" readonly />
+                </el-form-item>
+                <el-form-item label="客户编号">
+                  <el-input v-model="viewDataForm.客户编号" readonly />
+                </el-form-item>
+                <el-form-item label="款式">
+                  <el-input v-model="viewDataForm.款式" readonly />
+                </el-form-item>
+                <el-form-item label="物料分类">
+                  <el-input v-model="viewDataForm.物料分类" readonly />
+                </el-form-item>
+                <el-form-item label="物料名称">
+                  <el-input v-model="viewDataForm.物料名称" readonly />
+                </el-form-item>
+                <el-form-item label="颜色">
+                  <el-input v-model="viewDataForm.颜色" readonly />
+                </el-form-item>
+                <el-form-item label="物料编码">
+                  <el-input v-model="viewDataForm.物料编码" readonly />
+                </el-form-item>
+              </el-form>
+              <template #footer>
+                <div class="dialog-footer">
+                  <el-button @click="closeViewDataDialog">关闭</el-button>
+                </div>
+              </template>
+            </el-dialog>
+
+
               <!-- 表格数据 -->
               <el-table ref="multipleTable" style="width: 100%;height: 72vh" tooltip-effect="dark"
                         :row-style="{ height: '30px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                         :data="tableData"  border row-key="ID"
-                        size="small"
+                        size="small" id="Fabricinventory"
                         highlight-current-row="true" @row-dblclick="updateCompanyFunc"
                         @row-click="tableRowClick" :show-overflow-tooltip="true"
                         @selection-change="handleSelectionChange">
@@ -30,8 +102,8 @@
                <el-table-column   align="left" label="款式" prop="款式"  width="160" />
                <el-table-column   align="left" label="物料分类" prop="物料分类"  width="73" />
                <el-table-column   align="left" label="物料名称" prop="物料名称"  width="160" />
-			   <el-table-column   align="left" label="颜色" prop="颜色"  width="90" />
-			   <el-table-column   align="left" label="物料编码" prop="物料编码"  width="200" />
+              <el-table-column   align="left" label="颜色" prop="颜色"  width="90" />
+              <el-table-column   align="left" label="物料编码" prop="物料编码"  width="200" />
                <el-table-column   align="left" label="计划用料" prop="计划用料"  width="80" />
                <el-table-column   align="left" label="计划门幅" prop="计划门幅"  width="73" />
                <el-table-column   align="left" label="定额用料" prop="定额用料"  width="73" />
@@ -42,8 +114,8 @@
                <el-table-column   align="left" label="退还数量" prop="退还数量"  width="73" />
                <el-table-column   align="left" label="投料单位" prop="投料单位"  width="73" />
                <el-table-column   align="left" label="备注" prop="备注"  width="300" />
-               <el-table-column   align="left" label="建档人员" prop="Sys_ID"  width="160" />
-               <el-table-column   align="left" label="建档日期" prop="Sys_rq"  width="160" />
+               <el-table-column   align="left" label="操作人员" prop="Sys_ID"  width="150" />
+               <el-table-column   align="left" label="操作日期" prop="Sys_rq"  width="160" />
 
 
                 <!-- <el-table-column fixed="right" label="操作" width="200">
@@ -74,38 +146,6 @@
 					</div>
             </div>
 			
-            <el-dialog v-model="add_QuestiondialogFormVisible" :before-close="add_QuestioncloseDialog"
-            style="width: 40%; max-height: 80%; overflow-y: auto; margin-top: 4%;"
-            :title="'新增问题信息'" destroy-on-close>
-			
-            <el-form label-width="100px" :model="add_Questionformdata">
-              <el-row :gutter="24" class="form-row">
-                <el-col :span="20">
-                  <el-form-item label="问题类型" class="mab" prop="keyOrder" id ='MAC地址' label-width='110'>
-                    <el-input v-model="add_Questionformdata.问题类型"/>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="归属" class="mab" prop="keyOrder" id ='MAC地址' label-width='110'>
-                  <el-radio-group v-model="add_Questionformdata.归属" >
-                    <el-radio label="次片" border >次片</el-radio>
-                    <el-radio label="返工" border >返工</el-radio>
-                  </el-radio-group>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-        
-        
-            </el-form>
-        
-            <template #footer>
-              <div class="dialog-footer" style="display: flex; justify-content: flex-end; padding: 10px;">
-                <el-button type="primary" @click="add_QuestioncloseDialog">取消</el-button>
-                <el-button type="primary" @click="add_QuestionenterDialog">确定</el-button>
-              </div>
-            </template>
-            
-          </el-dialog>
             
           </el-main>
         </layout-content>
@@ -155,6 +195,93 @@ const onSearch = async () => { // 搜索按钮触发的事件处理函数,根
       total.value = response.data.total;
     }
 }
+
+// 日期筛选相关变量和方法
+const dateFilterDialogVisible = ref(false);
+const dateFilterForm = reactive({
+  startDate: '',
+  endDate: ''
+});
+//点击按钮日期筛选
+const dateFilter = () => {
+  dateFilterDialogVisible.value = true;
+}
+const closeDateFilterDialog = () => {
+  dateFilterDialogVisible.value = false;
+  // 清空日期选择
+  dateFilterForm.startDate = '';
+  dateFilterForm.endDate = '';
+}
+const confirmDateFilter = async () => {
+  if (!dateFilterForm.startDate || !dateFilterForm.endDate) {
+    ElMessage.warning('请选择开始日期和结束日期');
+    return;
+  }
+  // 调用接口根据日期筛选数据
+  const response = await Apibomlistarr({
+    search: searchinfo.value,
+    startDate: dateFilterForm.startDate,
+    endDate: dateFilterForm.endDate,
+    page: 1,
+    limit: 50
+  });
+  if (response.code === 0) {
+    tableData.value = response.data.list;
+    total.value = response.data.total;
+    ElMessage.success('日期筛选成功');
+  }
+  closeDateFilterDialog();
+}
+
+// 删除
+const handleDelete = () => {
+  ElMessage.success('删除成功');
+}
+// AI修正工单BOM信息
+const aiFixBom = () => {
+  ElMessage.success('AI修正工单BOM信息修正中');
+}
+// 查看工单资料
+const viewWorkOrderData = () => {
+  // ElMessage.success('');
+}
+// 导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('Fabricinventory');
+  // 文件名
+  const filename = 'BOM数据.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;
+}
+
+
+const viewDataDialogVisible = ref(false);
+const viewDataForm = reactive({});
+//点击修改按钮
+const updateCompanyFunc = (row) => {
+  if (row) {
+    // 复制行数据到查看表单
+    Object.assign(viewDataForm, row);
+    viewDataDialogVisible.value = true;
+  } else {
+    ElMessage.warning('请先选择一行数据');
+  }
+}
+
+const closeViewDataDialog = () => {
+  viewDataDialogVisible.value = false;
+  // 清空表单数据
+  Object.keys(viewDataForm).forEach(key => {
+    viewDataForm[key] = '';
+  });
+}
+
 //回车搜索
 const keydown_onSearch = async (event) => {
 	if(event.keyCode === 13){
@@ -176,41 +303,15 @@ const keydown_onSearch = async (event) => {
   }
   _gettabledata();
 
-  const add_QuestiondialogFormVisible = ref(false)
-  const add_Questionformdata = reactive({
-  问题类型: '',
-  归属: '',
-});
-
-  // 新增
-  const addonclick = () => {
-    add_QuestiondialogFormVisible.value = true;
-  }
 
+  // 新增功能暂时移除,因为相关变量已被删除
   const add_QuestionenterDialog =  async  () => {
-	//必填
-	if(add_Questionformdata['问题类型'] === ''||add_Questionformdata['归属'] === ''){
-		ElMessage({type: 'warning',message: '请将信息填写完整'})
-		return false;
-	}
-
-    const add_Questionparams = {
-      问题类型: add_Questionformdata.问题类型,
-      classification: add_Questionformdata.归属,
-      sys_id: userStore.userInfo.nickName,
-    }
-    console.log(add_Questionparams)
-	const res = await addProblemCategory(add_Questionparams)
-	if (res.code === 0) {
-		ElMessage.success('新增成功')
-		add_QuestioncloseDialog()
-		_gettabledata()
-	}
-}  
+    ElMessage.info('新增功能暂未实现');
+  }
 
-  //新增颜色资料取消
+  // 新增颜色资料取消
   const add_QuestioncloseDialog = () => {
-    add_QuestiondialogFormVisible.value = false
+    ElMessage.info('关闭功能暂未实现');
 }
   
 
@@ -270,6 +371,10 @@ const keydown_onSearch = async (event) => {
 
 
 
+
+
+
+
   
 
   

+ 107 - 4
src/view/material/technological.vue

@@ -4,22 +4,57 @@
 		<el-form-item>
 			<el-input v-model="searchInfo"  placeholder="搜索订单编号" style="width: 180px;" ></el-input>
 			<el-button type="primary" icon="search" @click="onSubmit" title="搜索"  ></el-button>
+			<el-button  type="primary" icon="Calendar" @click="dateFilter">日期筛选</el-button>
+              <el-button  type="primary" icon="Plus" @click="addonclick">新增</el-button>
+              <el-button  type="primary" icon="Edit" @click="updateCompanyFunc">修改</el-button>
+              <el-button  type="primary" icon="Delete" @click="handleDelete">删除</el-button>
+              <el-button  type="primary" icon="MagicStick" @click="aiFixBom">AI分析</el-button>
+              <el-button  type="primary" icon="Document" @click="viewWorkOrderData">查看工单资料</el-button>
+              <el-button  type="primary" icon="Download" @click="exportToExcel">导出Excel</el-button>
 		</el-form-item>
 	</el-form>	  
 
-					<!-- 左侧树状图区域 -->
 	<el-container>
 		<layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" >
 			<div class="JKWTree-tree" style="height: 70vh;" >
-				<h3>附件版本变更日志管理</h3>
+				<h3>工艺技术资料版本管理</h3>
 				<el-tree :data="treeData" class="treecolor" highlight-current @node-click="handleNodeClick" />
 			</div>
 		</layout-sider>
 	<el-container>
+
+		 <!-- 日期筛选弹窗 -->
+            <el-dialog v-model="dateFilterDialogVisible" :before-close="closeDateFilterDialog"
+              title="日期筛选" width="400px">
+              <el-form label-width="80px">
+                <el-form-item label="开始日期">
+                  <el-date-picker
+                    v-model="dateFilterForm.startDate"
+                    type="date"
+                    placeholder="选择开始日期"
+                    style="width: 100%"
+                  />
+                </el-form-item>
+                <el-form-item label="结束日期">
+                  <el-date-picker
+                    v-model="dateFilterForm.endDate"
+                    type="date"
+                    placeholder="选择结束日期"
+                    style="width: 100%"
+                  />
+                </el-form-item>
+              </el-form>
+              <template #footer>
+                <div class="dialog-footer">
+                  <el-button @click="closeDateFilterDialog">取消</el-button>
+                  <el-button type="primary" @click="confirmDateFilter">确定</el-button>
+                </div>
+              </template>
+            </el-dialog>
+            
+        
 			
-<!-- 右侧内容区域 -->
 <layout-content >
-
           <el-main>
             <el-tabs v-model="activeName" @tab-click="handleClick">
 			  <el-tab-pane label="技术附件" name="first">
@@ -32,6 +67,7 @@
 			      :cell-class-name="planUsageCellClass"
 			      highlight-current-row="true"
 			      @row-dblclick="ExcelShow"
+				  id="Fabricinventory"
 			      style="width: 100%;height: 72vh"
 			      border tooltip-effect="dark"
 			      :data="jstableData"
@@ -242,6 +278,9 @@ const showPdf = async (row) => {
 
 const searchInfo = ref('')
 const serachlist = async () => {
+	 jstableData.splice(0, jstableData.length);
+	 ddtableData.splice(0, jstableData.length);
+	
 	const jssearchlist = await OrderAttachments({order:searchInfo.value,page:page.value,limit:pageSize.value,desc:'技术附件'})
 	const ddsearchlist = await OrderAttachments({order:searchInfo.value,page:page.value,limit:pageSize.value,desc:'订单资料附件'})
     if (jssearchlist.code === 0 && ddsearchlist.code === 0) {
@@ -265,6 +304,70 @@ const onSubmit = () => {
 	pageSize.value = val;
 	getfjtable();
   };
+
+  // 日期筛选相关变量和方法
+const dateFilterDialogVisible = ref(false);
+const dateFilterForm = reactive({
+  startDate: '',
+  endDate: ''
+});
+//点击按钮日期筛选
+const dateFilter = () => {
+  dateFilterDialogVisible.value = true;
+}
+const closeDateFilterDialog = () => {
+  dateFilterDialogVisible.value = false;
+  // 清空日期选择
+  dateFilterForm.startDate = '';
+  dateFilterForm.endDate = '';
+}
+const confirmDateFilter = async () => {
+  if (!dateFilterForm.startDate || !dateFilterForm.endDate) {
+    ElMessage.warning('请选择开始日期和结束日期');
+    return;
+  }
+  // 调用接口根据日期筛选数据
+  const response = await Apibomlistarr({
+    search: searchinfo.value,
+    startDate: dateFilterForm.startDate,
+    endDate: dateFilterForm.endDate,
+    page: 1,
+    limit: 50
+  });
+  if (response.code === 0) {
+    tableData.value = response.data.list;
+    total.value = response.data.total;
+    ElMessage.success('日期筛选成功');
+  }
+  closeDateFilterDialog();
+}
+
+// 删除
+const handleDelete = () => {
+  ElMessage.success('删除成功');
+}
+// AI修正工单BOM信息
+const aiFixBom = () => {
+  ElMessage.success('AI分析中');
+}
+// 查看工单资料
+const viewWorkOrderData = () => {
+  // ElMessage.success('');
+}
+// 导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('Fabricinventory');
+  // 文件名
+  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;
+}
 </script>
 
 

+ 277 - 139
src/view/performance/MachineElectricity.vue

@@ -1,38 +1,28 @@
 <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="mxToExcel" >导出到Excel(明细)</el-button> -->
-                <el-button type="primary" class="bt" icon="download" @click="dlToExcel" >月度电量导出</el-button>
-              </el-form-item>
-            </el-form>
-  
-        
-  
-          </div>
-        </layout-header>
-  
+        <el-row :gutter="24" style="margin-bottom: 6px; margin-left: 0; padding-left: 0; justify-content: flex-start;">
+          <el-button type="primary" class="bt" icon="download" @click="dlToExcel" style="height: 40px; margin-left: 0;">月度电量导出</el-button>
+          <el-button type="primary" class="bt" icon="download" @click="dlToExcel" style="height: 40px; margin-left: 10px;">日度电量导出</el-button>
+          <el-button type="primary" class="bt" icon="download" @click="" style="height: 40px; margin-left: 10px;">按班组导出</el-button>
+          <el-button type="primary" class="bt" icon="MagicStick" @click="aiFixBom" style="height: 40px; margin-left: 10px;">按工单AI分析</el-button>
+        </el-row>
+      </layout>
+
         <layout>
-          <!--    左侧树侧形结构-->
-          <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
+          <layout-sider :resize-directions="['right']" :width="270" style="margin-right: 10px;">
             <div class="JKWTree-tree" style="height: 200px">
-              <h3>月份</h3>
+              <h3>设备电量管理</h3>
               <el-tree :data="treeData"  :props="defaultProps" class="treecolor" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
               </el-tree>
             </div>
           </layout-sider>
   
-          <!-- 右侧区域 -->
           <layout-content >
-          <el-main>
+            <!-- 电量走势曲线图 -->
+            <div id="electricityChart" style="width: 100%; height: 300px; margin-bottom: 20px;"></div>
             <div class="gva-table-box">
-              <!-- 表格数据 -->
-              <el-table ref="multipleTable" style="width: 100%;height: 78vh" tooltip-effect="dark"
+              <el-table ref="multipleTable" style="width: 100%;height: 42vh" 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"
@@ -41,130 +31,130 @@
                         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="电表ID" prop="电表ID"  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-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="200" />
-               <el-table-column   align="center" label="结束时间" prop="结束时间"  width="200" />
+               <el-table-column  sortable align="left" label="日期" prop="日期"  width="100" />
+               <el-table-column   align="left" label="电表ID" prop="电表ID"  width="120" />
+               <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" />
+               <el-table-column   align="left" label="开始时间" prop="开始时间"  width="160" />
+               <el-table-column   align="left" label="结束时间" prop="结束时间"  width="160" />
               </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>
-            
-
-<!-- 
-            <div class="gva-table-box">
-              <el-table ref="multipleTable" style="width: 100%;height: 45vh" 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"
-                        :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="120" />
-               <el-table-column  sortable align="center" label="主电表" prop="主电表"  width="200" />
-               <el-table-column  sortable align="center" label="辅电表" prop="辅电表"  width="100" />
-              </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> -->
 
             <el-dialog v-model="ondlexcel"  title="月度电量导出" destroy-on-close style="height: 30%;width: 20%;">
-  <el-form-item label="选择年月" label-width="100px">
-    <el-date-picker
-			    v-model="dlrq"
-			    type="month"
-			    placeholder="选择年月"
-			    :default-value="new Date()"
-          @change="dlonchange_data"
-			    style="width: 200px;" 
-			  />
-  </el-form-item>
-
-        <template #footer>
-		    <div class="dialog-footer" style="text-align: right;">
-		      <el-button @click="dlcloseDialog">取消</el-button>
-		      <el-button type="primary" @click="dlonDialog">确定</el-button>
-		    </div>
-		  </template>
+              <el-form-item label="选择年月" label-width="100px">
+                <el-date-picker
+                v-model="dlrq"
+                type="month"
+                placeholder="选择年月"
+                :default-value="new Date()"
+                @change="dlonchange_data"
+                style="width: 200px;"/>
+              </el-form-item>
+              <template #footer>
+                <div class="dialog-footer" style="text-align: right;">
+                  <el-button @click="dlcloseDialog">取消</el-button>
+                  <el-button type="primary" @click="dlonDialog">确定</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 * as XLSX from 'xlsx'
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import {ref, reactive, onMounted, watch} from 'vue'
+import * as echarts from 'echarts'
+import * as XLSX from 'xlsx'
 import FileSaver from 'file-saver'
-  import { exportExcelFile } from '@/utils/excel'
-  import {ElMessage} from "element-plus";
-  import { Meter,StatisticEleDay,Excel_StatisticEle} from '@/api/mes/job'
-  defineOptions({name: 'Company'})
+import { exportExcelFile } from '@/utils/excel'
+import {ElMessage} from "element-plus";
+import { Meter,StatisticEleDay,Excel_StatisticEle} from '@/api/mes/job'
+defineOptions({name: 'Company'})
 
-  const today = new Date();
+const today = new Date();
 const year = today.getFullYear();
 const month = String(today.getMonth() + 1).padStart(2, '0');
 
 // =========== 获取左侧树形结构 ===========
 const treeData = ref([])
-// 获取树形数据
 const getTree = async () => {
   try {
-    // 调用API获取数据
     const response = await Meter() 
     const data = response.data 
-    
     // 转换数据为el-tree需要的格式
     if (data && data.length > 0) {
-      // 生成从当前月份到一月的所有月份
-      const months = [];
+      // 获取当前年份和月份
       const currentYear = today.getFullYear();
       const currentMonth = today.getMonth() + 1; // 1-12
-      
-      for (let i = currentMonth; i >= 1; i--) {
-        months.push({
-          year: currentYear,
-          month: i,
-          label: `${currentYear}年${i}月`
-        });
+      // 从10月份开始显示到当前月份
+      const months = [];
+      const startMonth = 10;
+      // 如果当前月份大于等于10月,则只显示今年的10月到当前月
+      // 否则,显示去年的10月到12月,以及今年的1月到当前月
+      if (currentMonth >= startMonth) {
+        for (let i = currentMonth; i >= startMonth; i--) {
+          months.push({
+            year: currentYear,
+            month: i
+          });
+        }
+      } else {
+        // 显示去年的10月到12月
+        for (let i = 12; i >= startMonth; i--) {
+          months.push({
+            year: currentYear - 1,
+            month: i
+          });
+        }
+        // 显示今年的1月到当前月
+        for (let i = currentMonth; i >= 1; i--) {
+          months.push({
+            year: currentYear,
+            month: i
+          });
+        }
       }
       
-      // 为每个月创建树节点
-      treeData.value = months.map(monthItem => {
-        const formattedMonth = String(monthItem.month).padStart(2, '0');
-        const rqValue = `${monthItem.year}${formattedMonth}`;
-        return {
-          label: monthItem.label,
-          children: data.map(item => {
+      // 按年份分组
+      const yearGroups = {};
+      months.forEach(monthItem => {
+        if (!yearGroups[monthItem.year]) {
+          yearGroups[monthItem.year] = [];
+        }
+        yearGroups[monthItem.year].push(monthItem);
+      });
+      
+      // 生成树形数据
+      treeData.value = Object.keys(yearGroups).map(year => {
+        const yearNode = {
+          label: `${year}年`,
+          children: yearGroups[year].map(monthItem => {
+            const formattedMonth = String(monthItem.month).padStart(2, '0');
+            const rqValue = `${monthItem.year}${formattedMonth}`;
             return {
-              label: item.collectorid + '【' + item.description + '】',
-              mid: item.mid,
-              rq: rqValue
+              label: `${monthItem.month}月`,
+              children: data.map(item => {
+                return {
+                  label: item.collectorid + '【' + item.description + '】',
+                  mid: item.mid,
+                  rq: rqValue
+                }
+              })
             }
           })
-        }
+        };
+        return yearNode;
       });
     } else {
       treeData.value = []
@@ -174,12 +164,179 @@ const getTree = async () => {
     console.error('获取树形数据失败:', error)
   }
 }
-
-// 调用函数获取数据
 getTree()
 
   
 const hztableData = ref([])
+// 电量走势图表相关
+const chartDom = ref(null)
+const chartInstance = ref(null)
+// 初始化图表
+const initChart = () => {
+  chartDom.value = document.getElementById('electricityChart')
+  if (!chartDom.value) return
+  chartInstance.value = echarts.init(chartDom.value)
+  const option = {
+    title: {
+      text: '电量走势曲线图',
+      left: 'center'
+    },
+    tooltip: {
+      trigger: 'axis',
+      formatter: function(params) {
+        let result = params[0].name + '<br/>'
+        params.forEach(item => {
+          result += item.marker + item.seriesName + ': ' + item.value + '<br/>'
+        })
+        return result
+      }
+    },
+    legend: {
+      data: ['尖电量', '峰电量', '平电量', '谷电量', '当日总电量'],
+      top: 30
+    },
+    grid: {
+      left: '2%',
+      right: '20%',
+      bottom: '3%',
+      containLabel: true
+    },
+    xAxis: {
+      type: 'category',
+      boundaryGap: false,
+      data: [],
+      axisLabel: {
+        rotate: 0, // 旋转45度
+        interval: 0, // 显示所有标签
+        overflow: 'truncate', // 溢出时截断
+        formatter: function(value) {
+          // 格式化日期显示,只显示月日
+          return value.slice(4) // 假设日期格式为YYYYMMDD,显示MMDD
+        }
+      },
+      axisTick: {
+        alignWithLabel: true
+      }
+    },
+    yAxis: {
+      type: 'value',
+      name: '电量 (kWh)'
+    },
+    series: [
+      {
+        name: '尖电量',
+        type: 'line',
+        data: [],
+        smooth: true
+      },
+      {
+        name: '峰电量',
+        type: 'line',
+        data: [],
+        smooth: true
+      },
+      {
+        name: '平电量',
+        type: 'line',
+        data: [],
+        smooth: true
+      },
+      {
+        name: '谷电量',
+        type: 'line',
+        data: [],
+        smooth: true
+      },
+      {
+        name: '当日总电量',
+        type: 'line',
+        data: [],
+        smooth: true,
+        lineStyle: {
+          width: 4
+        },
+        itemStyle: {
+          color: '#007bff',
+          borderWidth: 3
+        },
+        symbol: 'circle',
+        symbolSize: 6,
+        emphasis: {
+          focus: 'series',
+          itemStyle: {
+            borderWidth: 6
+          }
+        }
+      }
+    ]
+  }
+  chartInstance.value.setOption(option)
+}
+
+// 更新图表数据
+const updateChartData = () => {
+  if (!chartInstance.value || !hztableData.value || hztableData.value.length === 0) return
+  // 按日期升序排序,确保最新日期在最右侧
+  const sortedData = [...hztableData.value].sort((a, b) => {
+    // 直接比较日期字符串转换的数字,假设日期格式为YYYY/MM/DD
+    const numA = parseInt(a.日期.replace(/\//g, ''))
+    const numB = parseInt(b.日期.replace(/\//g, ''))
+    return numA - numB
+  })
+  
+  const recent30DaysData = sortedData.slice(-30)
+  // 调试:输出排序后的日期顺序
+  console.log('排序后的日期顺序:', recent30DaysData.map(item => item.日期))
+  const dates = recent30DaysData.map(item => item.日期)
+  const jd = recent30DaysData.map(item => Number(item.尖电量))
+  const fd = recent30DaysData.map(item => Number(item.峰电量))
+  const pd = recent30DaysData.map(item => Number(item.平电量))
+  const gd = recent30DaysData.map(item => Number(item.谷电量))
+  const total = recent30DaysData.map(item => Number(item.总电量))
+  chartInstance.value.setOption({
+    xAxis: {
+      data: dates
+    },
+    series: [
+      {
+        name: '尖电量',
+        data: jd
+      },
+      {
+        name: '峰电量',
+        data: fd
+      },
+      {
+        name: '平电量',
+        data: pd
+      },
+      {
+        name: '谷电量',
+        data: gd
+      },
+      {
+        name: '当日总电量',
+        data: total
+      }
+    ]
+  })
+}
+
+// 监听数据变化,更新图表
+watch(hztableData, (newVal) => {
+  if (newVal && newVal.length > 0) {
+    updateChartData()
+  }
+}, { deep: true })
+// 窗口大小变化时调整图表大小
+onMounted(() => {
+  initChart()
+  window.addEventListener('resize', () => {
+    if (chartInstance.value) {
+      chartInstance.value.resize()
+    }
+  })
+})
 
 const handleNodeClick = async (node) => {
   // 取消所有节点的颜色
@@ -201,12 +358,10 @@ const handleNodeClick = async (node) => {
     hztableData.value = res.data
   }
   }
-
 }
-
   
 // 通用的导出Excel函数
-const exportToExcel = (data, filename = '导出数据.xlsx', sheetName = 'Sheet1') => {
+const exportToExcel = (data, filename = '电表数据.xlsx', sheetName = 'Sheet1') => {
   try {
     // 创建工作簿和工作表
     const wb = XLSX.utils.book_new();
@@ -302,15 +457,9 @@ const dlonDialog = async() => {
     ElMessage.error(res.msg || '获取数据失败');
   }
 }
-  
-
-  
-
-  
-  
-  
-  
-  
+const aiFixBom = () => {
+  ElMessage.success('AI分析中');
+}
   </script>
   
   <style scoped>
@@ -318,17 +467,14 @@ const dlonDialog = async() => {
     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;
   }
@@ -336,8 +482,6 @@ const dlonDialog = async() => {
     color: blue !important;
     font-weight: bold;
   }
-  
-
   /* 媒体查询,根据需要调整断点 */
   @media screen and (max-width: 768px) {
     .form-column {
@@ -345,9 +489,6 @@ const dlonDialog = async() => {
       margin-right: 0;
     }
   }
-  /*:deep(.el-table td .cell) {*/
-  /*  line-height: 30px !important;*/
-  /*}*/
   .JKWTree-container {
     display: flex;
   }
@@ -365,8 +506,6 @@ const dlonDialog = async() => {
   .JKWTree-content {
     flex: 1;
   }
-
-  
   /* 选中某行时的背景色 */
   :deep(.el-table__body tr.current-row) > td {
     background: #ff80ff !important;
@@ -384,7 +523,6 @@ const dlonDialog = async() => {
     margin-right: 10px !important;
   }
   .bt{
-    margin-left: 2px !important;
     padding: 3px !important;
     font-size: 12px;
   }

+ 117 - 41
src/view/performance/OrderElectricity.vue

@@ -6,6 +6,13 @@
             <!--          按钮部分-->
             <el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" >
               <el-form-item>
+                <el-input v-model="searchOrder" placeholder="搜索" clearable style="width: 200px;height: 40px;margin: 5px"></el-input>
+                <el-button type="primary" class="bt" icon="Search" @click="handleOrderSearch" style="height: 40px; margin-left: 0;">搜索</el-button>
+                <el-button type="primary" class="bt" icon="download" @click="dlToExcel" style="height: 40px; margin-left: 10px;">月度电量导出</el-button>
+          <el-button type="primary" class="bt" icon="download" @click="dlToExcel" style="height: 40px; margin-left: 10px;">日度电量导出</el-button>
+          <el-button type="primary" class="bt" icon="download" @click="" style="height: 40px; margin-left: 10px;">按班组导出</el-button>
+          <el-button type="primary" class="bt" icon="MagicStick" @click="aiFixBom" style="height: 40px; margin-left: 10px;">按工单AI分析</el-button>
+       
                 <!-- <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
                 <el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button> -->
                 <!-- <el-button type="primary" class="bt" icon="download" @click="dlToExcel" >月度电量导出</el-button> -->
@@ -21,6 +28,7 @@
           <!--    左侧树侧形结构-->
           <layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;">
             <div class="JKWTree-tree" style="height: 200px">
+				<h3>订单电量管理</h3>
               <el-tree :data="treeData"  :props="defaultProps" class="treecolor" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
               </el-tree>
             </div>
@@ -39,12 +47,11 @@
                         :cell-class-name="gxbgCellClass"
                         highlight-current-row="true" :show-overflow-tooltip="true"
                         @row-click="handleRowClick">
-               <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-column   align="center" label="订单时间段" prop="订单时间段"  width="340" />
-			   <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="260" />
+                      <el-table-column   align="center" label="累计总用电量" prop="累计总用电量"  width="110" />
+                      <el-table-column   align="center" label="生产时间段" prop="生产时间段"  width="330" />
               </el-table>
               <!-- 分页 -->
               <div class="gva-pagination">
@@ -63,12 +70,14 @@
                         size="small"
                         :cell-class-name="gxbgCellClass"
                         highlight-current-row="true" :show-overflow-tooltip="true">
-               <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="200" />
-			   <el-table-column  sortable align="center" label="电量" prop="电量"  width="100" />
-			   <el-table-column  sortable align="center" label="订单时间段" prop="电表时间段"  width="340" />
-			   <el-table-column  sortable 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="采集器ID"  width="130" />
+			   <el-table-column   align="center" label="完工数量" prop="产量"  width="100" />
+			   <el-table-column   align="center" label="累计用电量" prop="累计用电量"  width="120" />
+			   <el-table-column   align="center" label="生产时间段" prop="生产时间段"  width="330" />
+
+
               </el-table>
   
               <div class="gva-pagination">
@@ -111,7 +120,7 @@ import * as XLSX from 'xlsx'
 import FileSaver from 'file-saver'
 import { exportExcelFile } from '@/utils/excel'
 import {ElMessage} from "element-plus";
-import { Meter,StatisticEleDay,Excel_StatisticEle,OrderElectricitySummary,OrderElectricityDetail} from '@/api/mes/job'
+import { Meter,CustomerMenu,OrderElectricitySummary,OrderElectricityDetail} from '@/api/mes/job'
 defineOptions({name: 'Company'})
 
   const today = new Date();
@@ -125,23 +134,30 @@ const currentNode = ref(null)
 // 获取树形数据
 const getTree = async () => {
   try {
-    // 调用API获取数据
-    const response = await Meter() 
+    // 调用API获取数据,从Meter更换为CustomerMenu
+    const response = await CustomerMenu() 
     const data = response.data 
     
-    // 转换数据为el-tree需要的格式,直接使用电表数据,不按年月分组
-    if (data && data.length > 0) {
-      // 获取当前年月作为默认rq值
-      const currentYear = today.getFullYear();
-      const currentMonth = String(today.getMonth() + 1).padStart(2, '0');
-      const defaultRqValue = `${currentYear}${currentMonth}`;
-      
-      // 直接使用电表数据作为树节点
-      treeData.value = data.map(item => ({
-        label: item.collectorid + '【' + item.description + '】',
-        mid: item.mid,
-        rq: defaultRqValue
-      }));
+    // 转换数据为el-tree需要的格式,按照年份-月份-客户的树形结构
+    if (data) {
+      // 对年份进行降序排序,使最新的年份在最上面
+      treeData.value = Object.entries(data)
+        .sort(([yearA], [yearB]) => parseInt(yearB) - parseInt(yearA))
+        .map(([year, months]) => ({
+          label: year + '年',
+          // 对月份进行降序排序,使最新的月份在最上面
+          children: Object.entries(months)
+            .sort(([monthA], [monthB]) => monthB.localeCompare(monthA))
+            .map(([month, customers]) => ({
+              label: month, // 显示完整的月份格式,如"202501"
+              rq: month, // 存储月份作为查询参数
+              children: customers.map(customer => ({
+                label: customer,
+                mid: customer, // 使用客户代码作为mid
+                rq: month // 存储月份作为查询参数
+              }))
+            }))
+        }));
     } else {
       treeData.value = []
     }
@@ -159,6 +175,47 @@ const hztableData = ref([])
 
 const mxtableData = ref([])
 
+// 搜索相关
+const searchOrder = ref('')
+
+// 处理工单搜索
+const handleOrderSearch = async () => {
+  if (!searchOrder.value) {
+    ElMessage.warning('请输入要搜索的工单编号')
+    return
+  }
+  
+  try {
+    // 调用OrderElectricitySummary接口,传递order参数
+    const summaryRes = await OrderElectricitySummary({ order: searchOrder.value })
+    console.log('搜索结果数据:', summaryRes)
+    
+    if (summaryRes.code === 0 && summaryRes.data) {
+      // 更新汇总表格数据
+      hztableData.value = summaryRes.data
+      
+      // 如果有数据,自动加载第一个订单的明细数据
+      if (summaryRes.data.length > 0) {
+        const firstOrder = summaryRes.data[0]
+        const detailRes = await OrderElectricityDetail({ order: firstOrder['订单编号'] })
+        console.log('自动获取的明细数据:', detailRes)
+        if (detailRes.code === 0 && detailRes.data && detailRes.data.list) {
+          mxtableData.value = detailRes.data.list
+        }
+      } else {
+        // 清空明细表格
+        mxtableData.value = []
+        ElMessage.info('未找到匹配的工单数据')
+      }
+    } else {
+      ElMessage.error('搜索失败,请稍后重试')
+    }
+  } catch (error) {
+    ElMessage.error('搜索请求失败')
+    console.error('搜索失败:', error)
+  }
+}
+
 const handleNodeClick = async (node) => {
   // 存储当前选中的节点信息
   currentNode.value = node;
@@ -196,15 +253,36 @@ const handleNodeClick = async (node) => {
     
     console.log('格式化后的sczl_bh:', sczl_bh);
     
-    // 使用正确的参数调用接口
-    const params = {
-      mid: node.mid,
-      sczl_bh: sczl_bh
-    };
-    // 调用汇总数据接口
-    const summaryRes = await OrderElectricitySummary(params);
-    console.log('汇总数据:', summaryRes);
-    hztableData.value = summaryRes.data;
+    // 根据点击的节点类型决定传递的参数
+    let params = {};
+    
+    // 检查是否是客户节点(叶子节点)
+    if (node.children === undefined && node.mid) {
+      // 点击客户编号节点时,传递khbh和riqi参数
+      params = {
+        khbh: node.mid, // 客户编号
+        riqi: node.rq // 日期(来自节点的rq属性)
+      };
+      console.log('点击客户节点,参数:', params);
+    } 
+    // 检查是否是日期年月节点
+    else if (node.rq) {
+      // 点击日期年月节点时,只传递riqi参数
+      params = {
+        riqi: node.rq // 日期
+      };
+      console.log('点击日期节点,参数:', params);
+    }
+    
+    // 只有在有有效参数时才调用接口
+    if (Object.keys(params).length > 0) {
+      // 调用汇总数据接口
+      const summaryRes = await OrderElectricitySummary(params);
+      console.log('汇总数据:', summaryRes);
+      hztableData.value = summaryRes.data;
+    } else {
+      console.warn('未识别的节点类型或缺少必要参数');
+    }
     
   } catch (error) {
     ElMessage.error('获取数据失败');
@@ -219,15 +297,13 @@ const handleRowClick = async (row) => {
   
     // 使用订单编号、sczl_bh和mid调用明细数据接口 
      const params = { 
-       order: row['订单编号'], 
- 	   sczl_bh: row['sczl_bh'],
-       mid: currentNode.value?.mid || ''
+       order: row['订单编号']
      };
     
     // 调用明细数据接口
     const detailRes = await OrderElectricityDetail(params);
     console.log('获取的明细数据:', detailRes);
-    mxtableData.value = detailRes.data;
+    mxtableData.value = detailRes.data.list;
  
 }
 

+ 4 - 33
src/view/performance/QualityAssessment/QuestionClassification.vue

@@ -2,20 +2,15 @@
     <div>
       <layout>
         <layout-header>
-          <div class="gva-table-box" style="margin-left: 20px;width: 97%;">
             <el-form-item>
-              <el-button type="primary" icon="plus"  @click="addonclick" >新增问题分类</el-button>
+              <el-button type="primary" icon="plus"  @click="addonclick" style="margin-left: 20px;">新增问题分类</el-button>
             </el-form-item>
-          </div>
         </layout-header>
-  
         <layout>
   
-          <!-- 右侧区域 -->
           <layout-content >
           <el-main>
             <div class="gva-table-box">
-              <!-- 表格数据 -->
               <el-table ref="multipleTable" style="width: 100%;height: 76vh" tooltip-effect="dark"
                         :row-style="{ height: '30px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
@@ -29,24 +24,17 @@
                 <el-table-column align="center" label="操作" width="100">
               <template #default="{ row, $index }">
                 <el-button @click="record_deleteRow(row,$index)" type="danger" size="small" 
-					 style="font-size: 16px;padding: 0px;width: 60px;background-color: red;">
-				        删除
-				  </el-button>
+                  style="font-size: 16px;padding: 0px;width: 60px;background-color: red;">
+                      删除
+                </el-button>
               </template>
               </el-table-column>
               </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>
 			
             <el-dialog v-model="add_QuestiondialogFormVisible" :before-close="add_QuestioncloseDialog"
             style="width: 40%; max-height: 80%; overflow-y: auto; margin-top: 4%;"
             :title="'新增问题信息'" destroy-on-close>
-			
             <el-form label-width="100px" :model="add_Questionformdata">
               <el-row :gutter="24" class="form-row">
                 <el-col :span="20">
@@ -64,7 +52,6 @@
                 </el-col>
               </el-row>
             </el-form>
-        
             <template #footer>
               <div class="dialog-footer" style="display: flex; justify-content: flex-end; padding: 10px;">
                 <el-button type="primary" @click="add_QuestioncloseDialog">取消</el-button>
@@ -142,21 +129,8 @@
 }
   
 
-  // 更改状态
-  const Status_change = async (row, index) => {
-    console.log(row.UniqId,index) 
-    const newStatus = row.status === '1' ? '0' : '1';
-    // 调用接口获取数据
-    const res = await updateQuestionDeviceTypes({UniqId:row.UniqId,status:newStatus})
-    if (res.code === 0) {
-      ElMessage.success('更改状态成功')
-      _gettabledata();
-    }
-  }
-
   const record_deleteRow = async (row, index) => {
     console.log(row.id);
-
     // 使用 ElMessageBox 提示确认删除
     ElMessageBox.confirm('确定删除此行数据吗?', '提示', {
         confirmButtonText: '确定',
@@ -237,9 +211,6 @@
       margin-right: 0;
     }
   }
-  /*:deep(.el-table td .cell) {*/
-  /*  line-height: 30px !important;*/
-  /*}*/
   .JKWTree-container {
     display: flex;
   }

+ 23 - 17
src/view/performance/QualityAssessment/SemiFinishedRework.vue

@@ -14,7 +14,7 @@
           <!-- 按钮区域 -->
           <div class="gva-table-box">
             <el-form-item>
-              <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="可搜索单据编号、面料名称、订单编号、生产款号、款式、颜色" style="width: 450px;" />
+              <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="搜索" style="width: 200px;" />
               <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
               <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增半成品</el-button>
               <!-- <el-button type="primary" class="bt" icon="delete" @click="Del">删除</el-button> -->
@@ -33,14 +33,14 @@
               <el-table-column align="left"  label="单据编号" prop="单据编号" width="138" />
               <el-table-column align="left"  label="订单编号" prop="订单编号" width="105" />
               <el-table-column align="left"  label="生产款号" prop="生产款号" width="120" />
-              <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="60" />
-              <el-table-column align="left"  label="返工数量" prop="数量" width="100" />
+              <el-table-column align="left"  label="款式" prop="款式" width="160" />
+              <el-table-column align="left"  label="颜色" prop="颜色" width="130" />
+              <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="120" />
-              <el-table-column align="left"  label="组别" prop="组别" width="120" />
+              <el-table-column align="left"  label="组别" prop="组别" width="100" />
               <el-table-column align="left"  label="问题分类" prop="问题分类" width="120" />
-              <el-table-column align="left"  label="创建时间" prop="Sys_rq" width="120" />
+              <el-table-column align="left"  label="创建日期" prop="Sys_rq" width="100" />
               <el-table-column fixed="right" label="操作" width="130">
               <template #default="{ row, $index }">
               <el-button @click="Order_detailsRow(row,$index)" type="success" size="small" 
@@ -304,16 +304,22 @@ try {
     // 清空数组
     treeData.splice(0, treeData.length);
     
-    // 转换接口数据为树形结构
-    const formattedData = Object.entries(response.data).map(([year, months]) => ({
-      label: year,
-      children: Object.entries(months).map(([month, days]) => ({
-        label: month,
-        children: days.map(day => ({
-          label: day
-        }))
-      }))
-    }));
+    // 转换接口数据为树形结构,并按倒序排列年份、月份和日期
+    const formattedData = Object.entries(response.data)
+      .reverse() // 年份倒序
+      .map(([year, months]) => ({
+        label: year,
+        children: Object.entries(months)
+          .reverse() // 月份倒序
+          .map(([month, days]) => ({
+            label: month,
+            children: [...days]
+              .reverse() // 日期倒序
+              .map(day => ({
+                label: day
+              }))
+          }))
+      }));
     
     treeData.push(...formattedData);
     

+ 23 - 17
src/view/performance/QualityAssessment/cropdefective.vue

@@ -14,7 +14,7 @@
             <!-- 按钮区域 -->
             <div class="gva-table-box">
               <el-form-item>
-                <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="可搜索单据编号、面料名称、订单编号、生产款号、款式、颜色" style="width: 450px;" />
+                <el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="搜索" style="width: 200px;" />
                 <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
                 <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增次品</el-button>
                 <!-- <el-button type="primary" class="bt" icon="delete" @click="Del">删除</el-button> -->
@@ -30,14 +30,14 @@
                 :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                 :show-overflow-tooltip="true" @row-click="Click" @row-dblclick="doubleClick">
                 <el-table-column align="left"  label="单据编号" prop="单据编号" width="140" />
-                <el-table-column align="left"  label="面料名称" prop="面料名称" width="120" />
-                <el-table-column align="left"  label="次片数量" prop="数量" width="90" />
                 <el-table-column align="left"  label="订单编号" prop="订单编号" width="105" />
-                <el-table-column align="left"  label="生产款号" prop="生产款号" width="120" />
-                <el-table-column align="left"  label="款式" prop="款式" width="120" />
-                <el-table-column align="left"  label="颜色" prop="颜色" width="100" />
+                <el-table-column align="left"  label="生产款号" prop="生产款号" width="160" />
+                <el-table-column align="left"  label="款式" prop="款式" width="160" />
+                <el-table-column align="left"  label="颜色" prop="颜色" width="160" />
+                <el-table-column align="left"  label="面料名称" prop="面料名称" width="160" />
+                <el-table-column align="left"  label="次片数量" prop="数量" width="90" />
                 <el-table-column align="left"  label="问题分类" prop="问题分类" width="120" />
-                <el-table-column align="left"  label="创建时间" prop="Sys_rq" width="120" />
+                <el-table-column align="left"  label="创建日期" prop="Sys_rq" width="120" />
                 <el-table-column fixed="right" label="操作" width="130">
                 <template #default="{ row, $index }">
                 <el-button @click="Order_detailsRow(row,$index)" type="success" size="small" 
@@ -290,16 +290,22 @@ const getTabdata = async () => {
       // 清空数组
       treeData.splice(0, treeData.length);
       
-      // 转换接口数据为树形结构
-      const formattedData = Object.entries(response.data).map(([year, months]) => ({
-        label: year,
-        children: Object.entries(months).map(([month, days]) => ({
-          label: month,
-          children: days.map(day => ({
-            label: day
-          }))
-        }))
-      }));
+      // 转换接口数据为树形结构,并按倒序排列年份、月份和日期
+      const formattedData = Object.entries(response.data)
+        .reverse() // 年份倒序
+        .map(([year, months]) => ({
+          label: year,
+          children: Object.entries(months)
+            .reverse() // 月份倒序
+            .map(([month, days]) => ({
+              label: month,
+              children: [...days]
+                .reverse() // 日期倒序
+                .map(day => ({
+                  label: day
+                }))
+            }))
+        }));
       
       treeData.push(...formattedData);
       

+ 352 - 0
src/view/performance/QualityAssessment/rework.vue

@@ -0,0 +1,352 @@
+<template>
+    <div>
+      <!-- 左侧树形结构 -->
+      <el-container>
+        <!-- <layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" > -->
+           <!-- <div class="JKWTree-tree" style="height: 70vh;"> -->
+             <!-- <h3>返工数据报表</h3> -->
+             <!-- <el-tree :data="treeData"  class="treecolor" highlight-current @node-click="handleNodeClick"/> -->
+           <!-- </div> -->
+         <!-- </layout-sider> -->
+      <!-- <el-container> -->
+            
+          <el-main>
+            <!-- 按钮区域 -->
+            <div class="gva-table-box">
+              <el-form-item>
+                <el-input v-model="searchinfo" @keydown="onSubmit($event)" placeholder="搜索" style="width: 200px;" />
+                <el-button type="primary" class="search" icon="search" @click="onSearch">查询</el-button>
+              </el-form-item>
+              
+              <!-- 柱状图展示占比数据 -->
+              <div class="chart-container" ref="chartRef" style="width: 100%; height: 280px; margin-bottom: 30px;"></div>
+              
+              <!-- 数据展示 -->
+              <el-table ref="multipleTable" style="width: 100%;height: 35vh;" tooltip-effect="dark" :data="tableData" row-key="订单编号"
+                highlight-current-row="true"   border @selection-change="handleSelectionChange" id="table"
+                :row-style="{ height: '20px' }"  :header-cell-style="{ padding: '0px' }"
+                :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                :show-overflow-tooltip="true" @row-click="Click" @row-dblclick="doubleClick">
+                <el-table-column align="left"  label="订单编号" prop="订单编号" width="140" />
+                <el-table-column align="left"  label="生产款号" prop="生产款号" width="270" />
+                <el-table-column align="left"  label="面料名称" prop="面料名称" width="300" />
+                <el-table-column align="left"  label="颜色" prop="颜色" width="200" />
+                <el-table-column align="left"  label="尺码" prop="尺码" width="80" />
+                <el-table-column align="left"  label="问题分类" prop="问题分类" width="120" />
+				        <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 fixed="right" label="操作" width="130"> -->
+              <!--  <template #default="{ row, $index }">
+                <el-button @click="Order_detailsRow(row,$index)" type="success" size="small" 
+                style="font-size: 16px;padding: 0px;width: 90px;">
+                查看明细
+                </el-button>
+                </template> -->
+                <!-- </el-table-column> -->
+                
+              </el-table>
+              <!-- 分页 -->
+              <div class="gva-pagination">
+                <el-pagination layout="total, sizes, prev, pager, next, jumper" v-model:current-page="page"
+                  v-model:page-size="limit"
+                  :page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
+                  @size-change="handleSizeChange" />
+              </div>
+            </div>
+			
+
+          </el-main>
+        <!-- </el-container> -->
+      </el-container>
+    </div>
+  </template>
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { ElMessage, ElMessageBox, LAST_KEYS } from 'element-plus';
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
+import { Search, Refresh, Download } from '@element-plus/icons-vue'
+import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+// 引入ECharts用于图表展示
+import * as echarts from 'echarts';
+import {Get_rework} from '@/api/mes/job'
+import { useUserStore } from '@/pinia/modules/user'
+// import { el } from 'element-plus/es/locale'
+//获取登录用户信息
+const userStore = useUserStore()
+const _username = ref('')
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+console.log('获取用户名称',_username.value)
+//全局获取当前日期
+const today = new Date();
+const year = today.getFullYear();
+const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
+const day = String(today.getDate()).padStart(2, '0');
+const hours = String(today.getHours()).padStart(2, '0');
+const minutes = String(today.getMinutes()).padStart(2, '0');
+const seconds = String(today.getSeconds()).padStart(2, '0');
+const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+const currentDates = `${year}-${month}-${day}`;
+
+// 侧边栏数据请求
+const treeData = reactive([]);
+const tableData = ref([]);
+const total = ref(0);
+const page = ref(1);
+const limit = ref(50); // 默认设置为50条一页
+const searchinfo = ref(''); // 定义搜索关键字为ref类型
+const chartInstance = ref(null); // 图表实例
+const chartRef = ref(null); // 图表容器引用
+// 初始化空数组,后续从接口获取数据
+const percentageData = ref([]);
+
+const getTabdata = async () => {
+	// 构建查询参数,包含分页和搜索条件
+	const params = {
+		page: page.value,
+		limit: limit.value
+	};
+	
+	// 如果有搜索内容,添加到查询参数中
+	if (searchinfo.value && searchinfo.value.trim()) {
+		params.search = searchinfo.value.trim();
+	}
+	
+	const response = await Get_rework(params);
+	if (response.code === 0) {
+		tableData.value = response.data || [];
+		total.value = response.count || 0;
+		
+		// 更新柱状图数据(假设response.list包含问题分类占比数据)
+		if (response.list && Array.isArray(response.list)) {
+			percentageData.value = response.list;
+			// 重新渲染图表
+			nextTick(() => {
+				initChart();
+			});
+		}
+	} else {
+		ElMessage.error('获取返工数据失败');
+	}
+};
+
+const handleCurrentChange = (val) => {
+	page.value = val;
+	getTabdata();
+};
+
+const handleSizeChange = (val) => {
+	limit.value = val;
+	page.value = 1;
+	getTabdata();
+};
+
+// 搜索功能实现
+const onSearch = () => {
+	tableData.value = []; // 清空表格数据
+	page.value = 1; // 搜索时重置到第一页
+	getTabdata();
+};
+
+// 处理回车搜索
+const onSubmit = (e) => {
+	if (e.key === 'Enter') {
+    tableData.value = [];
+		onSearch();
+	}
+};
+
+// 处理选择变化
+const handleSelectionChange = (selection) => {
+	// 可以根据需要实现选择功能
+};
+
+// 处理行点击
+const Click = (row) => {
+	// 可以根据需要实现行点击功能
+};
+
+// 处理行双击
+const doubleClick = (row) => {
+	// 可以根据需要实现行双击功能
+};
+
+// 初始化柱状图
+const initChart = () => {
+    if (chartRef.value) {
+        // 销毁已存在的图表实例
+        if (chartInstance.value) {
+            chartInstance.value.dispose();
+        }
+        
+        // 创建新的图表实例
+        chartInstance.value = echarts.init(chartRef.value);
+        
+        // 准备数据
+        const categories = percentageData.value.map(item => item['问题分类']);
+        const percentages = percentageData.value.map(item => {
+            // 移除百分号并转换为数字
+            return parseFloat(item['百分比占比'].replace('%', ''));
+        });
+        
+        // 设置图表配置
+        const option = {
+            title: {
+                text: '问题分类占比统计',
+                left: 'center'
+            },
+            tooltip: {
+                trigger: 'axis',
+                axisPointer: {
+                    type: 'shadow'
+                },
+                formatter: function(params) {
+                    const data = params[0];
+                    const item = percentageData.value[data.dataIndex];
+                    return `${data.name}<br/>占比: ${data.value}%<br/>问题次数: ${item['问题次数']}<br/>问题数量: ${item['问题数量']}`;
+                }
+            },
+            grid: {
+                left: '3%',
+                right: '4%',
+                bottom: '1%',
+                containLabel: true
+            },
+            xAxis: {
+                type: 'category',
+                data: categories,
+                axisLabel: {
+                    interval: 0,
+                    rotate: 0,
+                    color: '#000000'
+                }
+            },
+            yAxis: {
+                type: 'value',
+                axisLabel: {
+                    formatter: '{value}%'
+                }
+            },
+            series: [{
+                data: percentages,
+                type: 'bar',
+                itemStyle: {
+                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                        { offset: 0, color: '#83bff6' },
+                        { offset: 0.5, color: '#188df0' },
+                        { offset: 1, color: '#188df0' }
+                    ])
+                },
+                emphasis: {
+                    itemStyle: {
+                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                            { offset: 0, color: '#2378f7' },
+                            { offset: 0.7, color: '#2378f7' },
+                            { offset: 1, color: '#83bff6' }
+                        ])
+                    }
+                },
+                label: {
+                    show: true,
+                    position: 'top',
+                    formatter: '{c}%'
+                }
+            }]
+        };
+        
+        // 设置图表配置
+        chartInstance.value.setOption(option);
+        
+        // 监听窗口大小变化,调整图表大小
+        window.addEventListener('resize', handleResize);
+    }
+};
+
+// 处理窗口大小变化
+const handleResize = () => {
+    if (chartInstance.value) {
+        chartInstance.value.resize();
+    }
+};
+
+// 组件挂载后初始化图表
+onMounted(() => {
+    nextTick(() => {
+        initChart();
+    });
+});
+
+// 组件卸载前清理
+const cleanupChart = () => {
+    if (chartInstance.value) {
+        chartInstance.value.dispose();
+        chartInstance.value = null;
+    }
+    window.removeEventListener('resize', handleResize);
+};
+
+getTabdata();
+
+
+</script>
+  
+  <style>
+  .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-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>

+ 628 - 0
src/view/performance/QualityAssessment/video.vue

@@ -0,0 +1,628 @@
+<template>
+  <div class="video-generation-container">
+    <el-card class="mb-4">
+      <template #header>
+          <span>文生视频生成</span>
+      </template>
+      <br>
+      <el-form ref="formRef" :model="form" label-width="100px" class="mb-4"
+          style="margin: 0px;padding: 0px !important;">
+        <el-form-item label="提示词" prop="prompt" required>
+          <el-input 
+            v-model="form.prompt" 
+            type="textarea" 
+            :rows="3" 
+            placeholder="请输入视频描述,例如:一个穿着宇航服的宇航员在月球上行走, 高品质, 电影级"
+          />
+        </el-form-item>
+        
+        <el-form-item label="模型" prop="model">
+          <el-select v-model="form.model" placeholder="请选择模型">
+            <el-option label="sora-2" value="sora-2" />
+          </el-select>
+        </el-form-item>
+        
+        <el-form-item label="时长(秒)" prop="seconds">
+          <el-select 
+            v-model.number="form.seconds" 
+            placeholder="请选择视频时长" 
+            style="width: 100%"
+          >
+            <el-option label="4秒" :value="4" />
+            <el-option label="8秒" :value="8" />
+            <el-option label="12秒" :value="12" />
+          </el-select>
+        </el-form-item>
+        
+        <el-form-item label="分辨率" prop="size">
+          <el-select v-model="form.size" placeholder="请选择分辨率" style="width: 100%">
+            <el-option label="720x1280" value="720x1280" />
+            <el-option label="1280x720" value="1280x720" />
+          </el-select>
+        </el-form-item>
+        
+        <el-form-item>
+           <!-- <el-input 
+              v-model="searchInfo" 
+              placeholder="搜索提示词" 
+              @keyup.enter="handleSearch"
+              clearable
+              @clear="handleSearch"
+              style="width: 230px; margin-right: 10px;margin: 0px;" 
+            />
+            <el-button type="primary" icon="Search" class="search" @click="handleSearch">查询</el-button> -->
+          <el-button 
+            type="primary" 
+            @click="generateVideo" 
+            :loading="isGenerating"
+          >
+            {{ isGenerating ? '生成中...' : '生成视频' }}
+          </el-button>
+          <el-button @click="resetForm">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+    
+    <!-- 视频播放对话框 -->
+    <el-dialog
+      v-model="dialogVisible"
+      title="视频播放"
+      width="80%"
+	  style="margin: 0px;margin-left: 10%;margin-top: 3%;"
+      center
+      destroy-on-close
+    >
+      <div class="dialog-video-preview">
+        <div v-if="!dialogVideoUrl" class="loading-text">加载中...</div>
+        <video 
+          :src="dialogVideoUrl" 
+          controls 
+          width="100%" 
+          height="auto"
+          v-else
+          autoplay
+        ></video>
+      </div>
+      <template #footer>
+        <el-button @click="dialogVisible = false">关闭</el-button>
+      </template>
+    </el-dialog>
+    
+    <!-- 历史记录 -->
+    <el-card class="mt-1">
+      <el-table :data="historyList"
+                :row-style="{ height: '20px' }"
+                :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                :header-cell-style="{ padding: '0px' }"
+                style="width: 100%;height: 40vh">
+        <el-table-column align="center" prop="id" label="ID" width="80" />
+        <el-table-column prop="prompt" label="提示词" width="500">
+          <template #default="scope">
+            <span :title="scope.row.prompt" class="text-ellipsis" style="display: inline-block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{ scope.row.prompt }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="model" label="模型" width="100" />
+        <el-table-column prop="seconds" label="时长" width="80" />
+        <el-table-column prop="size" label="分辨率" width="100" />
+        <el-table-column prop="sys_rq" label="创建时间" width="180" />
+        <el-table-column label="状态" width="100">
+          <template #default="scope">
+            <el-tag :type="scope.row.web_url ? 'success' : 'warning'">
+              {{ scope.row.web_url ? '已完成' : '生成中' }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="300">
+            <template #default="scope">
+              <el-button 
+                size="small" 
+                @click="playHistoryVideo(scope.row)"
+                :disabled="!scope.row.web_url"
+              >
+                播放
+              </el-button>
+              <el-button 
+                size="small" 
+                type="primary" 
+                @click="refreshVideo(scope.row)"
+                v-if="!scope.row.web_url && scope.row.video_id"
+              >
+                重新获取视频
+              </el-button>
+              <!-- <el-button size="small" type="danger" @click="deleteHistoryVideo(scope.row.id)">删除</el-button> -->
+            </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页组件 -->
+      <div class="gva-pagination">
+          <el-pagination
+              v-model:current-page="page"
+              v-model:page-size="pageSize"
+              :page-sizes="[10, 30, 50, 100, 500, 1000]"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange">
+          </el-pagination>
+        </div>
+    </el-card>
+  </div>
+</template>
+
+<script setup>
+import { ref, reactive } from 'vue'
+import { ElMessage } from 'element-plus'
+import {Getvideolist,video,videoContent
+} from '@/api/mes/job'
+
+// 表单数据
+const form = reactive({
+  prompt: '',
+  model: 'sora-2',
+  seconds: 4,
+  size: '1280x720'
+})
+
+// 表单引用
+const formRef = ref()
+
+// 状态变量
+const isGenerating = ref(false)
+const videoUrl = ref('')
+const dialogVisible = ref(false)
+const dialogVideoUrl = ref('')
+const currentVideoItem = ref(null)
+const historyList = ref([])
+// 分页相关数据
+const page = ref(1)
+const pageSize = ref(30)
+const total = ref(0)
+// 搜索关键词
+const searchInfo = ref('')
+
+// 获取环境变量服务器IP地址
+const basePath = import.meta.env.VITE_BASE_PATH;
+const uploadsPort = import.meta.env.VITE_UPLOADS_PORT ?? '8082';
+console.log("basePath", basePath);
+console.log("uploadsPort", uploadsPort);
+// 动态生成路径
+let base = 'http://192.168.28.22:8082';
+console.log("最终获取地址:", base);
+
+// 格式化视频URL
+const formatVideoUrl = (path) => {
+  if (!path) return ''
+  // 避免重复拼接http://
+  if (path.startsWith('http://') || path.startsWith('https://')) {
+    return path
+  }
+  // const base = 'http://20.0.16.102:9091'
+  // 避免重复拼接斜杠
+  const normalizedPath = path.startsWith('/') ? path.substring(1) : path
+  const normalizedBase = base.endsWith('/') ? base : `${base}/`
+  return `${normalizedBase}${normalizedPath}`
+}
+
+// 加载历史视频列表
+const loadVideoHistory = async () => {
+  try {
+    const params = {
+      page: page.value,
+      limit: pageSize.value
+    }
+    // 如果有搜索关键词,添加到请求参数中
+    if (searchInfo.value.trim()) {
+      params.search = searchInfo.value.trim()
+    }
+    
+    const res = await Getvideolist(params)
+    if (res.code === 0) {
+      historyList.value = Array.isArray(res.data.list) ? res.data.list : res.data
+      // 如果后端返回total,使用返回值,否则保持现有值
+      // 设置总数
+      total.value = res.count || 0
+    }
+  } catch (error) {
+    console.error('加载视频历史失败', error)
+    ElMessage.error('加载历史记录失败')
+  }
+}
+
+// 组件挂载时加载历史
+loadVideoHistory()
+
+// 生成视频
+const generateVideo = async () => {
+// console.log(form);
+// return false;
+  // 表单验证
+  if (!form.prompt) {
+    ElMessage.warning('请输入提示词')
+    return
+  }
+  
+  isGenerating.value = true
+  
+  try {
+    // 第一步:调用video接口生成视频ID
+    const videoIdRes = await video(form)
+    
+    if (videoIdRes.code === 0 && videoIdRes.data?.video_id) {
+      const videoId = videoIdRes.data.video_id
+      ElMessage.success('已提交视频生成请求,正在生成中...')
+      
+      // 第二步:使用videoContent接口根据ID生成视频
+      // 这里添加一个延迟,确保视频ID已经在后端系统中就绪
+      await new Promise(resolve => setTimeout(resolve, 1000))
+      
+      // 调用videoContent接口
+      const generateRes = await videoContent({ video_id: videoId })
+      
+      // 无论成功与否,都重新加载历史记录表格
+      await loadVideoHistory()
+      
+      if (generateRes.code === 0) {
+        // 如果视频已生成完成
+        if (generateRes.data && generateRes.data.web_url) {
+          ElMessage.success('视频生成成功')
+          
+          // 查找生成的视频项
+          const newVideoItem = historyList.value.find(item => item.video_id === videoId)
+          if (newVideoItem) {
+            // 自动打开视频播放对话框
+            playHistoryVideo(newVideoItem)
+          }
+        } else {
+          ElMessage.info('视频正在生成中,请稍后刷新查看')
+          
+          // 启动轮询检查进度
+          startCheckingProgress(videoId)
+        }
+      } else {
+        // 提取更详细的错误信息
+        let errorMsg = generateRes.msg || '未知错误'
+        if (generateRes.data && generateRes.data.error_message) {
+          try {
+            // 尝试解析JSON格式的错误信息
+            const errorData = JSON.parse(generateRes.data.error_message)
+            if (errorData.error && errorData.error.message) {
+              errorMsg += ' - ' + errorData.error.message
+            }
+          } catch (e) {
+            // 如果解析失败,直接使用原始错误信息
+            errorMsg += ' - ' + generateRes.data.error_message
+          }
+        }
+        
+        ElMessage.error('视频生成失败:' + errorMsg)
+      }
+    } else {
+      // 即使创建任务失败,也刷新表格数据
+      await loadVideoHistory()
+      
+      // 提取更详细的错误信息
+      let errorMsg = videoIdRes.msg || '未知错误'
+      if (videoIdRes.data && videoIdRes.data.error_message) {
+        try {
+          // 尝试解析JSON格式的错误信息
+          const errorData = JSON.parse(videoIdRes.data.error_message)
+          if (errorData.error && errorData.error.message) {
+            errorMsg += ' - ' + errorData.error.message
+          }
+        } catch (e) {
+          // 如果解析失败,直接使用原始错误信息
+          errorMsg += ' - ' + videoIdRes.data.error_message
+        }
+      }
+      
+      ElMessage.error('创建视频任务失败:' + errorMsg)
+    }
+  } catch (error) {
+    console.error('视频生成过程中发生错误', error)
+    // 发生异常也尝试刷新表格
+    try {
+      await loadVideoHistory()
+    } catch (e) {
+      console.error('刷新表格失败', e)
+    }
+    ElMessage.error('视频生成失败,请检查网络连接后重试')
+  } finally {
+    isGenerating.value = false
+  }
+}
+
+// 轮询检查视频生成进度
+let checkInterval = null
+const startCheckingProgress = (videoId) => {
+  if (!videoId) return
+  
+  // 清除之前的轮询
+  if (checkInterval) {
+    clearInterval(checkInterval)
+  }
+  
+  // 最大检查次数,避免无限轮询
+  let checkCount = 0
+  const maxCheckCount = 20 // 最多检查20次(60秒)
+  
+  // 每3秒检查一次
+  checkInterval = setInterval(async () => {
+    checkCount++
+    
+    if (checkCount > maxCheckCount) {
+      ElMessage.info('视频生成可能需要更长时间,请手动刷新查看')
+      clearInterval(checkInterval)
+      return
+    }
+    
+    try {
+      // 使用videoContent接口检查视频状态
+      const statusRes = await videoContent({ video_id: videoId, action: 'status' })
+      
+      if (statusRes.code === 0 && statusRes.data?.status === 'completed' && statusRes.data?.web_url) {
+        // 视频生成完成
+        ElMessage.success('视频生成完成')
+        
+        // 重新加载历史记录
+        await loadVideoHistory()
+        
+        // 查找对应的视频记录
+        const videoItem = historyList.value.find(item => item.video_id === videoId)
+        if (videoItem) {
+          // 自动打开视频播放对话框
+          playHistoryVideo(videoItem)
+        }
+        
+        clearInterval(checkInterval)
+      } else if (statusRes.code !== 0) {
+        console.error('检查视频状态失败', statusRes.msg)
+      }
+    } catch (error) {
+      console.error('检查视频进度失败', error)
+    }
+  }, 3000)
+}
+
+// 重置表单
+const resetForm = () => {
+  form.prompt = ''
+  form.model = 'sora-2'
+  form.seconds = 4
+  form.size = '1280x720'
+  videoUrl.value = ''
+}
+
+// 下载视频
+const downloadVideo = () => {
+  if (!videoUrl.value) return
+  
+  // 创建下载链接
+  const link = document.createElement('a')
+  link.href = videoUrl.value
+  link.download = `video_${Date.now()}.mp4`
+  document.body.appendChild(link)
+  link.click()
+  document.body.removeChild(link)
+  
+  ElMessage.success('视频下载中')
+}
+
+// 下载历史视频
+const downloadHistoryVideo = (row) => {
+  if (!row.web_url) {
+    ElMessage.warning('视频尚未生成完成')
+    return
+  }
+  
+  const videoUrl = formatVideoUrl(row.web_url)
+  const link = document.createElement('a')
+  link.href = videoUrl
+  link.download = `video_${row.video_id || Date.now()}.mp4`
+  document.body.appendChild(link)
+  link.click()
+  document.body.removeChild(link)
+  
+  ElMessage.success('视频下载中')
+}
+
+// 下载对话框中的视频
+const downloadDialogVideo = () => {
+  if (!currentVideoItem.value || !currentVideoItem.value.web_url) return
+  
+  downloadHistoryVideo(currentVideoItem.value)
+}
+
+// 重新生成
+const regenerateVideo = () => {
+  generateVideo()
+}
+
+// 播放历史视频
+const playHistoryVideo = (row) => {
+  if (!row.web_url) {
+    ElMessage.warning('视频尚未生成完成')
+    return
+  }
+  
+  // 设置当前视频项和URL
+  currentVideoItem.value = row
+  dialogVideoUrl.value = formatVideoUrl(row.web_url)
+  
+  console.log('正在播放视频:', dialogVideoUrl.value)
+  
+  // 显示对话框
+  dialogVisible.value = true
+  
+  // 填充表单
+  // form.prompt = row.prompt
+  // form.model = row.model
+  // form.seconds = row.seconds
+  // form.size = row.size
+}
+
+// 重新获取视频
+const refreshVideo = async (row) => {
+  if (!row.video_id) {
+    ElMessage.warning('视频ID不存在,无法重新获取')
+    return
+  }
+    ElMessage.info('正在重新获取视频...')
+    // 调用videoContent接口重新获取视频
+    const res = await videoContent({ video_id: row.video_id })
+    // 无论获取结果如何,都刷新表格数据
+    await loadVideoHistory()
+    if (res.code === 0) {
+      // 如果获取到了视频URL
+      if (res.data && res.data.web_url) {
+        ElMessage.success('视频获取成功')
+        
+        // 查找更新后的视频项
+        const updatedVideo = historyList.value.find(item => item.video_id === row.video_id)
+        if (updatedVideo && updatedVideo.web_url) {
+          // 自动播放获取到的视频
+          playHistoryVideo(updatedVideo)
+        }
+      } else {
+        ElMessage.info('视频仍在生成中,请稍后再试')
+      }
+    }
+}
+
+// 搜索处理
+const handleSearch = () => {
+  // 重置页码为1
+  page.value = 1
+  // 重新加载数据
+  loadVideoHistory()
+}
+
+// 分页大小变化处理
+const handleSizeChange = (size) => {
+  pageSize.value = size
+  // 重新加载数据
+  loadVideoHistory()
+}
+
+// 当前页码变化处理
+const handleCurrentChange = (current) => {
+  page.value = current
+  // 重新加载数据
+  loadVideoHistory()
+}
+
+// 删除历史视频
+const deleteHistoryVideo = async (id) => {
+  try {
+    // 这里应该调用实际的删除API
+    // const res = await deleteVideoApi({ id })
+    // if (res.code === 0) {
+      const index = historyList.value.findIndex(item => item.id === id)
+      if (index !== -1) {
+        historyList.value.splice(index, 1)
+        ElMessage.success('删除成功')
+      }
+    // }
+  } catch (error) {
+    console.error('删除视频失败', error)
+    ElMessage.error('删除失败,请重试')
+  }
+}
+</script>
+
+<style scoped lang="scss">
+
+::v-deep(.el-card__body){
+	padding: 0px;
+}
+.video-generation-container {
+  padding: 0px;
+  
+  .card-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+  
+  .refresh-button {
+    margin-left: auto;
+  }
+}
+
+.el-form {
+  .el-form-item {
+    margin-bottom: 10px;
+    padding: 0px;
+  }
+}
+
+.el-table {
+  .el-button {
+    margin-right: 5px;
+  }
+}
+
+// 对话框视频样式
+.dialog-video-preview {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  min-height: 400px;
+  padding: 20px 0;
+  
+  video {
+    max-height: 600px;
+    max-width: 100%;
+    border-radius: 4px;
+  }
+  
+  .loading-text {
+    font-size: 16px;
+    color: #909399;
+  }
+}
+
+// 最新生成结果样式
+.video-result-preview {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 10px;
+  background-color: #fafafa;
+  border-radius: 4px;
+  
+  .video-result-info {
+    flex: 1;
+    p {
+      margin: 5px 0;
+      font-size: 14px;
+    }
+  }
+  
+  .video-result-actions {
+    display: flex;
+    gap: 10px;
+  }
+}
+
+// 响应式调整
+@media screen and (max-width: 768px) {
+  .dialog-video-preview {
+    min-height: 300px;
+    
+    video {
+      max-height: 400px;
+    }
+  }
+  
+  .video-result-preview {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 15px;
+    
+    .video-result-actions {
+      width: 100%;
+      justify-content: flex-start;
+    }
+  }
+}
+</style>

+ 35 - 27
src/view/performance/Suborderdetailspage.vue

@@ -5,7 +5,7 @@
 		<span>订单编号或生产款号</span>
 		<span>选择相关</span>
 		<span style="color: red;"> “子订单编号” </span>
-		<span>“查看工序信息”</span>
+		<span>“查看工序报工信息”</span>
 	</p>
 	   <div class="order-info" style="margin: 10px 0px 0px 10px;">
 		   <el-text style="font-size: 24px;">订单编号:&nbsp;</el-text>
@@ -226,10 +226,11 @@ const handleOrderSelect = async (orderNo) => {
         value: item.子订单编号,
         label: item.子订单编号
       }));
-      if (subOrderOptions.value.length === 1) {
+      // 如果有子订单,无论多少条,都默认选择第一条
+      if (subOrderOptions.value.length > 0) {
         orderform.value.子订单编号 = subOrderOptions.value[0].value;
         const ress = await SubWorkOrderStatusList({ order:orderform.value.子订单编号}); 
-				
+			
 		if (ress.code === 0) {
 			orderform.value.客户编号 = ress.data.workOrderData['客户编号'];
 			orderform.value.款号 = ress.data.workOrderData['款号'];
@@ -328,7 +329,10 @@ const open = async (ddzbh,gongxu) => {
 	arr.length = 0
 	baoshulist(gx.value);
 	console.log(order.data.workOrderData)
-	orderform.value = order.data.workOrderData
+	// 保存当前子订单编号,避免被覆盖
+	const currentSubOrderNo = orderform.value.子订单编号;
+	// 更新表单数据,但保留子订单编号
+	orderform.value = { ...order.data.workOrderData, "子订单编号": currentSubOrderNo };
 	orderdata.splice(0,order.data.data.length,...order.data.data);//表格数据
 	arr.splice(0,order.data.arr.length,...order.data.arr);//表格尺码投数据
 }
@@ -349,29 +353,33 @@ const open = async (ddzbh,gongxu) => {
 		}
 	};
 	const baoshulist = async (gx) => {
-	  const orderMabaolist = await Mabaolist({ order: orderid.value, process:gx});
-	  console.log(orderMabaolist);
-	  // 初始化所有包的数据,将 chefeng 转换为对象以便标记状态
-	  Mabaolistform.splice(
-		0,
-		Mabaolistform.length,
-		...orderMabaolist.data.chefeng.map((item) => ({ value: item, status: 'default' }))
-	  );
-	  // 遍历完成包数,将状态标记为 complete
-	  orderMabaolist.data.complete.forEach((completed) => {
-		const target = Mabaolistform.find((item) => item.value === completed);
-		if (target) {
-		  target.status = 'complete';
-		}
-	  });
-	  // 遍历废掉包数,将状态标记为 deleted
-	  orderMabaolist.data.delete.forEach((deleted) => {
-		const target = Mabaolistform.find((item) => item.value === deleted);
-		if (target) {
-		  target.status = 'deleted';
-		}
-	  });
-	};
+  // 使用子订单编号而不是订单编号调用Mabaolist接口
+  const orderMabaolist = await Mabaolist({ order: orderform.value.子订单编号, process:gx});
+  console.log(orderMabaolist);
+  // 初始化所有包的数据,将 chefeng 转换为对象以便标记状态,先排序再去重
+  Mabaolistform.splice(
+    0,
+    Mabaolistform.length,
+    ...orderMabaolist.data.chefeng
+      .sort((a, b) => parseInt(a) - parseInt(b)) // 按数值排序
+      .filter((item, index, self) => self.indexOf(item) === index) // 去重
+      .map((item) => ({ value: item, status: 'default' }))
+  );
+  // 遍历完成包数,将状态标记为 complete
+  orderMabaolist.data.complete.forEach((completed) => {
+    const target = Mabaolistform.find((item) => item.value === completed);
+    if (target) {
+      target.status = 'complete';
+    }
+  });
+  // 遍历废掉包数,将状态标记为 deleted
+  orderMabaolist.data.delete.forEach((deleted) => {
+    const target = Mabaolistform.find((item) => item.value === deleted);
+    if (target) {
+      target.status = 'deleted';
+    }
+  });
+};
 	// 动态获取样式类
 	const getBoxClass = (item) => {
 	  if (item && item.status === 'complete') {

+ 340 - 12
src/view/performance/chukubaogong.vue

@@ -7,14 +7,102 @@
 				</el-input>
 				<el-button type="primary" @click="search_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">查询</el-button>
 				<el-button type="primary" @click="Reporting_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">面料出库</el-button>
-		  </el-row>
+				<div style="flex: 1;"></div> 
+				<el-button type="primary" @click="exportToExcel" style="height: 50px;font-size: 20px;margin-left: 20px;">导出Excel</el-button>
+				<el-button type="primary" @click="cp_gdprintonClick" style="height: 50px;font-size: 20px;margin-left: 20px;">工单打印查询</el-button>
+				 <el-button type="primary" @click="workOrderCompletionQuery" style="height: 50px;font-size: 20px;margin-left: 20px;">工单完工查询</el-button>
+				<el-button type="primary" @click="print" style="height: 50px;font-size: 20px;margin-left: 20px;margin-right: 20px;">出库单打印</el-button>
+			</el-row>
 		<layout>
 			<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
 				<div class="JKWTree-tree" style="height: 70vh;">
-					<h3>面料库存</h3>
+					<h3>日期</h3>
 					<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick"  />
 				</div>
 			</layout-sider>
+			<el-dialog
+		      v-model="order_viewVisible"
+		      title="选择打印格式"
+		      width="30%"
+		      top="10%"
+		      :before-close="order_viewCloseDialog"
+		      destroy-on-close>
+		      <el-form>
+		        <el-form-item label="打印方向" label-width="100px">
+		          <el-radio-group v-model="printDirection">
+		            <el-radio label="纵向">纵向</el-radio>
+		            <el-radio label="横向">横向</el-radio>
+		          </el-radio-group>
+		        </el-form-item>
+		      </el-form>
+		      <template #footer>
+		        <el-button @click="order_viewCloseDialog">关闭</el-button>
+		        <el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+		      </template>
+		    </el-dialog>
+
+			<!-- 工单完工查询弹窗 -->
+    <el-dialog 
+      v-model="workOrderCompletionDialogVisible" 
+      title="工单完工查询结果" 
+      width="80%"
+      :before-close="() => workOrderCompletionDialogVisible = false"
+      custom-class="work-order-dialog"
+    >
+      <div class="work-order-completion-container">
+        <!-- 核心信息展示区 -->
+        <div class="core-info-section" v-if="workOrderCompletionData && workOrderCompletionData.length > 0">
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">订单编号:</label>
+              <span class="info-value highlight">{{ workOrderCompletionData[0]['订单编号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">客户编号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['客户编号'] }}</span>
+            </div>
+          </div>
+          <div class="info-row">
+            <div class="info-item">
+              <label class="info-label">生产款号:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['生产款号'] }}</span>
+            </div>
+            <div class="info-item">
+              <label class="info-label">款式:</label>
+              <span class="info-value">{{ workOrderCompletionData[0]['款式'] }}</span>
+            </div>
+          </div>
+        </div>
+        
+        <!-- 表格区域 -->
+        <div class="table-section">
+          <el-table ref="multipleTable"
+            :data="workOrderCompletionData" 
+            style="width: 100%" 
+            border
+            :header-cell-style="tableHeaderStyle"
+            class="completion-table"
+          >
+		<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="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-column   align="center" label="订单状态" prop="订单状态"  width="130" />
+		<el-table-column   align="center" label="落货日期" prop="落货日期"  width="130" :formatter="dateFormatter" />
+		<el-table-column   align="center" label="日期" prop="日期"  width="90" />
+          </el-table>
+        </div>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="workOrderCompletionDialogVisible = false" size="large" class="close-btn">关闭</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
 		  <layout-content >
 			<div class="gva-table-box">
 			  <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -22,7 +110,7 @@
 				  <el-table ref="multipleTable"
 							:row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
 							:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-							:show-overflow-tooltip="true" highlight-current-row="true"
+							:show-overflow-tooltip="true" highlight-current-row="true" id="finished"
 							@row-click="Recordclicks" @row-dblclick="Doubleclickrecord"
 							@selection-change="detailSelectionChange" style="width: 100%;height: 65vh" border
 							:summary-method="getSummaries" tooltip-effect="dark" :data="recordtableData" row-key="ID" >
@@ -31,9 +119,9 @@
 					<el-table-column align="left"  label="订单编号" prop="订单编号"  width="105"/>
 				    <el-table-column align="left"  label="款号" prop="款号"  width="140"/>
 				  	<el-table-column align="left"  label="款式" prop="款式"  width="140"/>
-					<el-table-column align="left"  label="物料名称" prop="物料名称"  width="140"/>
+					<el-table-column align="left"  label="物料名称" prop="物料名称"  width="200"/>
 					<el-table-column align="left"  label="出库总数" prop="总数"  width="90"/>
-					<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="160"/>
 					<el-table-column align="left"  label="类型" prop="单号类型"  width="90"/>
@@ -274,7 +362,52 @@
 		</div>
 	</el-dialog>
 	
-  
+  <!-- 打印预览弹窗 -->
+  <el-dialog v-model="printPreviewVisible" :before-close="()=> printPreviewVisible = false" 
+    title="" width="60%">
+    <div id="printContent" style="padding: 20px;">
+      <h2 style="text-align: center; margin-bottom: 20px;">出库表</h2>
+      <div style="display: flex; justify-content: space-between; margin-bottom: 15px;">
+        <div style="display: flex; gap: 20px;">
+          <div>单据编号 :{{_danhao}}</div>
+          <div>订单编号 :{{_ordernuber}}</div>
+        </div>
+        <div>日期 :{{ new Date().toLocaleDateString('zh-CN') }}</div>
+      </div>
+      <!-- 主表格 -->
+      <table style="width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid #000;">
+        <thead>
+          <tr>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">序号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">款号</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">材料(物品)名称</th>
+            <th style="padding: 8px; text-align: center; width: 10%; border: 1px solid #000;">数量</th>
+            <th style="padding: 8px; text-align: center; width: 30%; border: 1px solid #000;">备注</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(item, index) in printPreviewData" :key="index">
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ index + 1 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.款号 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.物料名称 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.数量 }}</td>
+            <td style="padding: 8px; text-align: center; border: 1px solid #000;">{{ item.remark }}</td>
+          </tr>
+        </tbody>
+      </table>
+      <div style="margin-top: 10px; text-align: right;">
+        入库人员:{{_renyuan}}
+      </div>
+     
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="printPreviewVisible = false">关闭</el-button>
+        <el-button type="primary" @click="printDocument">打印</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
 	<!--单号详情记录 -->
 	<el-dialog v-model="details_pickingaddvisible" :before-close="()=> details_pickingaddvisible = false" style="width: 100%; margin: 0% auto; height: 100%;" :title="单据详情"
 	  destroy-on-close>
@@ -312,7 +445,8 @@
 			  </el-table>
 		  </div>
 	</el-dialog>
-	
+	<!-- 打印订单表预览 -->
+<PrintPage ref="printPageRef" />
   </template>
   <script>
   //点击按钮显示下方表格
@@ -334,15 +468,20 @@
   // 全量引入格式化工具 请按需保留
   import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
   import {ref, reactive} from 'vue'
+  import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
   import {getInputDetail,
   inputStash,rApictedit,
   OutOrderSearch,outReport,FabricDetail,gitReceiptNumber,
-  FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords} from '@/api/mes/job'
+  FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail,fetchMonthlyFabricRecords,OrderYieldList} from '@/api/mes/job'
   import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
   import dayjs, { Dayjs } from 'dayjs';
   import { useUserStore } from '@/pinia/modules/user'
-  // import { get } from 'scriptjs';
-  defineOptions({name: 'Company'})
+import PrintPage from '../yunyin/shengchanguanli/components/print.vue'
+// import { get } from 'scriptjs';
+defineOptions({name: 'Company'})
+//定义打印跳转页面
+  const printPageRef = ref()
   //获取用户登录信息
   const userStore = useUserStore()
   const _username = ref('')
@@ -911,6 +1050,8 @@ records_onSubmit();
 const recorddialogFormVisible = ref(false)
 const rdetailstableData = reactive([])
 const _danhao = ref('')
+const _renyuan = ref('')
+const _ordernuber = ref('')
 //查看明细
 const record_deleteRow = async (row) => {
   console.log(row)
@@ -923,6 +1064,129 @@ const record_deleteRow = async (row) => {
   rdetailstableData.splice(0,FabricDetaillists.length,...FabricDetaillists.data);
 }
 
+const selectedRow = ref('')
+const Recordclicks = async (row) => {
+	selectedRow.value = row;
+	_Gd_gdbh.value = row.订单编号
+	_ordernuber.value = row['订单编号']
+	_danhao.value = row['出库单']
+	_renyuan.value = row['操作机台']
+	console.log(_danhao.value)
+	console.log('选中的行数据:', selectedRow.value);
+}
+
+
+// 工单完工查询相关
+const currentSelectedRow = ref({})
+const workOrderCompletionDialogVisible = ref(false)
+const workOrderCompletionData = ref([])
+
+// 工单完工查询
+const workOrderCompletionQuery = async () => {
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的数据后,再操作此功能'})
+		return false;
+	}
+  try {
+    // 调用OrderYieldList接口,传入订单编号作为search参数
+    const response = await OrderYieldList({ search: _Gd_gdbh.value})
+    
+    if (response.code === 0) {
+      // 保存查询结果
+      workOrderCompletionData.value = response.data
+      // 显示弹窗
+      workOrderCompletionDialogVisible.value = true
+    } else {
+      ElMessage({ type: 'error', message: '查询失败' })
+    }
+  } catch (error) {
+    console.error('工单完工查询失败:', error)
+    ElMessage({ type: 'error', message: '查询失败' })
+  }
+}
+
+// 日期格式化函数,只显示年月日
+const dateFormatter = (row, column, cellValue) => {
+  if (!cellValue) return ''
+  return dayjs(cellValue).format('YYYY-MM-DD')
+}
+
+// 表格头部样式
+const tableHeaderStyle = {
+  background: '#409EFF',
+  color: '#fff',
+  fontWeight: 'bold',
+  textAlign: 'center'
+}
+
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+
+  //弹窗
+  const order_viewVisible = ref(false)
+  // 默认选择竖向
+  const printDirection = ref('纵向')
+  const cp_gdprintonClick = () => {
+	  order_viewVisible.value = true
+  }
+  //确定打印
+  const confirmPrintDirection = () => {
+	  console.log(_Gd_gdbh.value)
+	  console.log(printDirection.value)
+	    
+	  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+	    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+	    return false;
+	  }else{
+	    if(recordtableData.length >=1){
+	  	printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+	    }else{
+	  	ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+	  	return false;
+	    }
+	  }
+  }
+  const order_viewCloseDialog = () => {
+	  order_viewVisible.value = false
+  }
+// 入库单打印预览功能
+const printPreviewVisible = ref(false);
+const printPreviewData = ref([]);
+// 入库单打印功能
+const print =  async () => {
+	if(_danhao.value === '' || _danhao.value === null){
+		ElMessage({type: 'warning',message: '请选择具体的入库单后,再操作此功能'})
+		return false;
+	}
+	printPreviewVisible.value = true;
+	// 获取入库单详情数据
+	const result = await ReceiptDetail({receipt: _danhao.value});
+	console.log(result)
+	printPreviewData.value = result.data;
+	
+}
+// 执行打印
+const printDocument = () => {
+	try {
+		// 创建打印区域的克隆
+		const printContent = document.getElementById('printContent');
+		const printWindow = window.open('', '_blank');
+		// 写入打印内容
+		printWindow.document.write('<html><head><title>出库表</title></head><body>');
+		printWindow.document.write(printContent.innerHTML);
+		printWindow.document.write('</body></html>');
+		printWindow.document.close();
+		
+		// 执行打印
+		printWindow.print();
+		printWindow.close();
+		printPreviewVisible.value = false;
+	} catch (error) {
+		console.error('打印失败:', error);
+		ElMessage({type: 'error', message: '打印失败'});
+	}
+}
+
 //关闭
 const record_closeDialog = async (row) => {
   console.log(row)
@@ -1010,7 +1274,21 @@ const edit_closeDialog = async (row) => {
 	details_Selection.value = ids.join(',')
 	console.log("复选框",details_Selection.value)
   }
-  
+  //导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  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;
+};
+
   // // 删除详情按钮
   // const deldetail_delclick = async () => {
   //   try {
@@ -1162,5 +1440,55 @@ const edit_closeDialog = async (row) => {
   padding: 8px 12px !important;
   border-radius: 4px !important;
 }
+
+
+/* 工单完工查询核心信息区域样式 */
+.core-info-section {
+  background: #f9fafc;
+  border: 1px solid #ebeef5;
+  border-radius: 8px;
+  padding: 15px;
+  margin-bottom: 20px;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
+}
+
+.core-info-section .info-row {
+  display: flex;
+  flex-wrap: wrap;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-row:last-child {
+  margin-bottom: 0;
+}
+
+.core-info-section .info-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.core-info-section .info-label {
+  font-weight: 600;
+  color: #303133;
+  width: 100px;
+  margin-right: 10px;
+  text-align: right;
+}
+
+.core-info-section .info-value {
+  color: #606266;
+  flex: 1;
+  word-break: break-all;
+  font-size: 14px;
+}
+
+/* 响应式调整 */
+@media screen and (max-width: 768px) {
+  .core-info-section .info-item {
+    width: 100%;
+  }
+}
   </style>
-  
+  

+ 8 - 9
src/view/yunyin/shengchanguanli/AIFashionModelLibrary.vue

@@ -93,14 +93,13 @@
 
 <script setup>
 import { ref, nextTick, onMounted } from 'vue'
-import axios from 'axios'
 import { ElMessage } from 'element-plus'
 import {
   TemplateList,
   Template,
   updatetemplate,getPreviewFolders,
   setActiveTemplate
-} from '@/api/ai/aiimg'
+} from '@/api/mes/job'
 
 // 模版状态数据
 const templateList = ref([])
@@ -121,15 +120,15 @@ const mb_isLoading = ref(false)
 const loadTemplateList = async () => {
 	//文件夹列表
 	const getPreviewFolders_list = await getPreviewFolders()
-	path_templateList.value = getPreviewFolders_list.data.data.folders || []
+	path_templateList.value = getPreviewFolders_list.data.folders || []
 }
 
 //点击选择文件夹路径获取-》模版列表
 const path_loadTemplateDetail = async (path) => {
 	if(path){
 		const res = await TemplateList({path:path})
-		templateList.value = res.data.data.list || []
-		usedId.value = res.data.data.usedId
+		templateList.value = res.data.list || []
+		usedId.value = res.data.usedId
 		selectedId.value = usedId.value
 		await loadTemplateDetail(selectedId.value)
 	}
@@ -139,10 +138,10 @@ const path_loadTemplateDetail = async (path) => {
 const loadTemplateDetail = async (id) => {
 	if(id){
 		const res = await Template({ id })
-		textareaContent.value = res.data.data.content || ''
-		english_content.value = res.data.data.english_content || ''
-		width.value = res.data.data.width || ''
-		height.value = res.data.data.height || ''
+		textareaContent.value = res.data.content || ''
+		english_content.value = res.data.english_content || ''
+		width.value = res.data.width || ''
+		height.value = res.data.height || ''
 	}
 }
 

+ 34 - 34
src/view/yunyin/shengchanguanli/AIGeneratedvue.vue

@@ -110,7 +110,7 @@
 
 	  
 	<br>
-	<el-table :data="tableData" border height="450" highlight-current-row="true" v-loading="loading">
+	<el-table :data="tableData" border height="450" v-loading="loading">
 	  <el-table-column prop="id" label="ID" width="50" />
 	  <el-table-column prop="old_image_url" label="原图目录" width="360" />
 	  <el-table-column prop="new_image_url" label="出图目录" width="360" />
@@ -672,7 +672,7 @@ import {ref,reactive,toRaw} from 'vue'
 import {ElMessage, ElMessageBox,ElLoading } from 'element-plus'
 import axios from 'axios'
 import {Plus,Delete,CircleCheck,CircleClose} from '@element-plus/icons-vue'
-import {getPreviewSubDirs,queueStats,stopQueueProcesses, viewQueueStatus,ImgUpload,getPreviewimg,getlsit,
+import {stopQueueProcesses, queueStats, viewQueueStatus,ImgUpload,getPreviewSubDirs,getPreviewimg,getlsit,
 imageToText,txttoimg_moxing,txttoimg_update,
 textToImage,Template_ids,sd_models,getSide,
 TemplateList,
@@ -680,18 +680,21 @@ Template,
 updatetemplate,getPreviewFolders,
 setActiveTemplate,
 packImagess,getUploadPath,get_queue_logs,getTaskProgress
-} from '@/api/ai/aiimg'
+} from '@/api/mes/job'
 import { useUserStore } from '@/pinia/modules/user';
 
 //获取登录用户信息
 const userStore = useUserStore()
 const _username = ref('')
 _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+console.log('获取用户信息',_username.value)
+console.log('获取用户名称',userStore.userInfo.nickName)
+
 
 //获取服务器地址
 const formatImageUrl = (path) => {
   if (!path) return ''
-  const base = 'http://20.0.16.53:9093'
+  const base = 'http://192.168.28.22:8082'
   return `${base}/${path.replace(/^public\//, '')}`
 }
 
@@ -699,21 +702,20 @@ const formatImageUrl = (path) => {
 const tableData = ref([])
 const getPreviewSubDirslist = async () => {
 	const res = await getPreviewSubDirs()
-	console.log('getPreviewSubDirs',res.data.data)
-	const processedData = res.data.data.map(item => {
+	console.log('getPreviewSubDirs',res)
+	const processedData = res.data.map(item => {
 	  return {
 	    ...item,
 	    new_image_url: `${item.new_image_url}${item.name}/`
 	  };
 	});
 	tableData.value = processedData;
-	console.log(tableData.value)
 }
 getPreviewSubDirslist()
 
 // 环境配置
-const basePath = import.meta.env.VITE_BASE_PATH || 'http://20.0.16.53'
-const uploadsPort = import.meta.env.VITE_UPLOADS_PORT || '9093'
+const basePath = import.meta.env.VITE_BASE_PATH || 'http://192.168.28.22'
+const uploadsPort = import.meta.env.VITE_UPLOADS_PORT || '8082'
 const uploadUrl = ref(`${basePath}:${uploadsPort}/api/Facility/ImgUpload`)
 const uploadHeaders = { 
   'Content-Type': 'multipart/form-data',
@@ -924,13 +926,13 @@ const fetchPreviewImages = async () => {
   }else if(filterStatus.value === '高清放大') {
 	  params.status_name = "高清放大"
   }
-console.log("params",params)
+
   // 获取分页数据
   const res = await getPreviewimg(params);
-console.log("getPreviewimg",res.data.data)
-  if (res.data.code === 0) {
-    tableData_lsit.value = res.data.data;
-    total.value = res.data.total;
+
+  if (res.code === 0) {
+    tableData_lsit.value = res.data;
+    total.value = res.total;
   }
   loading.value = false;
 };
@@ -1032,25 +1034,25 @@ const record_deleteRow = async (row) => {
 		
 	// 任务队列
 	const queue_logs = await get_queue_logs({ old_image_file: row['old_image_url'] });
-	table_queue.value = queue_logs.data.data;
+	table_queue.value = queue_logs.data;
 	
 	//获取图出图自定义尺寸
 	const TemplateList_res = await TemplateList({path:row['old_image_url']})
 	
-	
 	const res = await Template_ids({path:row['old_image_url']});
-	height.value = res.data.data.height
-	width.value = res.data.data.width
+	height.value = res.data.height
+	width.value = res.data.width
 	
 	// 获取模型列表
 	const response = await txttoimg_moxing();
+
 	// 设置模型列表
-	imgtotxt_modelList.value = response.data.data.models.tushengwen;
-	txttotxt_modelList.value = response.data.data.models.wenshengwen;
-	txttoimg_modelList.value = response.data.data.models.wenshengtu;
+	imgtotxt_modelList.value = response.data.models.tushengwen;
+	txttotxt_modelList.value = response.data.models.wenshengwen;
+	txttoimg_modelList.value = response.data.models.wenshengtu;
 
 	// 设置当前使用的ID
-	usedIds.value = response.data.data.used_ids;
+	usedIds.value = response.data.used_ids;
 
 	// 设置默认选中的模型
 	if (txttoimg_modelList.value.length > 0) {
@@ -1222,10 +1224,8 @@ const ListTemplate_model = async () => {
 	ListTemplate_Visible.value = true
 	console.log(_resrow.value['old_image_url'])
 	const res = await TemplateList({path:_resrow.value['old_image_url']})
-	console.log("TemplateList",res.data.data.list)
-	console.log("TemplateList",res.data.data.usedId)
-	templateList.value = res.data.data.list
-	usedId.value = res.data.data.usedId
+	templateList.value = res.data.list || []
+	usedId.value = res.data.usedId
 	selectedId.value = usedId.value
 	await loadTemplateDetail(selectedId.value)
 }
@@ -1233,13 +1233,13 @@ const ListTemplate_model = async () => {
 const loadTemplateDetail = async (id) => {
 	if(id){
 		const res = await Template({ id })
-		textareaContent.value = res.data.data.content
-		english_content.value = res.data.data.english_content
-		width.value = res.data.data.width
-		height.value = res.data.data.height
+		textareaContent.value = res.data.content || ''
+		english_content.value = res.data.english_content || ''
+		width.value = res.data.width || ''
+		height.value = res.data.height || ''
 	}
 }
-// 新增模版按钮
+// 创建新模版(清空内容)
 const createNewTemplate = () => {
   selectedId.value = null
   textareaContent.value = '请输入新增模版内容'
@@ -1267,7 +1267,7 @@ const saveTemplate = async () => {
   })
   mb_isLoading.value = false
 
-  if (res.data.code === 0) {
+  if (res.code === 0) {
     ElMessage.success('模版保存成功')
     loadTemplateList()
   } else {
@@ -1687,8 +1687,8 @@ const confirmPack = async () => {
       ElMessage.success('打包成功,正在下载...');
 
       // ✅ 替换为服务的真实 IP 和端口
-      const basePath = import.meta.env.VITE_BASE_PATH || 'http://20.0.16.53';
-      const uploadsPort = import.meta.env.VITE_UPLOADS_PORT || '9093';
+      const basePath = import.meta.env.VITE_BASE_PATH || 'http://192.168.28.22';
+      const uploadsPort = import.meta.env.VITE_UPLOADS_PORT || '8082';
 
       let url = packRes.download_url;
 

+ 13 - 13
src/view/yunyin/shengchanguanli/AIPromptManagement.vue

@@ -258,7 +258,7 @@
 <script setup>
 import { ref, reactive, toRaw, onMounted } from 'vue'
 import { ElMessage } from 'element-plus'
-import { getTable, imageToText, Template_ids,txttoimg_moxing,txttoimg_update, getSide } from '@/api/ai/aiimg'
+import { getTable, imageToText, Template_ids,txttoimg_moxing,txttoimg_update, getSide } from '@/api/mes/job'
 import { useUserStore } from '@/pinia/modules/user'
 import { ArrowDown } from '@element-plus/icons-vue'
 
@@ -294,7 +294,7 @@ const editFormData = reactive({
 
 const formatImageUrl = (path) => {
   if (!path) return ''
-  const base = 'http://20.0.16.53:9093'
+  const base = 'http://192.168.28.22:8082'
   return `${base}/${path.replace(/^public\//, '')}`
 }
 
@@ -310,25 +310,25 @@ const getTableData = async () => {
       page: page.value,
       folder: selectedFolder.value
     })
-	console.log("getTable",res.data.data)
-    tableData1.value = res.data.data.list
-    total.value = res.data.data.total
+    tableData1.value = res.data.list
+    total.value = res.data.total
     
     // 更新文件夹列表
-    if (res.data.data.folder) {
-      folderList.value = res.data.data.folder
+    if (res.data.folder) {
+      folderList.value = res.data.folder
     }
 
- //    const res_Template = await Template_ids()
-	// console.log("Template_ids",res_Template)
- //    height.value = res_Template.data.data.height
- //    width.value = res_Template.data.data.width
+    const res_Template = await Template_ids()
+    if (res_Template?.data) {
+      height.value = res_Template.data.height || ''
+      width.value = res_Template.data.width || ''
+    }
 	
 	//文生图模型列表
 	const response = await txttoimg_moxing();
-	txttoimg_modelList.value = response.data.list;
+	txttoimg_modelList.value = response?.data?.list || [];
 	// 设置默认选中的模型(txttoimg_val为"1"的模型)
-	const defaultModel = response.data.data.list.find(item => item.txttoimg_val === "1");
+	const defaultModel = response?.data?.list?.find(item => item.txttoimg_val === "1");
 	if (defaultModel) {
 	  txtimgselectedModel.value = defaultModel.txttoimg;
 	  usedId.value = defaultModel.id;

+ 394 - 0
src/view/yunyin/shengchanguanli/Finishedproduct.vue

@@ -0,0 +1,394 @@
+<template>
+  <div>
+	  <layout>
+	    <layout-header>
+        <el-form>
+			<el-form-item>
+			  <el-input v-model="searchInfo" placeholder="搜索" @keyup.enter="handleSearch()" style="width: 230px;height: 40px;" />
+			  <el-button type="primary" icon="Search" class="search" @click="handleSearch" style="height: 40px;">查询</el-button>
+        <el-button type="primary" icon="Plus" class="" @click=""  style="height: 40px;">新增</el-button>
+        <el-button type="primary" icon="Edit" class="" @click=""  style="height: 40px;">修改</el-button>
+        <el-button type="danger" icon="delete" class="" @click=""  style="height: 40px;">删除</el-button>
+        <el-button type="primary" icon="MagicStick" class="" @click="aiFixBom"  style="height: 40px;">AI分析</el-button>
+			  <el-button  type="primary" icon="Download" @click="exportToExcel" style="height: 40px;margin-left: 20px;">导出成品Excel</el-button>
+			</el-form-item>
+		</el-form>
+	    </layout-header>
+	    <layout>
+		  
+		  <!-- 左侧树形结构 -->
+		  <layout-sider :resize-directions="['right']" :width="190" style="margin: 0px;">
+		    <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" style="width: 100%;height: 60vh" tooltip-effect="dark"
+						  :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
+              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						  :data="restableData"  border row-key="订单编号" size="small"  
+						  :cell-class-name="tableDataCellClass" id="finished"
+						  highlight-current-row="true"  @row-dblclick="updateCompanyFunc"
+						  @row-click="tableRowClick" :show-overflow-tooltip="true"
+						  @selection-change="handleSelectionChange">
+				  <el-table-column  align="left" label="订单编号" prop="订单编号" width="160" />
+				  <el-table-column  align="left" label="生产款号" prop="生产款号" width="160"/>
+				  <el-table-column  align="left" label="款式" prop="款式" width="150"/>
+				  <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="120"/>
+				  <el-table-column  align="left" label="入仓率" prop="入仓率" width="120"/>
+				  
+				</el-table>
+        <div class="gva-pagination">
+              <el-pagination
+                  @size-change="handleSizeChange"
+                  @current-change="handleCurrentChange"
+                  :current-page="page"
+                  :page-sizes="[10, 30, 50, 100]"
+                  :page-size="pageSize"
+                  layout="total, sizes, prev, pager, next, jumper"
+                  :total="total">
+              </el-pagination>
+            </div>
+			  </div>
+		
+		  
+		  </el-main>
+      </layout-content>
+      </layout>
+    </layout>
+  </div>
+  
+  
+</template>
+<script>
+//点击按钮显示下方表格
+export default {
+  data() {
+    return {
+      currentTable: '', // 当前展示的表格
+      activeName: 'first',
+      _ddhval:'',
+	  add_gddialogFormVisible: true,
+    };
+  },
+  methods: {
+    updateCompanyFunc(row) {
+      console.log('双击行:', row);
+    }
+  }
+};
+</script>
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import {ref, reactive} from 'vue'
+import {Finished_Datalist,Finished_Product} from '@/api/mes/job'
+import {ElMessage} from "element-plus";
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
+// import { get } from 'scriptjs';
+import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
+//获取用户登录信息
+const userStore = useUserStore()
+const _username = ref('')
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+console.log('获取用户名称',_username.value)
+//全局调用获取当前日期
+const today = new Date();
+const year = today.getFullYear();
+const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
+const day = String(today.getDate()).padStart(2, '0');
+const hours = String(today.getHours()).padStart(2, '0');
+const minutes = String(today.getMinutes()).padStart(2, '0');
+const seconds = String(today.getSeconds()).padStart(2, '0');
+const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+const currentDates = `${year}-${month}-${day}`;
+
+
+// =========== 左侧树侧形结构 =========== 
+const treeData = ref([]);
+const searchInfo = ref('');
+const _Machine_riqi = ref('');
+const _Machine = ref('');
+const page = ref(1);
+const pageSize = ref(50);
+const total = ref(0);
+const restableData = ref([]);
+
+// 获取树形菜单数据
+const getReceiptTabs = async () => {
+  try {
+    const response = await Finished_Datalist();
+    if (response.code === 0) {
+      // 转换数据为树形结构
+      const data = response.data;
+      const tree = [];
+      
+      // 获取所有年份并按降序排序(最新年份在最前面)
+      const years = Object.keys(data).sort((a, b) => b - a);
+      
+      // 遍历排序后的年份
+      years.forEach(year => {
+        const yearNode = {
+          label: year,
+          children: []
+        };
+        
+        // 获取所有月份并按降序排序(最新月份在最前面)
+        const months = Object.keys(data[year]).sort((a, b) => b.localeCompare(a));
+        
+        // 遍历排序后的月份
+        months.forEach(month => {
+          const monthNode = {
+            label: month,
+            children: []
+          };
+          
+          // 遍历日期,并按降序排序(最新日期在最上面)
+          data[year][month].sort((a, b) => new Date(b) - new Date(a)).forEach(date => {
+            monthNode.children.push({
+              label: date
+            });
+          });
+          
+          yearNode.children.push(monthNode);
+        });
+        
+        tree.push(yearNode);
+      })
+      
+      treeData.value = tree;
+    }
+  } catch (error) {
+    ElMessage.error('获取树形数据失败');
+    console.error('获取树形数据失败:', error);
+  }
+};
+
+// 处理节点点击事件
+const handleNodeClick = (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';
+	}
+	
+  // 重置搜索框,确保点击节点时不受搜索框内容影响
+  searchInfo.value = '';
+  
+  // 设置日期参数为节点标签值
+  _Machine_riqi.value = node.label;
+  console.log('设置的日期参数值:', node.label);
+  
+  _Machine.value = ''; // 成品入仓不需要机台信息
+  
+  // 重新加载表格数据
+  getStaffList();
+};
+
+// 搜索功能
+const handleSearch = () => {
+  page.value = 1;
+  getStaffList();
+};
+
+// 获取表格数据
+const getStaffList = async () => {
+  try {
+    // 构建参数对象
+    const params = {
+      order: searchInfo.value, // 搜索参数
+      page: page.value,
+      limit: pageSize.value
+    };
+    
+    // 只有当不是通过搜索框搜索时,才传递date参数
+    if (!searchInfo.value) {
+      params.date = _Machine_riqi.value;
+    }
+    
+    // 打印参数以便调试
+    console.log('请求参数:', params);
+    
+    // 调用Finished_Product接口获取成品入仓数据
+    const response = await Finished_Product(params);
+    
+    if (response.code === 0) {
+      restableData.value = response.data || [];
+      total.value = response.count || 0;
+      console.log('获取数据成功,共', total.value, '条记录');
+    } else {
+      console.warn('接口返回非成功状态:', response);
+      ElMessage.warning('获取数据时出现问题,请稍后重试');
+    }
+  } catch (error) {
+    ElMessage.error('获取数据失败');
+    console.error('获取数据失败:', error);
+  }
+};
+
+// 分页处理
+const handleSizeChange = (val) => {
+  pageSize.value = val;
+  getStaffList();
+};
+
+const handleCurrentChange = (val) => {
+  page.value = val;
+  getStaffList();
+};
+
+// 表格行点击事件
+const tableRowClick = (row) => {
+  console.log('选中行:', row);
+};
+
+// 表格单元格样式
+const tableDataCellClass = ({ row, column, rowIndex, columnIndex }) => {
+  return '';
+};
+
+// 处理选择变化
+const handleSelectionChange = (selection) => {
+  console.log('选中项:', selection);
+};
+
+getReceiptTabs();
+
+
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  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;
+}
+const aiFixBom = () => {
+  ElMessage.success('AI分析中');
+}
+</script>
+<style scoped>
+/* 根据出库状态文字颜色 */
+:deep(.status-plan-usage-low div) {
+  color: #8c939d  !important;
+}
+:deep(.statusy-plan-usage-low div) {
+  color: blue !important;
+}
+.form-container {
+  display: flex;
+  flex-wrap: wrap;
+}
+.form-column {
+  /*flex: 1;*/
+  margin-right: 15px; /* 调整列之间的间距 */
+}
+/* 左侧输入框宽度调整 */
+.form-column .el-form-item .el-input {
+  width: 150px; /* 调整左侧输入框的宽度 */
+}
+/* 媒体查询,根据需要调整断点 */
+@media screen and (max-width: 768px) {
+  .form-column {
+    flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
+    margin-right: 0;
+  }
+}
+.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-checkbox.el-checkbox--small .el-checkbox__inner) {
+    width: 45px; /* 复选框宽度 */
+    height: 23px; /* 复选框高度 */
+}
+/*bom参数背景*/
+: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;
+}
+:deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
+    transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
+    top: 5%; /* 调整对勾位置 */
+    left: 40%; /* 调整对勾位置 */
+    width: 5px; /* 调整对勾宽度 */
+    height: 9px; /* 调整对勾高度 */
+}
+/* 选中某行时的背景色 */
+: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;
+	margin-left: 5px !important;
+}
+.mab{
+  margin-bottom: 5px;
+}
+/* 搜索样式 */
+::v-deep .el-input__wrapper #searchInput {  
+  font-size: 16px; 
+}  
+::v-deep(.el-descriptions__table tbody tr .is-bordered-label){
+	width: 60px;
+}
+::v-deep(.el-descriptions__table tbody tr .el-descriptions__content){
+	width: 120px;
+}
+</style>

+ 778 - 0
src/view/yunyin/shengchanguanli/Orderprogress.vue

@@ -0,0 +1,778 @@
+<template>
+    <!-- 搜索区域 -->
+    <!-- <div class="search-container"> -->
+    <div class="">
+        <el-form-item style="margin-bottom: 0px;">
+          <el-input v-model="searchInfo" placeholder="搜索订单编号/生产款号/款式" @keyup.enter="handleSearch" style="width: 300px;height: 40px;"></el-input>
+          <el-button type="primary" class="search" @click="handleSearch" style="height: 40px;">
+            <el-icon><Search /></el-icon>
+            查询
+          </el-button>
+        </el-form-item>
+    </div>
+    
+    <!-- 内容区域 -->
+    <div class="content-container">
+      <!-- 订单生产进度卡片 -->
+      <el-card v-if="selectedOrder" class="order-progress-card">
+        <!-- <template #header>
+          <div class="card-header">
+            <h2>订单生产进度</h2>
+          </div>
+        </template> -->
+        
+        <!-- 订单基本信息 -->
+        <div class="order-basic-info">
+          <div class="order-image">
+            <img 
+              v-if="selectedOrder.img" 
+              :src="formatImageUrl(selectedOrder.img)" 
+              alt="订单图片" 
+              class="order-pic"
+            >
+          </div>
+          <!-- <div class="order-main">
+            <h3>{{ selectedOrder.订单编号 }}</h3>
+            <p class="order-style">{{ selectedOrder.款式 }}</p>
+          </div> -->
+          
+          <div class="order-details">
+             <div class="detail-item">
+              <span class="label">客户编号:</span>
+              <span class="value">{{ selectedOrder.客户编号 }}</span>
+            </div>
+            <div class="detail-item">
+              <span class="label">订单编号:</span>
+              <span class="value">{{ selectedOrder.订单编号 }}</span>
+            </div>
+            <div class="detail-item">
+              <span class="label">生产款号:</span>
+              <span class="value">{{ selectedOrder.生产款号 }}</span>
+            </div>
+             <div class="detail-item">
+              <span class="label">款式:</span>
+              <span class="value">{{ selectedOrder.款式 }}</span>
+            </div>
+            <div class="detail-item">
+              <span class="label">制单数量:</span>
+              <span class="value" style="font-size: 20px;">{{ selectedOrder.订单数量 }}</span>
+            </div>
+          </div>
+        </div>
+        
+        <div class="progress-visualization">
+          <h4>生产工序进度</h4>
+          <div class="progress-container">
+            <div 
+              v-for="(step, index) in processSteps" 
+              :key="step.name"
+              class="process-step"
+              :class="{
+                'step-completed': (step.name === '包装' && selectedOrder) ? 
+                                  (getProcessValue(step.name) >= selectedOrder.订单数量) : 
+                                  (getProcessValue(step.name) > 0),
+                'step-current': isCurrentStep(step.name)
+              }"
+            >
+              <div class="step-icon">{{ index + 1 }}</div>
+              <div class="step-content">
+                <div class="step-name">{{ step.label }}</div>
+                <div class="step-value">
+                  <span :class="{'value-zero': getProcessValue(step.name) === 0}">
+                    {{ getProcessValue(step.name) > 0 ? getProcessValue(step.name) : '未开始' }}
+                  </span>
+                </div>
+              </div>
+              <div v-if="index < processSteps.length - 1" class="step-line"></div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      
+      <div class="table-container">
+        <el-table 
+          ref="multipleTable" 
+          :row-style="{ height: '20px' }"
+          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+          :header-cell-style="{ padding: '0px' }"
+          style="width: 100%;height: 36vh"  
+          tooltip-effect="dark"
+          :data="restableData"  
+          border 
+          row-key="订单编号" 
+          :cell-class-name="tableDataCellClass"
+          highlight-current-row="true"
+          @row-dblclick="updateCompanyFunc"
+          @row-click="tableRowClick"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column  align="left" label="订单编号" prop="订单编号" min-width="90" />
+          <el-table-column  align="left" label="客户编号" prop="客户编号" min-width="70" />
+          <el-table-column  align="left" label="生产款号" prop="生产款号" min-width="140" />
+          <el-table-column  align="left" label="款式" prop="款式" min-width="100" />
+          <el-table-column  align="left" label="制单数量" prop="订单数量" min-width="80" />
+          <el-table-column  align="left" label="裁剪数量" prop="裁剪" min-width="80" />
+          <el-table-column  align="left" label="裁剪小组" prop="裁剪小组" min-width="120" />
+          <el-table-column  align="left" label="车缝数量" prop="车缝" min-width="80" />
+          <el-table-column  align="left" label="车缝小组" prop="车缝小组" min-width="120" />
+          <el-table-column  align="left" label="手工数量" prop="手工" min-width="80" />
+          <el-table-column  align="left" label="手工小组" prop="手工小组" min-width="120" />
+          <el-table-column  align="left" label="大烫数量" prop="大烫" min-width="80" />
+          <el-table-column  align="left" label="大烫小组" prop="大烫小组" min-width="120" />
+          <el-table-column  align="left" label="总检数量" prop="总检" min-width="80" />
+          <el-table-column  align="left" label="总检小组" prop="总检小组" min-width="120" />
+          <el-table-column  align="left" label="包装数量" prop="包装" min-width="80" />
+          <el-table-column  align="left" label="包装小组" prop="包装小组" min-width="120" />
+        </el-table>
+        <div class="gva-pagination">
+            <el-pagination
+                v-model:current-page="page"
+                v-model:page-size="pageSize"
+                :page-sizes="[10, 30, 50, 100, 500, 1000]"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="total"
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange">
+            </el-pagination>
+          </div>
+    </div>
+  </div>
+</template>
+<script>
+//点击按钮显示下方表格
+export default {
+  data() {
+    return {
+      currentTable: '', // 当前展示的表格
+      activeName: 'first',
+      _ddhval:'',
+	  add_gddialogFormVisible: true,
+    };
+  },
+  methods: {
+    updateCompanyFunc(row) {
+      console.log('双击行:', row);
+    }
+  }
+};
+</script>
+<script setup>
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import {ref, reactive, onMounted, onUnmounted} from 'vue'
+import {GetOrderprogress} from '@/api/mes/job'
+import {ElMessage} from "element-plus";
+import { Search } from '@element-plus/icons-vue';
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
+// import { get } from 'scriptjs';
+import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
+//获取用户登录信息
+const userStore = useUserStore()
+const _username = ref('')
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
+console.log('获取用户名称',_username.value)
+//全局调用获取当前日期
+const today = new Date();
+const year = today.getFullYear();
+const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
+const day = String(today.getDate()).padStart(2, '0');
+const hours = String(today.getHours()).padStart(2, '0');
+const minutes = String(today.getMinutes()).padStart(2, '0');
+const seconds = String(today.getSeconds()).padStart(2, '0');
+const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+const currentDates = `${year}-${month}-${day}`;
+
+
+// 获取环境变量服务器IP地址
+const basePath = import.meta.env.VITE_BASE_PATH;
+const uploadsPort = import.meta.env.VITE_UPLOADS_PORT ?? '8082';
+console.log("basePath", basePath);
+console.log("uploadsPort", uploadsPort);
+// 动态生成路径
+let base = 'http://192.168.28.22:8082';
+console.log("最终获取地址:", base);
+
+// 格式化图片URL,拼接服务器地址
+const formatImageUrl = (path) => {
+  if (!path) return '';
+  // 如果图片路径已经包含完整URL,则直接返回
+  if (path.startsWith('http://') || path.startsWith('https://')) {
+    return path;
+  }
+  // 否则拼接base路径
+  const imagePath = path.replace(/^public\//, ''); // 移除可能的public前缀
+  return `${base}/${imagePath}`;
+};
+
+// =========== 生产进度相关 =========== 
+const searchInfo = ref('');
+const page = ref(1);
+const pageSize = ref(30); // 默认每页显示5条,确保在一页内展示
+const total = ref(0);
+const restableData = ref([]);
+const selectedOrder = ref(null); // 当前选中的订单数据
+
+// 生产工序配置
+const processSteps = ref([
+  { name: '裁剪', label: '裁剪', teamField: '裁剪小组' },
+  { name: '车缝', label: '车缝', teamField: '车缝小组' },
+  { name: '手工', label: '手工', teamField: '手工小组' },
+  { name: '大烫', label: '大烫', teamField: '大烫小组' },
+  { name: '总检', label: '总检', teamField: '总检小组' },
+  { name: '包装', label: '包装', teamField: '包装小组' }
+]);
+
+// 获取工序数量值
+const getProcessValue = (processName) => {
+  return selectedOrder.value ? Number(selectedOrder.value[processName]) || 0 : 0;
+};
+
+// 获取负责小组 (当前未使用)
+const getTeamName = (processName) => {
+  const teamField = processSteps.value.find(step => step.name === processName)?.teamField;
+  return selectedOrder.value ? selectedOrder.value[teamField] || '未分配' : '未分配';
+};
+
+// 判断是否为当前工序
+const isCurrentStep = (processName) => {
+  if (!selectedOrder.value) return false;
+  
+  // 获取当前工序在流程中的索引
+  const currentIndex = processSteps.value.findIndex(step => step.name === processName);
+  
+  // 检查当前工序是否满足完成条件
+  let isStepCompleted = false;
+  if (processName === '包装') {
+    // 包装工序的完成条件是数量大于等于订单数量
+    isStepCompleted = getProcessValue(processName) >= selectedOrder.value.订单数量;
+  } else {
+    // 其他工序的完成条件是数量大于0
+    isStepCompleted = getProcessValue(processName) > 0;
+  }
+  
+  // 如果当前工序是最后一个(包装)且满足完成条件,则不是当前工序(应显示为已完成绿色)
+  if (currentIndex === processSteps.value.length - 1 && isStepCompleted) {
+    return false;
+  }
+  
+  // 如果当前工序不满足完成条件,则不是当前工序
+  if (!isStepCompleted) return false;
+  
+  // 检查下一个工序是否满足完成条件,如果没有,则当前工序是当前进行的工序
+  if (currentIndex < processSteps.value.length - 1) {
+    const nextStep = processSteps.value[currentIndex + 1];
+    let isNextStepCompleted = false;
+    
+    if (nextStep.name === '包装') {
+      isNextStepCompleted = getProcessValue(nextStep.name) >= selectedOrder.value.订单数量;
+    } else {
+      isNextStepCompleted = getProcessValue(nextStep.name) > 0;
+    }
+    
+    return !isNextStepCompleted;
+  }
+  
+  // 其他情况默认返回false
+  return false;
+};
+
+const getStaffList = async () => {
+  try {
+    const params = {
+      search: searchInfo.value,
+      page: page.value,
+      limit: pageSize.value
+    };
+    console.log('请求参数:', params);
+    
+    const response = await GetOrderprogress(params);
+    
+    if (response.code === 0) {
+      restableData.value = response.data || [];
+      total.value = response.count || 0;
+      console.log('获取数据成功,共', total.value, '条记录');
+      // 搜索后,默认选中第一条数据
+      if (restableData.value.length > 0) {
+        selectedOrder.value = restableData.value[0];
+      } else {
+        selectedOrder.value = null;
+      }
+    } else {
+      console.warn('接口返回非成功状态:', response);
+      ElMessage.warning('获取数据时出现问题,请稍后重试');
+    }
+  } catch (error) {
+    ElMessage.error('获取数据失败');
+    console.error('获取数据失败:', error);
+  }
+};
+
+// 初始化数据加载
+const getReceiptTabs = async () => {
+  await getStaffList();
+  // 页面加载时,默认选中第一条数据
+  if (restableData.value.length > 0) {
+    selectedOrder.value = restableData.value[0];
+  }
+};
+getReceiptTabs();
+
+// 搜索功能
+const handleSearch = () => {
+  page.value = 1;
+  getStaffList();
+};
+
+// 分页处理 - 使用v-model绑定后,这里只需要重新获取数据即可
+const handleSizeChange = () => {
+  console.log('页码大小改变为:', pageSize.value);
+  getStaffList();
+};
+
+const handleCurrentChange = () => {
+  console.log('当前页码改变为:', page.value);
+  getStaffList();
+};
+
+// 表格行点击事件
+const tableRowClick = (row) => {
+  console.log('选中行:', row);
+  // 点击表格行时,更新选中的订单数据
+  selectedOrder.value = row;
+};
+
+// 表格单元格样式
+const tableDataCellClass = ({ row, column, rowIndex, columnIndex }) => {
+  return '';
+};
+
+// 处理选择变化
+const handleSelectionChange = (selection) => {
+  console.log('选中项:', selection);
+};
+
+// 计算表格合计
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    
+    // 只对数值列计算合计
+    const prop = column.property;
+    if (['库存数量',].includes(prop)) {
+      const values = data.map(item => Number(item[prop]) || 0);
+      if (!values.every(value => isNaN(value))) {
+        sums[index] = values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!isNaN(value)) {
+            return prev + value;
+          } else {
+            return prev;
+          }
+        }, 0);
+        // 保留两位小数
+        sums[index] = sums[index].toFixed(2);
+      } else {
+        sums[index] = '-';
+      }
+    } else {
+      sums[index] = '-';
+    }
+  });
+  
+  return sums;
+};
+
+
+
+// 组件卸载时清理资源
+onUnmounted(() => {
+  console.log('组件卸载');
+});
+</script>
+
+<style scoped>
+/* 选中某行时的背景色 */
+:deep(.el-table__body tr.current-row) > td {
+  background: #ff80ff !important;
+}
+
+/* 搜索区域 */
+.search-container {
+  background-color: #fff;
+  border-bottom: 1px solid #e6e8eb;
+}
+/* 内容区域 */
+.content-container {
+  overflow: auto;
+}
+
+/* 订单进度卡片 */
+.order-progress-card {
+  margin-bottom: 5px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+}
+
+.card-header h2 {
+  margin: 0;
+  color: #333;
+  font-size: 18px;
+}
+
+/* 订单基本信息 */
+.order-basic-info {
+  display: flex;
+  align-items: flex-start;
+  margin-bottom: 10px;
+  padding-bottom: 10px;
+  border-bottom: 1px solid #eee;
+  flex-wrap: wrap;
+  gap: 20px;
+}
+
+/* 订单图片样式 */
+.order-image {
+  width: 200px;
+  height: 150px;
+  border: 1px solid #e6e8eb;
+  border-radius: 4px;
+  overflow: hidden;
+  background-color: #f5f7fa;
+}
+
+.order-pic {
+  max-width: 100%;
+  max-height: 100%;
+  object-fit: contain;
+}
+
+.order-main h3 {
+  margin: 0;
+  color: #333;
+  font-size: 20px;
+}
+
+.order-style {
+  margin: 2px 0 0 0;
+  color: #666;
+  font-size: 14px;
+}
+
+.order-details {
+  display: flex;
+  flex-direction: column;
+  gap: 5px;
+  width: 400px;
+  padding: 10px;
+  border-radius: 4px;
+}
+
+.detail-item {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+}
+
+.detail-item .label {
+  color: #999;
+  font-size: 20px;
+}
+
+.detail-item .value {
+  color: #333;
+  font-size: 13px;
+  font-weight: 500;
+}
+
+/* 生产进度可视化 */
+.progress-visualization {
+  margin-top: 20px;
+}
+
+.progress-visualization h4 {
+  margin-bottom: 15px;
+  color: #333;
+  font-size: 14px;
+  font-weight: 600;
+}
+
+.progress-container {
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+  position: relative;
+  padding: 0 10px;
+  flex-wrap: wrap;
+  gap: 15px;
+}
+
+/* 工序步骤 */
+.process-step {
+  display: flex;
+  align-items: center;
+  position: relative;
+  z-index: 2;
+  flex: 1;
+  min-width: 120px;
+  max-width: 140px;
+}
+
+/* 步骤图标 */
+.step-icon {
+  width: 40px;
+  height: 40px;
+  border-radius: 50%;
+  background-color: #e0e0e0;
+  color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 16px;
+  font-weight: bold;
+  margin-right: 10px;
+  transition: all 0.3s ease;
+}
+
+/* 步骤内容 */
+.step-content {
+  display: flex;
+  flex-direction: column;
+  gap: 3px;
+}
+
+.step-name {
+  font-size: 13px;
+  font-weight: 500;
+  color: #666;
+}
+
+.step-value {
+  font-size: 13px;
+  color: #333;
+}
+
+.step-value .value-zero {
+  color: #ff4d4f;
+}
+
+.step-team {
+  font-size: 11px;
+  color: #999;
+  margin-left: 3px;
+}
+
+/* 已完成工序样式 */
+.process-step.step-completed .step-icon {
+  background-color: #67c23a;
+  box-shadow: 0 0 0 3px rgba(103, 194, 58, 0.2);
+}
+
+.process-step.step-completed .step-name {
+  color: #67c23a;
+}
+
+/* 当前工序样式 */
+.process-step.step-current .step-icon {
+  background-color: #409eff;
+  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2);
+  transform: scale(1.05);
+}
+
+.process-step.step-current .step-name {
+  color: #409eff;
+  font-weight: 600;
+}
+
+/* 进度连接线 */
+.progress-container::before {
+  content: '';
+  position: absolute;
+  top: 20px;
+  left: 50px;
+  right: 50px;
+  height: 3px;
+  background-color: #e0e0e0;
+  z-index: 1;
+}
+
+/* 表格容器 */
+.table-container {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+  overflow-x: auto;
+}
+
+/* 表格样式 */
+:deep(.el-table) {
+  font-size: 12px;
+}
+
+:deep(.el-table td .cell),
+:deep(.el-table th .cell) {
+  line-height: 18px !important;
+  font-size: 12px;
+  padding: 8px 4px !important;
+  white-space: nowrap; /* 防止文字换行 */
+  overflow: hidden; /* 超出部分隐藏 */
+  text-overflow: ellipsis; /* 显示省略号 */
+}
+
+/* 分页容器 */
+.pagination-container {
+  padding: 10px 15px;
+  background-color: #fff;
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
+  border-top: 1px solid #e6e8eb;
+}
+
+/* 响应式布局 */
+@media (max-width: 768px) {
+  .order-basic-info {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+  
+  .progress-container {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+  
+  .progress-container::before {
+    display: none;
+  }
+  
+  .process-step {
+    margin-bottom: 15px;
+  }
+  
+  .search-container {
+    padding: 8px 15px;
+  }
+  
+  .content-container {
+    padding: 10px;
+  }
+}
+
+/* 进度连接线 */
+.progress-container::before {
+  content: '';
+  position: absolute;
+  top: 25px;
+  left: 50px;
+  right: 50px;
+  height: 4px;
+  background-color: #e0e0e0;
+  z-index: 1;
+}
+
+/* 工序步骤 */
+.process-step {
+  display: flex;
+  align-items: center;
+  position: relative;
+  z-index: 2;
+  flex: 1;
+  max-width: 160px;
+}
+
+/* 步骤图标 */
+.step-icon {
+  width: 50px;
+  height: 50px;
+  border-radius: 50%;
+  background-color: #e0e0e0;
+  color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 20px;
+  font-weight: bold;
+  margin-right: 15px;
+  transition: all 0.3s ease;
+}
+
+/* 步骤内容 */
+.step-content {
+  display: flex;
+  flex-direction: column;
+  gap: 5px;
+}
+
+.step-name {
+  font-size: 14px;
+  font-weight: 500;
+  color: #666;
+}
+
+.step-value {
+  font-size: 14px;
+  color: #333;
+}
+
+.step-value .value-zero {
+  color: #ff4d4f;
+}
+
+.step-team {
+  font-size: 12px;
+  color: #999;
+  margin-left: 5px;
+}
+
+/* 已完成工序样式 */
+.process-step.step-completed .step-icon {
+  background-color: #67c23a;
+  box-shadow: 0 0 0 4px rgba(103, 194, 58, 0.2);
+}
+
+.process-step.step-completed .step-name {
+  color: #67c23a;
+}
+
+/* 当前工序样式 */
+.process-step.step-current .step-icon {
+  background-color: #409eff;
+  box-shadow: 0 0 0 4px rgba(64, 158, 255, 0.2);
+  transform: scale(1.1);
+}
+
+.process-step.step-current .step-name {
+  color: #409eff;
+  font-weight: bold;
+}
+
+.process-step.step-current .step-value {
+  color: #409eff;
+  font-weight: bold;
+}
+
+/* 进度连接线 - 已完成部分 */
+.process-step.step-completed ~ .step-line {
+  background-color: #67c23a !important;
+}
+
+/* 步骤连接线 */
+.step-line {
+  position: absolute;
+  top: 25px;
+  left: calc(100% + 10px);
+  width: calc(100% - 80px);
+  height: 4px;
+  background-color: #e0e0e0;
+  transition: all 0.3s ease;
+}
+
+/* 搜索样式 */
+::v-deep .el-input__wrapper {
+  font-size: 14px; 
+}
+</style>

+ 4 - 4
src/view/yunyin/shengchanguanli/ShippingManagement.vue

@@ -85,8 +85,8 @@
                   <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="sys_id"  width="110" />
-                  <el-table-column   align="center" label="建立时间" prop="sys_rq"  width="110" />
+                  <el-table-column   align="center" label="建立人" prop="sys_id"  width="160" />
+                  <!-- <el-table-column   align="center" label="建立时间" prop="sys_rq"  width="110" /> -->
               </el-table>
             </div>
 
@@ -161,7 +161,7 @@
   </template>
   <script setup>
   import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-  import {Datalist,Read_List,Read_ListsData} from '@/api/mes/job'
+  import {Send_Out_Goods,Read_List,Read_ListsData} from '@/api/mes/job'
   import {ref, reactive} from 'vue'
   import { exportExcelFile } from '@/utils/excel'
   import {ElMessage} from "element-plus";
@@ -206,7 +206,7 @@
 	  };  
   const Datalistdata = async () => {
 	try {
-	  const Datalists = await Datalist();
+	  const Datalists = await Send_Out_Goods();
 	  console.log(Datalists)
 	Datalists.data.forEach(id => {  
 	  treeData.value.push({  

+ 118 - 24
src/view/yunyin/shengchanguanli/baogongshuju.vue

@@ -17,6 +17,8 @@
           color: Selection === '' ? '' : '#fff'
         }">删除报工
       </el-button>
+      <el-button type="primary" @click="cp_gdprintonClick" >工单打印</el-button>
+      <el-button type="primary" @click="exportToExcel">导出Excel</el-button>
 
       <!-- 查询产量进度表弹窗 -->
       <el-dialog v-model="statusExceldialog" :before-close="luckyexcelCloseDialog" style='height: 100%;margin: 0px;' width="100%"  >
@@ -108,7 +110,7 @@
            <el-table ref="multipleTable" style="width: 100%;height: 67vh" tooltip-effect="dark"
                       :row-style="{ height: '20px' }"  :header-cell-style="{ padding: '0px' }"
                       :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                      :data="tableData"  border row-key="ID" 
+                      :data="tableData"  border row-key="ID"   id="finished"
                       size="small"  show-summary :summary-method="getSummaries"
                       highlight-current-row="true" @row-dblclick="updateCompanyFunc"
                       @row-click="tableRowClick" :show-overflow-tooltip="true"
@@ -118,14 +120,14 @@
                   <el-table-column  align="left" label="子订单编号" prop="子订单编号" width="130"/>
                   <el-table-column  align="left" label="客户编号" prop="客户编号" width="80"/>
                   <el-table-column  align="left" label="生产款号" prop="生产款号" width="110"/>
-                  <el-table-column  align="left" label="款式" prop="款式" width="90"/>
-                  <el-table-column  align="left" label="颜色备注" prop="颜色备注" width="110"/>
+                  <el-table-column  align="left" label="款式" prop="款式" width="160"/>
+                  <el-table-column  align="left" label="颜色备注" prop="颜色备注" width="160"/>
       
                   <!-- 尺码列表 -->
                   <template v-for="item in sizeDatas">
                     <el-table-column align="center"  :label=item :prop=item  width="70"/> 
                   </template>
-                  <el-table-column  align="left" label="报工数量" prop="数量" width="90"/>
+                  <el-table-column  align="center" label="报工数量" prop="数量" width="90"/>
                   <el-table-column  align="left" label="组别" prop="sczl_bh" width="80"/>
                   <el-table-column  align="left" label="工序名称" prop="工序名称" width="80"/>
                   <el-table-column  align="left" label="上报时间" prop="上报时间" width="150"/>
@@ -166,6 +168,29 @@
       </layout>
     </layout>
   </div>
+
+  <el-dialog
+				v-model="order_viewVisible"
+				title="选择打印格式"
+				width="30%"
+				top="10%"
+				:before-close="order_viewCloseDialog"
+				destroy-on-close>
+				<el-form>
+				<el-form-item label="打印方向" label-width="100px">
+					<el-radio-group v-model="printDirection">
+					<el-radio label="纵向">纵向</el-radio>
+					<el-radio label="横向">横向</el-radio>
+					</el-radio-group>
+				</el-form-item>
+				</el-form>
+				<template #footer>
+				<el-button @click="order_viewCloseDialog">关闭</el-button>
+				<el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+				</template>
+			</el-dialog>
+		<!-- 打印订单表预览 -->
+		<PrintPage ref="printPageRef" />
 </template>
 <script>
 export default {
@@ -245,7 +270,10 @@ import {ref, reactive,onMounted } from 'vue'
 import {MachineList,MachineDetail,getOneWorkOrder,spotcheckdel,ProcessDetailDel} from '@/api/mes/job'
 import {ElMessage} from "element-plus";
 import { useUserStore } from '@/pinia/modules/user';
+import PrintPage from './components/print.vue'
 defineOptions({name: 'Company'})
+//定义打印跳转页面
+const printPageRef = ref()
 
 //获取登录用户信息
 const userStore = useUserStore()
@@ -358,31 +386,46 @@ const findFirstLayerValue = (currentNode) => {
 // 调用递归函数,查找当前分支的第一层值
 findFirstLayerValue(node);
 
-if (!node.children || node.children.length === 0) {
-  // 第4层(日期节点)
-  _Machine_riqi.value = node.label; // 日期为当前节点的值
-  const parentNode = node.parent; // 获取父节点(如 CQ03--裁剪03组)
-  if (parentNode) {
-    _Machine.value = parentNode.label.split('--')[0]; // 从父节点中提取机台名(CQ03)
-  }
-} else {
-  // 非第4层节点
-  _Machine_riqi.value = firstLayerValue; // 使用当前分支的第一层值作为日期
+// 确定节点层级
+let nodeLevel = 0;
+let currentNode = node;
+while (currentNode) {
+  nodeLevel++;
+  currentNode = currentNode.parent;
+}
 
-  if (node.label.includes('--')) {
-    // 第3层(机台节点)
-    _Machine.value = node.label.split('--')[0]; // 提取机台名(CQ03)
+if (nodeLevel === 4) {
+  // 第4层(日期节点)
+  _Machine_riqi.value = node.label; // 如 "12-02"
+  
+  // 确保父节点存在且是机台节点
+  if (node.parent && node.parent.label.includes('--')) {
+    _Machine.value = node.parent.label.split('--')[0]; // 从父节点中提取机台名(如 DT01)
   } else {
-    // 第1层或第2层节点
-    _Machine.value = node.label; // 直接取节点名作为机台(如“裁剪”)
+    _Machine.value = '';
   }
+} else if (nodeLevel === 3) {
+  // 第3层(机台节点)
+  _Machine.value = node.label.split('--')[0]; // 提取机台名(如 DT01)
+  _Machine_riqi.value = firstLayerValue; // 使用年月作为日期条件
+} else if (nodeLevel === 2) {
+  // 第2层(工序节点)
+  _Machine.value = ''; // 工序节点不设置machine
+  _Machine_riqi.value = firstLayerValue; // 使用年月作为日期条件
+} else if (nodeLevel === 1) {
+  // 第1层(年月节点)
+  _Machine.value = ''; // 年月节点不设置machine
+  _Machine_riqi.value = node.label; // 使用节点标签作为日期条件
 }
 
 // 调用获取员工列表的函数
 _getStaffList();
 };
 
-
+const tableRowClick = async(row) => {
+    console.log('当前行数据:', row)  
+    _Gd_gdbh.value = row.订单编号
+}
 
 // =========== 搜索 ===========
 const searchInfo = ref('')
@@ -407,14 +450,20 @@ const _getStaffList = async ()=>{
 // 	_Machine_riqi.value = _Machine.value
 // 	_Machine.value = '';
 // }
-console.log("机台",_Machine.value)
-console.log("日期",_Machine_riqi.value)
-// return;
 // 清空数据,防止重复
 sizeDatas.length = 0;
 tableData.length = 0;
 try {
-  const WorkListdata = await MachineDetail({machine:_Machine.value,date:_Machine_riqi.value,order:searchInfo.value,page:page.value,limit:pageSize.value});
+  // 根据调用场景构建参数
+  const params = {
+    page: page.value,
+    limit: pageSize.value,
+    order: searchInfo.value,
+    machine: _Machine.value, // 始终传递machine参数,允许为空
+    date: _Machine_riqi.value // 使用正确的参数名'data',始终传递允许为空
+  };
+  
+  const WorkListdata = await MachineDetail(params);
   //将 1 转换为 "是",0 转换为 "否"
   WorkListdata.data.table.forEach(item => {
     item.船样 = item.船样 === 1 ? '是' : '否';
@@ -517,6 +566,51 @@ _getStaffList()
 }
 
 
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+//弹窗
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+const cp_gdprintonClick = () => {
+  order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+  console.log(_Gd_gdbh.value)
+  console.log(printDirection.value)
+    
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+    return false;
+  }else{
+    // if(hztableData.length >=1){
+      printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+    // }else{
+    // ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+    // return false;
+    // }
+  }
+}
+const order_viewCloseDialog = () => {
+  order_viewVisible.value = false
+}
+
+
+//导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  const filename = _Machine_riqi.value + '月度车间报工汇总.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;
+}
 //导出Ex
 const exportToExcel2 = () => {
 const data = ExceltableData;

+ 88 - 47
src/view/yunyin/shengchanguanli/chengpinrucang.vue

@@ -3,24 +3,19 @@
       <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-input v-model="searchInfo"  placeholder="输入订单编号" style="width: 180px;" @keyup.enter="onSubmit()"></el-input>
+                <el-input v-model="searchInfo"  placeholder="搜索" style="width: 180px;" @keyup.enter="onSubmit()"></el-input>
                 <el-button type="primary" icon="search" @click="onSubmit" title="查询"  >查询</el-button>
-                <el-button type="primary" class="bt" icon="download" @click="hzToExcel" >订单成品导出</el-button>
-                <!-- <el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button> -->
+                <el-button type="primary" @click="hzToExcel" >订单成品导出</el-button>
+                <el-button type="primary" @click="cp_gdprintonClick" >工单打印</el-button>
+                <el-button type="primary" @click="" >工艺资料附件查询</el-button>
               </el-form-item>
             </el-form>
-  
-        
-  
           </div>
         </layout-header>
   
         <layout>
-          <!--    左侧树侧形结构-->
           <layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;">
             <div class="JKWTree-tree" style="height: 200px">
               <h3>产品返工次片合格率汇总</h3>
@@ -29,11 +24,8 @@
             </div>
           </layout-sider>
   
-          <!-- 右侧区域 -->
           <layout-content >
-          <!-- <el-main> -->
             <div class="gva-table-box">
-              <!-- 表格数据 -->
               <el-table ref="multipleTable" style="width: 100%;height: 33vh" tooltip-effect="dark"
                         :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
@@ -56,20 +48,14 @@
                <el-table-column   align="center" label="车缝合格率" prop="车缝合格率"  width="200" /> -->
                <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>
             </div>
 
-
             <div class="gva-table-box">
-              <!-- 表格数据 -->
               <el-table ref="multipleTable" style="width: 100%;height: 45vh" tooltip-effect="dark"
                         :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
@@ -91,33 +77,30 @@
                <!-- <el-table-column  sortable align="center" label="车缝数量" prop="车缝数量"  width="100" />
                <el-table-column  sortable 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>
             </div>
   
-            <el-dialog v-model="onhzexcel"  title="汇总数据导出" destroy-on-close style="height: 30%;width: 20%;">
-  <el-form-item label="选择年月" label-width="100px">
-    <el-date-picker
-			    v-model="hzrq"
-			    type="month"
-			    placeholder="选择年月"
-			    :default-value="new Date()"
-          @change="hzonchange_data"
-			    style="width: 200px;" 
-			  />
-  </el-form-item>
-
-        <template #footer>
-		    <div class="dialog-footer" style="text-align: right;">
-		      <el-button @click="hzcloseDialog">取消</el-button>
-		      <el-button type="primary" @click="hzonDialog">确定</el-button>
-		    </div>
-		  </template>
-            </el-dialog>
+          <el-dialog v-model="onhzexcel"  title="汇总数据导出" destroy-on-close style="height: 30%;width: 20%;">
+            <el-form-item label="选择年月" label-width="100px">
+              <el-date-picker
+              v-model="hzrq"
+              type="month"
+              placeholder="选择年月"
+              :default-value="new Date()"
+              @change="hzonchange_data"
+              style="width: 200px;" 
+              />
+            </el-form-item>
+            <template #footer>
+              <div class="dialog-footer" style="text-align: right;">
+                <el-button @click="hzcloseDialog">取消</el-button>
+                <el-button type="primary" @click="hzonDialog">确定</el-button>
+              </div>
+            </template>
+          </el-dialog>
 
             <el-dialog v-model="onmxexcel"  title="明细数据导出" destroy-on-close style="height: 30%;width: 20%;">
   <el-form-item label="选择年月" label-width="100px">
@@ -144,17 +127,44 @@
         </layout>
       </layout>
     </div>
+
+    <el-dialog
+		      v-model="order_viewVisible"
+		      title="选择打印格式"
+		      width="30%"
+		      top="10%"
+		      :before-close="order_viewCloseDialog"
+		      destroy-on-close>
+		      <el-form>
+		        <el-form-item label="打印方向" label-width="100px">
+		          <el-radio-group v-model="printDirection">
+		            <el-radio label="纵向">纵向</el-radio>
+		            <el-radio label="横向">横向</el-radio>
+		          </el-radio-group>
+		        </el-form-item>
+		      </el-form>
+		      <template #footer>
+		        <el-button @click="order_viewCloseDialog">关闭</el-button>
+		        <el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+		      </template>
+		    </el-dialog>
+    <!-- 打印订单表预览 -->
+<PrintPage ref="printPageRef" />
   </template>
   <script setup>
-  // 全量引入格式化工具 请按需保留
-  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-  import * as XLSX from 'xlsx'
+// 全量引入格式化工具 请按需保留
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+import * as XLSX from 'xlsx'
 import FileSaver from 'file-saver'
-  import {ref, reactive} from 'vue'
-  import { exportExcelFile } from '@/utils/excel'
-  import {ElMessage} from "element-plus";
-  import { GetWfpList,GetWfpDataLeft,GetSubOrderStats} from '@/api/mes/job'
-  defineOptions({name: 'Company'})
+import {ref, reactive} from 'vue'
+import { exportExcelFile } from '@/utils/excel'
+import {ElMessage} from "element-plus";
+import { GetWfpList,GetWfpDataLeft,GetSubOrderStats} from '@/api/mes/job'
+import PrintPage from './components/print.vue'
+// import { get } from 'scriptjs';
+defineOptions({name: 'Company'})
+//定义打印跳转页面
+const printPageRef = ref()
   // =========== 获取左侧树侧形结构 ===========
   const treeData = ref('')
 // 获取树形数据
@@ -226,7 +236,9 @@ const handleNodeClick = async (node) => {
 const mxtableData = ref([])
 const tableRowClick = async(row) => {
     const res = await GetSubOrderStats({sys_rq: _noderq.value,customer:  _nodecode.value,order:row.订单编号})
+    console.log('当前行数据:', row)  
     console.log('获取数据:', res)  
+    _Gd_gdbh.value = row.订单编号
     if(res.code === 0){
     mxtableData.value = res.data.result
   }
@@ -301,6 +313,35 @@ const convertColumnsToNumber = (worksheet, startCol = 2) => {
   }
 };
 
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+//弹窗
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+const cp_gdprintonClick = () => {
+  order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+  console.log(_Gd_gdbh.value)
+  console.log(printDirection.value)
+    
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+    return false;
+  }else{
+    // if(hztableData.length >=1){
+      printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+    // }else{
+    // ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+    // return false;
+    // }
+  }
+}
+const order_viewCloseDialog = () => {
+  order_viewVisible.value = false
+}
 
   
 const onhzexcel = ref(false)

+ 24 - 18
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -126,13 +126,13 @@
 					  <el-table-column align="left" sortable :label=item :prop=item  width="80"/> 
 					</template>
 					<el-table-column align="left" sortable label="制单总数" prop="zdtotal"  width="110"/>
-					<el-table-column align="left" sortable label="建用户" prop="Sys_id"  width="160"/>
-					<el-table-column align="left" sortable label="建档时间" prop="Sys_rq"  width="160"/>
-					<el-table-column align="left" sortable label="更新时间" prop="更新时间"  width="160"/>
+					<el-table-column align="left" sortable label="建用户" prop="Sys_id"  width="160"/>
+					<el-table-column align="left" sortable label="创建日期" prop="Sys_rq"  width="160"/>
+					<el-table-column align="left" sortable label="修改时间" prop="更新时间"  width="160"/>
 				  </el-table>
 				</el-tab-pane>
   
-				<el-tab-pane label="工艺资料" name="second">
+				<!-- <el-tab-pane label="工艺资料" name="second">
 				  <el-table ref="multipleTable"
 							:row-style="{ height: '20px' }"
 							:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
@@ -150,10 +150,10 @@
 					<el-table-column align="left" label="完工状态" prop="完工状态"  width="75"/>
 					<el-table-column align="left" label="工序名称" prop="工序名称"  width="280"/>
 					<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="150"/> 
+					<el-table-column align="left" label="建用户" prop="建用户"  width="90"/>
+					<el-table-column align="left" label="建日期" prop="建日期"  width="150"/> 
 				  </el-table>
-				</el-tab-pane>
+				</el-tab-pane> -->
   
 				<el-tab-pane label="订单资料附件" name="third">
 				  <el-table ref="multipleTable"
@@ -688,7 +688,7 @@
 		      v-model="order_viewVisible"
 		      title="选择打印格式"
 		      width="30%"
-		      top="25%"
+		      top="10%"
 		      :before-close="order_viewCloseDialog"
 		      destroy-on-close
 		    >
@@ -1392,7 +1392,8 @@
 			  <el-dialog v-model="InvoiceVisible" :before-close="InvoiceDialog" title="AI获取发货单出货信息"
 						  style="margin-top: 40px" height="300px" width="1000px" destroy-on-close>
 						  
-					<h3 style="color:red;font-size: 24px;margin:-5px 0px 8px 12px;" >订单编号&nbsp;&nbsp;&nbsp;{{_ddhval}}</h3>
+					<h3 style="color:red;font-size: 24px;margin:-5px 0px 8px 12px;" >订单编号&nbsp;&nbsp;&nbsp;{{_ddhval}}&nbsp;&nbsp;&nbsp;{{_mesval}}</h3>
+					
 					<el-table
 							ref="table" highlight-current-row
 							show-overflow-tooltip border
@@ -1407,16 +1408,16 @@
 						<el-table-column label="颜色" prop="颜色" width="110"></el-table-column>
 						<el-table-column label="尺码" prop="尺码" width="110"></el-table-column>
 						<el-table-column label="制单数量" prop="制单数量" width="110"></el-table-column>
-						<el-table-column label="发货箱数" prop="发货箱数" width="110">
-							<template #default="scope">
+						<el-table-column label="发货箱数" prop="发货箱数" width="110">
+							<template #default="scope">
 								<el-input
-									v-model="scope.row.发货箱数"
-									size="mini"
-									@change="handleQuantityChange(scope.row)"
-									@blur="handleQuantityBlur(scope.row)"
-									placeholder="请输入数量"
-								/>
-							</template>
+									v-model="scope.row.发货箱数"
+									size="mini"
+									@change="handleQuantityChange(scope.row)"
+									@blur="handleQuantityBlur(scope.row)"
+									placeholder="请输入数量"
+								/>
+							</template>
 						</el-table-column>
 							<el-table-column label="每箱件数" prop="每箱件数" width="110">
 							<template #default="scope">
@@ -1674,7 +1675,10 @@
   
 	const InvoiceVisible = ref(false)
 	const InvoicetableData = ref([])
+	const _mesval = ref('')
+
 	const fahuodan = async(row)=>{
+		
 	 const Read_Filelist = await Read_File({
 	     UniqId: row['UniqId'],
 	     order: row['关联编号'],
@@ -1686,6 +1690,8 @@
 		 const PrintListDatas = await PrintListData({order:_Gd_gdbh.value})
 		 sizeDatas.splice(0,PrintListDatas.data.型号.length,...PrintListDatas.data.型号);
 		 InvoicetableData.value = Read_Filelist.data
+		 _mesval.value = Read_Filelist.msg
+		 console.log(_mesval)
 	 }
 	}
 	//取消

+ 110 - 1681
src/view/yunyin/shengchanguanli/shengchanpaichan.vue

@@ -3,356 +3,16 @@
     <layout>
       <layout-header>
         <div class="">
-          <!--          按钮部分-->
           <el-form ref="elSearchFormRef"  :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
             <el-form-item>
-              <!--按钮-->
-             <!-- <el-input v-model="searchInfo" placeholder="搜索" clearable style="width: 180px;"></el-input>
-              <el-button type="primary" icon="search" @click="onSubmit" >查询</el-button> -->
-              <!-- <el-button type="primary" title="设置工单的状态--【计划中】 【生产中】 【已完成】" icon="edit" @click="onStatusClick" class="bt">工单状态设置</el-button> -->
-              <div v-if="(currentNode == '计划中') && treeType === 'customTree'">
-                <!-- <el-button type="primary" title="排产" icon="edit" @click="ongxztgzClick" class="bt">排产</el-button> -->
-                <!-- <el-button type="primary" title="修改" icon="edit" @click="pd_yysjcsonClick" class="bt">修改</el-button> -->
-              </div> 
-              <div v-if="(currentNode == '制程中') && treeType === 'customTree'">
-                <el-button type="primary" title="修改" icon="edit" @click="pd_yysjcsonClick" class="bt">修改</el-button>
-              </div> 
-              <div v-if="(currentNode == '已完工') && treeType === 'customTree'">
-              </div> 
-
-              <div v-else>
-              </div> 
-              <!-- <el-button type="primary" title="打印生产工单" icon="edit" @click="pd_gdprintonClick" class="bt">订单打印</el-button> -->
-			 <!-- <el-button type="primary" icon="edit"   @click="del_ddzlClick" v-if="table_del=== true" :disabled="table_Selection === ''"  class="bt" title="删除"  >删除</el-button> -->
+              <el-input v-model="searchInfo"  placeholder="查询当前订单总数据与数量" style="width: 200px;" @keyup.enter="onSubmit()"></el-input>
+              <el-button type="primary" icon="search" @click="onSubmit" title="搜索">查询</el-button>
+              <el-button type="primary" @click="cp_gdprintonClick" >工单打印</el-button>
+              <el-button type="primary" @click="exportToExcel">导出Excel</el-button>
             </el-form-item>
           </el-form>
-
-          <!-- 状态设置【弹窗】-->
-          <el-dialog v-model="onstatuslist" title="工单状态设置" width="30%" style="top: 15%">
-            <div style="width: 100%;height: 100%;">
-              <div style="width: 100%; display: flex; align-items: center;">
-                <el-form-item label="工单编号 :" prop="currentProcess">
-                  <el-input v-model="statusformData['gdbh']" placeholder="" />
-                </el-form-item>
-              </div>
-              <div style="width: 100%; display: flex; align-items: center; margin-top: 30px;">
-                <span>状态设置:</span>
-                <el-radio-group v-model="status" style="margin-left: 10px;">
-                  <el-radio label="计划中">计划中</el-radio>
-                  <el-radio label="生产中">生产中</el-radio>
-                  <el-radio label="已完工">已完工</el-radio>
-                </el-radio-group>
-              </div>
-              <div class="dialog-footer" style="text-align: right; margin-top: 40px;">
-                <el-button @click="handleCancel">取消</el-button>
-                <el-button type="primary"  @click="handleConfirm">确认</el-button>
-              </div>
-            </div>
-          </el-dialog>
-          <!-- 工序状态更正【弹窗】-->
-          <el-dialog v-model="gxztgzzlist" title="工序状态更正" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
-            <el-button type="primary" @click="edit_gxztgzzCancel">更新时间</el-button>
-            <el-button type="" @click="gxztgzzCancel">退出</el-button>
-            <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
-              <el-form-item label="工单编号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
-                <el-input v-model="gxztgzzformData['gdbh']" @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 200px;"/>
-              </el-form-item>
-            </div>
-            <el-table ref="paichengRef"
-                      :show-overflow-tooltip="true"
-                      :row-style="{ height: '0px' }"
-                      :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
-                      :header-cell-style="{ padding: '0px' }"
-                      style="width: 100%;height: 74vh" border tooltip-effect="dark"
-                      :data="gxztgzztableData" row-key="ID"
-                      :cell-class-name="gxztgzzCellClass">
-              <template v-for="(item, idx) in gxztgzztableColumns">
-                <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
-                  <!--                  <div v-if="['完工时间'].includes(item.prop)">-->
-                  <!--                    <el-input v-model="row[item.prop]"-->
-                  <!--                              :id="`input${idx}${$index}`" @keyup="gxztgzz_handleKeyDown($event, idx, $index, item.prop)"/>-->
-                  <!--                  </div>-->
-                  <div v-if="['完工时间'].includes(item.prop)">
-                    <el-date-picker
-                        v-model="row[item.prop]"
-                        type="datetime"
-                        :id="`datepicker${idx}${$index}`"
-                        placeholder="选择日期和时间">
-                    </el-date-picker>
-                  </div>
-                  <div v-else>{{ row[item.prop] }}</div>
-                </el-table-column>
-              </template>
-            </el-table>
-          </el-dialog>
-          <!--机组调整【弹窗】-->
-          <el-dialog v-model="jizuDisplay" title="机组调整" style="width: 600px;">
-            <el-row class="">
-              <el-col :span="18">
-                <el-tree :data="jizuList"
-                         :props="{label:'label', value: 'value', chidlren: 'children'}"
-                         node-key="value"
-                         show-checkbox
-                         :default-expanded-keys="jizuList[0].value"
-                         @check="checkTreeHandle"
-                         style="margin-right: 10px; padding: 10px; border:-1px solid #ececec"></el-tree>
-              </el-col>
-              <el-col :span="6">
-                <div><el-button type="primary" @click="saveJizuTiaozheng">确定</el-button></div>
-                <div style="margin-top: 20px"><el-button @click="()=>jizuDisplay = false">取消</el-button>                </div>
-              </el-col>
-            </el-row>
-          </el-dialog>
-          <!--车间设备排程【弹窗】-->
-          <el-dialog v-model="cjsbpclist" title="车间设备制程排序" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
-            <el-button type="" @click="cjsbpcCancel">退出</el-button>
-            <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; ">
-              <div style="width: 100%; height: 60px; padding: 0px;  display: flex; align-items: center;">
-                <el-form-item label="设备代号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
-                  <el-input v-model="cjsbpcformData['sbdh']" disabled placeholder="" />
-                </el-form-item>
-                <el-form-item label="班次选择:" prop="originalName" style="margin-left: 20px;">
-                  <el-select v-model="cjsbpcformData.banci" placeholder="请选择" style="width: 230px;" allow-create filterable @change="setBanci">
-                    <el-option
-                        v-for="(option, index) in cjsbpcformData.bancis"
-                        :key="index"
-                        :label="option.value"
-                        :value="option.value"
-                    >
-                      {{option.label}}
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="" prop="isBanciSelected" style="margin-left: 20px;">
-                  <el-checkbox v-model="cjsbpcformData.isBanciSelected">所有班次</el-checkbox>
-                </el-form-item>
-
-                <el-form-item label="" prop="" style="margin-left: 25px;">
-                  <el-button type="" icon="edit"  @click="oneditpcClick">更新排程</el-button>
-                </el-form-item>
-              </div>
-
-              <el-table ref="paichengRef"
-                        :show-overflow-tooltip="true"
-                        :row-style="{ height: '0px' }"
-                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
-                        :header-cell-style="{ padding: '0px' }"
-                        style="width: 100%;height: 74vh" border tooltip-effect="dark"
-                        @row-click="cjpc_tableRowClick"
-                        :data="paichengData" row-key="ID"
-                        :cell-class-name="cjzcCellClass"
-              >
-                <!--                highlight-current-row="true"-->
-                <template v-for="(item, idx) in paichengColumns">
-                  <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
-                    <div v-if="['优先次序', '小时产能', '生产工时', '辅助工时', '班次安排', '排单备注','最早开工时间', '计划开工时间'].includes(item.prop)">
-                      <el-input v-model="row[item.prop]"
-                                :id="`input${idx}${$index}`"
-                                @blur="handleBlur(item['label'], item)"
-                                @keyup="handleKeyDown($event, idx, $index, item.prop)"
-                      />
-                      <!--                      <el-date-picker v-model="row[item.prop]" v-if="['最早开工时间', '计划开工时间'].includes(item.prop)" type="datetime" :clearable="false"-->
-                      <!--                        :id="`input${idx}${$index}`"-->
-                      <!--                        @keyup="handleKeyDown($event, idx, $index , item.prop)"-->
-                      <!--                      />-->
-                    </div>
-                    <div v-else>
-                      {{ row[item.prop] }}
-                    </div>
-                  </el-table-column>
-                </template>
-              </el-table>
-            </div>
-
-          </el-dialog>
-          <!--工序产量核查【弹窗】-->
-          <el-dialog v-model="pd_gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
-            <el-button type="" @click="gxclhcCancel">退出</el-button>
-
-            <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
-              <div style="width: 100%; height: 60px; padding: 0px;  display: flex; align-items: center;">
-                <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 20px 0 0 0">
-                  <el-input v-model="gxclhcformData['gdbh']"  @keyup.enter="gxclhcProductValue" placeholder="" />
-                </el-form-item>
-                印件选择:
-                <el-select v-model="gdwhformData.yjno" placeholder="请选择" allow-create filterable style="width: 100px; margin-right: 10px;">
-                  <el-option v-for="option in gdwhformData.yinjian" @click="ongdwhfanclick" :key="option" :label="option" :value="option" />
-                </el-select>
-                <el-input v-model="inputCpmc" readonly style="width: 50vw; margin-right: 10px;" />
-              </div>
-            </div>
-            <el-table ref="paichengRef"
-                      :show-overflow-tooltip="true"
-                      :row-style="{ height: '0px' }"
-                      :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
-                      :header-cell-style="{ padding: '0px' }"
-                      style="width: 100%;height: 70vh" border tooltip-effect="dark"
-                      highlight-current-row="true"
-                      @row-click="gxclhc_tableRowClick"
-                      :data="gxclhc_Data" row-key="ID"
-                      :cell-class-name="gxclhcCellClass"
-            >
-              <template v-for="(item, idx) in gxclhc_Columns">
-                <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
-                  {{row[item.prop]}}
-                </el-table-column>
-              </template>
-            </el-table>
-          </el-dialog>
-          <!--流程单查询【弹窗】-->
-          <el-dialog v-model="pd_lcdlist" title="工单工序生产进程" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
-            <div style="width: 100%;height: 100%;">
-              <el-button type="" @click="pd_lcdCancel">退出</el-button>
-            </div>
-            <div style="width: 100%; height: 100%; display: flex; align-items: center;">
-              <el-form-item label="工单编号" style="margin-right: 20px; padding: 0;">
-                <el-input v-model="pd_lcdformData['gdbh']" @keyup.enter="pd_lcdProductValue"/>
-              </el-form-item>
-              <el-form-item label="印件号" style="margin-right: 5px; padding: 0;">
-                <el-input v-model="pd_lcdformData['yjno']" @keyup.enter="pd_lcdProductValue"/>
-              </el-form-item>
-              <el-form-item label="" style="margin-right: 5px; padding: 0;">
-                <el-input v-model="pd_lcdformData['code']" disabled/>
-              </el-form-item>
-              <el-form-item label="" style="margin-right: 5px; padding: 0;">
-                <el-input v-model="pd_lcdformData['name']" disabled style="width: 500px"/>
-              </el-form-item>
-            </div>
-            <div style="width: 100%; height: 70vh; display: flex;">
-              <layout>
-                <layout-sider :resize-directions="['right']" :width="240" style="margin-right: 10px;height: 70vh;">
-                  <div class="JKWTree-tree">
-                    <el-tree :data="pd_lcd_treeData" @node-click="pd_lcd_handleNodeClick" default-expand-all></el-tree>
-                  </div>
-                </layout-sider>
-                <layout-main>
-                  <!-- 这里放右侧的内容 -->
-                  <el-space wrap>
-                    <!-- 右侧内容 -->
-                    <template v-for="item in processList.total_process">
-                      <el-button disabled :type="! processList.process.includes(item) ? 'danger' : 'info'" plain style="width: 50px">{{ item }}</el-button>
-                    </template>
-                  </el-space>
-                </layout-main>
-              </layout>
-            </div>
-          </el-dialog>
-          <!-- 排产-->
-            <el-dialog v-model="add_gdyjdialogFormVisible" :before-close="add_gdyjcloseDialog" style="width: 50%;" :title="'车缝小烫排产'" destroy-on-close>
-              <el-form label-width="100px" :model="add_yjzlformdata">
-                <div style="display: flex; gap: 0px;">
-                  <el-form-item label="订单子编号:" class="mab" prop="keyOrder">
-                    <el-input v-model="add_yjzlformdata.ddzbh" style="width: 100px;margin-bottom: 12px; " id="ddzbh" @keydown="add_gdzlent($event, 'zzmc4', 'ddzbh', 'ys')"/>
-                  </el-form-item>
-                  <el-form-item label="颜色:" class="mab" prop="keyOrder">
-                    <el-input v-model="add_yjzlformdata.ys" style="width: 100px;margin-bottom: 12px;" id="ys" @keydown="add_gdzlent($event, 'ddzbh', 'ys', '尺码规格')"/>
-                  </el-form-item>
-                </div>
-                <div style="display: flex; gap: 0px;">
-                  <el-form-item label="尺码规格:" prop="joinDate" >
-                    <el-select v-model="add_yjzlformdata.cmgg" style="width: 150px;" id="尺码规格" @keydown="add_gdzlent($event, 'ys', '尺码规格', '工作中心')">
-                      <el-option label="32~46" value="32~46"></el-option>
-                      <el-option label="S~XXL" value="47~52"></el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item label="工作中心:" prop="joinDate" >
-                    <el-select v-model="add_yjzlformdata.gzzx" style="width: 150px;" id="工作中心" @keydown="add_gdzlent($event, '尺码规格', '工作中心', 'zdsl')">
-                      <el-option label="二分厂" value="32~46"></el-option>
-                      <el-option label="大分厂" value="47~52"></el-option>
-                    </el-select>
-                  </el-form-item>
-                </div>
-
-                <div style="display: flex; gap: 0px;">
-                  <el-form-item label="尺码:" class="mab" prop="keyOrder">
-                    <el-input v-model="cmformdata.cm1" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm2" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm3" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm4" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm5" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm6" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm7" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm8" readonly style="width: 80px;"/>
-                    <el-input v-model="cmformdata.cm9" readonly style="width: 80px;"/>
-                  </el-form-item>
-                </div>
-                <div style="display: flex; gap: 0px;">
-                  <el-form-item label="制单数:" class="mab" prop="keyOrder">
-                    <el-input v-model="zdsformdata.zds1" style="width: 80px;" id="zdsl" @keydown="add_gdzlent($event, '工作中心', 'zdsl', 'zds2')"/>
-                    <el-input v-model="zdsformdata.zds2" style="width: 80px;" id="zds2" @keydown="add_gdzlent($event, 'zdsl', 'zds2', 'zds3')"/>
-                    <el-input v-model="zdsformdata.zds3" style="width: 80px;" id="zds3" @keydown="add_gdzlent($event, 'zds2', 'zds3', 'zds4')"/>
-                    <el-input v-model="zdsformdata.zds4" style="width: 80px;" id="zds4" @keydown="add_gdzlent($event, 'zds3', 'zds4', 'zds5')"/>
-                    <el-input v-model="zdsformdata.zds5" style="width: 80px;" id="zds5" @keydown="add_gdzlent($event, 'zds4', 'zds5', 'zds6')"/>
-                    <el-input v-model="zdsformdata.zds6" style="width: 80px;" id="zds6" @keydown="add_gdzlent($event, 'zds5', 'zds6', 'zds7')"/>
-                    <el-input v-model="zdsformdata.zds7" style="width: 80px;" id="zds7" @keydown="add_gdzlent($event, 'zds6', 'zds7', 'zds8')"/>
-                    <el-input v-model="zdsformdata.zds8" style="width: 80px;" id="zds8" @keydown="add_gdzlent($event, 'zds7', 'zds8', 'zds9')"/>
-                    <el-input v-model="zdsformdata.zds9" style="width: 80px;" id="zds9" @keydown="add_gdzlent($event, 'zds8', 'zds9', '车缝小烫小组1')"/>
-                  </el-form-item>
-                </div>
-                <!-- 图片 -->
-                <div style="display: flex; gap: 0px;">
-                  <el-form-item label="上传图片:" prop="image" class="mab" label-width="100px">
-								    <el-upload ref="upload" class="avatar-uploader" :show-file-list="false" :before-upload="handlePreview" accept="image/*" >
-								      <img v-if="imageUrl" :src="imageUrl" class="avatar" />
-								      <div v-else class="upload-placeholder">
-								        <i class="el-icon-plus avatar-uploader-icon"></i>
-								        <div class="upload-text">点击上传图片</div>
-								      </div>
-								    </el-upload>
-								  </el-form-item>
-                </div>
-
-                <div style="display: flex; gap: 0px;margin-left:30px ;">
-                  <el-form-item label="车缝小烫小组:" prop="joinDate" ><br><br><br>
-                    <div style="margin-left:-105px;margin-top: 25px;">
-                      <el-select v-model="add_yjzlformdata.cfxtxz1" style="width: 120px;" id="车缝小烫小组1" @keydown="add_gdzlent($event, 'zds9', '车缝小烫小组1', '排产数量1')">
-                        <el-option label="服装厂1组" value="32~46"></el-option>
-                        <el-option label="服装厂11组" value="47~52" ></el-option>
-                      </el-select>
-                      <div >
-                      <el-select v-model="add_yjzlformdata.cfxtxz2" style="width: 120px;margin-top: 20px;" id="车缝小烫小组2" @keydown="add_gdzlent($event, '排产数量1', '车缝小烫小组2', '排产数量2')" >
-                        <el-option label="服装厂11组" value="32~46"></el-option>
-                        <el-option label="服装厂1组" value="47~52" ></el-option>
-                      </el-select>  
-                    </div>
-                    </div>
-                    <el-form-item label="排产数量:" prop="joinDate" ><br><br><br>
-                    <div style="margin-left:-75px;margin-top: 25px;">
-                      <el-select v-model="add_yjzlformdata.pcsl1" style="width: 120px;" id="排产数量1" @keydown="add_gdzlent($event, '车缝小烫小组1', '排产数量1', '车缝小烫小组2')">
-                        <el-option label="50" value="32~46"></el-option>
-                        <el-option label="40" value="47~52" ></el-option>
-                      </el-select>
-                      <div >
-                      <el-select v-model="add_yjzlformdata.pcsl2" style="width: 120px;margin-top: 20px;" id="排产数量2" @keydown="add_gdzlent($event, '车缝小烫小组2', '排产数量2', 'ddzbh')">
-                        <el-option label="40" value="32~46"></el-option>
-                        <el-option label="50" value="47~52" ></el-option>
-                      </el-select>  
-                    </div>
-                    </div>
-                    <el-form-item label="操作:" prop="joinDate" ><br><br><br>
-                    <div style="margin-left:-50px;margin-top: 25px;">
-                      <el-button type="primary"  @click="aa" style="margin: 5px;width:40px" >+</el-button>
-                      <div >
-                      <el-button type="primary"  @click="bb" style="margin: 5px;width:40px" >-</el-button>
-                    </div>
-                    </div>
-                  </el-form-item>
-                  </el-form-item>
-                  </el-form-item>
-                </div>
-              </el-form>
-              <template #footer>
-                <div class="dialog-footer" style="text-align: right;">
-                  <el-button @click="add_dyjcloseDialog">取消</el-button>
-                  <el-button type="primary"  @click="add_gdyjenterDialog">保存</el-button>
-                </div>
-              </template>
-            </el-dialog>
-
         </div>
       </layout-header>
-
-      <!-- 左侧 -->
       <layout>
         <layout-sider :resize-directions="['right']" :width="280" style="margin-right: 10px;">
           <div class="JKWTree-tree" style="height: 200px">
@@ -360,123 +20,58 @@
             <el-tree :data="treeData" :props="defaultProps" class="treecolor"  :current-node-key="currentNodeKey" @node-click="handleNodeClick"></el-tree>
           </div>
         </layout-sider>
+
         <layout-content>
           <el-main>
-<!--          customTree 排程 制程  dataTree // 计划中,排产中 ,dataTree 车间-->
-            <div class="gva-table-box"  v-if="treeType === 'customTree'">
-              <el-table ref="multipleTable" style="width: 100%;height: 25vh"
-                        :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                        :header-cell-style="{ padding: '0px' }" border
-                        tooltip-effect="dark" :data="tableData" row-key="ID"
-                        :highlight-current-row="true" size="small" @row-click="gdtableRowClick"
-                        @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
-
-                <template v-for="item in tableFields[currentNode]">
-                  <el-table-column :align="item.align" :label="item.title" :fixed="item.fixed"   :prop="item.prop" :width="item.width" :sortable="item.sortable"  />
-                </template>
-              </el-table>
-              <!-- 分页 -->
-             
-            </div>
-
-            <el-tabs v-model="activeName" @tab-click="handleClick" v-if="(currentNode == '计划中' || currentNode == '已完工') &&  treeType === 'customTree'">
-              <el-tab-pane label="工艺资料"  @click="showTable('工艺资料')"  name="first">
-                <el-table ref="multipleTable" :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
-                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                          :header-cell-style="{ padding: '0px' }" highlight-current-row="true"
-                          style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
-                  <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="500"/>
-                  <el-table-column align="left" sortable label="工序备注" prop="工序备注"  width="150"/>
-                  <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="110"/>
-                  <el-table-column align="left" sortable label="版距" prop="版距"  width="100"/>
-                  <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="UNIQID" prop="UNIQID"  width="110"/>
-                </el-table>
-              </el-tab-pane>
-
-              <el-tab-pane label="印件资料"  @click="showTable('印件资料')"  name="second">
-                <el-table ref="multipleTable" :row-style="{ height: '20px' }"
-                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                          :header-cell-style="{ padding: '0px' }" :show-overflow-tooltip="true"
-                          :highlight-current-row="true"
-                          style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
-                  <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="240"/>
-                  <el-table-column align="left" sortable label="纸张名称" prop="纸张名称"  width="230"/>
-                  <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="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="110"/>
-                  <el-table-column align="left" sortable label="修改时间" prop="修改时间"  width="110"/>
-                  <el-table-column align="left" sortable label="UNIQID" prop="UNIQID"  width="110"/>
-                </el-table>
-              </el-tab-pane>
-            </el-tabs>
-
-            <div v-if="treeType === 'customTree'">
-              <el-table ref="multipleTable2"
-                        v-if="['排程中', '制程中'].includes(currentNode)"
+            <div>
+              <el-table ref="chejianRef"  id="finished"
                         :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                        :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"
-                        :cell-class-name="pczc_planUsageCellClass"
-                        style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
-                <template v-for="item in bottomTableF[currentNode]">
-                  <el-table-column :align="item.align" :label="item.title" :fixed="item.fixed"  :prop="item.prop" :width="item.width" :sortable="item.sortable" />
-                </template>
-              </el-table>
-            </div>
-
-            <div v-if="treeType === 'dataTree'">
-              <el-table ref="chejianRef"
-                        :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
-                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                        :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"  @row-click="chejianRowClick"
-                        style="width: 100%;height: 80vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange"
-              >
-                <!-- 车缝小烫车间列表-->
-                <el-table-column type="selection" width="30" />
-                <template v-for="item in [
-                  { align:'left', title:'订单编号', prop: '订单编号', width: 110, sortable: 'sortable', },
-                  { align:'left', title: '客户编号', prop: '客户编号', width: 110, sortable: 'sortable', },
-                  { align:'left', title: '款式', prop: '款式', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '生产款号', prop: '生产款号', width: 160,  sortable: 'sortable', },
-                  { align:'left', title: '制单数', prop: '制单数', width: 160,  sortable: 'sortable', },
-                  { align:'left', title: '车缝完工数量', prop: '完工数量', width: 160,  sortable: 'sortable', },
-                  { align:'left', title: '落货日期', prop: '落货日期', width: 120,  sortable: 'sortable', },
-                  { align:'left', title: '生产时间', prop: '创建时间', width: 160,  sortable: 'sortable', },
-              ]">
-                  <el-table-column :align="item.align" :label="item.title"  :fixed="item.fixed" :prop="item.prop" :width="item.width" :sortable="item.sortable" />
-                </template>
-				 <div class="gva-pagination">
-				                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
-				                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
-				              </div>
+                        :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"  @row-click="tableRowClick"
+                        style="width: 100%;height: 80vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange">
+                <!-- <el-table-column type="selection" width="30" /> -->
+                <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="200"/>
+                <el-table-column align="left" label="生产款号" prop="生产款号" width="120"/>
+                <el-table-column align="left" label="制单数" prop="制单数" width="75"/>
+                <el-table-column align="left" label="车缝完工数量" prop="完工数量" width="130"/>
+                <el-table-column align="left" label="落货日期" prop="落货日期" width="130"/>
+                <el-table-column align="left" label="生产时间" prop="创建时间" width="130"/>
+                <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> 
             </div>
           </el-main>
         </layout-content>
-
       </layout>
     </layout>
-
-    <PrintPage ref="printPageRef" />
   </div>
+
+     <el-dialog
+				v-model="order_viewVisible"
+				title="选择打印格式"
+				width="30%"
+				top="10%"
+				:before-close="order_viewCloseDialog"
+				destroy-on-close>
+				<el-form>
+				<el-form-item label="打印方向" label-width="100px">
+					<el-radio-group v-model="printDirection">
+					<el-radio label="纵向">纵向</el-radio>
+					<el-radio label="横向">横向</el-radio>
+					</el-radio-group>
+				</el-form-item>
+				</el-form>
+				<template #footer>
+				<el-button @click="order_viewCloseDialog">关闭</el-button>
+				<el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+				</template>
+			</el-dialog>
+		<!-- 打印订单表预览 -->
+		<PrintPage ref="printPageRef" />
 </template>
 <script>
 //点击按钮显示下方表格
@@ -511,22 +106,17 @@ export default {
 <script setup>
 // 全量引入格式化工具 请按需保留
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
-import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
-import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { ref, reactive,onMounted } from 'vue'
+import * as XLSX from 'xlsx'
+import FileSaver from 'file-saver'
 import dayjs from 'dayjs'
-import {MachineList,MachineDetail,CfmachineList,CfdataList,CfdataDel} from '@/api/mes/job'
-import {DataList,getProduct,ProductionSchedulingAdd,Project,
-  StatusEdit,EquipmentScheduling,ScheduleSelection,MachineWorkOrderList,ProcessStatusCorrection,
-  ProductionSchedulingPause,ProcessStatusCorrectionEdit,Schedule,complete,getOrderProcessCount,
-  getOrderProcessLeft,EquipmentSchedulingEdit,MachineTeamEdit,PrintDetailList
-} from "@/api/yunyin/yunying";
-
-import PrintPage from './components/print.vue'
-
+import {MachineList,MachineDetail,CfmachineList,CfdataList,CfdataDel, WorkOrderList} from '@/api/mes/job'
 import { useUserStore } from '@/pinia/modules/user';
+import PrintPage from './components/print.vue'
 defineOptions({name: 'Company'})
+//定义打印跳转页面
+const printPageRef = ref()
 //获取登录用户信息
 const userStore = useUserStore()
 const _username = ref('')
@@ -542,35 +132,72 @@ const minutes = String(today.getMinutes()).padStart(2, '0');
 const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
-const printPageRef = ref()
-//上方表格
-const tableFields = ref({})
-//全局获取工单编号
-const _Gd_gdbh = ref(null)
-const _Gd_yjno = ref(null)
-const tableData = reactive([])
-const chejianData = reactive([])
-const _machine = ref(null);
+
+
 const _Machine_riqi = ref(null);
-const treeType = ref('dataTree') // customTree // 计划中,排产中 ,dataTree 车间
-const machine = ref('');//记录左侧车间机台编号
+// 车间数据相关变量
+const chejianData = reactive([]);
+const jhz_total = ref([]);
+const tableRowClick = async(row) => {
+    console.log('当前行数据:', row)  
+    _Gd_gdbh.value = row.订单编号
+}
+
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+//弹窗
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+const cp_gdprintonClick = () => {
+  order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+  console.log(_Gd_gdbh.value)
+  console.log(printDirection.value)
+    
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+    return false;
+  }else{
+    // if(hztableData.length >=1){
+      printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+    // }else{
+    // ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+    // return false;
+    // }
+  }
+}
+const order_viewCloseDialog = () => {
+  order_viewVisible.value = false
+}
 
+//导出
+const exportToExcel = ()=>{
+  const el = document.getElementById('finished');
+  // 文件名
+  const filename = _Machine_riqi.value + '车缝APS进程.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;
+}
 // =========== 获取左侧树侧形结构 ===========
 const treeData = ref([]);
-const _department_code = ref(null); 
-
 const getDepartmentdata = async () => {
   try {
     // 车缝派工菜单
     const CfmachineLists = await CfmachineList();
     console.log(CfmachineLists);
-
     // 清空 treeData.value 以防止重复添加
     treeData.value = [];
-
     // 获取并排序年份月份,从大到小排列
     const sortedYearMonths = Object.keys(CfmachineLists.data).sort((a, b) => b - a);
-
     // 处理排序后的数据
     for (const yearMonth of sortedYearMonths) {
       const machineList = CfmachineLists.data[yearMonth];
@@ -582,16 +209,13 @@ const getDepartmentdata = async () => {
         }))
       });
     }
-
     // 设置 _Machine_riqi.value 为最新的年月
     _Machine_riqi.value = sortedYearMonths[0];
-
     console.log(treeData.value);
   } catch (error) {
     console.error('获取数据失败:', error);
   }
 };
-
 getDepartmentdata();
 
 // 点击左侧菜单栏
@@ -601,13 +225,11 @@ const handleNodeClick = async (node) => {
     console.log("点击的是日期节点,无需传递参数");
     return;
   }
-
   // 取消所有节点的颜色
   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}"]`);
@@ -615,7 +237,6 @@ const handleNodeClick = async (node) => {
     // 给当前点击的节点改变颜色
     clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
   }
-
   // 以 '【' 分隔,取第一部分
   const machineCode = node.label.split('【')[0];
   console.log(machineCode);  // 输出: CF01
@@ -629,313 +250,8 @@ const handleNodeClick = async (node) => {
   chejianData.splice(0, chejianData.length, ...CfdataListtable.data.table);
   jhz_total.value = CfdataListtable.data.table;
 };
-//默认显示计划中表格
-const currentNode = ref("计划中")
-//计划中、已完工下方印件资料
-const yjtableData = ref([])
-//计划中、已完工下方工艺资料
-const gytableData = ref([])
-//排程中、制程中下方表格
-const bottomData = ref([])
-//车间机台制程列表
-const chejianfuData = ref([])
-//点击侧边栏获取参数
-const _cname = ref(null)
-//工单侧边栏 设备定额及分配参数设置
-const schandleNodeClick = async (node) => {
-  currentNode.value = node.number
-  bottomData.value = []
-  yjtableData.value = []
-  gytableData.value = []
-  console.log(node.number)
 
-  switch (node.number) {
-    case "计划中":
-    const jhz_Projectdata = [
-      {
-        '序号':'1',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-1',
-        '颜色':'红色',
-        '制单总数':'90',
-        '工作中心':'--',
-        '部门':'--',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-      },
-      {
-        '序号':'2',
-        '订单号':'2408001',
-        '生产款号':'2403-1623款',
-        '订单子编号':'2408001-2',
-        '颜色':'蓝色',
-        '制单总数':'80',
-        '工作中心':'--',
-        '部门':'--',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'长袖',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-      },
-      {
-        '序号':'3',
-        '订单号':'2408001',
-        '生产款号':'2403-1623款',
-        '订单子编号':'2408001-2',
-        '颜色':'蓝色',
-        '制单总数':'80',
-        '工作中心':'--',
-        '部门':'--',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'长袖',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-      },
-      {
-        '序号':'4',
-        '订单号':'2408001',
-        '生产款号':'2403-1623款',
-        '订单子编号':'2408001-2',
-        '颜色':'蓝色',
-        '制单总数':'80',
-        '工作中心':'--',
-        '部门':'--',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'长袖',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-      },
-     
-  ];
-      console.log(jhz_Projectdata)
-      tableData.splice(0,tableData.length,...jhz_Projectdata);//表格数据
 
-      _cname.value = '计划中';
-      // _jhz_Projectdata_page();
-      break;
-    // case "排程中":
-    //   const pc_Schedule = await Schedule({status:currentNode.value,search:''});
-    //   tableData.value = pc_Schedule.data;
-    //   break;
-    case "制程中":
-      // const zc_Schedule = await Schedule({status:currentNode.value,search:''});
-    const zcz_Projectdata = [
-      {
-        '序号':'1',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-1',
-        '颜色':'红色',
-        '制单总数':'90',
-        '排产数量':'50',
-        '工作中心':'二分厂',
-        '部门':'服装厂11组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-14 12:00',
-        '排产人':'车间主任xxx',
-      },
-      {
-        '序号':'2',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-1',
-        '颜色':'红色',
-        '制单总数':'90',
-        '排产数量':'40',
-        '工作中心':'二分厂',
-        '部门':'服装厂1组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-14 12:00',
-        '排产人':'车间主任xxx',
-      },
-      {
-        '序号':'3',
-        '订单号':'2408001',
-        '生产款号':'2403-1623款',
-        '订单子编号':'2408001-2',
-        '颜色':'蓝色',
-        '制单总数':'80',
-        '排产数量':'80',
-        '工作中心':'二分厂',
-        '部门':'服装厂12组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-14 12:00',
-        '排产人':'车间主任xxx',
-      },
-  ];
-
-  console.log(zcz_Projectdata)
-  tableData.splice(0,tableData.length,...zcz_Projectdata);//表格数据
-  _cname.value = '制程中';
-      break;
-    case "已完工":
-    const ywg_Projectdata = [
-    {
-        '序号':'1',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-1',
-        '颜色':'红色',
-        '制单总数':'90',
-        '排产数量':'50',
-        '完工数量':'50',
-        '工作中心':'二分厂',
-        '部门':'服装厂11组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-10 12:00',
-        '排产人':'车间主任xxx',
-        '完工时间':'2024-8-14 12:00',
-      },
-    {
-        '序号':'2',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-1',
-        '颜色':'红色',
-        '制单总数':'90',
-        '排产数量':'40',
-        '完工数量':'40',
-        '工作中心':'二分厂',
-        '部门':'服装厂1组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-10 12:00',
-        '排产人':'车间主任xxx',
-        '完工时间':'2024-8-14 12:00',
-      },
-    {
-        '序号':'3',
-        '订单号':'2408001',
-        '生产款号':'2403-1622款',
-        '订单子编号':'2408001-2',
-        '颜色':'黑色',
-        '制单总数':'80',
-        '排产数量':'80',
-        '完工数量':'80',
-        '工作中心':'二分厂',
-        '部门':'服装厂12组',
-        '客户':'DC-7',
-        '落货日期':'2024/7/20',
-        '款式':'连衣裙',
-        '箱唛要求':'折箱装修',
-        '面料':'面布:乱麻复合布;拼布:AZ666雪纺…',
-        '要求':'',
-        '船样描述':'',
-        '船样合计':'4',
-        '粘衬':'',
-        '订单数量':'174',
-        '单位':'件',
-        '审核':'裘志江',
-        '审核日期':'2024/6/27',
-        '排产时间':'2024-8-10 12:00',
-        '排产人':'车间主任xxx',
-        '完工时间':'2024-8-14 12:00',
-      },
-  ]
-  console.log(ywg_Projectdata)
-  tableData.splice(0,tableData.length,...ywg_Projectdata);//表格数据
-  _cname.value = '已完工';
-      break;
-  }
-};
 //分页
 // 分页相关的响应式变量
 const page = ref(1)
@@ -953,904 +269,17 @@ page.value = 10;//默认显示
 pageSize.value = val;
 };
 
-
-//左上角搜索计划中、已完工工单编号
 const searchInfo = ref('');
 //搜索按钮
-const onSubmit = () => {
-  if(searchInfo.value === ''){
-    ElMessage({type: 'warning',message: '请输入搜索的信息'})
-    return false;
-  }else{
-    console.log(searchInfo.value)
-    console.log("点击了搜索按钮");
-  }
-};
-//搜索计划中、已完工一条工单接口
-const _Project = async () => {
-  const status = currentNode.value;
-  const search = searchInfo.value;
-  const Project_search = await Project({status:status,search:search,page:1,limit:30});
-  if(Project_search.msg === '成功'){
-    tableData.value = Project_search.data.data;
-  }else{
-    ElMessage({type: 'warning',message: '查不到具体条件的工单'})
-    return false;
-  }
-};
-// 搜索排程、制程一条工单接口
-const _Schedule = async () => {
-  const status = currentNode.value;
-  const search = searchInfo.value;
-  const Schedule_search = await Schedule({status:status,search:search});
-  if(Schedule_search.msg === '成功'){
-    tableData.value = Schedule_search.data;
-  }else{
-    ElMessage({type: 'warning',message: '查不到具体条件的工单'})
-    return false;
-  }
-};
-//机台搜索一条工单接口
-const _MachineWorkOrderList = async () => {
-  let params = {}
-  params.search = searchInfo.value;
-  params.machine = _machine.value;
-  const MachineWorkOrderList_search = await MachineWorkOrderList(params);
-  if(MachineWorkOrderList_search.msg === ''){
-    ElMessage({type: 'warning',message: '查不到具体条件的工单'})
-    return false;
-  }else{
-    console.log(searchInfo.value)
-    chejianfuData.value = MachineWorkOrderList_search.data['制程'];
-    chejianData.value = MachineWorkOrderList_search.data['排程'];
-  }
-};
-//加入排产按钮
-const onjrpcClick = async () => {
-  searchInfo.value = '';
-  if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
-    ElMessage({type: 'warning',message: '请勾选排程中工单'})
-  }else{
-    if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
-      ElMessage({type: 'warning',message: '选择中小时产量为 0'})
-      return false;
-    }else{
-      let params = {}
-      params.workOrder = _PC_gdbh.value;
-      params.machine = _machine.value;
-      params.printCode = _PC_yjno.value;
-      params.processCode =  _PC_gxh.value;
-      const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
-      if (ProductionSchedulingAdd_add.code === 0) {
-        const  pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
-        chejianData.value = pc_zc_table.data['排程'];
-        chejianfuData.value = pc_zc_table.data['制程'];
-        ElMessage({type: 'success',message: '加入排产 更新成功'});
-      } else {
-        ElMessage({ type: 'error',message: '更新失败'})
-      }
-    }
-
-  }
-};
-//暂停排产按钮
-const onztwgClick = async () => {
-  searchInfo.value = '';
-  if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
-    ElMessage({type: 'warning', message: '请勾选制程中工单'})
-  }else{
-    let params = {}
-    params.workOrder = _ZC_gdbh.value;
-    params.machine = _machine.value;
-    params.printCode = _ZC_yjno.value;
-    params.processCode =  _ZC_gxh.value;
-    const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
-    if (ProductionSchedulingAdd_stop.code === 0) {
-      const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
-      chejianData.value = pc_zc_table.data['排程'];
-      chejianfuData.value = pc_zc_table.data['制程'];
-      ElMessage({type: 'success',message: '暂停排产 更新成功'});
-    } else {
-      ElMessage({ type: 'error',message: '更新失败'})
-    }
-  }
-};
-//工序完工按钮
-const ongxwgClick = async () => {
-  searchInfo.value = '';
-  if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
-    onstatuslist.value = false;
-    ElMessage({type: 'warning',message: '请勾选制程中工单'})
-  }else{
-    let params = {}
-    params.workOrder = _ZC_gdbh.value;
-    params.processCode = _ZC_gxh.value;
-    const complete_get = await complete(params);
-    if (complete_get.code === 0) {
-      const  pc_zc_table = await MachineWorkOrderList({ machine:_machine.value});
-      // chejianData.value = pc_zc_table.data['排程'];
-      chejianfuData.value = pc_zc_table.data['制程'];
-      ElMessage({type: 'success',message: '工序完工 更新成功'})
-    } else {
-      ElMessage({ type: 'error',message: '更新失败'})
-    }
-  }
+const onSubmit = async () => {
+  console.log(searchInfo.value)
+  console.log("点击了搜索按钮");
+  // 调用工单列表接口,传递search参数(可以为空)
+   const CfdataListtable = await CfdataList({ search: searchInfo.value, machine: '', date: '' });
+   chejianData.splice(0, chejianData.length, ...CfdataListtable.data.table);
 };
 
-const table_del = ref(true)
-//表格复选框
-const table_Selection = ref('')
-const PC_handleChange = (selection, type) => {
-	console.log(selection)
-  const ids = selection.map(item => {
-    return item.UniqId
-  })
-  // console.log('获取复选框Uniqid:',ids)
-  table_Selection.value = ids.join(',')
-  console.log("获取复选框逗号间隔:",table_Selection.value)
-}
-
-//删除按钮
-const del_ddzlClick = async () => {
-	console.log(table_Selection._value)
-  
-	let params = {};  
-	params.UniqId = table_Selection._value; 
-	console.log(params)
-  
-	const res1 = await CfdataDel(params)
-	res1.code === 0 && ElMessage.success('删除成功')
-
-	const CfdataListtable = await CfdataList({machine:machine.value});
-	console.log(99999,CfdataListtable)
-	const cjData = CfdataListtable.data
-	console.log(cjData)
-	chejianData.splice(0,chejianData.length,...cjData);//表格数据
-}
-
-//=========工序产量核查===========
-const pd_gxclhclist = ref(false);
-const gxclhc_Data = ref([]);
-const gxclhc_Columns = ref(
-    [
-      { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
-      // { label: '印件', prop: 'Gy0_yjno', width: '130' },
-      // { label: '工序', prop: 'Gy0_gxh', width: '130' },
-      // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
-      { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
-      { label: '联数', prop: 'Gy0_ls', width: '70' },
-      { label: '折算车头产量', prop: '折算车头产量', width: '120' },
-      { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
-      { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
-      { label: '制程废品率', prop: '制程废品率', width: '120' },
-      { label: '来料异常', prop: '来料异常', width: '90' },
-      { label: '流程单数', prop: 'process_num', width: '90' },
-      { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
-      { label: '工序状态', prop: 'PD_WG', width: '90'},
-      { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
-    ]
-)
-const gxclhcformData = reactive({
-  gdbh: '',
-  gdmc: '',
-  yjno: '',
-});
-const gdwhformData = reactive({
-  // 下拉框选项数据
-  yinjian: [],
-  // 设置默认值
-  yjno: '',
-});
-const inputCpmc = ref('')
-
-// 工序产量核查按钮
-const pd_gxclhconClick = async () => {
-  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
-    ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
-    return false;
-  }
-  gxclhcformData['gdbh'] = _Gd_gdbh.value;
-  pd_gxclhclist.value = true;
-  const response = await PrintDetailList ({workOrder:_Gd_gdbh.value});
-  console.log(response)
-  gdwhformData.yjno = response.data[0].no
-  inputCpmc.value = response.data[0].name
-  if (response.code === 0) {
-	  const noFields = response.data.map(item => item.no);
-	  gdwhformData.yinjian = noFields
-	} else {
-	  console.error('查询失败:', response.msg);
-	}
-  _getOrderProcessCount();
-};
-
-//点击印件下拉框
-const ongdwhfanclick = async() => {
-	_PrintDetailList();
-  _getOrderProcessCount();
-}
-
-//工序产量核查回车
-const gxclhcProductValue = async () => {
-  _getOrderProcessCount();
-  _PrintDetailList();
-}
-//工序产量核查退出
-const gxclhcCancel = async () => {
-  pd_gxclhclist.value = false;
-};
-
-//印件编号获取方法接口
-const _PrintDetailList = async () => {
-  const order = gxclhcformData['gdbh'];
-  const response = await PrintDetailList ({workOrder:order});
-  const matchingItem = response.data.find(item => item.no === gdwhformData.yjno);
-    if (matchingItem) {
-		console.log(matchingItem.name)
-		inputCpmc.value = matchingItem.name;
-	} else {
-		console.log(`No matching item found for no: ${gdwhformData.yjno}`);
-	}
-}
-
-//工序产量核查方法接口
-const _getOrderProcessCount = async () => {
-  const order = gxclhcformData['gdbh'];
-  const yjno = gdwhformData.yjno;
-  const getOrderProcessCount_list = await getOrderProcessCount({order:order,yjno:yjno});
-  const concatenatedData = getOrderProcessCount_list.data.map(item => {
-    // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
-    const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
-    const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
-    const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc}`;
-    return {
-      ...item,
-      concatenatedData: concatenatedValue, // 使用新属性名
-    };
-  });
-  gxclhc_Data.value = concatenatedData;
-};
-//工序产量核查
-const gxclhcCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if (column.label === '实际上报产量' ||column.label === '制程废品'  || column.label === '制程废品率' ||
-      column.label === '来料异常' || column.label === '流程单数' || column.label === '当前设备') {
-    return 'lan-plan-usage-lows';
-  }
-  if (column.label === '折算车头产量') {
-    return 'gxclhc—color-column-red';
-  }
-  // 如果不是 'PD_WG' 列,返回空字符串或其他样式类
-  if (column.label === '工序状态'){
-    if(row['PD_WG'] === '完工'){
-      return 'lan-plan-usage-lowshui';
-    }else{
-      return 'pczccolor-column-lan';
-    }
-  }
-}
-
 
-//===========工单状态设置按钮=======
-const onstatuslist = ref(false);
-const statusformData = reactive({gdbh: '',});
-const status = ref('计划中'); // 默认选择
-const onStatusClick = () => {
-  if(_Gd_gdbh.value === null || _Gd_gdbh.value === ''){
-    onstatuslist.value = false;
-    ElMessage({
-      type: 'warning',
-      message: '请选择树形后,再操作此功能'
-    })
-  }else{
-    statusformData['gdbh'] = _Gd_gdbh.value;
-    onstatuslist.value = true;
-  }
-};
-//工单状态设置【放弃按钮】
-const handleCancel = () => {
-  onstatuslist.value = false;
-};
-//工单状态设置【执行按钮】
-const handleConfirm = async () => {
-  //工单编号
-  let workOrder = statusformData['gdbh'];
-  //状态
-  let statusCode;
-  if (status.value === '计划中') {
-    statusCode = "3-计划中";
-  } else if (status.value === '生产中') {
-    statusCode = "2-生产中";
-  }else if (status.value === '已完工') {
-    statusCode = "1-已完工";
-  }
-  const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
-  if (StatusEditdata.code === 0) {
-    ElMessage({type: 'success',message: '更新成功'})
-  } else {
-    ElMessage({type: 'error',message: '更新失败'})
-  }
-  onstatuslist.value = false;
-};
-
-
-// =========== 【工序状态更正】 ===========
-const gxztgzztableColumns = ref(
-    [
-      { label: '印件及工序', prop: '印件及工序', width: '600' },
-      { label: '计划产量/已完成', prop:['计划产量/已完成'], width: '500' },
-      { label: '完成率', prop: '完成率', width: '240' },
-      { label: '完工时间', prop: '完工时间', width: '300' },
-      { label: '设备代号', prop: '设备代号', width: '240' },
-    ]
-)
-const gxztgzztableData = ref([]);
-const gxztgzzlist = ref(false);
-const gxztgzzformData = reactive({gdbh: '',});
-
-// =========== 排产 ===========
-//默认弹窗关闭
-const add_gdyjdialogFormVisible = ref(false)
-const add_yjzlformdata = reactive({
-  ddzbh: '',
-  ys: '',
-  cmgg: '',
-  sfcy: '',
-  gzzx: '',
-  cfxtxz1: '',
-  cfxtxz2: '',
-  pcsl1: '',
-  pcsl2: '',
-});
-const cmformdata = reactive({
-  cm1:'32',
-  cm2:'34',
-  cm3:'36',
-  cm4:'38',
-  cm5:'40',
-  cm6:'42',
-  cm7:'44',
-  cm8:'46',
-  cm9:'总计',
-});
-const zdsformdata = reactive({
-  zds1:'10',
-  zds2:'20',
-  zds3:'30',  
-  zds4:'',
-  zds5: '',
-  zds6:'',
-  zds7:'',
-  zds8:'',
-  zds9:'',
-});
-//清空对象的属性值
-const gdyj_clearFormData = () => {
-  Object.keys(zdsformdata).forEach(key => {
-    zdsformdata[key] = '';
-  });
-  add_yjzlformdata['ddzbh'] = '2408001-1';
-  add_yjzlformdata['ys'] = '红色';
-  add_yjzlformdata['cmgg'] = '32~46';
-  add_yjzlformdata['sfcy'] = '是';
-  add_yjzlformdata['gzzx'] = '二分厂';
-  add_yjzlformdata['cfxtxz1'] = '服装厂11组';
-  add_yjzlformdata['cfxtxz2'] = '服装厂1组';
-  add_yjzlformdata['pcsl1'] = '50';
-  add_yjzlformdata['pcsl2'] = '40';
-};
-//排产按钮
-const ongxztgzClick = () => {
-  // add_yjzlformdata.ddzbh =  _Gd_gdbh.value
-  add_gdyjdialogFormVisible.value = true
-  gdyj_clearFormData();
-}
-//增删小组
-
-//排产确定
-const add_gdyjenterDialog =  async  () => {
-  
-}
-//排产取消
-const add_dyjcloseDialog = () => {
-  add_gdyjdialogFormVisible.value = false
-}
-
-//新增工单资料弹窗 键盘input框跳转
-const add_gdzlent = async (event,id1,id2,id3,idx) => {
-  if(event.keyCode === 40){
-    if(id3!=''){
-      document.getElementById(id3).focus()
-    }
-  }else if (event.keyCode === 13) { // Enter 或向下箭头
-    if(id3!=''){
-      document.getElementById(id3).focus()
-    }
-  } else if (event.keyCode === 38) { // 向上箭头
-    if(id1!=''){
-      document.getElementById(id1).focus()
-    }
-  }else if (event.keyCode === 8) { // 删除箭头
-    if(id1!='' && document.getElementById(id2).value==''){
-      document.getElementById(id1).focus()
-    }
-  }else if (event.keyCode === 37) { // 向左箭头
-    if(id1!='' && document.getElementById(id2).selectionStart==0){
-      document.getElementById(id1).focus()
-    }
-  }else if (event.keyCode === 39) { // 向右箭头
-    if(id3!='' && document.getElementById(id2).selectionStart == document.getElementById(id2).value.length){
-      document.getElementById(id3).focus()
-    }
-  }
-}
-
-//工序状态更正按钮
-// const ongxztgzClick = () => {
-//   if(_Gd_gdbh.value == null){
-//     gxztgzzlist.value = false;
-//     ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
-//   }else{
-//     gxztgzzformData['gdbh'] = _Gd_gdbh.value;
-//     _ProcessStatusCorrection();
-//     gxztgzzlist.value = true;
-//   }
-// };
-//工序状态更正回车
-const gxztgzzgetProductValue = () => {
-  _ProcessStatusCorrection();
-};
-//工序状态更正接口获取
-const _ProcessStatusCorrection = async (row) => {
-  const workOrder = gxztgzzformData['gdbh'];
-  const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
-  gxztgzztableData.value = ProcessStatusCorrectiondata.data;
-};
-//工序状态更正更新
-const edit_gxztgzzCancel = async () => {
-  const formatDate = (inputDateString) => {
-    const timestamp = Date.parse(inputDateString);
-    if (isNaN(timestamp)) {
-      return ''; // 返回空字符串表示日期无效
-    }
-    const date = new Date(timestamp);
-    const year = date.getFullYear();
-    const month = ('0' + (date.getMonth() + 1)).slice(-2);
-    const day = ('0' + date.getDate()).slice(-2);
-    const hour = ('0' + date.getHours()).slice(-2);
-    const minute = ('0' + date.getMinutes()).slice(-2);
-    const second = ('0' + date.getSeconds()).slice(-2);
-    return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
-  };
-  const formattedData = gxztgzztableData.value.map(item => {
-    return {
-      UniqId: item['UniqId'],
-      PD_WG: formatDate(item['完工时间']),
-    };
-  });
-  const ProcessStatusCorrectionEdit_status = await ProcessStatusCorrectionEdit(formattedData);
-  if (ProcessStatusCorrectionEdit_status.code === 0) {
-    ElMessage({ type: 'success',message: '更新成功' })
-  } else {
-    ElMessage({type: 'error',message: '更新失败'})
-  }
-  gxztgzzlist.value = false;
-};
-//工序状态更正退出
-const gxztgzzCancel = () => {
-  gxztgzzlist.value = false;
-};
-
-
-//机组调整按钮
-const jizuDisplay = ref(false)
-const jizuList = ref([])
-const jizuSelection = ref([])
-const onjztzClick = async () => {
-  if (jitaiArr.value.length === 0) {
-    ElMessage.warning('请选择数据')
-    return
-  }
-  jizuList.value = [
-    {
-      label: jitaiArr.value[0].车间名称,
-      value: jitaiArr.value[0].车间名称,
-      disabled: true,
-      children: []
-    }
-  ]
-  const res = await gdzl_MachineList({address:jitaiArr.value[0].车间名称})
-  jizuList.value[0].children = res.data.map(item => {
-    return { label: item, value: item.match(/^\w+#/)[0]}
-  })
-  jizuDisplay.value = true
-};
-
-const checkTreeHandle = (data, tree) => {
-  jizuSelection.value = tree.checkedNodes
-}
-
-const saveJizuTiaozheng = async () => {
-  if (jizuSelection.value.length === 0) {
-    ElMessage.warning('请先勾选机组')
-    return
-  }
-  const uid = jitaiArr.value.map(item => item.GYUID).join(' ')
-  const jizu = jizuSelection.value.map(item=>item.value).join(' ')
-  try {
-    const res = await MachineTeamEdit({UniqId: uid, machine: jizu})
-    if (res.code == 0) ElMessage.success('调整成功')
-    const  pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
-    chejianData.value = pc_zc_table.data['排程'];
-    chejianfuData.value = pc_zc_table.data['制程'];
-    jizuDisplay.value = false
-  } catch(e) {
-    ElMessage.error(e)
-  }
-}
-
-//=============引用实际参数================
-const pd_yysjcsonClick = () => {
-  if(_Gd_gdbh.value == null){
-    gxztgzzlist.value = false;
-    ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
-  }else{
-    console.log(_Gd_gdbh.value)
-    ElMessage({type: 'warning',message: '没有找到该产品的入仓完工记录,不能继续进行'})
-  }
-};
-
-//=============车间设备排程================
-const paichengColumns = ref(
-    [
-      { label: '优先次序', prop: '优先次序', width: '105' },
-      { label: '工单编号', prop: '工单编号', width: '100' },
-      // { label: '印件名称', prop: '印件名称', width: '200' },
-      { label: '接货数', prop: '计划接货数', width: '90' },
-      { label: '已完成', prop: '已完成', width: '90' },
-      { label: '小时产能', prop: '小时产能', width: '100' },
-      { label: '生产工时', prop: '生产工时', width: '100' },
-      { label: '辅助工时', prop: '辅助工时', width: '100' },
-      { label: '班次安排', prop: '班次安排', width: '100' },
-      { label: '排单备注', prop: '排单备注', width: '150' },
-      { label: '最早开工时间', prop: '最早开工时间', width: '180' },
-      { label: '计划开工时间', prop: '计划开工时间', width: '180' },
-      { label: '计划完工时间', prop: '计划完工时间', width: '180' },
-      { label: '销售订单号', prop: '销售订单号', width: '120' },
-      { label: '印件/工序', prop: '印件/工序', width: '110' },
-    ])
-
-const handleDataSortAndSettingDate = () => {
-  paichengData.value.sort((a, b) => {
-    const priorityA = parseFloat(a['优先次序']);
-    const priorityB = parseFloat(b['优先次序']);
-    // 将空白值放在最后
-    if (isNaN(priorityA)) return 1;
-    if (isNaN(priorityB)) return -1;
-    // 按优先次序升序排序
-    return priorityA - priorityB;
-  });
-
-  paichengData.value.map((item, index) => {
-    console.log(Math.round(((item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0)) / item['小时产能']).toFixed(1))
-
-
-    if(item['小时产能'] !== '' && item['小时产能'] !== 0){
-      item['生产工时'] = Math.round(((item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0)) / item['小时产能']).toFixed(1);
-    }
-    if(item['生产工时'] === 'Infinity' || item['生产工时'] === '-Infinity'){
-      item['生产工时'] = 0;
-    }
-
-    let hour = parseFloat(item['生产工时']) + parseFloat(item['辅助工时'])
-    if ( ((Math.floor(hour) * 10) % 10) !== 5) {
-      hour = Math.round(hour)
-    }
-    const sec = hour * 3600
-    const startTime = dayjs(item['计划开工时间']).unix()
-    item['计划完工时间'] = dayjs((startTime + sec) * 1000).format('YYYY-MM-DD HH:mm:ss')
-    if (index > 0) {
-      item['计划开工时间'] = paichengData.value[index-1]['计划完工时间']
-      hour = parseFloat(item['生产工时']) + parseFloat(item['辅助工时'])
-      if ( ((Math.floor(hour) * 10) % 10) !== 5) {
-        hour = Math.round(hour)
-      }
-      const sec = hour * 3600
-      const startTime = dayjs(item['计划开工时间']).unix()
-      item['计划完工时间'] = dayjs((startTime + sec) * 1000).format('YYYY-MM-DD HH:mm:ss')
-    }
-  })
-}
-
-const handleBlur = (name, item) => {
-  console.log(name)
-  console.log(item)
-  if (name === '优先次序' || name === '计划开工时间' || name === '生产工时' || name === '辅助工时' || name === '最早开工时间') {
-    handleDataSortAndSettingDate()
-  }
-  if (name === '小时产能') {
-    // console.log(item)
-    // item['生产工时'] = Math.round( ( (item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0) ) / item['小时产能'] ).toFixed(1)
-    // console.log(item['计划接货数'])
-    // console.log(item['已完成'])
-    // console.log(item['生产工时'])
-    handleDataSortAndSettingDate()
-  }
-}
-const handleKeyDown = (event, x, y, prop) => {
-  const currentElement = document.getElementById(`input${x}${y}`);
-  if (currentElement === null && currentElement === undefined) return
-  let move = 0
-  switch (event.keyCode) {
-    case 13: // Enter
-      if (x === 0 && y === +y) {
-            handleDataSortAndSettingDate()
-      }
-      const nextInputElement = document.getElementById(`input${x}${y + 1}`);
-      if (nextInputElement) {
-        nextInputElement.focus();
-      }
-      break;
-    case 40: // 向下箭头
-      if (y < paichengData.value.length ){
-        const nextInputElement = document.getElementById(`input${x}${y + 1}`);
-        if (nextInputElement) {
-          nextInputElement.focus();
-        }
-      }
-      break;
-    case 38: // 向上箭头
-      if ( y > 0) {
-        document.getElementById(`input${x}${y - 1}`).focus();
-      }
-      break;
-    case 39: // 向右箭头
-      if ( x === 0) {
-        move = x + 5
-      } else if (x >= 5 && x <=10) {
-        move = x + 1
-      }
-      const nextInputElements = document.getElementById(`input${move}${y}`);
-      if (nextInputElements) {
-        nextInputElements.focus();
-      }
-      break;
-    case 37: // 向左箭头
-      if ( x === 5) {
-        move = x -  5
-      } else if (x >= 5 && x <=10) {
-        move = x - 1
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    default:
-      break;
-  }
-}
-const cjsbpclist = ref(false);
-const cjsbpcformData = reactive({
-  //设备代号
-  sbdh: '',
-  // 下拉框选项数据
-  bancis: [],
-  // 设置默认值
-  banci: '',
-  isBanciSelected: false,
-});
-
-//订单打印
-const pd_gdprintonClick = () => {
-  printPageRef.value.open(_Gd_gdbh.value)
-}
-
-//车间设备排程【按钮】
-const oncjsbpcClick = async () => {
-  cjsbpcformData['sbdh'] = _machine.value;
-  paichengData.value = [];
-   _EquipmentSchedulingdata();
-   _ScheduleSelectiondata();
-
-  cjsbpclist.value = true;
-};
-//调用班次选择列表接口
-const _ScheduleSelectiondata = async ()=>{
-  try {
-    const ScheduleSelectiondata = await ScheduleSelection();
-    // 清空之前的数据
-    cjsbpcformData.bancis = [];
-    // 循环遍历数组并将每个班次的detail添加到bancis数组中
-    for (const option of ScheduleSelectiondata.data) {
-      cjsbpcformData.bancis.push({ label: option.detail, value: option.detail.split('||')[0], rename:option.detail});
-    }
-  } catch (error) {
-    console.error(error);
-  }
-}
-//车间设备排程->数据展示
-const paichengData = ref([])
-//点击车间排程行
-const _bcxz_val = ref(null)
-
-//点击表格行的时候触发的方法
-const cjpc_tableRowClick = (row) => {
-  _bcxz_val.value = row; // 保存点击的行数据
-}
-//班次选择列表下拉框
-const setBanci = (v) => {
-  if(cjsbpcformData['isBanciSelected'] === true){
-    paichengData.value.map( item => item.班次安排 = v)
-  }else{
-    if (_bcxz_val.value) {
-      _bcxz_val.value['班次安排'] = v;
-    }
-  }
-}
-const _EquipmentSchedulingdata = async ()=>{
-  // let machine = 'WY01#';
-  let machine = _machine.value;
-  try {
-    const EquipmentSchedulingdata = await EquipmentScheduling({machine:machine});
-    console.log(EquipmentSchedulingdata)
-    if (EquipmentSchedulingdata.code === 0) {
-      paichengData.value = EquipmentSchedulingdata.data
-      paichengData.value.map((item, index) => {
-        item['优先次序'] = 50 + index
-      })
-
-      handleDataSortAndSettingDate()
-    }
-  } catch (error) {
-    console.error(error);
-  }
-}
-//车间设备制程->数据编辑
-
-
-//车间设备制程【更新排程】
-const oneditpcClick = async () => {
-  const rawValueArray = paichengData._rawValue;
-  const formattedData = rawValueArray.map(item => {
-    return {
-      capacity: item.小时产能,
-      ProductionHours: item.生产工时,
-      AuxiliaryHours: item.辅助工时,
-      shift: item.班次安排,
-      remark: item.排单备注,
-      start: item.最早开工时间,
-      projectTime: item.计划开工时间,
-      endTime: item.计划完工时间,
-      UniqId: item.UniqId
-    };
-  });
-  console.log(formattedData);
-  const EquipmentSchedulingEdit_edit = await EquipmentSchedulingEdit(formattedData);
-  // console.log(EquipmentSchedulingEdit_edit)
-  if (EquipmentSchedulingEdit_edit.code === 0) {
-    ElMessage({ type: 'success', message: '更新成功' });
-    console.log(_machine.value)
-    const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
-    chejianData.value = zhubiao.data['排程'];
-    chejianfuData.value = zhubiao.data['制程'];
-    cjsbpclist.value = false;
-  } else {
-    ElMessage({ type: 'error', message: '更新失败' });
-  }
-  // cjsbpclist.value = true;
-};
-//车间设备制程【退出】
-const cjsbpcCancel = () => {
-  cjsbpclist.value = false;
-};
-
-
-// =========== 流程单查询 ===========
-
-const pd_lcdlist = ref(false);
-const pd_lcdformData = reactive({
-  gdbh: '',
-  code: '',
-  name: '',
-  yjno: '',
-});
-// 流程单查询按钮
-const processList = ref([]);
-const pd_lcdlistonClick = async () => {
-  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
-    ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
-    return false;
-  }else{
-    pd_lcdformData['gdbh'] = _Gd_gdbh.value;
-    pd_lcdformData['yjno'] = _Gd_yjno.value;
-    pd_lcdlist.value = true;
-    processList.value = []
-    _getOrderProcessLeft_list();
-  }
-}
-const pd_lcdProductValue = async () => {
-  _getOrderProcessLeft_list();
-}
-const pd_lcd_treeData = ref([]);
-const _getOrderProcessLeft_list = async () => {
-  const order = pd_lcdformData['gdbh'];
-  const yjno = pd_lcdformData['yjno']
-  // console.log(order)
-  try {
-    //5.1流程单查询-工单工序生产进程菜单栏
-    const getOrderProcessLeft_list = await getOrderProcessLeft({ order:order,yjno:yjno});
-    console.log(getOrderProcessLeft_list)
-    pd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code'];
-    pd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name'];
-    pd_lcd_treeData.value = [{
-      label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
-      // label: order + '-' + getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
-      value: undefined,
-      children: []
-    }]
-    const newData = [];
-    for (let key in getOrderProcessLeft_list.data.Gy_info) {
-      let temp = getOrderProcessLeft_list.data.Gy_info[key];
-      let concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`;
-      newData.push({ label: concatenatedValue,value: temp.Gy0_gxh });
-    }
-    pd_lcd_treeData.value[0].children = newData;
-    //5.2流程单查询-获取工单工序生产进程右侧【进入页面默认显示第一个】
-    const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:newData[0].value,yjno:yjno});
-    processList.value = getOrderProcessRight_list.data
-  } catch (error) {
-    console.error(error);
-  }
-};
-
-const pd_lcd_handleNodeClick = async (node) => {
-  if (node.value === undefined) return
-  const order = pd_lcdformData['gdbh'];
-  const yjno = pd_lcdformData['yjno'];
-  ////5.2流程单查询-获取工单工序生产进程右侧
-  const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:node.value,yjno:yjno});
-  console.log(getOrderProcessRight_list)
-  processList.value = getOrderProcessRight_list.data
-};
-
-// 流程单查询退出
-const pd_lcdCancel = async () => {
-  pd_lcdlist.value = false;
-}
-
-
-//颜色
-//工序状态更正颜色
-const gxztgzzCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if(row['完工时间'] === ''){
-    return 'lan-plan-usage-low';
-  }else{
-    return 'hui-plan-usage-low';
-  }
-}
-//车间设备制程排序背景
-const cjzcCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if (column.label === '小时产能' || column.label === '优先次序' || column.label === '生产工时' || column.label === '辅助工时' || column.label === '班次安排' || column.label === '排单备注' || column.label === '最早开工时间'  || column.label === '计划开工时间') {
-    return 'background-color-column-fen';
-  }
-  if (row) {
-    return 'color-column-lan';
-  }
-}
-
-//排程中、制程中 下方表格文字变色
-const pczc_planUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if (row['工序完工'].substring(0, 2) === "20") {
-    return 'pczccolor-column-hui';
-  } else {
-    return 'pczccolor-column-lan';
-  }
-}
-
-
-// 右键勾选
-const rowContextMenu = (row) => {
-  // console.log(row)
-
-  return false
-}
 </script>
 <style scoped>
 /* 选中某行背景粉色 */

+ 133 - 387
src/view/yunyin/shengchanguanli/yangyipihe.vue

@@ -2,9 +2,7 @@
 	<div style="margin: 0px;">
 	  <layout>
 		<layout-header>
-		  <!-- <div class=""> -->
-			<!--          按钮部分-->
-			<el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" >
+			<el-form>
 			  <el-form-item>
 				<el-input v-model="searchInfo" placeholder="模糊搜索订单编号或者生产款号" @keyup.enter="onSubmit()"  style="width: 220px;"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
@@ -17,56 +15,47 @@
 					<span>” 的代表新订单未上传附件</span>
 				</el-tag>
 			</el-form>
-			
-		  <!-- </div> -->
 		</layout-header>
-  
 		<layout>
 
-		  <!-- 右侧区域 -->
 		  <layout-content >
-		  <!-- <el-main> -->
 			<div class="gva-table-box">
-			  <!-- 表格数据 -->
 			  <el-tabs v-model="activeName">
-				<el-tab-pane label="样衣待核批列表"   @click="showTable('样衣待核批列表')" name="first">
+				<el-tab-pane label="订单资料列表" name="first">
 					<el-table ref="multipleTable"  :row-style="{ height: '20px' }"
 							:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
 							:header-cell-style="{ padding: '0px' }"
-							 @row-click="yydp_clickybupdate" 
-                        	 @row-dblclick="yydp_updateCompanyFunc"
-							 highlight-current-row="true"
-							 :show-overflow-tooltip="true"
+							highlight-current-row="true"
+							:show-overflow-tooltip="true"
 							style="width: 100%;height: 65vh" border  :data="tableData1" row-key="ID" @selection-change="handleSelectionChange">
 						<el-table-column   align="center" type="selection" width="40"/>
 						<el-table-column   align="center" label="技术附件状态" prop="status"  width="110" />
 						<el-table-column   align="center" label="订单附件状态" prop="orderstatus"  width="110" />
 						<el-table-column   align="left" label="客户" prop="客户编号"  width="70" />
 						<el-table-column   align="left" label="订单编号" prop="订单编号"  width="115" />
-						<el-table-column   align="left" label="款号" prop="生产款号"  width="150" />
+						<el-table-column   align="left" label="生产款号" prop="生产款号"  width="150" />
 						<el-table-column   align="left" label="款式" prop="款式"  width="110" />
-						<el-table-column align="center" label="状态" prop="gd_statu" width="115" >
+						<el-table-column align="center" label="状态" prop="gd_statu" width="130" >
 						    <template #default="{ row }">
 						      <el-tag :type="row.gd_statu === '1-计划中' ? 'warning' : 
 						                     (row.gd_statu === '已裁剪' ? 'primary' : 
 						                     (row.gd_statu === '已车缝' ? '' : 
 						                     (row.gd_statu === '2-生产中' ? 'success' :
 						                     (row.gd_statu.includes('总检已') ? 
-						                       (parseInt(row.gd_statu.match(/\d+/)?.[0]) >= 95 ? 'success' : 'info') : 
+						                       (parseInt(row.gd_statu.match(/\d+/))?.[0] >= 95 ? 'success' : 'info') : 
 						                     (row.gd_statu === '已完工' ? 'success' : 'info')))))">
 						            {{ row.gd_statu === '1-计划中' ? '计划中' : 
 						               (row.gd_statu === '已裁剪' ? '已裁剪' : 
 						               (row.gd_statu === '已车缝' ? '已车缝' : 
 						               (row.gd_statu === '2-生产中' ? '生产中' :
 						               (row.gd_statu.includes('总检已') ? 
-						                 (parseInt(row.gd_statu.match(/\d+/)?.[0]) >= 95 ? '已完工' : row.gd_statu.replace('总检已', '总检')) : 
+						                 (parseInt(row.gd_statu.match(/\d+/))?.[0] >= 95 ? '已完工' : row.gd_statu.replace('总检已', '总检')) : 
 						               row.gd_statu)))) }}
 						      </el-tag>
 						    </template>
 						</el-table-column>
 						<el-table-column   align="left" label="订单数量" prop="订单数量"  width="90" />
 						<el-table-column   align="left" label="包装完工数量" prop="工单完工数量"  width="110" />
-						<el-table-column   align="left" label="完工日期" prop="工单完工日期"  width="140" />
 						<el-table-column   align="left" label="单位" prop="单位"  width="55" />
 						<el-table-column   align="left" label="面料" prop="面料"  width="360" />
 						<el-table-column   align="left" label="粘衬" prop="粘衬"  width="360" />
@@ -76,16 +65,12 @@
 						<el-table-column   align="left" label="箱唛要求" prop="箱唛要求"  width="360" />
 						<el-table-column   align="left" label="制单人" prop="Sys_id"  width="160" />
 						<el-table-column   align="left" label="制单日期" prop="Sys_rq"  width="160" />
-						<!-- <el-table-column   align="left" label="接单日期" prop="接单日期"  width="120" /> -->
 						<el-table-column   align="left" label="出库日期" prop="出库日期"  width="160" />
 						<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="160" />
-						<!-- <el-table-column   align="left" label="更新时间" prop="Mod_rq"  width="160" /> -->
-
 					</el-table>
 				</el-tab-pane>
-					<!-- 分页 -->
 					<div class="gva-pagination">
 						<el-pagination
 							@size-change="handleSizeChange"
@@ -99,8 +84,9 @@
 					</div>
             </el-tabs>
 			</div>
+
 				<!-- 状态更改弹窗 -->
-				<el-dialog v-model="dialogVisible" title="状态更改" style="width: 45vh;height: 25vh;">
+				<el-dialog v-model="dialogVisible" title="状态更改">
 				<el-radio-group v-model="selectedStatus" >
 					<el-radio 
 					v-for="item in statusOptions"
@@ -111,386 +97,155 @@
 					</el-radio>
 				</el-radio-group>
 				<template #footer >
-					<el-button style="margin-top: 70px;" @click="dialogVisible = false">取消</el-button>
-					<el-button style="margin-top: 70px;"type="primary" @click="handleStatusConfirm">确认</el-button>
+					<el-button @click="dialogVisible = false">取消</el-button>
+					<el-button type="primary" @click="handleStatusConfirm">确认</el-button>
 				</template>
 				</el-dialog>
-		  <!-- </el-main> -->
+
 		</layout-content>
 		</layout>
 	  </layout>
 	</div>
   </template>
-  <script>
-  //点击按钮显示下方表格
-  export default {
-	data() {
-	  return {
-		currentTable: '', // 当前展示的表格
-		activeName: 'first',
-	  };
-	},
-	methods: {
-	  showTable(tableName) {
-		this.currentTable = tableName;
-	  },
-	}
-  };
-  </script>
   <script setup>
   // 全量引入格式化工具 请按需保留
-  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+  import { Layout, LayoutContent } from '@arco-design/web-vue';
   import {ref, reactive} from 'vue'
-  import {UnapprovalList,Approval,Apigdstatus} from '@/api/mes/job'
-  import {jcgetTab,workOrderDetail,getOrderProcessCount,PrintDetailList} from '@/api/yunyin/yunying'
-  import PrintPage from './components/print.vue'
+  import {UnapprovalList, Approval, Apigdstatus} from '@/api/mes/job'
   import {ElMessage} from "element-plus";
-import { useUserStore } from '@/pinia/modules/user';
-defineOptions({name: 'Company'})
-//获取登录用户信息
-const userStore = useUserStore()
-const _username = ref('')
-_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
-// console.log('获取用户名称',_username.value)
-//全局获取当前日期
-const today = new Date();
-const year = today.getFullYear();
-const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
-const day = String(today.getDate()).padStart(2, '0');
-const hours = String(today.getHours()).padStart(2, '0');
-const minutes = String(today.getMinutes()).padStart(2, '0');
-const seconds = String(today.getSeconds()).padStart(2, '0');
-const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
-const currentDates = `${year}-${month}-${day}`;
-
+  import { useUserStore } from '@/pinia/modules/user';
+  
+  defineOptions({name: 'Company'})
+  
+  //获取登录用户信息
+  const userStore = useUserStore()
+  
   // 分页相关的响应式变量
   const page = ref(1)
   const total = ref(0)
   const pageSize = ref(50)
+  const activeName = ref('first')
+  
   // 分页
   const handleCurrentChange = (val) => {
-	page.value = val;
-	onSubmit();
+    page.value = val;
+    onSubmit();
   };
   
   // 修改页面容量 点击多少条/页
   const handleSizeChange = (val) => {
-	pageSize.value = val;
-	onSubmit();
+    pageSize.value = val;
+    onSubmit();
   };
-
-
-//进入页面显示所有数据
-const getUnapprovalList = async () => {
-  try {
-    const UnapprovalListtable  = await UnapprovalList({search:'',page:page.value,limit:pageSize.value});
-	const workOrderDetaildata1 = UnapprovalListtable.data.table
-	tableData1.splice(0,tableData1.length,...workOrderDetaildata1);
-	total.value = UnapprovalListtable.data.total
-
-  setTimeout(() => {
-				const inputElement = document.getElementById('searchInput');
-				if (inputElement) {
-					inputElement.focus();		
-				}
-			}, 100); // 延迟100毫秒
-  } catch (error) {
-    console.error(error)
-  }
-}
-getUnapprovalList();
-
-
-
-
-  // =========== 获取左侧树侧形结构 ===========
-//   const treeData = ref({})
-//   const _department_code = ref(null)
-//   const getDepartmentdata = async () => {
-// 	try {
-// 	  const data = 
-// 		[{
-// 		label : '客户编号',
-// 		children : [
-// 		{label : 'DC-1'},
-// 		{label : 'DC-2'},
-// 		{label : 'DC-3'},
-// 		{label : 'DC-4'},
-// 		{label : 'DC-5'},
-// 		{label : 'DC-6'},
-// 		{label : 'DC-7'},
-// 		{label : 'DC-8'},
-// 		{label : 'DC-9'},
-// 		{label : 'DC-10'},
-// 		{label : 'DC-11'},
-// 		{label : 'DC-12'},
-// 		{label : 'DC-13'},
-// 		{label : 'DC-14'},
-// 		{label : 'DC-15'}
-// 	  ]
-// 	  }];
-// 	  treeData.value = data
-// 	} catch (error) {
-// 	  console.error(error)
-// 	}
-//   }
-//   getDepartmentdata();
-
-//全局调用左侧菜单编号
-const _code = ref(null);  
-//全局调用工单编号
-const _Gd_gdbh = ref(null)
-//全局调用印件代号
-const _Gd_cpdh = ref(null)
-
-const tableData1 = reactive([]);
-const tableData2 = reactive([]);
- //点击左侧树形 获取右侧table列表
-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';
-	}
-	searchInfo.value = '';  // 清空搜索信息
-
-	if(node.label === '客户编号'){
-		// console.log(node.label)
-	}else{
-		// console.log(node.label)
-		
-		const workOrderDetaildata2 = [
-			{
-				'序号':'1',
-				'订单子编号':'XXX001-船',
-				'颜色名称':'黑色',
-				'生产款号':'2403-1622款',
-				'客户':'DC-7',
-				'船样':'否',
-				'S':'/',
-				'M':'2',
-				'L':'/',
-				'XL':'2',
-				'XXL':'/',
-				'制单总数':'4',
-				'建档用户':'xxx',
-				'建档日期':'',
-				'更新时间':'',
-				'核批人':'/',
-				'核批日期':'/',
-			},
-		];
-		// console.log(workOrderDetaildata1)
-		// console.log(workOrderDetaildata2)
-
-		tableData2.splice(0,tableData2.length,...workOrderDetaildata2);
-	}
-	
-};
-
-
-// =========== 表格 ===========
-//单机样衣待核批列表
-const yydp_clickybupdate = async (row) => {
-
-};
-
-//双击样衣待核批列表
-const yydp_updateCompanyFunc = async (row) => {
-	
-};
-
-//单机样衣已核批列表
-const yyyp_clickybupdate = async (row) => {
-
-};
-
-//双击样衣已核批列表
-const yyyp_updateCompanyFunc = async (row) => {
-
-};
- 
-
-// =========== 按钮 ===========
-// 搜索默认为空
-const searchInfo = ref('')
-const table_Selection = ref(false)
-//查询按钮
-const onSubmit = async ()  => {
-	// if(searchInfo.value === ''){
-		// ElMessage({type: 'warning',message: '请输入搜索的订单编号' })
-		// return false;
-	// }else{
-		const UnapprovalListtable = await UnapprovalList({search:searchInfo.value,page:page.value,limit:pageSize.value});
-		tableData1.splice(0,tableData1.length,...UnapprovalListtable.data.table);
-		total.value = UnapprovalListtable.data.total
-	// }
-};
-
-//表格复选框
-const _Uniqid = ref('');  
-const _Sys_id = ref('');
-const multipleTable = ref(null);
-const handleSelectionChange = (selection, type) => {
-    // console.log(selection);  
-	if(selection.length >= 1){
-		table_Selection.value = true
-		 // 提取 Uniqid  
-		 const Uniqid_ids = selection.map(item => item.Uniqid).join(',');  
-		_Uniqid.value = Uniqid_ids;  
-		// 提取 Sys_id  
-		const Sys_ids = selection.map(item => item.Sys_id).join(',');  
-		_Sys_id.value = Sys_ids;  
-	}else{
-		table_Selection.value = false
-	}
-   
-};
-
-//核批通过按钮
-const hptg_onClick = async () => {
-	// console.log(_Uniqid.value)
-	// console.log(_Sys_id.value)
-	const Approvals = await Approval({Uniqid:_Uniqid.value,sys_id:userStore.userInfo.nickName});
-	if (Approvals.code === 0) {
-		searchInfo.value = ''
-		_Uniqid.value = ''
-		_Sys_id.value = ''	
-		ElMessage({type: 'success',message: '核批成功'})
-		if (multipleTable.value) {
-			multipleTable.value.clearSelection();
+  
+  const getUnapprovalList = async () => {
+    try {
+      const UnapprovalListtable = await UnapprovalList({search:'', page:page.value, limit:pageSize.value});
+      const workOrderDetaildata1 = UnapprovalListtable.data.table;
+      tableData1.splice(0, tableData1.length, ...workOrderDetaildata1);
+      total.value = UnapprovalListtable.data.total;
+    } catch (error) {
+      console.error('获取数据失败:', error);
+      ElMessage.error('获取数据失败');
     }
-		const UnapprovalListtable = await UnapprovalList({search:searchInfo.value,page:page.value,limit:pageSize.value});
-		tableData1.splice(0,tableData1.length,...UnapprovalListtable.data.table);
-		total.value = UnapprovalListtable.data.total
-	} else {
-		ElMessage({ type: 'error',message: '核批失败'})
-	}
-};
-
-const dialogVisible = ref(false);
-const selectedStatus = ref('');
-const statusOptions = [
-  { value: '1-计划中', label: '1-计划中' },
-  { value: '2-生产中', label: '2-生产中' },
-  { value: '3-已完工', label: '3-已完工' }
-];
-
-const handleStatusConfirm = async () => { 
-  if (!selectedStatus.value) {
-    ElMessage.warning('请选择状态');
-    return;
   }
-  // 在这里处理状态更改逻辑,例如发送请求到后端
-  const res = await Apigdstatus({ Uniqid: _Uniqid.value, gd_statu: selectedStatus.value });
-  if (res.code === 0) {
-	ElMessage.success(`已更改为:${selectedStatus.value}`);
-	dialogVisible.value = false;
-	onSubmit();
-  }else{
-  	ElMessage.error('更改失败');	
+  getUnapprovalList();
+  
+  const tableData1 = reactive([]);
+  
+  // =========== 按钮 ===========
+  // 搜索默认为空
+  const searchInfo = ref('')
+  const table_Selection = ref(false)
+  
+  //查询按钮
+  const onSubmit = async () => {
+    try {
+      const UnapprovalListtable = await UnapprovalList({search:searchInfo.value, page:page.value, limit:pageSize.value});
+      tableData1.splice(0, tableData1.length, ...UnapprovalListtable.data.table);
+      total.value = UnapprovalListtable.data.total;
+    } catch (error) {
+      console.error('搜索失败:', error);
+      ElMessage.error('搜索失败');
+    }
+  };
+  
+  //表格复选框
+  const _Uniqid = ref('');  
+  const multipleTable = ref(null);
+  
+  const handleSelectionChange = (selection) => {
+    if(selection.length >= 1) {
+      table_Selection.value = true;
+      // 提取 Uniqid  
+      const Uniqid_ids = selection.map(item => item.Uniqid).join(',');  
+      _Uniqid.value = Uniqid_ids;
+    } else {
+      table_Selection.value = false;
+    }
+  };
+  
+  //核批通过按钮
+  const hptg_onClick = async () => {
+    try {
+      const Approvals = await Approval({Uniqid:_Uniqid.value, sys_id:userStore.userInfo.nickName});
+      if (Approvals.code === 0) {
+        searchInfo.value = '';
+        _Uniqid.value = '';
+        ElMessage({type: 'success', message: '核批成功'});
+        
+        if (multipleTable.value) {
+          multipleTable.value.clearSelection();
+        }
+        
+        await onSubmit();
+      } else {
+        ElMessage({type: 'error', message: '核批失败'});
+      }
+    } catch (error) {
+      console.error('核批失败:', error);
+      ElMessage.error('核批失败');
+    }
+  };
+  
+  // 状态更改弹窗
+  const dialogVisible = ref(false);
+  const selectedStatus = ref('');
+  const statusOptions = [
+    { value: '计划中', label: '计划中' },
+    { value: '生产中', label: '生产中' },
+    { value: '已裁剪', label: '已裁剪' },
+    { value: '已车缝', label: '已车缝' },
+    { value: '已完工', label: '已完工' }
+  ];
+  
+  const handleStatusConfirm = async () => {
+    if (!selectedStatus.value) {
+      ElMessage.warning('请选择状态');
+      return;
+    }
+    
+    try {
+      const res = await Apigdstatus({ Uniqid: _Uniqid.value, gd_statu: selectedStatus.value });
+      if (res.code === 0) {
+        ElMessage.success(`已更改为:${selectedStatus.value}`);
+        dialogVisible.value = false;
+        await onSubmit();
+      } else {
+        ElMessage.error('更改失败');
+      }
+    } catch (error) {
+      console.error('状态更改失败:', error);
+      ElMessage.error('更改失败');
+    }
+  };
+  
+  //状态更改按钮
+  const ztgg_onClick = () => {
+    dialogVisible.value = true;
   }
-};
-
-//状态更改按钮
-const ztgg_onClick = async () => {
-	// console.log(_Uniqid.value)
-	dialogVisible.value = true;
-}
-
-
-
- 
-
-  // 弹窗控制标记
-  const dialogFormVisible = ref(false)
-  //修改
-  const formDataTest = ref({})
   </script>
   <style scoped>
-/* 选中某行时的背景色 */
-:deep(.el-table__body tr.current-row) > td {
-  background: #ff80ff !important;
-}
-
-  .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;
-	}
-  }
-  .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;
-  }
-  /* 图片上传 */
-  .upload-box {
-	width: 200px;
-	height: 200px;
-	border: 2px dashed #e2e2e2;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	position: relative;
-	cursor: pointer;
-  }
-  .uploaded-image {
-	width: 100%;
-	height: 100%;
-	object-fit: cover;
-  }
-  .upload-icon {
-	font-size: 40px;
-	color: #c0c4cc;
-  }
-  .file-input {
-	display: none;
-  }
-  .el-table .warning-row {
-	background: oldlace;
-  }
-  /* 选中某行时的背景色 */
   :deep(.el-table__body tr.current-row) > td {
 	background: #ff80ff !important;
   }
@@ -501,24 +256,15 @@ const ztgg_onClick = async () => {
   }
   :deep(.el-tabs__header){
 	margin-bottom: 0;
-  }
-  .search{
-	margin-left: 0px !important;
-	margin-right: 10px !important;
+	margin: 0px !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>
   

+ 68 - 10
src/view/yunyin/shengchanguanli/yuedudahuoshengchanjindu.vue

@@ -9,6 +9,8 @@
 				<el-input v-model="searchInfo" placeholder="搜索" style="width: 180px;"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
 				<el-button  type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">每月客户导出</el-button>
+				<el-button type="primary" @click="cp_gdprintonClick" >工单打印</el-button>
+                <el-button type="primary" @click="" >工艺资料附件查询</el-button>
 				</el-form-item>
 			</el-form>
 		  </div>
@@ -46,7 +48,7 @@
 			 			<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="90" />
-						<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="160" />
 			 			<el-table-column   align="left" label="日期" prop="日期"  width="90" />
 			  </el-table>
@@ -62,6 +64,29 @@
 		</layout>
 	  </layout>
 	</div>
+
+		<el-dialog
+				v-model="order_viewVisible"
+				title="选择打印格式"
+				width="30%"
+				top="10%"
+				:before-close="order_viewCloseDialog"
+				destroy-on-close>
+				<el-form>
+				<el-form-item label="打印方向" label-width="100px">
+					<el-radio-group v-model="printDirection">
+					<el-radio label="纵向">纵向</el-radio>
+					<el-radio label="横向">横向</el-radio>
+					</el-radio-group>
+				</el-form-item>
+				</el-form>
+				<template #footer>
+				<el-button @click="order_viewCloseDialog">关闭</el-button>
+				<el-button type="primary" @click="confirmPrintDirection">确定打印</el-button>
+				</template>
+			</el-dialog>
+		<!-- 打印订单表预览 -->
+		<PrintPage ref="printPageRef" />
   </template>
   <script setup>
 // 全量引入格式化工具 请按需保留
@@ -70,10 +95,12 @@ import {ref, reactive} from 'vue'
 import {dateList,OrderYieldList,Datalist,ProductInformation} from '@/api/mes/job'
 import * as XLSX from 'xlsx'
 import FileSaver from 'file-saver'
-import PrintPage from './components/print.vue'
 import {ElMessage} from "element-plus";
 import { useUserStore } from '@/pinia/modules/user';
+import PrintPage from './components/print.vue'
 defineOptions({name: 'Company'})
+//定义打印跳转页面
+const printPageRef = ref()
 //获取登录用户信息
 const userStore = useUserStore()
 const _username = ref('')
@@ -166,32 +193,32 @@ const handleNodeClick = async (node) => {
 
 const _workOrderDetailList = async ()=>{
 	console.log("客户编号",_khbh.value);
+	console.log("搜索信息",searchInfo.value);
 	console.log("日期",_riqi.value);
 	
-	// if(_khbh.value === ''){return;}
+	// 传递客户编号、搜索信息和日期参数
 	const OrderYieldListtable = await OrderYieldList({client:_khbh.value,search:searchInfo.value,date:_riqi.value});
 	tableData.splice(0,tableData.length,...OrderYieldListtable.data);
 }
 
-//全局调用工单编号
-const _Gd_gdbh = ref(null)
-//全局调用印件代号
-const _Gd_cpdh = ref(null)
 //点击表格行
 const tableRowClick = async (row) => {
 	console.log(row)
+	_Gd_gdbh.value = row.订单编号
 };
   
   
 // 搜索框
 const searchInfo = ref('')
 //查询
-const onSubmit = () => {
+const onSubmit = async () => {
 	if(searchInfo.value === ''){
 	  tableData.length = 0;
 	}else{
-		//调用查询接口
-	  _workOrderDetailList();
+		//调用查询接口,只传递搜索参数
+	  console.log("搜索信息",searchInfo.value);
+	  const OrderYieldListtable = await OrderYieldList({search:searchInfo.value});
+	  tableData.splice(0,tableData.length,...OrderYieldListtable.data);
 	}
 };
 
@@ -209,6 +236,37 @@ const exportToExcel = ()=>{
   }
   return wbout;
 }
+
+// =========== 订单打印 ===========
+const _Gd_gdbh = ref('')
+//弹窗
+const order_viewVisible = ref(false)
+// 默认选择竖向
+const printDirection = ref('纵向')
+const cp_gdprintonClick = () => {
+  order_viewVisible.value = true
+}
+//确定打印
+const confirmPrintDirection = () => {
+  console.log(_Gd_gdbh.value)
+  console.log(printDirection.value)
+    
+  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
+    return false;
+  }else{
+    // if(hztableData.length >=1){
+      printPageRef.value.open(_Gd_gdbh.value,printDirection.value) 
+    // }else{
+    // ElMessage({type: 'warning',message: '请新增颜色资料,再操作此功能'})
+    // return false;
+    // }
+  }
+}
+const order_viewCloseDialog = () => {
+  order_viewVisible.value = false
+}
+
   
 // 分页相关的响应式变量
 const page = ref(1)