zck 1 год назад
Родитель
Сommit
3b4c608424

+ 63 - 148
src/view/job/piece/piece.vue

@@ -9,98 +9,7 @@
       </el-aside>
       <el-container>
         <el-main>
-          <div class="gva-search-box">
-            <!-- <el-form ref="elSearchFormRef" :inline="true" :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
-              <el-form-item label="创建日期" prop="createdAt">
-                <template #label>
-        <span>
-          创建日期
-          <el-tooltip content="搜索范围是开始日期(包含)至结束日期(不包含)">
-            <el-icon><QuestionFilled /></el-icon>
-          </el-tooltip>
-        </span>
-                </template>
-                <el-date-picker v-model="searchInfo.startCreatedAt" type="datetime" placeholder="开始日期" :disabled-date="time=> searchInfo.endCreatedAt ? time.getTime() > searchInfo.endCreatedAt.getTime() : false"></el-date-picker>
-                —
-                <el-date-picker v-model="searchInfo.endCreatedAt" type="datetime" placeholder="结束日期" :disabled-date="time=> searchInfo.startCreatedAt ? time.getTime() < searchInfo.startCreatedAt.getTime() : false"></el-date-picker>
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary" icon="search" @click="onSubmit">查询</el-button>
-                <el-button icon="refresh" @click="onReset">重置</el-button>
-              </el-form-item>
-            </el-form> -->
-			<div class="gva-btn-list">
-			  <el-button type="primary" icon="upload" @click="bacthEditClick">定额参数批量修改excel</el-button>
-			  <el-button type="primary" icon="plus" @click="bacthSubmit">更新</el-button>
-			</div>
-          </div>
-          <div class="gva-table-box">
-            <!-- <div class="gva-btn-list">
-			  <el-button type="primary" icon="upload" @click="">导出到excel</el-button>
-			  <el-button type="primary" icon="plus" @click="getDetails(2)">详情</el-button>
-            </div> -->
-            <el-table
-                ref="multipleTable"
-				stripe
-            	border
-                style="width: 100%"
-                tooltip-effect="dark"
-                :data="tableData"
-                row-key="ID"
-                @selection-change="handleSelectionChange"
-            	@row-dblclick="updateCompanyFunc"
-            	:show-overflow-tooltip="true"
-            	highlight-current-row="true"
-            >
-              <el-table-column align="left" label="定额代号" prop="sys_bh" width="120" />
-              <el-table-column align="left" label="名称备注" prop="sys_mc" width="210" />
-              <el-table-column align="left" label="使用工序" prop="use_gx" width="88" />
-			  <el-table-column align="left" label="适用机型" prop="use_machine" width="88" />
-			  <el-table-column fixed="right" v-slot="scope" align="left" label="日定额" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.daily_quota" :clearable="false"/>
-			  </el-table-column>
-			  <el-table-column fixed="right" v-slot="scope" align="left" label="千件工价" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.thousand_piece" :clearable="false"/>
-			  </el-table-column>
-			  <el-table-column fixed="right" v-slot="scope" align="left" label="补产标准" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.production_standard" :clearable="false"/>
-			  </el-table-column>
-			 <!-- <el-table-column align="left" label="原日定额" prop="daily_quota" width="90" />
-			  <el-table-column align="left" label="原千件工价" prop="thousand_piece" width="100" />
-			  <el-table-column align="left" label="原补产标准" prop="production_standard" width="100" /> -->
-			 <!-- <el-table-column fixed="right" v-slot="scope" align="left" label="新日定额" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.daily_quota" :clearable="false"/>
-			  </el-table-column>
-			  <el-table-column fixed="right" v-slot="scope" align="left" label="新千件工价" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.thousand_piece" :clearable="false"/>
-			  </el-table-column>
-			  <el-table-column fixed="right" v-slot="scope" align="left" label="新补产标准" width="100" >
-			      <el-input @input="inputClick" v-model="scope.row.production_standard" :clearable="false"/>
-			  </el-table-column> -->
-			  <!-- <el-table-column v-slot="scope" align="left" label="新补产标准" width="100">
-				  	<el-form-item :prop="'tableData.'+scope.row+'.production_standard'">
-				  		<el-input v-model="scope.row.production_standard" :clearable="true"/>
-				  	</el-form-item>
-              </el-table-column> -->
-			  <el-table-column v-slot="scope" v-if="false" align="left" label="UniqId" width="100" >
-			      <el-input v-model="scope.row.UniqId" :clearable="false"/>
-			  </el-table-column>
-            </el-table>
-            <!-- <div class="gva-pagination">
-              <el-pagination
-                  layout="total, sizes, prev, pager, next, jumper"
-                  :current-page="page"
-                  :page-size="pageSize"
-                  :page-sizes="[10, 30, 50, 100]"
-                  :total="total"
-                  @current-change="handleCurrentChange"
-                  @size-change="handleSizeChange"
-				  :row-style="{ height: '20px' }"
-				  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-				  :header-cell-style="{ padding: '0px' }"
-              />
-            </div> -->
-          </div>
+          
           <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type==='create'?'添加':'修改'" destroy-on-close>
             <el-scrollbar height="500px">
               <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="80px">
