princeLee 4 years ago
parent
commit
56d572a742

+ 9 - 5
src/views/workbench/components/searchSection.vue

@@ -112,17 +112,21 @@ export default {
       },
       immediate: true,
       deep: true
+    },
+    searchForm: {
+      handler(newV) {
+        this.queryTeamMember()
+      },
+      immediate: true,
+      deep: true
     }
   },
-  created() {
-    this.queryTeamMember()
-  },
   methods: {
     async queryTeamMember() { // 获取团队人员
       if (this.workbench === '团队' || this.workbench === '团队忙碌' || this.workbench === '团队空闲') {
-        const params = this.searchForm.teamId ? { teamId: this.searchForm.teamId } : {}
-        const res = await queryTeamMember(params)
+        const res = await queryTeamMember(this.searchForm)
         if (res.code === 200) {
+          res.data = res.data || []
           this.memberList = this.handleMember(res.data)
           this.filtrate.checkedMembers = this.memberList.map(item => item.idap)
           this.checkAllMember = true

+ 5 - 9
src/views/workbench/team/index.vue

@@ -371,33 +371,29 @@ export default {
       const res = await settingGetBizList({})
       if (res.code === 200 && res.data) {
         this.searchEnum.businesslines = res.data
-        this.searchEnum.businesslines.unshift({ code: null, name: '全部' })
+        this.searchEnum.businesslines.unshift({ code: null, name: '全部业务线' })
       }
     },
     async queryTeamInfoList() { // 获取用户团队列表
-      const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0 })
+      const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0, bizId: this.searchForm.bizId })
       if (res.code === 200 && res.data) {
         this.searchEnum.teams = res.data.list
-        this.searchEnum.teams.unshift({ teamId: null, teamName: '全部' })
+        this.searchEnum.teams.unshift({ teamId: null, teamName: '全部团队' })
       }
     },
     handleTeams(e) { // 团队变动
       this.searchForm.teamId = e
       const res = this.searchEnum.teams.find(item => item.teamId === e)
       this.teamName = res.teamName
-      if (this.$refs['search-section']) {
-        this.$refs['search-section'].queryTeamMember()
-      }
       this.handleClick()
     },
     handleBizId(e) { // 业务线变动
+      console.log(e)
       this.searchForm.bizId = e
+      this.queryTeamInfoList()// 重新获取团队
       const res = this.searchEnum.businesslines.find(item => item.code === e)
       this.bizName = res.name
       this.$store.dispatch('global/setBizId', res.code)
-      if (this.$refs['search-section']) {
-        this.$refs['search-section'].queryTeamMember()
-      }
       this.handleClick()
     },
     showSchedule(e) { // 查看日程详情