chenlu
2025-02-26 1cce75de3dc3541beb5136192613eeb6a1ef6703
添加打印界面中三个不同按钮根据配置显示隐藏对应按钮
6个文件已修改
59 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/stores/sd/companySet/天津北玻.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/stores/sd/companySet/常州吉利.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/stores/sd/companySet/新疆恒鑫.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/stores/sd/companySet/金华天成.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/stores/sd/companySet/Ìì½ò±±²£.js
@@ -32,6 +32,7 @@
        deliveryRemark: ['备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!'],
        deliveryOutbound: false,//发货默认出库
        flowCardMerge: 0,//流程卡合片打印
        printBtn:1,//打印界面三个按钮中是否显示标签打印相关按钮,0显示常州,1天津其它不显示
        //天津
        printLabel: {
            custom: (item1) => {
north-glass-erp/northglass-erp/src/stores/sd/companySet/³£ÖݼªÀû.js
@@ -32,6 +32,7 @@
        deliveryRemark: ['备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!'],
        deliveryOutbound: true,//发货默认出库
        flowCardMerge: 1,//流程卡合片打印
        printBtn:0,//打印界面三个按钮中是否显示标签打印相关按钮,0显示常州,1天津其它不显示
        //天津
        printLabel: {
            custom: (item1) => {
north-glass-erp/northglass-erp/src/stores/sd/companySet/н®ºãöÎ.js
@@ -32,6 +32,7 @@
        deliveryRemark: ['备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!'],
        deliveryOutbound: false,//发货默认出库
        flowCardMerge: 0,//流程卡合片打印
        printBtn:1,//打印界面三个按钮中是否显示标签打印相关按钮,0显示常州,1天津其它不显示
        //天津
        printLabel: {
north-glass-erp/northglass-erp/src/stores/sd/companySet/½ð»ªÌì³É.js
@@ -34,6 +34,7 @@
            '收货时需验收产品数量、规格及有无破损,如发现问题需于收货三日内,以书面通知并附上现场证明材料(如破损照片等),相关证明资料不足,或在上述日期内未提出质量异议的,逾期视为产品合格,我司将不予承担任何责任。敬请留意!'],
        deliveryOutbound: false,//发货默认出库
        flowCardMerge: 0,//流程卡合片打印
        printBtn:1,//打印界面三个按钮中是否显示标签打印相关按钮,0显示常州,1天津其它不显示
        //天津
        printLabel: {
            custom: (item1) => {
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -147,6 +147,7 @@
  },
]
let hidePrintLabels = company.printLabel.hideButton;
let btnType = company.printBtn;
if (hidePrintLabels == 'true') {
  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
@@ -191,6 +192,7 @@
data.value.printList = JSON.parse(route.query.printList)
let inquiryMode = route.query.checkedValue
// ç¬¬ä¸€æ¬¡åŠ è½½æŸ¥è¯¢
request.post(`/processCard/selectPrint/${inquiryMode}`, data.value).then((res) => {
@@ -207,7 +209,8 @@
    gridOptions.loading = false
    hideButton()
    hideButton();
    hideHead()
  } else {
    ElMessage.warning(res.msg)
  }
@@ -640,16 +643,35 @@
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 && button.code !== 'printLike'; // æ˜¾ç¤ºè¯¥æŒ‰é’®
    // æ ¹æ® hidePrintLabels è¿‡æ»¤ printLabel å’Œ printLabel2 æŒ‰é’®
    if (hidePrintLabels === 'true') {
      if (button.code === 'printLabel' || button.code === 'printLabel2') {
        return false; // éšè— printLabel å’Œ printLabel2
      }
    }
  })
    // å¦‚æžœ printBtn ä¸º '1',则隐藏 customLabel æŒ‰é’®
    if (btnType == 1 && button.code === 'customLabel') {
      console.log('Hiding customLabel button');
      return false; // éšè— customLabel æŒ‰é’®
    }
    // é»˜è®¤æƒ…况下返回 true,保留其他按钮
    return true;
  });
}
const hideHead = () => {
  // åˆ¤æ–­ btnType æ˜¯å¦ç­‰äºŽ '1' (可以根据需要调整为数字 1)
  if (btnType == 1) {
    const headDiv = document.querySelector('.head');
    if (headDiv) {
      headDiv.style.display = 'none'; // éšè— class="head" çš„ div
    }
  }
}
// ç›‘听打印完成事件
const printNumber = () => {
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);
@@ -744,16 +745,24 @@
}
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;
  });
};
// ç›‘听打印完成事件