zck 9 months ago
parent
commit
355ce1fb80

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

@@ -681,6 +681,17 @@ export const getPPCode = (params) => {
   }) 
 }
 
+
+//印版管理->印版领用
+export const getPPgdReceive = (data) => {
+  return service({
+    url: '/mes_server/Printing_Plate/PrintingPlateReceive',
+    method: 'post',
+    data
+  }) 
+}
+
+
 //印版管理->印版领用下方工单领用详情
 export const getPPReceive = (params) => {
   return service({

+ 4 - 4
src/view/DecisionSupport/outputsum/index.vue

@@ -234,8 +234,8 @@ const exportToExcel = async () => {
     // 准备Excel数据
     const excelData = res.data.map(item => ({
       '工序名称': item.工序名称 || '',
-      '墨色': item.墨色 ? Number(item.墨色) : 0, // 确保墨色是数字类型
-      '车间': item.车间 || ''
+      '产量合计': item.产量合计 || '',
+      '色度数': item.色度数 || 0, // 确保墨色是数字类型
     }));
 
     // 创建工作簿
@@ -261,10 +261,10 @@ const exportToExcel = async () => {
     });
 
     // 添加工作表到工作簿
-    XLSX.utils.book_append_sheet(wb, ws, '色数据');
+    XLSX.utils.book_append_sheet(wb, ws, '色度数数据');
 
     // 导出Excel
-    const filename = `色数据_${noderq.value}.xlsx`;
+    const filename = `色度数数据${noderq.value}.xlsx`;
     const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
     
     FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);

+ 1 - 1
src/view/equipment/maintenance.vue

@@ -791,7 +791,7 @@ const maintenanceForm = reactive(initMaintenanceForm())
 
 const dialogwxFormVisible = ref(false)
 const dialogbyFormVisible = ref(false)
-const type = ref('create') // 'create' 或 'edit'
+const type = ref('create') // 'create' 或 'upload'
 const deptDialogVisible = ref(false) // 部门选择弹窗控制
 const deptTreeData = ref([]) // 部门树数据
 const deviceDialogVisible = ref(false) // 设备选择弹窗控制

+ 3 - 0
src/view/managements/hardversionlibrary.vue

@@ -365,6 +365,9 @@ const transformData = (data) => {
     const res = await getPPReceive({ code: row.存货编码,batch:row.供方批号})
     if (res.code === 0) {
       wlmxtableData.value = res.data 
+    }else{
+      ElMessage.error('未搜索到数据') 
+      wlmxtableData.value = []
     }
   }
   

+ 2 - 2
src/view/performance/12-orderAccounting/index.vue

@@ -1065,8 +1065,8 @@ const rcgdsj = async () => {
   if(gdbh.value && jjcp_yjno.value){
     rcgdsjrq.value=''
   }else{
-    console.log(cjsriqi.value)
-    rcgdsjrq.value=	cjsriqi.value
+    rcgdsjrq.value =	`${cjsriqi.value.slice(0, 4)}-${cjsriqi.value.slice(4)}`;
+    console.log(rcgdsjrq.value)
   }
   onrcgdsj.value = true
 }

+ 2 - 1
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -2535,13 +2535,14 @@ const _hscstzgetProductGy = async ()=>{
 //核算参数调整 【执行按钮】
 const hscstzConfirm = async () => {
   const rawValueArray = hscstztableData._rawValue;
+  console.log(rawValueArray)
   const formattedData = rawValueArray.map(item => {
     return {
       UniqID: item.UniqID,
       difficulty_coe: item.difficulty_coe,
       loss_coe: item.loss_coe,
       ms_coe: item.ms_coe,
-      shdh: item.shdh?item.shdh:'',
+      shdh: item.Gy0_shdh?item.Gy0_shdh:'',
     };
   });
   const hscstz_edit = await editGy(formattedData);

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

@@ -0,0 +1,663 @@
+<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="search" @click="on_search">查询</el-button>
+                <el-button type="primary" class="bt" icon="edit" @click="onout">领出</el-button>
+                <el-button type="primary" class="bt" icon="document" @click="onwithdraw">收回</el-button>
+                <el-button type="primary" class="bt" icon="delete" :disabled="!selectedIds" @click="on_delete">删除</el-button>
+                <el-button type="primary" icon="edit" class="bt"@click=" () => { dialogGxclhc = true;}">工序产量核查</el-button>
+                <el-button type="primary" class="bt" icon="download"  @click="ToExcel" >导出到Excel</el-button>
+              </el-form-item>
+            </el-form>
+  
+        
+  
+          </div>
+        </layout-header>
+  
+        <layout>
+          <!--    左侧树侧形结构-->
+          <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
+            <div class="JKWTree-tree" style="height: 200px">
+              <h3>工单印版领用</h3>
+              <el-tree :data="treeData"  :props="defaultProps" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
+              </el-tree>
+            </div>
+          </layout-sider>
+  
+          <!-- 右侧区域 -->
+          <layout-content >
+          <el-main>
+            <div class="gva-table-box">
+              <!-- 表格数据 -->
+              <el-table ref="multipleTable" style="width: 100%;height: 33vh" tooltip-effect="dark"
+                        :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
+                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                        :data="wltableData"  border row-key="ID"
+                        size="small" v-if="!showKH"
+                        :cell-class-name="gxbgCellClass" id="wltable"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
+                        @row-click="tableRowClick" :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   align="center" label="印版名称" prop="印版名称"  width="200" />
+               <el-table-column   align="center" label="供方批号" prop="供方批号"  width="200" />
+               <el-table-column   align="center" label="制造日期" prop="制造日期"  width="110" />
+               <el-table-column   align="center" label="原始印数" prop="原始印数"  width="200" />
+               <el-table-column   align="center" label="累计印数" prop="累计印数"  width="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="110" />
+               <el-table-column   align="center" label="创建时间" prop="创建时间"  width="110" />
+               <el-table-column   align="center" label="修改时间" prop="修改时间"  width="110" />
+              </el-table>
+  
+              <!-- 分页 -->
+              <div class="gva-pagination">
+                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
+                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
+              </div>
+            </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="wlmxtableData"  border row-key="ID"
+                        size="small" v-if="!showKH"
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" @row-dblclick="updateCompanyFunc2"
+                        @row-click="gdtableRowClick" :show-overflow-tooltip="true"
+                        @selection-change="wlmxSelectionChange">
+               <el-table-column type="selection" width="30" />
+               <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="100" />
+               <el-table-column  sortable align="center" label="成品代号" prop="成品代号"  width="100" />
+               <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>
+
+
+            <div class="gva-table-box">
+              <!-- 表格数据 -->
+              <el-table ref="multipleTable" style="width: 100%;height: 78vh" tooltip-effect="dark"
+                        :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
+                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                        :data="hztableData"  border row-key="ID"
+                        size="small" v-if="showKH"
+                        :cell-class-name="gxbgCellClass"
+                        highlight-current-row="true" 
+                        @row-click="tableRowClick3" :show-overflow-tooltip="true"
+                        @selection-change="handleSelectionChange">
+               <el-table-column  sortable align="center" label="产品编号" prop="产品编号"  width="120" />
+               <el-table-column  sortable align="center" label="产品名称" prop="产品名称"  width="120" />
+               <el-table-column   align="center" label="存货编码" prop="存货编码"  width="200" />
+               <el-table-column   align="center" label="存货名称" prop="存货名称"  width="200" />
+               <el-table-column   align="center" label="印版名称" prop="印版名称"  width="110" />
+               <el-table-column   align="center" label="供方批次" prop="供方批次"  width="200" />
+               <el-table-column   align="center" label="制造日期" prop="制造日期"  width="200" />
+               <el-table-column   align="center" label="印数" prop="印数"  width="110" />
+               <el-table-column   align="center" label="印版类别" prop="印版类别"  width="110" />
+               <el-table-column   align="center" label="客户编号" prop="客户编号"  width="110" />
+               <el-table-column   align="center" label="客户名称" prop="客户名称"  width="110" />
+              </el-table>
+  
+              <!-- 分页 -->
+              <div class="gva-pagination">
+                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
+                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
+              </div>
+            </div>
+
+            <el-dialog
+    v-model="dialogPlateVisible"
+    :before-close="dhlcloseDialog"
+    :title="'印版工单发放'"
+    destroy-on-close
+    style="width: 40%; margin: 30vh auto;"
+  >
+    <el-form :model="Plate" label-width="120px">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="工单编号">
+            <el-input 
+              v-model="Plate.工单编号"  
+              @keyup.enter="openOrderSelectDialog"
+              placeholder="请输入工单编号" 
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="印件号">
+            <el-input v-model="Plate.印件号" placeholder="请输入印件号" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :span="18">
+          <el-form-item label="产品名称">
+            <el-input v-model="Plate.产品名称" placeholder="请输入产品名称" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :span="10">
+          <el-form-item label="机台备注">
+            <el-input 
+              v-model="Plate.机台备注" 
+              @keyup.enter="openMachineSelectDialog"
+              placeholder="请输入机台备注" 
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <template #footer>
+      <div class="dialog-footer" style="width: 100%;">
+        <el-button @click="dhlcloseDialog" style="width: 100px; height: 40px;">关 闭</el-button>
+        <el-button type="primary" @click="dhlenterDialog" style="width: 100px; height: 40px;">确 定</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
+
+  <!-- 工单选择弹窗 -->
+  <el-dialog
+    v-model="orderSelectDialogVisible"
+    title="请选择工单"
+    width="60%"
+    @keyup.enter="confirmOrderSelection"
+  >
+    <el-table
+      ref="orderTableRef"
+      :data="orderList"
+      highlight-current-row
+      @current-change="handleOrderSelect"
+      @row-dblclick="confirmOrderSelection"
+      @keyup.enter.native="confirmOrderSelection"
+    >
+      <el-table-column prop="yj_Yjno" label="印件号" />
+      <el-table-column prop="Gd_cpmc" label="产品名称" />
+    </el-table>
+  </el-dialog>
+
+  <!-- 机台选择弹窗 -->
+  <el-dialog
+    v-model="machineSelectDialogVisible"
+    title="请选择机台"
+    width="40%"
+    @keyup.enter="confirmMachineSelection"
+  >
+    <el-table
+      ref="machineTableRef"
+      :data="machineList"
+      highlight-current-row
+      @current-change="handleMachineSelect"
+      @row-dblclick="confirmMachineSelection"
+      @keyup.enter.native="confirmMachineSelection"
+    >
+      <el-table-column prop="value" label="机台编号" />
+    </el-table>
+  </el-dialog>
+
+      <!-- 工序产量核查 -->
+      <Gxclhc v-if="dialogGxclhc"  v-model="dialogGxclhc"
+      :gdbh="gdbh" :jjcp_yjno = "jjcp_yjno"
+    />
+
+
+  
+          </el-main>
+        </layout-content>
+        </layout>
+      </layout>
+    </div>
+  </template>
+  <script setup>
+  // 全量引入格式化工具 请按需保留
+  import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
+  
+  import {ref, reactive,nextTick} from 'vue'
+  import * as XLSX from 'xlsx'
+  import FileSaver from 'file-saver'
+  import dayjs, { Dayjs } from 'dayjs';
+  import { exportExcelFile } from '@/utils/excel'
+  import { useUserStore } from '@/pinia/modules/user'
+  import {ElMessage,ElMessageBox} from "element-plus";
+  import {getOrderInfo,} from '@/api/mes_api_gty/workOrderVerification'
+  import Gxclhc from '@/view/performance/12-orderAccounting/componets/gxclhc.vue'
+  import {getPPTab,getPPList,getMachine,getPPgdReceive,getPPCode,getPPReceive,getPPDelete} from "@/api/mes/job.js"
+  const userStore = useUserStore()
+  const sys_id='['+userStore.userInfo.userName+'/'+userStore.userInfo.nickName+']'
+  defineOptions({name: 'Company'})
+  // =========== 获取左侧树侧形结构 ===========
+  const treeData = ref([])
+  const getTreeData = async () => {
+  try {
+    const res = await getPPTab()
+    if (res.code === 0) {
+      treeData.value = transformData(res.data)
+    } else {
+      console.error('获取数据失败:', res.msg)
+    }
+  } catch (error) {
+    console.error('请求出错:', error)
+  }
+}
+
+// 转换数据格式为el-tree需要的结构
+const transformData = (data) => {
+  return Object.entries(data).map(([key, value]) => {
+    const children = Object.entries(value).map(([subKey, subValue]) => {
+      return {
+        label: subKey,
+        children: Object.entries(subValue).map(([typeKey, typeValue]) => {
+          return {
+            label: typeKey,
+            children: typeValue.map(item => ({
+              label: item,
+              code: key
+            }))
+          }
+        })
+      }
+    })
+    return {
+      label: key,
+      children
+    }
+  })
+}
+  
+  getTreeData()
+  
+  const showKH = ref(false)
+  const dialogGxclhc = ref(false)
+  const wltableData = ref([])
+  const nodecode = ref('')
+  const handleNodeClick = async (node) => {
+    console.log(node) 
+    if(!node.children){
+      nodecode.value = node.label.split(' ')[0]
+      showKH.value = node.code === '客户产品印版库'?true:false;
+      const res = await getPPList({code:node.label.split(' ')[0]})
+      wltableData.value = res.data
+    }
+  }
+
+  const searchInfo = ref('')
+  const on_search = async () => {
+    const res = await getPPList({code:nodecode.value,search:searchInfo.value})
+    if (res.code === 0) {
+      wltableData.value = res.data 
+    }else{
+      ElMessage.error('未搜索到数据') 
+    }
+  }
+
+  const wlmxtableData = ref([])
+  const clickedRow = ref(null)
+  const tableRowClick = async (row) => {
+    try {
+    console.log(row)
+    clickedRow.value = row;
+    console.log(clickedRow.value)
+    const res = await getPPReceive({ code: row.存货编码,batch:row.供方批号})
+    if (res.code === 0) {
+      wlmxtableData.value = res.data 
+    }else{
+      wlmxtableData.value = []
+    }
+  } catch (error) {
+    ElMessage.error('获取数据失败')
+  }
+}
+
+  
+    //新增
+    const Plate = reactive({})
+    // 弹窗控制
+    const dialogPlateVisible = ref(false)
+    const orderSelectDialogVisible = ref(false)
+    const machineSelectDialogVisible = ref(false)
+
+    // 表格引用
+    const orderTableRef = ref(null)
+    const machineTableRef = ref(null)
+
+    // 工单和机台数据
+    const orderList = ref([])
+    const machineList = ref([])
+
+    // 当前选中项
+    const selectedOrder = ref(null)
+    const selectedMachine = ref(null)
+
+  const onout = async () => {
+    if(!clickedRow.value){
+      ElMessage.error('请先选择要领出的记录')
+      return
+    }else{
+      dialogPlateVisible.value = true;
+    }
+    dialogPlateVisible.value = true;
+  }
+
+  // 打开工单选择弹窗
+const openOrderSelectDialog = async () => {
+  try {
+    const res = await getOrderInfo({ order: Plate.工单编号 })
+    
+    if (res.code === 0 && res.data.length > 0) {
+      orderList.value = res.data
+      orderSelectDialogVisible.value = true
+      
+      // 默认选中第一条并聚焦表格
+      nextTick(() => {
+        if (orderList.value.length > 0) {
+          orderTableRef.value.setCurrentRow(orderList.value[0])
+          selectedOrder.value = orderList.value[0]
+          // 聚焦表格以便响应键盘事件
+          orderTableRef.value.$el.querySelector('.el-table__body-wrapper').focus()
+        }
+      })
+    } else {
+      ElMessage.warning('未找到相关工单信息')
+    }
+  } catch (error) {
+    ElMessage.error('获取工单信息失败: ' + error.message)
+  }
+}
+
+// 处理工单选择
+const handleOrderSelect = (row) => {
+  selectedOrder.value = row
+}
+
+// 确认工单选择
+const confirmOrderSelection = () => {
+  if (selectedOrder.value) {
+    Plate.印件号 = selectedOrder.value.yj_Yjno
+    Plate.产品名称 = selectedOrder.value.Gd_cpmc
+    orderSelectDialogVisible.value = false
+  } else {
+    ElMessage.warning('请选择一条工单记录')
+  }
+}
+
+// 打开机台选择弹窗
+const openMachineSelectDialog = async () => {
+  try {
+    const res = await getMachine({ search: Plate.机台备注 })
+    
+    if (res.code === 0 && res.data.length > 0) {
+      machineList.value = res.data.map(item => ({ value: item }))
+      machineSelectDialogVisible.value = true
+      
+      // 默认选中第一条并聚焦表格
+      nextTick(() => {
+        if (machineList.value.length > 0) {
+          machineTableRef.value.setCurrentRow(machineList.value[0])
+          selectedMachine.value = machineList.value[0]
+          // 聚焦表格以便响应键盘事件
+          machineTableRef.value.$el.querySelector('.el-table__body-wrapper').focus()
+        }
+      })
+    } else {
+      ElMessage.warning('未找到相关机台信息')
+    }
+  } catch (error) {
+    ElMessage.error('获取机台信息失败: ' + error.message)
+  }
+}
+
+// 处理机台选择
+const handleMachineSelect = (row) => {
+  selectedMachine.value = row
+}
+
+// 确认机台选择
+const confirmMachineSelection = () => {
+  if (selectedMachine.value) {
+    Plate.机台备注 = selectedMachine.value.value
+    machineSelectDialogVisible.value = false
+  } else {
+    ElMessage.warning('请选择一个机台')
+  }
+}
+
+// 其他原有方法保持不变
+const dhlcloseDialog = () => {
+  dialogPlateVisible.value = false
+}
+
+const dhlenterDialog = () => {
+  // 确定按钮逻辑
+  const params = {
+    gdbh:Plate.工单编号,
+    yjno:Plate.印件号,
+    machine:Plate.机台备注,
+    code:clickedRow.value.存货编码,
+    batch:clickedRow.value.供方批号,
+    sys_id:sys_id,
+  }
+  console.log(params)
+  getPPgdReceive(params).then(res=>{
+    if(res.code===0){
+      ElMessage.success('领出成功')
+      dialogPlateVisible.value = false
+      on_search()
+    }else{
+      ElMessage.error(res.msg)
+    }
+  })
+  dialogPlateVisible.value = false
+}
+
+
+
+const selectedIds = ref('')
+
+// 维修表格选择变化
+const wlmxSelectionChange = (selection) => {
+  console.log('维修表格选择变化:', selection)
+  selectedIds.value = selection.map(item => item.UniqID).join(',')
+  console.log('选中的ID:', selectedIds.value)
+}
+
+// 删除操作
+const on_delete = async () => {
+  if (!selectedIds.value.length) {
+    ElMessage.warning('请先选择要删除的记录')
+    return
+  }
+
+  try {
+    await ElMessageBox.confirm('确定要删除选中的记录吗?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    })
+    
+    // 调用删除API,假设是批量删除接口
+    const res = await getPPDelete({ id: selectedIds.value,})
+    
+    if (res.code === 0) {
+      ElMessage.success('删除成功')
+      // 删除成功后刷新表格数据
+      // 清空选中
+      selectedIds.value = []
+    } else {
+      ElMessage.error(res.msg || '删除失败')
+    }
+  } catch (error) {
+    if (error !== 'cancel') {
+      console.error('删除失败:', error)
+      ElMessage.error('删除操作已取消')
+    }
+  }
+}
+
+const gdbh = ref('')
+const jjcp_yjno = ref('')
+const gdtableRowClick = async (row) => {
+  gdbh.value = row.工单编号
+  jjcp_yjno.value = row.印件号
+}
+
+const ToExcel = () => {
+  if(showKH.value === false){
+    console.log('导出版材')
+    const el = document.getElementById('wltable');
+    const filename = '工单印版导出.xlsx';
+  
+    // 1. 获取原始表格数据
+    const wb = XLSX.utils.table_to_book(el, { raw: true });
+    const ws = wb.Sheets[wb.SheetNames[0]];
+
+    // 2. 定义需要转换为数字的列(基于原始列字母)
+    const numberColumns = {
+      'F': 2, 
+      'G': 0,  
+      'H': 2,  
+    };
+
+    // 3. 转换数字格式
+    Object.keys(ws).forEach(address => {
+      const col = address.charAt(0);
+      
+      if (numberColumns[col] !== undefined) {
+        const cell = ws[address];
+        const num = parseFloat(cell.v);
+        
+        if (!isNaN(num)) {
+          cell.t = 'n';
+          cell.v = num;
+          cell.z = numberColumns[col] === 0 
+            ? '0' 
+            : `0.${'0'.repeat(numberColumns[col])}`;
+        }
+      }
+    });
+
+    // 4. 导出
+    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.error('导出失败:', e);
+    }
+    return wbout;
+  }
+}
+  
+  </script>
+  
+  <style scoped>
+  .form-container {
+    display: flex;
+    flex-wrap: wrap;
+  }
+  
+  .form-column {
+    /*flex: 1;*/
+    margin-right: 15px; /* 调整列之间的间距 */
+  }
+  
+  /* 左侧输入框宽度调整 */
+  .form-column .el-form-item .el-input {
+    width: 150px; /* 调整左侧输入框的宽度 */
+  }
+  
+  :deep(.hui-plan-usage-lows  div) {
+    color: #8c939d !important;
+  }
+  :deep(.lan-plan-usage-lows  div) {
+    color: blue !important;
+    font-weight: bold;
+  }
+  
+
+  /* 媒体查询,根据需要调整断点 */
+  @media screen and (max-width: 768px) {
+    .form-column {
+      flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
+      margin-right: 0;
+    }
+  }
+  /*:deep(.el-table td .cell) {*/
+  /*  line-height: 30px !important;*/
+  /*}*/
+  .JKWTree-container {
+    display: flex;
+  }
+  .JKWTree-tree {
+    /*width: 300px;*/
+    background-color: #fff;
+    padding: 10px;
+    margin-right: 20px;
+  }
+  .JKWTree-tree h3 {
+    font-size: 15px;
+    font-weight: 700;
+    margin: 10px 0;
+  }
+  .JKWTree-content {
+    flex: 1;
+  }
+
+  
+  /* 选中某行时的背景色 */
+  :deep(.el-table__body tr.current-row) > td {
+    background: #ff80ff !important;
+  }
+  </style>
+  <style scoped>
+  :deep(.el-table td .cell) {
+    line-height: 20px !important;
+  }
+  :deep(.el-tabs__header){
+    margin-bottom: 0;
+  }
+  .search{
+    margin-left: 0px !important;
+    margin-right: 10px !important;
+  }
+  .bt{
+    margin-left: 2px !important;
+    padding: 3px !important;
+    font-size: 12px;
+  }
+  .el-tabs__header{
+    margin: 0px !important;
+  }
+  .gva-table-box{
+    padding: 0px !important;
+  }
+  .mab{
+    margin-bottom: 5px;
+  }
+  </style>
+  

+ 1 - 1
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -1489,7 +1489,7 @@ const handleKeyDown = async (event, x, y, prop) => {
   let move = 0
   switch (event.keyCode) {
     case 13: // Enter
-    if(x === 7){
+    if(x === 8){
     const param = ref([])
     let filteredData = ref([])
     sh_num.value = y//保存行

+ 49 - 5
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -698,11 +698,12 @@
 		  width="1300px"
 		  style="height: 75%;"
 		>
-		<!-- <div style="margin-top:-10px">
-			<el-button @click="selectSameWorkOrder" type="success">批量选择</el-button>
+		<div style="margin-top:-12px">
+			<el-button type="primary" class="bt" icon="edit" @click="onout">领出</el-button>
+			<el-button type="primary" class="bt" icon="document" @click="onwithdraw">收回</el-button>
 			<el-button @click="invertSelection" type="info">反选</el-button>
-    </div> -->
-		  <el-row :gutter="24">
+    </div>
+		  <el-row :gutter="24" style="margin-top: 10px;">
 		    <el-col :span="4">
 		      <el-form-item label="工单编号" prop="id">
 		        <el-input v-model="formData.工单编号" :clearable="true" />
@@ -740,7 +741,8 @@
 		        style="width:1000px; height:400px;"
 		        @row-dblclick="handleSelectClick"
 		        :row-class-name="rowClassName"
-		      >
+				@selection-change="yinbanSelectionChange">
+			  <el-table-column type="selection" width="30" />
 		        <el-table-column
 		          prop="存货编码"
 		          label="存货编码"
@@ -2515,6 +2517,7 @@ import{
 import {
 MachineTeamAdd,
   setMachineTeam,
+  PrintDetailAdd,
 } from '@/api/jixiaoguanli/baogong'
 import {
   FieldInspectionRecord,
@@ -5274,6 +5277,47 @@ const facilityPrintDetailItem = async (value) => {
   }
 };
 
+let currentSelection = []; // 存储选中的数据
+
+// 勾选回调
+const yinbanSelectionChange = (selection) => {
+  currentSelection = selection; // 更新选中的数据
+  console.log("当前勾选数据:", currentSelection);
+};
+
+const onout = async () => {
+  try {
+    console.log("当前selection:", currentSelection); // 确保能访问到
+    
+    if (!currentSelection || currentSelection.length === 0) {
+      ElMessage.warning("请先选择要领出的印版");
+      return;
+    }
+
+    // 转换数据格式
+    const requestData = currentSelection.map(item => ({
+      Yb_工单编号: formData.value.工单编号 || "",
+      Yb_存货编码: item.存货编码 || "",
+      Yb_供方批号: item.供方批号 || "",
+      Yb_领用机台: JTMC, 
+      Yb_印数: item.印数 ? item.印数.toString() : "0", 
+      Sys_id: sys_id || "",
+    }));
+
+    console.log("提交数据:", requestData);
+    const response = await PrintDetailAdd(requestData);
+    
+	if (response?.code === 0) {  
+		ElMessage.success("领出成功!");
+	} else {
+		ElMessage.error(`领出失败: ${response?.msg || "未知错误"}`);  
+	}
+  } catch (error) {
+    console.error("领出失败:", error);
+    ElMessage.error(`调用失败: ${error.message}`);
+  }
+};
+
 //树形结构单机
 const dianjianselectData = reactive([])
 const yinbanselectData = ref([])