wangziqian 4 жил өмнө
parent
commit
646709affb

+ 14 - 8
src/views/projectManage/dialog_vue.vue

@@ -100,6 +100,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 const _ = require('lodash')
 import { taskCreate, memberQueryMemberInfoByIDAPorName, configShowTaskEnum, configShowRequirementVersionEnum, taskGet, taskUpdate, projectListProject } from '@/api/taskIndex' // ajax
 import { projectList, settingGetBizList } from '@/api/projectIndex'
@@ -124,8 +125,8 @@ export default {
       loading: false,
       tit: '', // 跳转
       tit_Name: '', // 新建(编辑)
-      projectId: '', // 项目id
-      requireId: '', // 需求id
+      projectId: -1, // 项目id
+      requireId: -1, // 需求id
       options: [], // 员工信息
       options1: [],
       noTest: [], // 是否免测
@@ -156,11 +157,20 @@ export default {
   computed: {
     ...mapGetters(['bizId'])
   },
+  created() {
+    this.analysisBizId_id()
+  },
   mounted() {
     this.get_taskSelect()
     this.bugDataGet()
   },
   methods: {
+    analysisBizId_id() { // 解析路由中的bizId_id
+      if (!this.$route.query.bizId_id) return
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.projectId = bizId_id[1]
+      this.requireId = bizId_id[1]
+    },
     init(e, id, data = null) {
       this.tit_Name = '新建任务'
       switch (e) {
@@ -182,9 +192,7 @@ export default {
           break
         case 2: // 新建任务(项目详情)
           this.tit = '新建任务'
-          var url = window.location.href // 获取url中"?"符后的字串
-          this.projectId = url.split('?id=')
-          projectList({ id: Number(this.projectId[1]), curIndex: 1, pageSize: 15 }).then(res => {
+          projectList({ id: this.projectId, curIndex: 1, pageSize: 15 }).then(res => {
             this.dialogFormVisible = true
             var that = this
             setTimeout(function() {
@@ -234,12 +242,10 @@ export default {
           break
         case 4: // 新建任务(项目详情)
           this.tit = '新建任务'
-          var url1 = window.location.href // 获取url中"?"符后的字串
-          this.requireId = url1.split('/')
           var ss = {}
           configShowRequirementVersionEnum({ bizId: this.bizId }).then(res => {
             res.data.map(item => {
-              item.id === Number(this.requireId[7]) ? ss = item : ''
+              item.id === this.requireId ? ss = item : ''
             })
             this.dialogFormVisible = true
             const that = this

+ 1 - 1
src/views/projectManage/iteration/components/requiredTable.vue

@@ -232,6 +232,7 @@ export default {
     bizId: {
       handler(newV) {
         if (newV === -1) return
+        this.analysisBizId_id()
         this.iteratioFilter()
         this.SearchIteration()
       },
@@ -239,7 +240,6 @@ export default {
     }
   },
   created() {
-    this.analysisBizId_id()
     this.getTaskStatus()
   },
   mounted() {

+ 2 - 1
src/views/projectManage/iteration/details/iterationDetails.vue

@@ -96,7 +96,8 @@ export default {
       immediate: true
     }
   },
-  mounted() {
+  created() {
+    this.analysisBizId_id()
     this.$store.state.data.status = true
   },
   destroyed() {