chenlu
2024-09-24 edc227277159601c5cb86829f1c5ce14cf7903a4
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue
@@ -35,9 +35,8 @@
const lableType = route.query.lableType
onMounted(() => {
      request.post(`/processCard/getSelectPrintCustomLabel/${type}`, data.value).then((res) => {
      request.post(`/processCard/getSelectPrintCustomLabel/${type}/1`, data.value).then((res) => {
        if (res.code == 200) {
          console.log(res.data.data)
          produceList.value = deepClone(res.data.title)
          list.value = deepClone(res.data.data)
          const data = produceList.value[0].value
@@ -51,7 +50,6 @@
              }
            }
          }
          console.log(lastList.value)
        } else {
          ElMessage.warning(res.msg)
          router.push("/login")
@@ -66,7 +64,7 @@
// 打印方法
const printFlowCard = () => {
  // 需要打印的局部区域赋予"print-wrap"的id
  let el = document.getElementById("print");
  let el = document.getElementById("printFlowCard");
  let doc = document;
  let body = doc.body || doc.getElementsByTagName("body")[0];
  let printId = "print-" + Date.now();
@@ -80,7 +78,11 @@
  style.innerHTML =
      "body>#" +
      printId +
      "{display:none}@media print{body>:not(#" +
      "{display:none}@media print{" +
      "@page {" +
      "    size: auto; " +
      "    margin: 2mm 2mm 2mm 2mm;  " +
      "  }body>:not(#" +
      printId +
      "){display:none !important}body>#" +
      printId +
@@ -104,21 +106,25 @@
<template>
  <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button>
  <div id="printFlowCard" >
    <div id="entirety" v-for="(item,id) in lastList" >
    <template v-for="(item,id) in lastList">
    <div id="entirety" >
      <div class="row1">
        <span>{{ item.customerAbbreviation }}</span>&nbsp;
        <span>{{ item.orderId }}</span>
      </div>
      <div  class="row2">
        <span>{{ item.project }}</span>&nbsp;
        <span>{{ item.building_number }}</span>
        <span>{{ item.buildingNumber }}</span>
      </div>
      <div class="row3">{{item.width}}*{{item.height}}={{item.quantity}}</div>
      <div class="row3" v-if="item.other_columns!=null&&(JSON.parse(item.other_columns).S02!=null)">{{JSON.parse(item.other_columns).S02}}={{item.quantity}}</div>
      <div class="row3" v-else>{{Math.round(item.width)}}x{{Math.round(item.height)}}={{item.quantity}}</div>
      <div class="row5">
        <span>{{item.remarks}}</span>&nbsp;
        <span>{{ item.processing_note }}</span>
        <span>{{item.filmNumber}}</span>&nbsp;
        <span>{{ item.processingNote }}</span>
      </div>
    </div>
    <div style="width: 20px" v-if="id%2===0"></div>
    </template>
  </div>
</template>
@@ -130,7 +136,7 @@
}
#printButton {
  margin-top: -20px;
  /*margin-top: -20px;*/
  width: 100px;
}
@@ -138,44 +144,55 @@
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
  margin-left: 5px;
  margin-top: 15px;
  width: 500px;
}
#entirety{
  text-align: center;
  width: 185px;
  height: 87px;
  margin-bottom: 10px;
  width: 48%;
  height: 160px;
  border: black 1px;
  word-wrap: break-word;
}
.row1 {
  font-size: 8pt;
  font-size: 12pt;
  font-weight: bold;
  height: 16px;
  height: 35px;
}
.row1 span {
  font-size: 15pt;
}
.row2 {
  font-size: 8pt;
  font-size: 14pt;
  font-weight: bold;
  height: 16px;
  height: 35px;
}
.row2 span {
  font-size: 14pt;
}
span {
  font-size: 8pt;
  font-size: 12pt;
  font-weight: bold;
}
.row3 {
  margin-top: -5px;
  height: 19px;
  font-size: 12pt;
  height: 35px;
  font-size: 22pt;
  font-weight: bolder;
  line-height: 35px;
}
.row5 {
  height: 15px;
  height: 50px;
  font-weight: bold;
  font-size: 8pt;
  font-size: 12pt;
  margin-left: 20px;
}
.row5 span {
  font-size: 14pt;
}
.row6 {
@@ -186,16 +203,17 @@
@page {
  size: auto;  /* auto is the initial value */
  margin: 8mm 4mm 0mm 6mm  /* this affects the margin in the printer settings */
}
@media print {
  div {
    page-break-inside: avoid;
  }
  @page {
    size: auto;  /* auto is the initial value */
    margin: 2mm 2mm 2mm 2mm;  /* this affects the margin in the printer settings */
  }
}
</style>