PrinceLee 5 жил өмнө
parent
commit
bfc8beac92

+ 8 - 0
src/api/projectViewDetails.js

@@ -55,3 +55,11 @@ export function scheduleGet(id) {
     method: 'get'
   })
 }
+// 任务状态更新
+export function taskUpdate(data) {
+  return request({
+    url: TeamManagement + `/task/update`,
+    method: 'post',
+    data
+  })
+}

+ 2 - 2
src/components/dialog/normalDialog.vue

@@ -3,7 +3,7 @@
     <el-dialog
       :title="title"
       :visible.sync="visible"
-      :width="'70%'"
+      :width="width"
       :modal-append-to-body="false"
       :close-on-click-modal="false"
       :top="top"
@@ -32,7 +32,7 @@ export default {
     },
     width: {
       type: String,
-      default: '',
+      default: '70%',
       required: false
     },
     showDialog: {

+ 13 - 6
src/views/projectManage/projectList/component/modifySchedule.vue

@@ -201,7 +201,7 @@ export default {
       this.tasksDetailList.push(res)
       this.form.taskList.push(res.id)
     },
-    cancelTask(id) {
+    cancelTask(id) { // 删除单个关联任务
       if (this.disabled) {
         return false
       }
@@ -218,29 +218,36 @@ export default {
         this.schedule = res.data.seperateDaysNoHoliday
       }
     },
-    async scheduleCreate(params) {
+    async scheduleCreate(params) { // 创建排期
       const res = await scheduleCreate(params)
       if (res.code === 200) {
         console.log(res.data)
         this.$message({ message: '添加成功', type: 'success', duration: 1000, offset: 150 })
       }
     },
-    confirmForm() {
+    async scheduleUpdate(params) { // 更新排期
+      const res = await scheduleUpdate(params)
+      if (res.code === 200) {
+        console.log(res.data)
+        this.$message({ message: '更新成功', type: 'success', duration: 1000, offset: 150 })
+      }
+    },
+    confirmForm() { // 确认提交表单
       this.$refs['form'].validate((valid) => {
         if (valid) {
           const params = _.cloneDeep(this.form)
           params.dayList = this.detailDayList
-          this.scheduleCreate(params)
+          params.id ? this.scheduleUpdate(params) : this.scheduleCreate(params)
           this.cancel()
         }
       })
     },
-    cancel() {
+    cancel() { // 关闭弹框
       this.show = false
       this.$emit('update:visible', this.show)
       this.init()
     },
-    init() {
+    init() { // 表单初始化
       this.tasksDetailList = []
       this.form = {
         bizId: localStorage.getItem('bizId'),

+ 56 - 10
src/views/projectManage/projectList/component/taskList.vue

@@ -44,7 +44,7 @@
       <el-table-column label="任务名称" width="200" align="center" show-overflow-tooltip>
         <template slot-scope="scope"><span>{{ scope.row.name }}</span></template>
       </el-table-column>
-      <el-table-column label="所属模块" min-width="120" align="center">
+      <el-table-column label="所属模块" width="150" align="center" show-overflow-tooltip>
         <template slot-scope="scope">{{ scope.row.moduleInfoName }}</template>
       </el-table-column>
       <el-table-column label="状态" width="105" align="center">
@@ -54,7 +54,7 @@
             :class="['status'+scope.row.status]"
             class="btns"
             size="mini"
-            @change="blurEvent(scope.row, scope.row.status)"
+            @change="changeStatus(scope.row)"
           >
             <el-option v-for="item in allStatus" :key="item.code" :label="item.msg" :value="item.code" />
           </el-select>
@@ -67,10 +67,10 @@
         <template slot-scope="scope">{{ scope.row.app }}</template>
       </el-table-column>
       <el-table-column label="开发负责人" width="100" align="center" show-overflow-tooltip>
-        <template slot-scope="scope">{{ scope.row.rdObject === null ? '' : scope.row.rdObject.name }}</template>
+        <template slot-scope="scope">{{ scope.row.rdObject ? scope.row.rdObject.name : '' }}</template>
       </el-table-column>
       <el-table-column label="测试负责人" width="100" align="center" show-overflow-tooltip>
-        <template slot-scope="scope">{{ scope.row.qaObject === null ? '' : scope.row.qaObject.name }}</template>
+        <template slot-scope="scope">{{ scope.row.qaObject ? scope.row.qaObject.name : '' }}</template>
       </el-table-column>
       <el-table-column label="任务进度" min-width="150" align="center">
         <template slot-scope="scope">
@@ -81,6 +81,12 @@
     <TestReport v-if="dialogTestReport" ref="TestReport" />
     <DailyReport v-if="dialogDailyReport" ref="DailyReport" />
     <ClientReport v-if="dialogClientReport" ref="ClientReport" />
+    <normal-dialog :show-dialog.sync="statusDialog" :title="'状态变更:已上线'" :width="'50%'" @confirm="confirmStatus()">
+      <div class="dialog-change-status">
+        <span>实际上线时间:</span>
+        <el-date-picker v-model="changeStatusDate" type="date" style="width:100%;" placeholder="选择日期" format="yyyy-MM-dd HH:mm:ss" />
+      </div>
+    </normal-dialog>
   </div>
 </template>
 <script>
@@ -88,10 +94,13 @@ import TestReport from '@/views/Platform/presentation/Templates/TestReport' // 
 import DailyReport from '@/views/Platform/presentation/Templates/DailyReport' // 日报
 import ClientReport from '@/views/Platform/presentation/Templates/ClientReport' // 准出
 import { taskList } from '@/api/projectIndex'
+import { taskUpdate } from '@/api/projectViewDetails'
 import { configShowTaskEnum } from '@/api/taskIndex'
 import scheduleList from './scheduleList'
+import normalDialog from '@/components/dialog/normalDialog'
 export default {
   components: {
+    normalDialog,
     TestReport,
     DailyReport,
     ClientReport,
@@ -113,7 +122,10 @@ export default {
       planHandleType: '', // 任务列表操作类型
       dialogTestReport: false, // 提测
       dialogDailyReport: false, // 日报
-      dialogClientReport: false// 准出
+      dialogClientReport: false, // 准出
+      statusDialog: false, // 修改状态弹框
+      changeStatusDate: null, // 状态改变时间
+      nowChangeTask: null // 当前正在改变的任务对象
     }
   },
   watch: {
@@ -140,7 +152,7 @@ export default {
         // }
       }
     },
-    async getTaskStatus() {
+    async getTaskStatus() { // 获取任务状态列表
       const res = await configShowTaskEnum()
       if (res.code === 200) {
         this.allStatus = res.data.taskStatus
@@ -160,8 +172,35 @@ export default {
       this.allChange = isEx
       isEx ? this.expandArr = this.all_task.map(item => item.id) : this.expandArr = []
     },
-    blurEvent() { // 状态改变
-
+    async changeStatus(e) { // 状态改变
+      if (e.status === 5) { // 已上线
+        this.statusDialog = true
+        this.nowChangeTask = e
+      } else {
+        const user = {
+          name: localStorage.getItem('username'),
+          ename: localStorage.getItem('realname'),
+          id: ''
+        }
+        const taskInfoDO = e
+        const resTask = await taskUpdate({ taskInfoDO, user })
+        if (resTask.code === 200) {
+          this.$message({ message: resTask.msg, type: 'success', offset: 150 })
+        }
+      }
+    },
+    async confirmStatus() {
+      const user = {
+        name: localStorage.getItem('username'),
+        ename: localStorage.getItem('realname'),
+        id: ''
+      }
+      const taskInfoDO = this.nowChangeTask
+      taskInfoDO.onlineRealTime = this.changeStatusDate
+      const resTask = await taskUpdate({ taskInfoDO, user })
+      if (resTask.code === 200) {
+        this.$message({ message: resTask.msg, type: 'success', offset: 150 })
+      }
     },
     handleSelectionChange(val) { // 任务列表删选操作
       val.length > 0 ? this.showHeader = false : this.showHeader = true
@@ -280,10 +319,10 @@ export default {
 .status1 {
   @include setStatus(#FF8952)
 }
-.status2 {
+.status3 {
   @include setStatus(#13C2C2)
 }
-.status3 {
+.status5 {
   @include setStatus(#7ED321)
 }
 .expand i {
@@ -359,4 +398,11 @@ export default {
   padding-left: 14px;
   padding-right: 14px;
 }
+.dialog-change-status {
+  margin: 2% 3%;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  white-space:nowrap;
+}
 </style>