廖井涛
2025-04-14 3bfff48245e0eb8affcbf2a16fb2c75eb1cff8bb
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue
@@ -141,6 +141,7 @@
  },
]
let hidePrintLabels = company.printLabel.hideButton;
let btnType = company.printBtn;
if (hidePrintLabels == 'true') {
  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
@@ -222,6 +223,7 @@
request.post(`/processCard/selectPrintDetails/${inquiryMode}/${type}`, data.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    let newDataCollection = [];
    for (let i = 0; i < res.data.data.length; i++) {
      res.data.data[i].detail.forEach((item) => {
@@ -335,6 +337,20 @@
      filterMethod: filterChanged, width: 100
    },
    {
      field: 'width',
      title: t('order.width'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged, width: 100
    },
    {
      field: 'height',
      title: t('order.height'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged, width: 100
    },
    {
      field: 'glassNumber',
      title: t('reportingWorks.glassNumber'),
      filters: [{data: ''}],
@@ -443,6 +459,7 @@
    let lableTitle = lableType.text
    if ($grid) {
      switch (code) {
        //打印流程卡
        case 'print': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
@@ -464,7 +481,7 @@
          dialogTableVisible.value = true
          break
        }
        //标签打印 常州
        case 'printLabel': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
@@ -486,6 +503,7 @@
          break
        }
        //标签打印2 常州
        case 'printLabel2': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
@@ -535,6 +553,7 @@
          })
          break
        }
        //自定义成品标签打印
        case 'customLabel': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
@@ -553,6 +572,7 @@
              id += selectRecords[i].id + "|"
            }
          }
          //成品标签1
          if (lableTypes == 1) {
            labelRow.value.list = JSON.stringify(selectRecords)
            labelRow.value.faceOrientation = faceOrientation
@@ -561,7 +581,9 @@
            lastList.value = []
            if (company.label === 1) {
              dialogTableVisibleLabel.value = true
            } else if (company.label === 2) {
            }
            //常州项目
            else if (company.label === 2) {
              router.push({
                path: '/main/processCard/PrintCustomLabelCZ',
                query: {
@@ -574,7 +596,9 @@
              })
            }
          } else if (lableTypes == 2) {
          }
          //成品标签2
          else if (lableTypes == 2) {
            labelRow.value.list = JSON.stringify(selectRecords)
            labelRow.value.faceOrientation = faceOrientation
            labelRow.value.type = type
@@ -582,7 +606,9 @@
            lastList.value = []
            if (company.label === 1) {
              dialogTableVisibleCustomLabel.value = true
            } else if (company.label === 2) {
            }
            //常州项目
            else if (company.label === 2) {
              router.push({
                path: '/main/processCard/PrintCustomLabelSemiCZ',
                query: {
@@ -594,7 +620,9 @@
                }
              })
            }
          } else if (lableTypes == 3) {
          }
          //成品标签3
          else if (lableTypes == 3) {
            router.push({
              path: '/main/processCard/PrintLabel1',
              query: {
@@ -730,24 +758,32 @@
}
const hideButton = () => {
  // 根据条件值 hidePrintLabels 过滤按钮数组
  gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
    // 这里根据 hidePrintLabels 的值决定是否隐藏 printLabel 和 printLabel2
    // 如果 type 不为空时,隐藏 print 按钮
    if (btnType == 1 && button.code === 'print') {
      return false;  // 隐藏 print 按钮
    }
    // 根据 hidePrintLabels 的值判断是否隐藏 printLabel、printLabel2 和 customLabel
    if (hidePrintLabels == 'true') {
      return button.code !== 'printLabel' && button.code !== 'printLabel2' && button.code !== 'customLabel';
    } else {
      return true && button.code !== 'printLike' && button.code !== 'printLabel3' && button.code !== 'printTest'; // 显示该按钮
      // 如果 hidePrintLabels 不是 'true',则隐藏 printLike、printLabel3 和 printTest
      return button.code !== 'printLike' && button.code !== 'printLabel3' && button.code !== 'printTest';
    }
  })
}
    // 默认返回 true,表示保留按钮
    return true;
  });
};
// 监听打印完成事件
// 监听打印次数事件
const printNumber = () => {
  selectRecordsData.value.printList = selectRecords
  let printState = 0
  request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => {
  request.post(`/processCard/updatePrintNumber`, selectRecordsData.value).then((res) => {
    if (res.code == 200 && res.data === true) {
    } else {
@@ -756,7 +792,6 @@
    }
  })
}
</script>
<template>
@@ -874,7 +909,7 @@
        destroy-on-close
        style="width: 80%;height:75% ">
      <template #header="{ close, titleId, titleClass }">
        <el-button v-print="printContentLabel" :icon="Printer" circle/>
        <el-button v-print="printContentLabel" :icon="Printer" circle @click="printNumber"/>
      </template>
      <print-custom-label id="childLabel"
                          :faceOrientation="labelRow.faceOrientation"