shish 3 лет назад
Родитель
Сommit
1b6134e5e9
2 измененных файлов с 40 добавлено и 6 удалено
  1. 0 1
      ghsApp/src/mixins/product.js
  2. 40 5
      hdApp/src/mixins/product.js

+ 0 - 1
ghsApp/src/mixins/product.js

@@ -353,7 +353,6 @@ export default {
 						})
 					}
 				}
-
 			})
 
 			let searchList = this.$util.unique(filterItemData)

+ 40 - 5
hdApp/src/mixins/product.js

@@ -258,29 +258,60 @@ export default {
 				return
 			}
 
+			var reg = /^[0-9a-zA-Z]*$/g
+			let notChinese = reg.test(this.py) == true ? true : false
+
 			//大于等于2个字符才开始搜索 shish 20210622
 			if(this.py.length <=1){
 				return
 			}
-			//红色粉色花材太多,搜索时会卡住,所以设置输入第三个字母时才搜索
+			//色花材太多,搜索时会卡住,所以设置输入第三个字母时才搜索
 			if(this.py.indexOf('fs') == 0 && this.py.length <= 2){
 				return
 			}
+			if(this.py.indexOf('粉色') == 0 && this.py.length <= 2){
+				return
+			}
 			if(this.py.indexOf('hs') == 0 && this.py.length <= 2){
 				return
 			}
+			if(this.py.indexOf('红色') == 0 && this.py.length <= 2){
+				return
+			}
+			if(this.py.indexOf('黄色') == 0 && this.py.length <= 2){
+				return
+			}
 			if(this.py.indexOf('zs') == 0 && this.py.length <= 2){
 				return
 			}
+			if(this.py.indexOf('紫色') == 0 && this.py.length <= 2){
+				return
+			}
 			if(this.py.indexOf('ls') == 0 && this.py.length <= 2){
 				return
 			}
+			if(this.py.indexOf('绿色') == 0 && this.py.length <= 2){
+				return
+			}
 			if(this.py.indexOf('bs') == 0 && this.py.length <= 2){
 				return
 			}
+			if(this.py.indexOf('白色') == 0 && this.py.length <= 2){
+				return
+			}
+			if(this.py.indexOf('cs') == 0 && this.py.length <= 2){
+				return
+			}
+			if(this.py.indexOf('橙色') == 0 && this.py.length <= 2){
+				return
+			}
+			if(this.py.indexOf('银色') == 0 && this.py.length <= 2){
+				return
+			}
 			if(this.py.indexOf('yj') == 0 && this.py.length <= 2){
 				return
 			}
+
 			//涉及记住花材的代码和流程,请全项目搜索关键词remember_item
 			//将已选的花材按productId键名组合
 			let selectListData = []
@@ -305,9 +336,14 @@ export default {
 					currentItem.userPrice = 0
 					currentItem.smallCount = 0
 				}
-				let elePy = (currentItem.py && currentItem.py.toLocaleUpperCase()) || "";
-				let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
-				if (hasPy) {
+				let has = false
+				if (notChinese){
+					let elePy = (currentItem.py && currentItem.py.toLocaleUpperCase()) || "";
+					has = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0 ? true : false
+				}else{
+					has = currentItem.name && currentItem.name.indexOf(this.py) >= 0 ? true : false
+				}
+				if (has) {
 					if(this.$util.isEmpty(filterItemData)){
 						filterItemData = [{classId: currentItem.classId, className: currentItem.className,isActive:true,child:[currentItem]}]
 					}else{
@@ -320,7 +356,6 @@ export default {
 						})
 					}
 				}
-
 			})
 
 			let searchList = this.$util.unique(filterItemData)