Browse Source

Merge branch 'http_mock' into http_test

wenbobowen 4 years ago
parent
commit
070997aa0e

+ 19 - 6
src/views/projectManage/requirement/list/index.vue

@@ -231,9 +231,8 @@
               }"
               :size="size"
               placeholder=""
-              @change="(e) => statusChange(e, scope.row.id)"
             >
-              <el-option v-for="o in scope.row.availableStatusList" :key="o.code" :label="o.name" :value="o.code" />
+              <el-option v-for="o in scope.row.availableStatusList" :key="o.code" :label="o.name" :value="o.code" @click.native="statusChange(scope.row, o)" />
             </el-select>
             <span v-else>{{ scope.row.statusName }}</span>
           </template>
@@ -305,6 +304,7 @@
         />
       </div>
     </filterModal>
+    <rqmtStatus v-if="rqmtStatusShow" :status-obj="statusObj" @update="updateStatus" />
   </div>
 </template>
 
@@ -336,6 +336,7 @@ import chartSearchForm from '@/components/searchHeader/searchForm'
 import filterList from '@/views/projectManage/components/filterList'
 import extraUrgent from '@/assets/extraUrgent.png'
 import normalDialog from '@/components/dialog/normalDialog'
+import rqmtStatus from '@/views/projectManage/components/requirementStatus.vue'
 import '@/views/projectManage/publicCss/index.css'
 
 export default {
@@ -346,10 +347,12 @@ export default {
     mainTitle,
     chartView,
     filterModal,
-    chartSearchForm
+    chartSearchForm,
+    rqmtStatus
   },
   data() {
     return {
+      rqmtStatusShow: false,
       size: 'small',
       pickerOptions: {
         shortcuts: [{
@@ -466,12 +469,22 @@ export default {
   },
   methods: {
     // 修改状态
-    async statusChange(e, id) {
-      const res = await updateStatus({ status: e, id })
+    async statusChange(item, value) {
+      this.statusObj = value
+      this.statusObj.id = item.id
+      if (value.name === 'PRD评审通过' || value.name === 'BRD评审通过' || value.name === '技术准入' || value.name === '已上线') {
+        this.rqmtStatusShow = true
+        return
+      }
+      const res = await updateStatus({ status: value.code, id: item.id })
       if (res.code === 200) {
         this.get_charts()
       }
     },
+    updateStatus() {
+      this.rqmtStatusShow = false
+      this.get_charts()
+    },
     filterModalConfirm() {
       this.showChartModal = false
       this.get_charts()
@@ -545,7 +558,7 @@ export default {
       this.loading = true
       const res = await getChartData(this.searchForm)
       this.chartData = res.data
-      this.get_chartListDetial(res.data.data[0].code)
+      this.get_chartListDetial(this.searchForm.code ? this.searchForm.code : res.data.data[0].code)
     },
     async get_chartListDetial(code) {
       this.showChartModal = false

+ 24 - 7
src/views/projectManage/taskList/taskIndex.vue

@@ -365,7 +365,7 @@
               v-model="scope.row.status"
               :size="size"
               placeholder
-              @change="(e) => statusChange(e, scope.row.id)"
+              @change="(e) => statusChange(e, scope.row)"
             >
               <el-option
                 v-for="o in scope.row.availableStatusList"
@@ -475,6 +475,7 @@
         />
       </div>
     </filterModal>
+    <task-dialog v-if="showTaskDialog" :show.sync="showTaskDialog" :task-id="taskId.id" :status-name="taskId.statusString" @getList="getNew" />
   </div>
 </template>
 
@@ -493,9 +494,9 @@ import {
   createFilter,
   filterGetFilter,
   getChartListData,
-  getChartData,
-  updateStatus
+  getChartData
 } from '@/api/taskIndex' // ajax
+import { taskUpdate } from '@/api/projectViewDetails'
 import filterModal from '@/components/filterModal'
 import { settingQueryBizModuleList } from '@/api/defectManage'
 import openDialog from '@/views/projectManage/dialog_vue'
@@ -506,6 +507,7 @@ import mainTitle from '@/components/mainTitle'
 import chartView from '@/components/chartView'
 import chartSearchFormData from './renderData/chartSearchForm'
 import chartSearchForm from '@/components/searchHeader/searchForm'
+import taskDialog from '@/views/projectManage/taskList/dialog/taskDialog' // 任务状态修改(已上线/已提测/已准出)
 import '@/views/projectManage/publicCss/index.css'
 export default {
   components: {
@@ -515,10 +517,12 @@ export default {
     mainTitle,
     chartView,
     filterModal,
-    chartSearchForm
+    chartSearchForm,
+    taskDialog
   },
   data() {
     return {
+      showTaskDialog: false, // 状态弹窗
       size: 'small',
       pickerOptions: {
         shortcuts: [
@@ -684,12 +688,25 @@ export default {
         this.get_taskList()
       }
     },
-    async statusChange(e, id) {
-      const res = await updateStatus({ status: e, id })
+    async statusChange(e, row) {
+      console.log(e, row)
+      if (row.status === 60 || row.status === 70 || row.status === 90 || row.status === 100) {
+        this.taskId = row
+        this.daStatus.map(item => {
+          item.code === row.status ? this.taskId.statusString = item.msg : ''
+        })
+        this.showTaskDialog = true
+        this.nowChangeTask = row
+        return
+      }
+      const res = await taskUpdate({ taskInfoDO: { status: e, id: row.id }})
       if (res.code === 200) {
         this.get_charts()
       }
     },
+    getNew() { // 状态改变成功回调
+      this.get_charts()
+    },
     get_charts() {
       this.logHandle('get_task_charts')
       this.updateChartSearchFormValue()
@@ -700,7 +717,7 @@ export default {
       this.table_loading = true
       const res = await getChartData(this.form_task)
       this.chartData = res.data
-      this.get_chartListDetial(res.data.data[0].code)
+      this.get_chartListDetial((this.form_task && this.form_task.code) ? this.form_task.code : res.data.data[0].code)
     },
     async get_chartListDetial(code) {
       this.showChartModal = false