@@ -123,7 +32,8 @@
             </template>
           </el-dialog>
 
-          <el-dialog v-model="detailShow" style="width: 800px" lock-scroll :before-close="closeDetailShow" :title="`当前编码:${pieceData.sys_bh}`" destroy-on-close>
+          <!-- <el-dialog v-model="detailShow" style="width: 800px" lock-scroll :before-close="closeDetailShow" :title="`当前编码:${pieceData.sys_bh}`" destroy-on-close> -->
+            <div>
             <el-scrollbar height="300px">
               <el-descriptions column="1" border>
                 <el-descriptions-item label="编号">
@@ -183,7 +93,8 @@
 				</el-descriptions-item>
 			  </el-descriptions>
             </el-scrollbar>
-          </el-dialog>
+          </div>
+          <!-- </el-dialog> -->
         </el-main>
       </el-container>
     </el-container>
@@ -218,62 +129,66 @@ defineOptions({
 })
 
 
-const treeData=ref([])
-const PieceWork = async() => {
-  const getPieceWorks = await getPieceWork()
+const treeData = ref([]);
+
+const PieceWork = async () => {
+  const getPieceWorks = await getPieceWork();
   if (getPieceWorks.code === 0) {
-	  
-	  const transformedData1 = getPieceWorks.data.machineData.map(item => ({
-	          label: `${item.sys_mc}【${item.sys_bh}】`,
-			  params: {
-			    code: item.sys_bh,
-			  },
-	          children: item.child.map(sysItem => ({
-	            label: `${sysItem.gx} ${sysItem.jx}【${sysItem.sys_bh}】`,
-	            params: {
-	              code: sysItem.sys_bh,
-	            },
-				children: sysItem.children.map(syssItem => ({
-				  label: `${syssItem.sys_mc}【${syssItem.sys_bh}】`,
-				  params: {
-				    code: syssItem.sys_bh,
-				  },
-				}))
-	          })),
-	        }));
-		const transformedData2 = getPieceWorks.data.handData.map(item => ({
-		        label: `${item.gx}【${item.sys_bh}】`,
-				params: {
-				  code: item.sys_bh,
-				},
-		        children: item.child.map(sysItem => ({
-		          label: `${sysItem.sys_mc}【${sysItem.sys_bh}】`,
-		          params: {
-		            code: sysItem.sys_bh,
-		          },
-						children: sysItem.children.map(syssItem => ({
-						  label: `${syssItem.sys_mc}【${syssItem.sys_bh}】`,
-						  params: {
-						    code: syssItem.sys_bh,
-						  },
-						}))
-		        })),
-		      }));
-			  
-	    treeData.value = [
-	    	{
-	    		label: '机器作业计件定额',
-	    		children:transformedData1,
-				code:'020'
-	    	},
-			{
-				label: '人工作业计件定额',
-				children:transformedData2,
-				code:'030'
-			}
-	    ]
+    // 处理 machineData
+    const transformedData1 = getPieceWorks.data.machineData.map(item => ({
+      label: `${item.sys_mc}【${item.sys_bh}】`,
+      params: {
+        code: item.sys_bh,
+      },
+      children: item.child?.map(sysItem => ({
+        label: `${sysItem.gx} ${sysItem.jx}【${sysItem.sys_bh}】`,
+        params: {
+          code: sysItem.sys_bh,
+        },
+        children: sysItem.children?.map(syssItem => ({
+          label: `${syssItem.sys_mc}【${syssItem.sys_bh}】`,
+          params: {
+            code: syssItem.sys_bh,
+          },
+        })) || [], // 如果 children 是 undefined,则返回空数组
+      })) || [], // 如果 child 是 undefined,则返回空数组
+    }));
+
+    // 处理 handData
+    const transformedData2 = getPieceWorks.data.handData.map(item => ({
+      label: `${item.gx}【${item.sys_bh}】`,
+      params: {
+        code: item.sys_bh,
+      },
+      children: item.child?.map(sysItem => ({
+        label: `${sysItem.sys_mc}【${sysItem.sys_bh}】`,
+        params: {
+          code: sysItem.sys_bh,
+        },
+        children: sysItem.children?.map(syssItem => ({
+          label: `${syssItem.sys_mc}【${syssItem.sys_bh}】`,
+          params: {
+            code: syssItem.sys_bh,
+          },
+        })) || [], // 如果 children 是 undefined,则返回空数组
+      })) || [], // 如果 child 是 undefined,则返回空数组
+    }));
+
+    // 更新 treeData
+    treeData.value = [
+      {
+        label: '机器作业计件定额',
+        children: transformedData1,
+        code: '020',
+      },
+      {
+        label: '人工作业计件定额',
+        children: transformedData2,
+        code: '030',
+      },
+    ];
   }
-}
+};
 PieceWork()
 const handleNodeClick = (node,check) => {
   //存放当前节点的nodeId

+ 295 - 1
src/view/yunyin/shengchanguanli/chengpinrucang.vue

@@ -6,7 +6,7 @@
 		  <el-aside width="250px" class="aside-container">
 			<div class="JKWTree-tree">
 			  <h3>成品入仓管理</h3>
-			  <el-tree :data="treeData" :props="defaultProps" highlight-current="true"
+			  <el-tree :data="treeData"  highlight-current="true"
 				@node-click="handleNodeClick"></el-tree>
 			</div>
 		  </el-aside>
@@ -22,6 +22,7 @@
 			  <el-button type="primary" class="bt" @click="onSMB">入仓末板数据统计</el-button>
 			  <el-button type="primary" class="bt" @click="onDay">各日统计</el-button>
 			  <el-button type="primary" class="bt" @click="onAdd">新增</el-button>
+        <el-button type="primary" class="bt" @click="scpconClick" >工单生产批次信息查询</el-button>
 			  
               <div style="margin-left: auto;">			
                 <el-button type="primary" class="bt" icon="Download" @click="exportExcel">导出到Excel</el-button>
@@ -393,6 +394,157 @@
               </layout>
             </div>
           </el-dialog>
+
+          			<!--工单生产批次信息查询【弹窗】-->
+			<el-dialog v-model="scpconlist" title="工单生产批次信息查询" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
+			  <el-button type="primary"   @click="ontuicclicks" style="color: white;margin-left: 20px;"  class="bt" title="退出">退出</el-button>
+			  <div 
+			    style="
+			      width: 60%; 
+			      height: 470px; 
+			      position: fixed; 
+			      left: 25%; 
+			      padding: 20px; 
+			      border-radius: 8px; 
+			      background-color: #fff; 
+			      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);">
+			    <div style="margin-top: 10px;">
+			      <!-- 提示信息 -->
+			      <hr>
+			      <p style="font-size: 14px; color: red; margin: 10px 0;">搜索栏目为空,则从最近2周完工的工单中选择</p>
+			      <p style="font-size: 14px; color: red; margin: 10px 0;">否则,以栏目值为关键字,从工单编号、产品名称、客户名称中选择</p>
+			      <hr>
+			      
+			      <!-- 输入框和按钮 -->
+			      <div style="display: flex; align-items: center; margin-top: 10px;">
+			        <el-input v-model="searchInfolcd" placeholder="Enter回车搜索工单编号" @keydown="Enterkeysearch" id="searchInfo" style="height: 40px;flex: 1;"></el-input>
+			        <el-button type="primary" title="搜索"  icon="el-icon-search" style="width: 70px;height: 40px;font-size: 18px;"  @click="onSubmitlcd" >搜索</el-button>
+					<el-button type="primary" title="查看"  icon="el-icon-search" style="width: 110px;height: 40px;font-size: 18px;"  @click="onstatsuclick" >查看流程单</el-button>
+			      </div>
+			      
+			      <!-- 表格展示区域 -->
+			      <div class="gva-table-box" style="margin-top: 15px;">
+			        <el-table 
+						ref="multipleTable"
+						style="width: 100%; height: 30vh; verflow: auto;" 
+						:row-style="{ height: '20px' }"  :header-cell-style="{ padding: '0px' }"
+						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						:data="tableDatalcd" 
+						:border="true" 
+						:tooltip-effect="'dark'"
+						row-key="ID"
+						highlight-current-row
+						@row-click="tableRowClicklcd"
+						@row-dblclick="updateCompanyFunclcd"
+						@selection-change="handleSelectionChange">
+			  		<el-table-column align="left"  label="工单编号" 	  width="115"	prop="Gd_gdbh" />
+			  		<el-table-column align="left"  label="行号" 	  width="60"	prop="行号" />
+			  		<el-table-column align="left"  label="工序名称" 	 	prop="Gd_cpmc"  />
+			          <!-- <el-table-column prop="工单" label="工单编号-行号-工序名称" align="left" sortable show-overflow-tooltipmin-width="300"/> -->
+			        </el-table>
+			      </div>
+			    </div>
+			  </div>
+			  <!-- 机台生产日报表维护弹窗 -->
+			  <el-dialog v-model="popdialog" title="机台生产日报表维护" destroy-on-close width="90%" style="height: 92%; margin-left: 5%; margin-top: 1%;">
+			    <div>
+			      <!-- 顶层布局 -->
+			      <layout>
+			        <!-- 顶部的搜索区域 -->
+			        <layout-header>
+			          <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule">
+			            <!-- 添加按钮 -->
+			  		  <el-button type="primary" icon="edit" style="color: white;margin-left: 20px;"   @click="ontuicclick"  class="bt" title="退出">退出</el-button>
+			          </el-form>
+			        </layout-header>
+			  
+			        <!-- 左右布局 -->
+			        <layout style="height: calc(100% - 50px); display: flex;">
+			          <!-- 左侧树形区域 -->
+			          <layout-sider style="width: 140px; margin-right: 10px; overflow: hidden;height: 584px;">
+			            <div class="JKWTree-tree" style="height: 100%; max-height: 100vh; overflow-y: auto;">
+			              <h3></h3>
+			              <el-tree
+			                :data="treeDatalcd"
+			                node-key="num"
+			                highlight-current
+			                :props="defaultProps"
+			                @node-click="handleNodeClicklcd"
+			              />
+			            </div>
+			          </layout-sider>
+			  
+			  
+			          <!-- 右侧表格区域 -->
+			          <layout-content style="flex: 1; overflow: auto;">
+			            <el-main>
+			  			 <div style="width: 100%; font-family: Arial, sans-serif; font-size: 14px;">
+			  				 <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
+			  				   <p style="flex: 0.4; margin: 0;">工单编号:<span style="color: red;">{{ _GetorderDetail['Gd_gdbh'] }}</span></p>
+			  				   <p style="flex: 0.3; margin: 0;">产品代号:<span style="color: red;">{{ _GetorderDetail['Gd_cpdh'] }}</span></p>
+			  				   <p style="flex: 1; margin: 0;">产品名称:<span style="color: red;">{{ _GetorderDetail['Gd_cpmc'] }}</span></p>
+			  				 </div>
+			  				 <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
+			  				   <p style="flex: 0.4; margin: 0;">订单数量:<span style="color: red;">{{ _GetorderDetail['订单数量'] }}</span></p>
+			  				   <p style="flex: 0.3; margin: 0;">实际投料:<span style="color: red;">{{ _GetorderDetail['实际投料'] }}</span></p>
+			  				   <p style="flex: 1; margin: 0;">
+			  					 单位:<span style="color: red;">{{ _GetorderDetail['计量单位'] }}</span> 
+			  					 目标合格率:<span style="color: red;">{{ _GetorderDetail['投料率'] }}</span>
+			  				   </p>
+			  				 </div>
+			  			   </div>
+			  			  
+			  			  <el-tabs v-model="activeName" @tab-click="handleClick">
+			  					<el-tab-pane label="工艺及生产班组"  @click="showTable('工艺及生产班组')"  name="first">
+			  					  <el-table tooltip-effect="dark" :data="lcdtableData" row-key="ID"
+			  					    highlight-current-row="true"
+			  					    :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
+			  					    :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
+			  					    border :show-overflow-tooltip="true" :cell-class-name="planUsageCellClass"
+			  					    style="width: 100%;height: 56vh" ref="tablesczl_gxmc"
+			  					    @row-dblclick="gyscbzSelectClick">
+			  					    <el-table-column align="left"  label="流程单号" 	  width="81"	prop="流程单号" />
+			  					    <el-table-column align="left"  label="工序号" 	  width="68"	prop="工序号" />
+			  					    <el-table-column align="left"  label="工序名称" 	  width="240"	prop="工序名称"  />
+			  					    <el-table-column align="left"  label="生产日期" 	  width="120"	prop="生产日期"  />
+			  					    <el-table-column align="left"  label="机台编号" 	  width="81"	prop="机台编号"  />
+			  					    <el-table-column align="left"  label="班组人员01"  width="105"  :formatter="(row) => `${row.sczl_bh1 || ''} ${row.name1 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员02"  width="105"  :formatter="(row) => `${row.sczl_bh2 || ''} ${row.name2 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员03"  width="105"  :formatter="(row) => `${row.sczl_bh3 || ''} ${row.name3 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员04"  width="105"  :formatter="(row) => `${row.sczl_bh4 || ''} ${row.name4 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员05"  width="105"  :formatter="(row) => `${row.sczl_bh5 || ''} ${row.name5 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员06"  width="105"  :formatter="(row) => `${row.sczl_bh6 || ''} ${row.name6 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员07"  width="105"  :formatter="(row) => `${row.sczl_bh7 || ''} ${row.name7 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员08"  width="105"  :formatter="(row) => `${row.sczl_bh8 || ''} ${row.name8 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员09"  width="105"  :formatter="(row) => `${row.sczl_bh9 || ''} ${row.name9 || ''}`"/>
+			  					    <el-table-column align="left"  label="班组人员10"  width="105"  :formatter="(row) => `${row.sczl_bh10 || ''} ${row.name10 || ''}`"/>
+			  					  </el-table>
+			  					</el-tab-pane>
+			  					
+			  					<el-tab-pane label="制程异常记录"  @click="showTable('制程异常记录')"  name="second">
+			  					  <el-table tooltip-effect="dark" :data="zcycjltableData" row-key="ID"
+			  					    highlight-current-row="true"
+			  					    :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
+			  					    :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
+			  					    border :show-overflow-tooltip="true" :cell-class-name="planUsageCellClass"
+			  					    style="width: 100%;height: 65vh" ref="tablzcycjl_gxmc"
+			  					    @row-dblclick="zcycjlSelectClick">
+			  					    <el-table-column align="left"  label="流程单号" 	  width="100"	prop="流程单号" />
+			  					    <el-table-column align="left"  label="数量" 	  	  width="100"	prop="数量" />
+			  					    <el-table-column align="left"  label="异常备注" 	  width="400"	prop="缺陷备注"  />
+			  					    <el-table-column align="left"  label="用户" 	  	  width="160"	prop="用户"  />
+			  					  </el-table>
+			  					</el-tab-pane>
+			  
+			  			  </el-tabs>
+			            </el-main>
+			          </layout-content>
+			        </layout>
+			      </layout>
+			    </div>
+			  </el-dialog>
+			</el-dialog>
+      
         </el-main>
       </el-container>
     </el-container>
