Browse Source

报告页面的业务线逻辑更改

wangziqian 4 năm trước cách đây
mục cha
commit
0d434f5f1d

+ 1 - 1
src/views/ToConfigure/BusinessDirection/BusinessDirection.vue

@@ -82,7 +82,7 @@ export default {
       moduleForm: { bizId: null, rqmtOrntNames: [null], parentId: null, id: null }, // 添加方向form
       moduleTitle: '',
       codeName: '', // 编辑失败还原之前的名字
-      bizIds: localStorage.getItem('bizId')
+      bizIds: this.$store.state.data.bizId
     }
   },
   watch: {// 数据监听统一格式,改变后主动影响其他数据的是用watch

+ 4 - 3
src/views/ToConfigure/components/modifyNotice.vue

@@ -163,6 +163,7 @@
 </template>
 <script>
 const _ = require('lodash')
+import { mapGetters } from 'vuex'
 import {
   showRequireStatusEnum,
   showTaskStatusEnum,
@@ -207,7 +208,6 @@ export default {
   },
   data() {
     return {
-      bizId: Number(localStorage.getItem('bizId')),
       title: '',
       requireProps: {
         value: 'id',
@@ -225,7 +225,7 @@ export default {
       modulesList: [], // 任务模块列表
       formData: {
         type: this.type === 'require' ? 0 : 1,
-        bizId: Number(localStorage.getItem('bizId')),
+        bizId: this.bizId,
         requireOrientIdList: [], // 需求方向
         techModuleIdList: [], // 技术模块
         clientId: null, // 客户端
@@ -275,7 +275,8 @@ export default {
           return []
         }
       }
-    }
+    },
+    ...mapGetters(['bizId'])
   },
   watch: {
     data: {

+ 0 - 1
src/views/ToConfigure/components/noticeConfig.vue

@@ -174,7 +174,6 @@ export default {
     },
     bizId: {
       handler(newV) {
-        localStorage.setItem('bizId', newV)
         this.getBizNoticeSettingList()
       },
       immediate: true

+ 4 - 1
src/views/ToConfigure/configure.vue

@@ -247,6 +247,7 @@
 </template>
 <script>
 
+import { mapGetters } from 'vuex'
 import { teamCreateTeam, memberQueryMemberInfoByIDAPorName, teamQueryTeamInfoList, configShowTeamAndMemberEnum, teamIsTeamNameRepetition, teamQueryTeamInfo, teamModifyTeam, getBizList, verifyIsAdmin, addBiz, updateBiz, deleteBiz, queryBizModuleList, addModule, updateBizModule, deleteBizModule } from '@/api/configure'
 import normalDialog from '@/components/dialog/normalDialog'
 import Business from '@/views/ToConfigure/BusinessDirection/BusinessDirection.vue'
@@ -262,7 +263,6 @@ export default {
   data() {
     return {
       userInformation: localStorage.getItem('username'),
-      bizJson: localStorage.getItem('bizId'),
       dialogFormVisible: false,
       dialogFormVisibleQuery: false,
       activeName: 'second',
@@ -322,6 +322,9 @@ export default {
       teamType: 0 // 0 我的 1 团队
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   created() {
     this.get_isAdmin()
     this.get_select()

+ 1 - 1
src/views/home/index.vue

@@ -297,7 +297,7 @@ export default {
           this.$router.push({ name: 'jar包管理' })
           break
         case '4' :
-          this.$router.push({ name: '项目' })
+          this.$router.push({ name: '业务线选择' })
           break
         case '6':
           this.$router.push({ name: '单车' })

+ 6 - 2
src/views/reportManagement/ReleaseReport/newReleaeTemplate.vue

@@ -105,6 +105,7 @@
 
 <script>
 const _ = require('lodash')
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss' // 公共css
 import searchPeople from '@/components/select/searchPeople' // 人员select
 import normalArea from '@/components/input/normalArea' // 富文本
@@ -141,6 +142,9 @@ export default {
       loading: false // loading状态
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   watch: {
     taskIds: {
       handler(newV) {
@@ -380,7 +384,7 @@ export default {
             } else {
               return false
             }
-            data.bizId = localStorage.getItem('bizId') // 业务线
+            data.bizId = this.bizId // 业务线
             data.moduleId = this.fromData.id // 模块id
             data.content = this.fromData.content // 富文本
             data.developer = this.from.developer ? this.from.developer.toString() : null // 开发人员
@@ -401,7 +405,7 @@ export default {
       this.$refs.fromCreateData.validate(async(valid) => {
         if (valid) {
           const data = {}
-          data.bizId = localStorage.getItem('bizId')
+          data.bizId = this.bizId
           this.loading = true
           try {
             data.content = await getContainImgHTMLNode(this.fromData.content)

+ 7 - 3
src/views/reportManagement/Testing/newTestingTemplate.vue

@@ -128,6 +128,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss' // 公共css
 import searchPeople from '@/components/select/searchPeople' // 人员select
 import normalArea from '@/components/input/normalArea' // 富文本
@@ -163,6 +164,9 @@ export default {
       loading: false // loading状态
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   watch: {
     taskIds: {
       handler(newV) {
@@ -323,7 +327,7 @@ export default {
             data.reportName = this.from.reportName
             data.content = this.fromCreateData.content
             data.taskIds = this.taskId
-            data.bizId = localStorage.getItem('bizId')
+            data.bizId = this.bizId
             data.moduleId = this.tpltId
             data.delayReason = this.from.delayReason
             data.deliverTestPlanTime = this.from.deliverTestPlanTime // 计划提测时间
@@ -357,7 +361,7 @@ export default {
             data.reportName = this.from.reportName
             data.content = this.fromCreateData.content
             data.taskIds = this.taskId
-            data.bizId = localStorage.getItem('bizId')
+            data.bizId = this.bizId
             data.moduleId = this.tpltId
             data.delayReason = this.from.delayReason
             data.deliverTestPlanTime = this.from.deliverTestPlanTime // 计划提测时间
@@ -397,7 +401,7 @@ export default {
     getCreateData(e) {
       this.$refs.fromCreateData.validate((valid) => {
         if (valid) {
-          this.fromCreateData.bizId = localStorage.getItem('bizId')
+          this.fromCreateData.bizId = this.bizId
           this.fromCreateData.moduleName = this.from.moduleName
           this.fromCreateData.type = 1
           if (e === '新建模版') {

+ 13 - 3
src/views/reportManagement/components/DailyReport.vue

@@ -78,6 +78,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss'
 import { settingQueryReportModuleList, settingDeleteReportModule, dailyReportGetV2 } from '@/api/reportTemplate'
 import dailyTemplate from '@/views/reportManagement/daily/dailyTemplate.vue'
@@ -111,12 +112,21 @@ export default {
       daily_taskIds: [] // 选择的任务ID
     }
   },
-  created() {
-    this.getreportTemplate()
+  computed: {
+    ...mapGetters(['bizId'])
+  },
+  watch: {
+    bizId: {
+      handler(newV) {
+        if (newV === -1) return
+        this.getreportTemplate()
+      },
+      immediate: true
+    }
   },
   methods: {
     async getreportTemplate() { // 获取模版list
-      const res = await settingQueryReportModuleList({ bizId: localStorage.getItem('bizId'), type: 3 }) // 3 日报
+      const res = await settingQueryReportModuleList({ bizId: this.bizId, type: 3 }) // 3 日报
       if (res.code === 200) {
         this.$nextTick(() => {
           const data = res.data

+ 5 - 5
src/views/reportManagement/components/ReleaseReport.vue

@@ -76,6 +76,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss'
 import { settingQueryReportModuleList, settingDeleteReportModule, reportreleaseGetReportById } from '@/api/reportTemplate'
 import newReleaeTemplate from '@/views/reportManagement/ReleaseReport/newReleaeTemplate.vue'
@@ -97,7 +98,6 @@ export default {
       fromData: {
         radio: 0
       },
-      bizJson: localStorage.getItem('bizId'),
       preview: {},
       newDailyTemplate: false, // 新建日报模版
       reportTamplate: false, // new模版
@@ -113,12 +113,12 @@ export default {
       dailys: this.$route.query.id
     }
   },
-  // created() {
-  //   this.getreportTemplate()
-  // },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   methods: {
     async getreportTemplate() { // 获取模版list
-      const res = await settingQueryReportModuleList({ bizId: this.bizJson, type: 4 })
+      const res = await settingQueryReportModuleList({ bizId: this.bizId, type: 4 })
       if (res.code === 200) {
         this.$nextTick(() => {
           const data = res.data

+ 5 - 1
src/views/reportManagement/components/TestingReport.vue

@@ -76,6 +76,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss'
 import { settingQueryReportModuleList, settingDeleteReportModule, reportdelivertestGetReportById } from '@/api/reportTemplate'
 import newTestingTemplate from '@/views/reportManagement/Testing/newTestingTemplate.vue'
@@ -107,9 +108,12 @@ export default {
       daily_taskIds: [] // 选择的任务ID
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   methods: {
     async getreportTemplate() { // 获取模版list
-      const res = await settingQueryReportModuleList({ bizId: localStorage.getItem('bizId'), type: 1 }) // 1 提测
+      const res = await settingQueryReportModuleList({ bizId: this.bizId, type: 1 }) // 1 提测
       if (res.code === 200) {
         this.$nextTick(() => {
           const data = res.data

+ 7 - 3
src/views/reportManagement/daily/dailyTemplate.vue

@@ -35,6 +35,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss'
 import normalArea from '@/components/input/normalArea'
 import { taskList as allTaskList } from '@/api/taskIndex'
@@ -66,6 +67,9 @@ export default {
       loading: false // loading状态
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   watch: {
     modelId: {
       handler(newV) {
@@ -105,7 +109,7 @@ export default {
     },
 
     async remoteMethods(query) { // 远程搜索任务
-      const res = await allTaskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
+      const res = await allTaskList({ bizId: this.bizId, name: query })
       if (res.code === 200) {
         this.tasksOptions = res.data
         this.tasksDetailList.push(res.data[0]) // 展示关联任务
@@ -113,7 +117,7 @@ export default {
     },
 
     async remoteMethod(query) { // 远程搜索任务
-      const res = await allTaskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
+      const res = await allTaskList({ bizId: this.bizId, name: query })
       if (res.code === 200) {
         this.tasksOptions = res.data
       }
@@ -153,7 +157,7 @@ export default {
       }
       this.$refs.fromCreateData.validate(async(valid) => {
         if (valid) {
-          this.fromCreateData.bizId = localStorage.getItem('bizId')
+          this.fromCreateData.bizId = this.bizId
           this.fromCreateData.reportor = localStorage.getItem('usernames')
           this.fromCreateData.taskIds = this.taskid_arr
           this.fromCreateData.moduleId = this.moduleId

+ 12 - 4
src/views/reportManagement/daily/newReportTemplate.vue

@@ -53,6 +53,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss' // 公共css
 import echarts from 'echarts'
 import normalArea from '@/components/input/normalArea' // 富文本
@@ -80,6 +81,9 @@ export default {
       loading: false // loading状态
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
   watch: {
     templateId: {
       handler(newV) {
@@ -87,11 +91,15 @@ export default {
         this.tpltId ? this.settingGetReportModuleById(newV) : ''
       },
       immediate: true
+    },
+    bizId: {
+      handler(newV) {
+        if (newV === -1) return
+        this.getRouterData()
+      },
+      immediate: true
     }
   },
-  created() {
-    this.getRouterData()
-  },
   methods: {
     async settingGetReportModuleById(val) {
       const res = await settingGetReportModuleById(val)
@@ -129,7 +137,7 @@ export default {
     getCreateData(e) {
       this.$refs['fromCreateData'].validate(async(valid) => {
         if (valid) {
-          this.fromCreateData.bizId = localStorage.getItem('bizId')
+          this.fromCreateData.bizId = this.bizId
           this.fromCreateData.type = e
           this.loading = true
           try {

+ 18 - 7
src/views/reportManagement/testPresentation.vue

@@ -151,6 +151,7 @@
 
 <script>
 const _ = require('lodash')
+import { mapGetters } from 'vuex'
 import '@/styles/PublicStyle/index.scss'
 import { dailyReportDelete } from '@/api/testPresentetion' // 日报
 import { projectTestReportList } from '@/api/ResultPage' // 准出
@@ -181,7 +182,6 @@ export default {
       history: true, // 新老数据
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
-      bizJson: localStorage.getItem('bizId'),
       message: {}, // 老日报数据
       reportDaily: false,
       testPresenyL: false, // 老日报数据
@@ -214,11 +214,22 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
+  watch: {
+    bizId: {
+      handler(newV) {
+        if (newV === -1) return
+        this.getList()
+      },
+      immediate: true
+    }
+  },
   destroyed() {
     this.$store.state.data.status = false
   },
   created() {
-    this.getList()
     this.$store.state.data.status = true
   },
   methods: {
@@ -244,7 +255,7 @@ export default {
     async getList(e) { // 报告list
       this.loading = true
       this.history = true
-      const indexPage = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
+      const indexPage = { bizId: this.bizId, pageSize: this.pageSize, curIndex: this.curIndex }
       e ? indexPage.reportName = this.state : ''
       if (this.title === '测试日报') {
         const res = await dailyReportListV2(indexPage)
@@ -261,7 +272,7 @@ export default {
         }
       }
       if (this.title === '提测报告') {
-        const data = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
+        const data = { bizId: this.bizId, pageSize: this.pageSize, curIndex: this.curIndex }
         e ? data.reportName = this.state : ''
         const res = await reportdelivertestList(data)
         if (res.code === 200) {
@@ -400,7 +411,7 @@ export default {
     // 远程搜索任务
     async getTaskList(val) {
       const params = {
-        bizId: localStorage.getItem('bizId')
+        bizId: this.bizId
       }
       if (val) { params.name = val }
       const res = await taskListCreate(params)
@@ -477,7 +488,7 @@ export default {
     async gethistoryData(e) { // 查看所有老日报列表
       this.loading = true
       this.history = false
-      const indexPage = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
+      const indexPage = { bizId: this.bizId, pageSize: this.pageSize, curIndex: this.curIndex }
       e ? indexPage.reportName = this.state : ''
       if (this.title === '测试日报') {
         const res = await dailyReportList(indexPage)
@@ -494,7 +505,7 @@ export default {
         }
       }
       if (this.title === '提测报告') {
-        const data = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
+        const data = { bizId: this.bizId, pageSize: this.pageSize, curIndex: this.curIndex }
         e ? data.name = this.state : ''
         const res = await launchTestList(data)
         if (res.code === 200) {