廖井涛
2024-07-05 615d0a9e2011510b589ccc3b4bc58894a39e8295
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -91,6 +91,7 @@
]
//标签类型
let  filteredOptions=[]
const lableType = ref('1')
const lableTypeOptions = [
  {
@@ -110,6 +111,13 @@
    label: `${company.printLabel.labelType3}`,
  },
]
let hidePrintLabels = company.printLabel.hideButton;
if (hidePrintLabels=='true'){
  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
}else {
  filteredOptions = lableTypeOptions;
}
//合片流程卡打印下拉选项
const printMerge = ref('')
@@ -135,16 +143,17 @@
  if (res.code == 200) {
    produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.dataType = res.data.type
    // produceList.forEach(item => {
    //   if(item.print_status == 1){
    //     item.print_status='已打印'
    //   }
    //   else if (item.print_status == 0){
    //     item.print_status='未打印'
    //   }
    // });
    produceList.forEach(item => {
      if(item.print_status == 1){
        item.print_status='已打印'
      }
      else if (item.print_status == 0){
        item.print_status='未打印'
      }
    });
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
    hideButton()
  } else {
    ElMessage.warning(res.msg)
  }
@@ -276,13 +285,18 @@
        return ''
      })
    ]
  }
  },
})
const gridEvents = {
  toolbarButtonClick ({ code}) {
    const $grid = xGrid.value
    selectRecords = $grid.getCheckboxRecords()
    selectRecords.forEach(obj => {
      delete obj.print_status;
    });
    let type=printType.value
    let faceOrientation=stateValue.value
    let lableTypes=lableType.value
@@ -290,6 +304,7 @@
    if ($grid) {
      switch (code) {
        case 'print': {
          console.log(selectRecords)
          if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
@@ -564,14 +579,14 @@
          },
          {
            code: 'addAutomatically',
            name: "自动填充",
            name: t('processCard.addAutomatically'),
            prefixIcon: 'vxe-icon-indicator',
            visible: true,
            disabled: false
          },
          {
            code: 'selectFill',
            name: "选中填充",
            name: t('processCard.selectFill'),
            prefixIcon: 'vxe-icon-indicator',
            visible: true,
            disabled: false
@@ -704,6 +719,18 @@
  addListener(xGridDetail.value, detailGridOptions)
}
const hideButton = () =>{
  // 根据条件值 hidePrintLabels 过滤按钮数组
  gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
    // 这里根据 hidePrintLabels 的值决定是否隐藏 printLabel 和 printLabel2
    if (hidePrintLabels=='true') {
      return button.code !== 'printLabel' && button.code !== 'printLabel2';
    } else {
      return true; // 不隐藏任何按钮
    }
  })
}
</script>
<template>
@@ -722,7 +749,7 @@
    &nbsp;
    <el-select v-model="lableType" class="m-2" :placeholder="lableTypeOptions[0].label" style="width: 140px">
      <el-option
          v-for="item in lableTypeOptions"
          v-for="item in filteredOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"