@@ -428,6 +580,7 @@ import { TRUE } from 'sass'
 import { exportExcelFile } from '@/utils/excel'
 import { useUserStore } from '@/pinia/modules/user'
 import { getOrderProcessCount,PrintDetailList,getOrderProcessLeft,getOrderProcessRight } from "@/api/yunyin/yunying";
+import { StaGetOrderList,StaGetList,StaProcessList,StaGetOrderDetail,StaProcessAnomaly,} from '@/api/mes/job'
 const userStore = useUserStore() 
 const sys_id='['+userStore.userInfo.userName+'/'+userStore.userInfo.nickName+']'
 defineOptions({
@@ -964,7 +1117,147 @@ const pd_lcdCancel = async () => {
   pd_lcdlist.value = false;
 }
 
+/*
+	工单生产批次信息查询
+*/
+//搜索
+const searchInfolcd = ref('');
+const tableDatalcd = reactive([])
+const scpconlist = ref(false);
+const scpconClick = async () => {
+  scpconlist.value = true;
+  tableDatalcd.splice(0,tableDatalcd.length,...[]);//表格数据
+  onSubmitlcd()//调用接口
+}
+//进入页面默认光标加载
+setTimeout(() => {
+	const inputElement = document.getElementById('searchInfo');
+	if (inputElement) {
+		inputElement.focus();		
+	}
+}, 100);
+			
 
+//查询按钮
+const onSubmitlcd = () => {
+  _StaGetOrderList()
+};
+//搜索回车
+const Enterkeysearch = (event) => {
+   if (event.key === 'Enter') {
+      _StaGetOrderList();
+    }
+};
+//调用接口
+const _StaGetOrderList = async (node) => {
+  const StaGetOrderListdata = await StaGetOrderList({search:searchInfolcd.value});
+  console.log(StaGetOrderListdata)
+	if (StaGetOrderListdata.data === null) {
+	  ElMessage({
+		type: 'warning',
+		message: '未搜索具体查询条件',
+		customClass: 'custom-message', // 添加自定义类名
+		duration: 3000 // 可选:设置消息显示的持续时间(单位:毫秒)
+	  });
+	}
+  tableDatalcd.splice(0,tableDatalcd.length,...StaGetOrderListdata.data);//表格数据
+};
+
+// 树形节点属性映射
+const treeDatalcd = reactive([]);
+const defaultProps = {
+  label: '流程单',
+  children: 'children',
+};
+//全局调用工单编号、印件号
+const _Gd_gdbhlcd = ref(null)
+const _Gd_yjnolcd = ref(null)
+const _GetorderDetail = ref(null)
+
+
+/*
+	弹窗页面
+*/
+const popdialog = ref(false);
+const currentRow = ref('');
+// 获取当前行数据
+const tableRowClicklcd = (row) => {
+  currentRow.value = row; // 保存当前选中行
+};
+
+// 按钮点击逻辑
+const onstatsuclick  = async () => {
+	console.log(currentRow)
+  if (!currentRow.value) {
+	ElMessage({
+	  type: "warning",
+	  message: "请先点击选择一行数据",
+	});
+	return;
+  }
+  await updateCompanyFunclcd(currentRow.value);
+};
+//双击
+const updateCompanyFunclcd = async (row) => {
+	console.log("双击",row)
+	_Gd_gdbhlcd.value = row['Gd_gdbh']
+	_Gd_yjnolcd.value =row['行号']
+	
+	const StaGetOrderDetaildata = await StaGetOrderDetail({ gdbh: row['Gd_gdbh'], yjno: row['行号'] });
+	let resultData = StaGetOrderDetaildata.data;
+	// 遍历对象,将 null 值替换为空字符串
+	Object.keys(resultData).forEach((key) => {
+	  if (resultData[key] === null) {
+	    resultData[key] = '';
+	  }
+	});
+	_GetorderDetail.value = resultData;
+	// console.log("_GetorderDetail.value", _GetorderDetail.value);
+	_StaGetList(row)
+}
+
+//左侧树形节点点击事件
+const handleNodeClicklcd = (node) => {
+  _StaProcessList(node['num'])
+  _StaProcessAnomaly()
+};
+
+//获取左侧菜单栏
+const _StaGetList = async (row) => {
+  const StaGetListdata = await StaGetList({gdbh:row['Gd_gdbh'],yjno:row['行号']});
+  console.log(StaGetListdata.msg)
+  if(StaGetListdata.msg === '成功'){
+	  treeDatalcd.splice(0, treeDatalcd.length, ...StaGetListdata.data);
+	  popdialog.value = true
+  }else{
+	  console.log(StaGetListdata.msg)
+	  ElMessage({type: 'warning',message: StaGetListdata.msg})
+  }
+};
+
+//工艺及生产班组
+const lcdtableData = reactive([])
+const _StaProcessList = async (node) => {
+  const StaProcessListdata = await StaProcessList({gdbh:_Gd_gdbhlcd.value,yjno:_Gd_yjnolcd.value,num:node});
+  lcdtableData.splice(0,lcdtableData.length,...StaProcessListdata.data);
+};
+
+//制程异常记录
+const zcycjltableData = reactive([])
+const _StaProcessAnomaly = async () => {
+  const StaProcessAnomalydata = await StaProcessAnomaly({gdbh:_Gd_gdbhlcd.value,yjno:_Gd_yjnolcd.value});
+  zcycjltableData.splice(0,zcycjltableData.length,...StaProcessAnomalydata.data);
+};
+
+//退出按钮
+const ontuicclick = async () => {
+  popdialog.value = false
+};
+
+//退出按钮
+const ontuicclicks = async () => {
+  scpconlist.value = false
+};
 
 //定位
 const GetmachineLocate = async () => {
@@ -1457,6 +1750,7 @@ function doubleClick(row, column, event) {
 }
 // 单击表格操作
 function Click(row, column, event) {
+  searchInfolcd.value =row.jjcp_gdbh
     lastCellValue= row['UniqId'];
    console.log(lastCellValue)
   

+ 207 - 3
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -355,7 +355,7 @@
                 <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]" :clearable="false"
-                              :id="`input${idx}${$index}`" @keyup="handleKeyDown($event, idx, $index, item.prop)"/>
+                              :id="`input${idx}${$index}`" @keyup.stop="handleKeyDown($event, idx, $index, item.prop)"/>
                   </div>
                   <div v-else>{{ row[item.prop] }}</div>
                 </el-table-column>
@@ -363,6 +363,19 @@
             </el-table>
           </el-dialog>
 
+          <!-- 新增查询标准损耗 -->
+          <el-dialog v-model="searchSHModel" :before-close="() => searchSHModel = false" id="tableFplb" @keydown="ent($event)" >
+            <el-form>
+              <div>
+                <div style="border:1px solid #eee; width:100%; height: 400px; overflow-y: auto">
+                  <el-tree :data="getSHListdatas" :props="defaultProps" ref="table_fplb" @keydown.stop="handleTreeKeydown"
+                  node-key="id"
+                  @node-click="SHNodeClick" />
+                </div>
+              </div>
+            </el-form>
+          </el-dialog>
+
           <!--质检废品系数-->
           <el-dialog v-model="scfjfpxslist" title="质检废品系数"  style="width: 100%;height: 100%;margin: 0px;padding: 0px">
             <el-button type="primary"  @click="scfjfpxsConfirm">更新</el-button>
@@ -1462,12 +1475,93 @@ const xzhstableColumns = ref(
       { label: '新损耗系数', prop: '损耗系数', width: '100' },
     ]
 )
-const handleKeyDown = (event, x, y, prop) => {
+const sh_num = ref(0)
+const getSHListdatas = ref([]);
+const searchSHModel = ref(false)
+const table_fplb = ref(null);
+const handleKeyDown = async (event, x, y, prop) => {
+  event.stopPropagation();
+  console.log(event,x,y)
   const currentElement = document.getElementById(`input${x}${y}`);
   if (currentElement === null && currentElement === undefined) return
   let move = 0
   switch (event.keyCode) {
     case 13: // Enter
+    if(x === 7){
+      console.log(112)
+    sh_num.value = y
+    const WastageList_data = await WastageList({process: shdhh.value[y].gxmc})
+    const getLossCode_data = await getLossCode({ code: WastageList_data.data.slice(0, 3)});
+    const filteredData = getLossCode_data.data.filter(item => item.sys_bh.startsWith(WastageList_data.data.slice(0, 3)));
+    console.log(filteredData);
+    const data = filteredData;
+
+    const treeData = [];
+    const map = {};
+    let idCounter = 1; // 用于生成唯一 ID 的计数器
+    // 构建树形结构
+    data.forEach(item => {
+  map[item.sys_bh] = { ...item, children: [], label: `${item.sys_bh}---${item.sys_mc}` };
+});
+
+// 初始化 map 和 treeData
+
+
+ 
+// 初始化 map,为每个 sys_bh 创建一个对象,并赋予一个唯一的 id
+data.forEach(item => {
+  if (!map[item.sys_bh]) {
+    map[item.sys_bh] = {
+      id: idCounter++, // 分配一个唯一的 ID
+      sys_bh: item.sys_bh,
+      level: null,
+      children: []
+    };
+  }
+});
+ 
+// 构建树结构和设置层级
+data.forEach(item => {
+  // 使用 sys_bh 作为 ID
+  const itemId = item.sys_bh;
+
+  if (item.sys_bh.length === 3) {
+    map[item.sys_bh].level = 1;
+    map[item.sys_bh].id = itemId; // 使用 sys_bh 作为 ID
+    treeData.push(map[item.sys_bh]);
+  } else {
+    map[item.sys_bh].level = 2;
+    map[item.sys_bh].id = itemId; // 使用 sys_bh 作为 ID
+    map[item.sys_bh.substring(0, 3)].children.push(map[item.sys_bh]);
+  }
+});
+
+getSHListdatas.value = treeData;
+searchSHModel.value = true;
+      // 使用 nextTick 确保树形组件渲染完成后执行操作
+      nextTick(() => {
+        const tree = table_fplb.value; // 获取树形组件实例
+        if (tree) {
+          const firstNode = tree.getNode(0); // 获取树形的第一个节点
+          if (firstNode) {
+            firstNode.el.focus(); // 聚焦到第一个节点
+          }
+        }
+      });
+  }
+  if ( x === 4) {
+        move = x + 3
+      } else if(x === 7){
+        move = x + 3
+      } else if( x === 10){
+        move = x + 1
+      }else if( x === 11){
+        move = x + 2
+      }else if( x === 13){
+        move = x + 2
+      }
+      document.getElementById(`input${move}${y}`).focus();
+      break;
     case 40: // 向下箭头
       if (y < sxzhscstableData.value.length )
         document.getElementById(`input${x}${y + 1}`).focus();
@@ -1509,6 +1603,111 @@ const handleKeyDown = (event, x, y, prop) => {
       break;
   }
 }
+
+//键盘事件
+const handleTreeKeydown = (event) => {
+  const tree = table_fplb.value; // 获取树实例
+  if (!tree) {
+	console.error("树组件未加载");
+	return;
+  }
+// 阻止事件冒泡
+  const focusedElement = document.activeElement;
+  const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
+  
+  if (event.keyCode === 13 && focusedNodeId) { // 判断是否是回车键
+    event.stopPropagation();
+	tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
+	tree.$nextTick(() => {
+	  const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
+	  if (!currentNode) {
+		console.warn("没有选中的节点");
+		return;
+	  }
+	// 清除上一次的选中状态
+	clearPreviousSelection(tree);
+	  // 收起所有其他节点
+	  Object.keys(tree.store.nodesMap).forEach((key) => {
+		tree.store.nodesMap[key].expanded = false; // 收起所有节点
+	  });
+
+	  // 展开当前节点
+	  tree.store.nodesMap[currentNode.id].expanded = true;
+console.log(currentNode)
+	  // 如果当前节点有子节点,选中第一个子节点
+	  if (currentNode.children && currentNode.children.length > 0) {
+		const firstChild = currentNode.children[0];
+		if (firstChild) {
+		  const firstChildKey = firstChild.id.toString();
+		  tree.setCurrentKey(firstChildKey); // 设置第一个子节点为选中
+		  setTimeout(() => {
+			const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
+			if (firstChildDom) {
+			  firstChildDom.focus();
+			  firstChildDom.scrollIntoView({ block: "nearest" });
+			}
+		  });
+		}
+	  } else {
+	  // 如果节点没有子节点,打印节点名称
+    console.log(currentNode)
+    if(searchSHModel.value) {
+      searchSHModel.value = false;
+      // 添加延迟确保状态更新
+      setTimeout(() => {
+        sxzhscstableData.value[sh_num.value].损耗代号 = currentNode.sys_bh;
+      }, 50);
+    }
+	  }
+	});
+  } else if (event.keyCode === 38 || event.keyCode === 40) { // 上下箭头键
+	const currentNode = tree.getCurrentNode();
+	if (currentNode) {
+	  const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
+	  if (currentNodeDom) {
+		currentNodeDom.focus();
+	  }
+	}
+  }
+};
+
+// 清除之前的选中状态
+const clearPreviousSelection = (tree) => {
+  const selectedNodes = tree.getCheckedNodes();
+  selectedNodes.forEach(node => {
+	tree.setChecked(node, false);
+  });
+  tree.setCurrentKey(null);
+};
+
+  // 弹出框键盘事件
+  const ent = (event) => {
+  if (document.activeElement.id === "tableFplb") {
+    if (table_fplb.value) {
+      const tree = table_fplb.value?.$el;
+      if (tree) {
+        const node = tree.querySelector("[data-key]");
+        if (event.keyCode === 13) {
+          }
+        if (node) {
+          node.scrollIntoView({ block: "nearest" }); // 确保节点可见  
+        node.focus(); // 确保焦点正确
+        }
+      }
+    }
+  }
+};
+
+//点击损耗代号
+const SHNodeClick = (node,check) => {
+  console.log('损耗node',node)
+  console.log(getSHListdatas.value)
+  if(getSHListdatas.value[0].children){
+    sxzhscstableData.value[sh_num.value].损耗代号= node.sys_bh
+    searchSHModel.value = false;
+  }
+}
+
 const xzhscslist = ref(false);
 const xzhscsformData = reactive({
   gdbh: '',
@@ -1534,12 +1733,14 @@ const xzhscsgetProductValue = () => {
   _AccountingParameterdata()
 };
 // 修正工单核算参数表格数据
+const shdhh = ref('');
 const _AccountingParameterdata = async ()=>{
   let workOrder = xzhscsformData['gdbh'];
   console.log(workOrder)
   try {
     const AccountingParameterdata = await AccountingParameter({workOrder:workOrder});
     console.log(AccountingParameterdata);
+    shdhh.value = AccountingParameterdata.data;
     sxzhscstableData.value = AccountingParameterdata.data;
     const formattedData = AccountingParameterdata.data.map(item=>{
       item.sxzhscsold_难度系数 = item.难度系数;
@@ -4598,5 +4799,8 @@ const luckyexcelCloseDialog = () => {
   font-size: 20px;
   border-color: #f5c6cb;
 }
-
+/* tree组件背景高亮 */
+:deep(.el-tree-node:focus > .el-tree-node__content){
+	background: #ff80ff !important;
+}
 </style>