Просмотр исходного кода

会务流程和团组进程联想添加

liuhj 19 часов назад
Родитель
Сommit
4f6cbec806
2 измененных файлов с 109 добавлено и 7 удалено
  1. 65 2
      src/components/OP/AffairsBackward.vue
  2. 44 5
      src/components/OP/GroupProgress.vue

+ 65 - 2
src/components/OP/AffairsBackward.vue

@@ -3,8 +3,8 @@
         <div class="affairbackward-hade">
             <el-form style="display: flex;justify-content: space-between;align-items: center;" :inline="true" :model="formInline" class="demo-form-inline">
                 <el-form-item>
-                    <el-select filterable @change="ConferenceProceduresInit" v-model="diid" placeholder="团组名称" style="width: 250px;">
-                        <el-option :style="item.hasChildData?'color: #66b1ff;':''" v-for="(item, index) in AuditStatus" :key="index" :label="item.teamName"
+                    <el-select filterable remote :filter-method="advancedFilter" @change="ConferenceProceduresInit" v-model="diid" placeholder="团组名称" style="width: 250px;">
+                        <el-option :style="item.hasChildData?'color: #66b1ff;':''" v-for="(item, index) in AuditStatusArr" :key="index" :label="item.teamName"
                             :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
@@ -154,6 +154,9 @@ export default {
             porojectname:[],
             porojectindex:[],
             num:0,
+            selectLoading:false,
+            AuditStatusArr:[],
+            searchMode: 'character', // 'character': 字符匹配, 'fuzzy': 模糊匹配
         }
     },
     created() {
@@ -161,6 +164,65 @@ export default {
         // this.flattenData();
     },
     methods:{
+        advancedFilter(query) {
+            if (!query || query.trim() === '') {
+                this.AuditStatusArr = [...this.AuditStatus];
+                return;
+            }
+
+            const trimmedQuery = query.trim();
+
+            if (this.searchMode === 'character') {
+                // 字符匹配模式:每个字都必须包含
+                this.characterMatchFilter(trimmedQuery);
+            } else {
+                // 模糊匹配模式(默认的filterable行为)
+                this.fuzzyMatchFilter(trimmedQuery);
+            }
+        },
+        /*** 严格的字符匹配 - 每个查询字符都必须出现*/
+        characterMatchFilter(query) {
+            const queryChars = query.split('').filter(char => char.trim() !== '');
+
+            this.AuditStatusArr = this.AuditStatus.filter(item => {
+                const teamName = item.teamName || '';
+                return queryChars.every(char => teamName.includes(char));
+            });
+        },
+        /*** 模糊匹配 - 包含整个查询字符串即可*/
+        fuzzyMatchFilter(query) {
+            const lowerQuery = query.toLowerCase();
+            this.AuditStatusArr = this.AuditStatus.filter(item => {
+                const teamName = (item.teamName || '').toLowerCase();
+                return teamName.includes(lowerQuery);
+            });
+        },
+
+
+        //搜索提示
+        GroupItemKeywordSearch(query) {
+            if (query !== '') {
+                this.selectLoading=true;
+                var url = "/api/Groups/GroupItemKeywordSearch?keyword=" + query
+                var that = this
+                this.$axios({
+                    method: 'get',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                }).then(function (res) {
+                    that.AuditStatus=[];
+                    if (res.data.code == 200) {
+                        that.AuditStatus = res.data.data;
+                    }else{
+                        that.AuditStatus=[];
+                    }
+                }).finally(()=>{
+                    that.selectLoading=false;
+                })
+            }
+        },
         // 将嵌套的数据结构转换为扁平结构
         flattenData() {
             this.tableDatass = [];
@@ -261,6 +323,7 @@ export default {
             }).then(function (res) {
                 if(res.data.code==200){
                     that.AuditStatus=res.data.data.groupList;
+                    that.AuditStatusArr = that.AuditStatus;
                     if (that.diid==='') {
                         that.diid=res.data.data.groupInfo.id;
                     }

+ 44 - 5
src/components/OP/GroupProgress.vue

@@ -4,9 +4,9 @@
             <el-form style="display: flex;justify-content: space-between;align-items: center;" :inline="true"
                 :model="formInline" class="demo-form-inline">
                 <el-form-item>
-                    <el-select filterable @change="GetGroupNameList" v-model="diid" placeholder="团组名称"
+                    <el-select filterable remote :filter-method="advancedFilter" @change="PostShareGroupInfo" v-model="diid" placeholder="团组名称"
                         style="width: 250px;">
-                        <el-option :style="item.hasProcess?'color: #409EFF;':''" v-for="(item, index) in AuditStatus"
+                        <el-option :style="item.hasProcess?'color: #409EFF;':''" v-for="(item, index) in AuditStatusArr"
                             :key="index" :label="item.groupName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
@@ -642,9 +642,49 @@ export default {
             progressloading:false,
             jobName:'',
             visaclickid:'',
+
+            AuditStatusArr:[],
+            searchMode: 'character', // 'character': 字符匹配, 'fuzzy': 模糊匹配
         }
     },
     methods: {
+        advancedFilter(query) {
+            if (!query || query.trim() === '') {
+                this.AuditStatusArr = [...this.AuditStatus];
+                return;
+            }
+
+            const trimmedQuery = query.trim();
+
+            if (this.searchMode === 'character') {
+                // 字符匹配模式:每个字都必须包含
+                this.characterMatchFilter(trimmedQuery);
+            } else {
+                // 模糊匹配模式(默认的filterable行为)
+                this.fuzzyMatchFilter(trimmedQuery);
+            }
+        },
+        /*** 严格的字符匹配 - 每个查询字符都必须出现*/
+        characterMatchFilter(query) {
+            const queryChars = query.split('').filter(char => char.trim() !== '');
+
+            this.AuditStatusArr = this.AuditStatus.filter(item => {
+                const groupName = item.groupName || '';
+                return queryChars.every(char => groupName.includes(char));
+            });
+        },
+        /*** 模糊匹配 - 包含整个查询字符串即可*/
+        fuzzyMatchFilter(query) {
+            const lowerQuery = query.toLowerCase();
+            this.AuditStatusArr = this.AuditStatus.filter(item => {
+                const groupName = (item.groupName || '').toLowerCase();
+                return groupName.includes(lowerQuery);
+            });
+        },
+
+
+
+
         handleChange(val) {
             console.log(val);
         },
@@ -664,7 +704,6 @@ export default {
         },
         //获取团组id
         GetGroupNameList(){
-            this.progressloading=true;
             this.AuditStatus=[];
             var url = "/api/Groups/GroupProcessGroupNames"
             var that = this
@@ -677,19 +716,20 @@ export default {
             }).then(function (res) {
                 if(res.data.code==200){
                     that.AuditStatus=res.data.data;
+                    that.AuditStatusArr=that.AuditStatus;
                     if (that.diid==='') {
                         that.diid=res.data.data[0].id;
                         
                     }
                     that.PostShareGroupInfo();
                 }else{
-                    that.progressloading=false;
                     that.$message.error(res.data.msg);
                 }
             })
         },
         //获取团组详情
         PostShareGroupInfo(){
+            this.progressloading=true;
             var url = "/api/Business/PostShareGroupInfo"
             var that = this
             this.$axios({
@@ -703,7 +743,6 @@ export default {
                     id: that.diid
                 }
             }).then(function (res) {
-                console.log(res)
                 if(res.data.code==200){
                     that.formInline.name = res.data.data.teamName;
                     that.formInline.clientName = res.data.data.clientName;