guoyujie
2025-11-20 5fb1f180d0e6eceb83cda226c1daeca3f634e813
north-glass-erp/northglass-erp/src/components/pp/PrintProcess.vue
@@ -1,7 +1,7 @@
<script setup>
import request from "@/utils/request"
import {ElDatePicker, ElMessage} from "element-plus"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch, computed } from "vue"
import {Search} from "@element-plus/icons-vue"
import {useRouter} from 'vue-router'
import {changeFilterEvent, filterChanged} from "@/hook"
@@ -277,12 +277,37 @@
  }
}
// 原始图片数组 picture
// 1. 按 orderNumber 分组
const pictureMap = computed(() => {
  const map = {}
  picture.value.forEach(p => {
    if (!map[p.orderNumber]) map[p.orderNumber] = []
    map[p.orderNumber].push(p)
  })
  return map
})
// 2. 根据流程卡 detailList 合并序号对应图片
const getPicturesByDetailList = (detailList) => {
  let pics = []
  detailList.forEach(d => {
    const num = d.order_number
    if (pictureMap.value[num]) {
      pics = pics.concat(pictureMap.value[num])
    }
  })
  return pics
}
</script>
<template>
  <!--  <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button>-->
  <div id="printFlowCard">
    <table v-for="(item,id) in produceList" id="contentTable" :key="id" style="border-bottom: none">
<div id="contentDiv" v-for="(item,id) in produceList" :key="id">
  <table  id="contentTable"  style="border-bottom: none">
      <thead>
      <tr v-for="(itemFlow,index) in item.detail" :key="index">
        <td  colspan="31">
@@ -341,8 +366,7 @@
        <td rowspan='2'>图号</td>
        <td rowspan='2'>编号</td>
        <td rowspan="2">小片顺序</td>
        <td v-if="name=='浙江巨星嘉泰新材料有限公司'"  rowspan='2' style="width: 90px">宽(弧长)*高</td>
        <td v-else rowspan='2' style="width: 90px">宽*高</td>
      <td rowspan='2' style="width: 90px">宽(弧长)*高</td>
        <td rowspan='2' >数量</td>
        <td rowspan='2'>面积</td>
        <td rowspan='2'>周长</td>
@@ -372,8 +396,7 @@
        <td>{{ itemDatile.total_area }}</td>
        <td>{{ itemDatile.perimeter }}</td>
        <td>{{ itemDatile.bend_radius }}</td>
        <td v-if="name!='金华福喜天成玻璃有限公司'" style="white-space: normal; word-break: break-all; word-wrap: break-word;">{{ itemDatile.remarks }}</td>
        <td v-else>{{ itemDatile.remarks }}</td>
      <td>{{ itemDatile.remarks }}</td>
        <template v-for=" n in item.processList.length">
          <td></td>
          <td></td>
@@ -452,9 +475,7 @@
      <tr v-for="(itemtextareas,index) in item.detail" :key="index">
        <td  colspan="31"  style="width: 480px;height: 150px ">
          <div v-if="name=='浙江巨星嘉泰新材料有限公司'" style="width: 100%;height: 100%;text-align: left"><textarea style="height: 99%;width: 99%;border: none;;font-size: 16px;font-weight: bold;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea>
          </div>
          <div v-else style="width: 100%;height: 100%;text-align: left"><textarea style="height: 99%;width: 99%;border: none;;font-size: 14px;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea>
          <div style="width: 100%;height: 100%;text-align: left"><textarea style="height: 99%;width: 99%;border: none;;font-size: 16px;font-weight: bold;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea>
          </div>
        </td>
      </tr>
@@ -469,15 +490,14 @@
      </tfoot>
    </table>
    <el-image
        class="picture"
        v-for="(item,index) in picture"
        :src="item.imageBase64"
        :preview-src-list="[item.imageBase64]"
      v-for="(img, index) in getPicturesByDetailList(item.detailList)"
      :key="index"
      :src="img.imageBase64"
        fit="contain"
        style="max-height: 700px;"
      style="max-width: 400px;max-lines: 600px"
    />
  </div>
  </div>
</template>
<style scoped>
@@ -495,6 +515,10 @@
//font-weight: bolder; height: 600px;
}
#contentDiv {
  width: 100%;
}
#contentTable {
  border-collapse: collapse;
  border: 1px solid black;