Bladeren bron

业务线变换更改

wangziqian 4 jaren geleden
bovenliggende
commit
fd6e171332

+ 15 - 13
src/layout/components/Navbar.vue

@@ -151,23 +151,25 @@ export default {
         this.get_bizArr()
       }
     },
-    async sumTypeCkeck(type) { // 下拉列表的点击事件x
+    sumTypeCkeck(type) { // 下拉列表的点击事件x
       this.sumType = type.name
-      await settingUserSetBiz({ bizId: type.code })
       this.$store.dispatch('data/setBizId', type.code)
-      const url = window.location.href
-      const urlArr = url.split('?')
-      const k = urlArr[0]
-      const appU = k.split('/')
-      const name = appU[appU.length - 1]
-      name === 'projectViewDetails' ? this.$router.push({ name: '项目', query: {}}) : ''
-      name === 'taskViewDetails' ? this.$router.push({ name: '任务', query: {}}) : ''
-      name === 'requirementDetails' ? this.$router.push({ name: '需求', query: {}}) : ''
-      name === 'iterationDetails' ? this.$router.push({ name: '迭代', query: {}}) : ''
-      if (name !== 'projectViewDetails' && name !== 'taskViewDetails' && name !== 'requirementDetails' && name !== 'iterationDetails') {
-        window.location.reload()
+      this.settingUserSetBiz(type.code)
+      const name = this.$route.name
+      const isDetailPage = needIdList.find(item => item === name)
+      if (isDetailPage) {
+        this.$router.push({ name: name.substr(0, 2), query: { bizId: EncryptId(type.code) }})
+      } else {
+        this.$router.push({
+          path: this.$route.path,
+          query: { ...this.$route.query, bizId: EncryptId(type.code) }
+        })// 更新路由连接
+        this.$nextTick(() => { this.$router.go(0) }) // 重载页面
       }
     },
+    async settingUserSetBiz(bizId) { // 设置成员登录业务线
+      await settingUserSetBiz({ bizId: bizId })
+    },
     async getLoginMember() { // 获取登录人员信息
       const res = await memberGetLoginInMemberInfoByLdap()
       this.options = res.data

+ 2 - 1
src/router/needIdList.js

@@ -1,5 +1,6 @@
 export const needIdList = [
   '项目详情',
   '需求详情',
-  '任务详情'
+  '任务详情',
+  '迭代详情'
 ]

+ 4 - 5
src/views/projectManage/projectList/components/modifySchedule.vue

@@ -219,7 +219,7 @@ export default {
       taskScheduleEvent: [], // 排期类型选项
       bizIdList: [], // bizId列表
       form: {
-        bizId: this.bizId,
+        bizId: null,
         bizName: null,
         type: '',
         peopleList: [],
@@ -273,7 +273,6 @@ export default {
     selectTaskList: { // 已选择任务列表
       handler(newV, old) {
         if (newV && newV.length > 0) {
-          // this.tasksOptions = newV
           this.tasksDetailList = [...newV]
           this.form.taskList = newV.map(item => item.id)
         }
@@ -283,12 +282,11 @@ export default {
     title(newV) { // 弹框标题
       this.title = newV
     },
-    isDelete: {
+    isDelete: { // 是否删除状态
       handler(newV, old) {
         this.isDeleteStatus = newV
       },
-      immediate: true,
-      deep: true
+      immediate: true
     },
     selectBy(newV) { // 任务选择类型变化时
       this.nowQuery = ''
@@ -532,6 +530,7 @@ export default {
         this.scheduleDelete()
         return
       }
+      if (this.form.bizId === null) this.form.bizId = this.bizId
       this.$refs['form'].validate((valid) => {
         if (valid) {
           const params = _.cloneDeep(this.form)