廖井涛
2024-09-10 caf567becb6378f848b3b930821a4b38cb7564a5
north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
@@ -25,12 +25,14 @@
let props = defineProps({
  printList:null,
  printMerge:null,
  printLike: null
  printLike: null,
  mergeTechnologyNumber:null
})
const {currentRoute} = useRouter()
const route = currentRoute.value
const printMerge = props.printMerge
let mergeTechnologyNumber=props.mergeTechnologyNumber
let merge=props.printMerge
if (merge == '') {
  merge = null
@@ -54,9 +56,9 @@
//   }
// });
// data.value.printList = Object.values(uniqueObjects);
let flowCardCount = data.value.printList.length
let flowCardCount = null
onMounted(() => {
  request.post(`/processCard/getSelectPrintingRefund/${merge}/${like}`, data.value).then((res) => {
  request.post(`/processCard/getSelectPrintingRefund/${merge}/${like}/${mergeTechnologyNumber}`, data.value).then((res) => {
        if (res.code == 200) {
          produceList.value = deepClone(res.data.data)
          //处理单片厚度
@@ -136,9 +138,32 @@
          }
          //处理同配置打印
          // 使用一个对象来存储合并后的结果
          const mergedData = produceList.value.reduce((acc, item) => {
            const processId = item.detail[0].process_id;
            // 如果该 process_id 尚未在 acc 中,初始化其数组
            if (!acc[processId]) {
              acc[processId] = {
                processList: item.processList,
                detailList: [],
                detail: item.detail
              };
            }
            // 合并 detailList
            acc[processId].detailList = acc[processId].detailList.concat(item.detailList);
            return acc;
          }, {});
          // 将合并后的对象转换回数组
          produceList.value = Object.values(mergedData);
           flowCardCount=produceList.value.length
          handleSummary()
          handleGetQRCode()
        } else {
          ElMessage.warning(res.msg)
@@ -151,22 +176,19 @@
const handleGetQRCode = async () => {
  let technologyNumber=''
  for (let i = 0; i < produceList.value.length; i++) {
    const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符
    const technologyNumber = produceList.value[i].detail[0].mergeTechnologyNumber.toString(); // 转换为字符串以便处理每个字符
    produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code
    for (let j = 0; j < technologyNumber.length; j++) {
      const processId = produceList.value[i].detail[0].process_id;
      const url = `${processId}/${technologyNumber[j]}`;
      // 生成 QR Code 并存储到数组中
      const qrcodeData = await QRCode.toDataURL(url);
      produceList.value[i].detail[0]["qrcodeList"].push({
        qrcode: qrcodeData,
        technologyNumber: technologyNumber[j]
      });
    }
    const processId = produceList.value[i].detail[0].process_id;
    const url = `${processId}/${technologyNumber}`;
    // 生成 QR Code 并存储到数组中
    const qrcodeData = await QRCode.toDataURL(url);
    produceList.value[i].detail[0]["qrcodeList"].push({
      qrcode: qrcodeData,
      technologyNumber: technologyNumber
    });
  }
};
@@ -206,8 +228,8 @@
    <table v-for="(item,id) in produceList" id="contentTable" :key="id">
      <thead>
      <tr v-for="(itemFlow,index) in item.detail" :key="index">
        <td  v-if="like='1'"  colspan="26">
          <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px;margin: 5px  "/></div>
        <td    colspan="29">
          <div style="float: left;">补片单号:{{itemFlow.patch_id}}</div>
          <div id="bj" style="float: right;font-size: 28px">补 {{ id + 1 }}</div>
          <div>{{ company.companyName }}</div>
          <div>生产流程卡</div>
@@ -215,21 +237,9 @@
              itemFlow.process_id
            }}/{{ itemFlow.technologyNumberMerge }} 共 {{ flowCardCount }} 架
          </div>
          <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{
              itemFlow.process_id
            }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架
          </div>
        </td>
        <td v-else colspan="24">
          <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px  "/></div>
          <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div>
          <div>{{ company.companyName }}</div>
          <div>生产流程卡</div>
          <div v-if="itemFlow.technologyNumberMerge!=''" style="text-align: right;font-weight: bolder">流程卡号: {{
              itemFlow.process_id
            }}/{{ itemFlow.technologyNumberMerge }} 共 {{ flowCardCount }} 架
          </div>
          <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{
          <div v-else style="text-align: right;font-weight: bolder">
            {{itemFlow.otherRemarks}}&nbsp;&nbsp;
            流程卡号: {{
              itemFlow.process_id
            }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架
          </div>
@@ -241,8 +251,7 @@
        <td class="tdNowrap">项目名称:</td>
        <td colspan="2">{{ items.project }}</td>
        <td class="tdNowrap">工艺流程:</td>
        <td colspan="19" v-if="like='1'" style="width: 500px">{{ items.process }}</td>
        <td colspan="17" v-else style="width: 500px">{{ items.process }}</td>
        <td colspan="22"  style="width: 500px">{{ items.process }}</td>
      </tr>
      <tr v-for="(itemTr,index) in item.detail" :key="index">
        <td class="tdNowrap">磨边类型:</td>
@@ -250,14 +259,12 @@
        <td class="tdNowrap">单片名称:</td>
        <td colspan="2">{{ itemTr.glass_child }}</td>
        <td class="tdNowrap">产品名称:</td>
        <td v-if="like=='1'" colspan="19">{{ itemTr.product_name }}</td>
        <td v-else colspan="17">{{ itemTr.product_name }}</td>
        <td colspan="22">{{ itemTr.product_name }}</td>
      </tr>
      <tr>
        <td rowspan='2'>序号</td>
        <td rowspan='2'>编号</td>
        <td v-if="like!=null" rowspan="2">小片顺序</td>
        <td v-else style="display: none;" rowspan="2">小片顺序</td>
        <td rowspan="2">小片顺序</td>
        <td rowspan='2'>宽*高</td>
        <td rowspan='2'>数量</td>
        <td rowspan='2'>面积</td>
@@ -267,23 +274,27 @@
        <td v-for="(itemPr,index) in item.processList" :key="index" colspan="2">{{ itemPr.process }}</td>
      </tr>
      <tr>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{company.printLabel.printFlowCard.patch}}</td>
        <td>{{company.printLabel.printFlowCard.lackOf}}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
        <td>{{ company.printLabel.printFlowCard.patch }}</td>
        <td>{{ company.printLabel.printFlowCard.lackOf }}</td>
      </tr>
      </thead>
      <tbody>
@@ -291,11 +302,10 @@
      <tr v-for="(itemDatile,index) in item.detailList" :key="index">
        <td>{{ itemDatile.order_number }}</td>
        <td>{{ itemDatile.s01Value }}</td>
        <td v-if="like=='1'">{{ itemDatile.technology_number }}</td>
        <td v-else style="display: none"></td>
        <td>{{ itemDatile.technology_number }}</td>
        <td>{{ itemDatile.child_width }}</td>
        <td class="item" style="width: 5%;height: 100%;">
          <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input>
          <input v-model="itemDatile.quantity" style="width: 100%;height: 100%"  @keyup="handleSummary()"/>
        </td>
        <td>{{ itemDatile.total_area }}</td>
        <td>{{ itemDatile.perimeter }}</td>
@@ -317,11 +327,15 @@
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      </tbody>
      <tfoot>
      <tr style="height: 14px">
        <td v-for="(itemsum,index) in item.detail" :key="index" colspan="26">
        <td v-for="(itemsum,index) in item.detail" :key="index" colspan="29">
          数量:
          <label>{{ itemsum.quantity }}</label>
          面积:
@@ -331,27 +345,19 @@
        </td>
      </tr>
      <tr v-for="(itemtextarea,index) in item.detail" :key="index">
        <td v-if="like='1'" colspan="4" rowspan="6" style="width: 480px;height: 100px ">
        <td colspan="4" rowspan="5" style="width: 480px;height: 100px ">
          <div>
            次破类型:{{itemtextarea.breakage_type}}&nbsp;
            次破原因:{{itemtextarea.breakage_reason}}&nbsp;
            责任工序:{{itemtextarea.responsible_process}}&nbsp;
            责任班组:{{itemtextarea.responsible_team}}
            <span v-if="itemtextarea.responsible_personnel!=null">责任信息:{{itemtextarea.responsible_personnel}}</span>
          </div>
<!--          <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{company.printLabel.printFlowCard.processingNote(itemtextarea)}}</textarea>-->
<!--          </div>-->
        </td>
        <td v-else colspan="6" rowspan="2" style="width: 480px;height: 100px ">
          <div>
            次破类型:{{itemtextarea.breakage_type}}
            次破原因:{{itemtextarea.breakage_reason}}
            责任工序:{{itemtextarea.responsible_process}}
            责任班组:{{itemtextarea.responsible_team}}
          </div>
<!--          <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{company.printLabel.printFlowCard.processingNote(itemtextarea)}}</textarea>-->
<!--          </div>-->
        </td>
        <td>完工签名</td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
@@ -375,10 +381,14 @@
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
      </tr>
      <tr>
        <td>质检签名</td>
        <td colspan="2"></td>
        <td colspan="2">生产签名</td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
@@ -389,8 +399,12 @@
        <td colspan="2"></td>
        <td colspan="2"></td>
      </tr>
      <tr>
        <td>原片箱号</td>
        <td colspan="24"></td>
      </tr>
      <tr v-for="(qrCodeItem,index) in item.detail" :key="index">
        <td colspan="23">
        <td colspan="25">
          <span style="display: flex;">
            <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%">
            <div class='qrCode' style="width: 80px;height: 80px;">
@@ -402,7 +416,12 @@
          </span>
          </span>
        </td>
      </tr>
      <tr v-for="(itemtextareas,index) in item.detail" :key="index">
        <td  colspan="29" rowspan="6" style="width: 480px;height: 150px ">
          <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 12px;text-align: left">{{itemtextareas.processing_note}}</textarea>
          </div>
        </td>
      </tr>
      </tfoot>
    </table>
@@ -451,12 +470,10 @@
}
#contentTable tbody {
  white-space: nowrap;
}
.tdNowrap {
  white-space: nowrap;
}
@@ -465,14 +482,19 @@
  font-weight: bolder;
}
@page {
  size: auto;  /* auto is the initial value */
  margin: 2mm 0mm 0mm 1mm  /* this affects the margin in the printer settings */
input{
  border: none;
  background: none;
}
@media print {
  @page {
    size: auto;  /* auto is the initial value */
    margin: 2mm 4mm 0mm 4mm  /* this affects the margin in the printer settings */
  }
  tbody {
    display: table-row-group;
  }