Parcourir la source

英文打印时 去除色号中的中文字符

lph il y a 1 an
Parent
commit
8827eba159
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      zkqy-ui/src/utils/print/printUtils.js

+ 5 - 1
zkqy-ui/src/utils/print/printUtils.js

@@ -13,6 +13,9 @@ export function getServerPrintData(printRow) {
   return result
 
 }
+function removeChineseCharacters(str) {
+  return str.replace(/[\u4e00-\u9fa5]/g, '');
+}
 
 function printEN(printRow) {
   let {
@@ -26,6 +29,7 @@ function printEN(printRow) {
     lotNum, //批次
     boxNum, //箱号
   } = printRow;
+  let ENColor = removeChineseCharacters(productColor) || ''
   let res = []
   res.push({
     key1: 'GRADE:',
@@ -37,7 +41,7 @@ function printEN(printRow) {
   })
   res.push({
     key1: 'COLOR NO.:',
-    key2: productColor + '    ' + lotNum,
+    key2: ENColor + '    ' + lotNum,
   })
   res.push({
     key1: 'CONE NO.:',