Explorar el Código

客户名称查重

qymljy hace 11 meses
padre
commit
ffbfcbb2c7
Se han modificado 1 ficheros con 26 adiciones y 5 borrados
  1. 26 5
      src/utils/tool.js

+ 26 - 5
src/utils/tool.js

@@ -265,17 +265,38 @@ export default {
     const date = String(newData.getDate()).padStart(2,'0')
     return year + '-' + month +'-' + date
   },
-  /*查重格式化*/
-  getFontHighlight(data,type){
+  /*查重项目格式化*/
+  getCheckFontProject(data){
     data.map(item => {
       item.chars = item.chars.reduce((acc,ite) => ({
         ...acc,
         ...ite
       }),{})
 
-      item[type] = item[type].split('').map(text => {
-        type = item.chars[type].join("") || ''
-        return type.includes(text) ? {
+      item.projectname = item.projectname.split('').map(text => {
+        let projectname = item.chars.projectname.join("") || ''
+        return projectname.includes(text) ? {
+          text,
+          color: 'red'
+        } : {
+          text,
+          color: '#666'
+        }
+      })
+      return item
+    })
+  },
+  /*查重客户格式化*/
+  getCheckFontEnterprisename(data){
+    data.map(item => {
+      item.chars = item.chars.reduce((acc,ite) => ({
+        ...acc,
+        ...ite
+      }),{})
+
+      item.enterprisename = item.enterprisename.split('').map(text => {
+        let enterprisename = item.chars.enterprisename.join("") || ''
+        return enterprisename.includes(text) ? {
           text,
           color: 'red'
         } : {