|
|
@@ -355,6 +355,8 @@ export default {
|
|
|
rollcallarr:[],
|
|
|
nongroupty:true,
|
|
|
depname:'',
|
|
|
+ //xiao nao fa yu bu jian quan de xu qiu
|
|
|
+ companyName:'',
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -412,6 +414,42 @@ export default {
|
|
|
// this.$router.back(-1)
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
+ //匹配
|
|
|
+ filteredItems() {
|
|
|
+ if (this.companyName=='') return this.cityData;
|
|
|
+
|
|
|
+ const searchChars = this.companyName.toLowerCase();
|
|
|
+
|
|
|
+ return this.cityData.filter(item => {
|
|
|
+ // 将对象的所有字符串属性拼接起来
|
|
|
+ const searchContent = item.name.toLowerCase();
|
|
|
+ // 检查搜索字符串中的每个字符是否出现在对象内容中
|
|
|
+ for (let i = 0; i < searchChars.length; i++) {
|
|
|
+ if (searchContent.includes(searchChars[i])) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }).map(item => {
|
|
|
+ // 添加匹配字符信息
|
|
|
+ const matchedChars = [];
|
|
|
+ const searchContent = Object.values(item)
|
|
|
+ .filter(value => typeof value === 'string')
|
|
|
+ .join(' ')
|
|
|
+ .toLowerCase();
|
|
|
+
|
|
|
+ for (let i = 0; i < searchChars.length; i++) {
|
|
|
+ if (searchContent.includes(searchChars[i])) {
|
|
|
+ matchedChars.push(searchChars[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ matchedChars: [...new Set(matchedChars)] // 去重
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
//获取下拉列表
|
|
|
getdown() {
|
|
|
var url = "/api/Groups/GroupEditBasicSource"
|
|
|
@@ -443,6 +481,9 @@ export default {
|
|
|
that.gradearr = res.data.data.teamLevData;
|
|
|
that.OPtype = res.data.data.teamTypeData;
|
|
|
that.cityData = res.data.data.cityData;
|
|
|
+ that.ruleForm.cityId=that.filteredItems()[0].id;
|
|
|
+ console.log(that.filteredItems());
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
var url = "/api/System/QuerySetData"
|
|
|
@@ -792,6 +833,7 @@ export default {
|
|
|
this.token = JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
this.userid = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
|
|
|
this.depname = JSON.parse(localStorage.getItem('userinif')).userInfo.depName;
|
|
|
+ this.companyName = JSON.parse(localStorage.getItem('userinif')).userInfo.companyName;
|
|
|
setTimeout(() => {
|
|
|
this.PostTourClientListByDiId();
|
|
|
}, 500);
|