瀏覽代碼

任务详情状态改造

qinzhipeng_v 5 年之前
父節點
當前提交
c3803f6c89

+ 2 - 1
src/views/projectManage/bugList/details/index.vue

@@ -1653,13 +1653,14 @@ border-color: #DCDFE6;
 
 <style scoped lang="scss">
 .operatorName {
-  min-width: 100px;
+  min-width: 50px;
   font-size:14px;
   font-family:PingFang SC;
   font-weight:500;
   line-height:20px;
   color:rgba(51,59,74,1);
   opacity:1;
+  margin-right: 10px;
 }
 
 .createTime {

+ 48 - 7
src/views/projectManage/taskList/dialog/taskDialog.vue

@@ -5,36 +5,47 @@
       <div style=" margin-bottom: 5%; white-space:nowrap;">{{ name }}</div>
       <div style=" margin: 2% 3%; display: flex; justify-content: space-between; align-items: center; white-space:nowrap;">
         <span>{{ codeName }}:</span>
-        <el-date-picker v-model="date.name" type="date" style="width:100%;" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" />
+        <el-date-picker
+          v-model="date"
+          type="date"
+          placeholder="选择日期时间"
+          format="yyyy.MM.dd"
+          value-format="yyyy.MM.dd"
+          style="width: 100%;"
+        />
       </div>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="OnClose">取 消</el-button>
-      <el-button size="small" type="primary">确 定</el-button>
+      <el-button size="small" type="primary" @click="task_status_uptate(date)">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
 import '@/styles/PublicStyle/index.scss'
+import { taskUpdate } from '@/api/taskIndex' // 更新状态接口
 export default {
   name: 'TemplateDialog',
   props: {
-    show: { type: Boolean, default: false },
-    statusName: { type: String, default: null }
+    show: { type: Boolean, default: false }, // 弹窗展示
+    statusName: { type: String, default: null }, // 状态name
+    taskId: { type: String, default: null } // 任务ID
   },
   data() {
     return {
       visible: this.show,
-      date: {},
+      date: new Date(),
       name: '',
+      task_Id: this.taskId,
       codeName: '',
       measurementTimeName: '实际提测时间',
       exitTimeName: '实际准出时间',
       onlineTimeName: '实际上线完成时间',
       measurementTime: '请确认提测报告发出后再切换任务状态为已提测!',
       exitTime: '请确认准出报告发出后再切换任务状态为已准出!',
-      onlineTime: '请确认所有端或服务均已上线后再切换任务状态为已上线'
+      onlineTime: '请确认所有端或服务均已上线后再切换任务状态为已上线',
+      userData: { id: '', ename: localStorage.getItem('username'), name: localStorage.getItem('realname') }
     }
   },
   watch: {
@@ -42,6 +53,11 @@ export default {
       immediate: true,
       handler(show) {
         this.visible = this.show
+        const date = new Date()
+        const year = date.getFullYear()
+        const month = date.getMonth() + 1
+        const strDate = date.getDate()
+        this.date = year + '.' + month + '.' + strDate
       }
     },
     statusName: {
@@ -65,8 +81,33 @@ export default {
   methods: {
     OnClose() {
       this.$emit('update:show', false)
+    },
+    task_status_uptate(e) {
+      const taskInfoDO = {}
+      if (this.statusName === '已提测') {
+        taskInfoDO.status = 2
+        taskInfoDO.launchTestRealTime = e
+      }
+      if (this.statusName === '已准出') {
+        taskInfoDO.status = 4
+        taskInfoDO.testFinishRealTime = e
+      }
+      if (this.statusName === '已上线') {
+        taskInfoDO.status = 5
+        taskInfoDO.onlineRealTime = e
+      }
+      taskInfoDO.id = this.task_Id
+      taskInfoDO.bizId = localStorage.getItem('bizId')
+      const user = this.userData
+      taskUpdate({ taskInfoDO, user }).then(res => {
+        if (res.code === 200) {
+          this.$emit('update:show', false)
+          this.$emit('getList')
+          this.$message({ message: res.msg, type: 'success' })
+        }
+      })
     }
+
   }
 }
 </script>
-

+ 11 - 44
src/views/projectManage/taskList/taskViewDetails.vue

@@ -138,12 +138,12 @@
               </el-table-column>
             </el-table>
             <div class="dateSet">排期汇总:{{ tiem_date.startTime | naspOut }} ~ {{ tiem_date.endTime | naspOut }}</div>
+            <div class="dateSet" style="border-bottom:1px solid #E9E9E9;">预计上线版本:{{ task_form.preOnlineVersion }}</div>
             <div class="dateSet" style=" display: flex; justify-content: start; align-items: center;">
               <div style="flex:1">实际提测时间:{{ task_form.launchTestRealTime | naspOut }}</div>
               <div style="flex:1">实际准出时间:{{ task_form.testFinishRealTime | naspOut }}</div>
               <div style="flex:1">实际上线完成时间:{{ task_form.onlineRealTime | naspOut }}</div>
             </div>
-            <div class="dateSet">预计上线版本:{{ task_form.preOnlineVersion }}</div>
           </div>
         </el-header>
         <el-footer class="footer" style=" height: auto;">
@@ -365,7 +365,7 @@
           <el-button type="primary" @click="even === '新建事件'? event_created(form):event_update(form)">确 定</el-button>
         </div>
       </el-dialog>
-      <el-dialog :visible.sync="centerDialogVisible_status" width="30%" center :close-on-click-modal="false">
+      <!-- <el-dialog :visible.sync="centerDialogVisible_status" width="30%" center :close-on-click-modal="false">
         <div align="center" style="margin-bottom: 8%; font-weight: 600;">状态变更:已上线</div>
         <div style=" margin: 2% 3%; display: flex; justify-content: space-between; align-items: center; white-space:nowrap;">
           <span>实际上线时间:</span>
@@ -375,7 +375,7 @@
           <el-button size="mini" @click="centerDialogVisible_status = false">关 闭</el-button>
           <el-button size="mini" type="primary" @click="task_status_uptate(NewDate)">确 定</el-button>
         </span>
-      </el-dialog>
+      </el-dialog> -->
       <!-- 删除 -->
       <el-dialog
         :visible.sync="centerDialogVisible_task"
@@ -456,7 +456,7 @@
       @childValInput="childVal"
       @click.stop
     />
-    <task-dialog :show.sync="showTaskDialog" :status-name="statusName" />
+    <task-dialog :show.sync="showTaskDialog" :task-id="taskId" :status-name="statusName" @getList="get_list" />
   </div>
 </template>
 
@@ -568,7 +568,6 @@ export default {
       commentTxt: [],
       commentShow: true, // 评论为空默认显示
       dialog_launchTestInfoDOS: false, // 打回弹窗
-      centerDialogVisible_status: false, // status
       currentPage: 0,
       tiem_date: { // 排期汇总
         startTime: '',
@@ -952,14 +951,10 @@ export default {
       })
     },
     async handleCommand(command) {
-      if (command.label === '已提测' || command.label === '已准出') {
+      if (command.label === '已提测' || command.label === '已准出' || command.label === '已上线') {
         this.statusName = command.label
         this.showTaskDialog = true
         return
-      }
-      if (command.label === '已上线') {
-        this.centerDialogVisible_status = true
-        return
       } else {
         this.task_form.statusString = command.label
         const taskInfoDO = this.task_form
@@ -971,21 +966,6 @@ export default {
         }
       }
     },
-    task_status_uptate(e) {
-      this.task_form.statusString = '已上线'
-      const resDate = e.getFullYear() + '-' + (e.getMonth() + 1) + '-' + e.getDate() + ' ' + e.getHours() + ':' + e.getMinutes() + ':' + e.getSeconds()
-      const taskInfoDO = this.task_form
-      taskInfoDO.status = 5
-      taskInfoDO.onlineRealTime = resDate
-      const user = { name: this.userNames, ename: this.userInformation, id: '' }
-      taskUpdate({ taskInfoDO, user }).then(res => {
-        this.centerDialogVisible_status = false
-        if (res.code === 200) {
-          this.centerDialogVisible_status = false
-        }
-        this.$message({ message: res.msg, type: 'success', offset: 150 })
-      })
-    },
     // 事件删除
     event_delete(id) {
       const user = { name: this.userNames, ename: this.userInformation, id: '' }
@@ -1288,28 +1268,16 @@ export default {
     createReport(e, ele) {
       switch (e) {
         case 1: // 提测
-          if (this.task_form.statusString !== '开发中') {
-            this.$message({ message: '存在状态不是【开发中】的任务,请将任务状态为【开发中】才可提测,请检查!', type: 'warning' })
-          } else {
-            this.dialogVisible1 = true
-            this.$nextTick(() => { this.$refs.TestReport.init(1, ele) })
-          }
+          this.dialogVisible1 = true
+          this.$nextTick(() => { this.$refs.TestReport.init(1, ele) })
           break
         case 2: // 日报
-          if (this.task_form.statusString !== '测试中') {
-            this.$message({ message: '存在状态不是【测试中】的任务,请将任务状态为【测试中】才可测试,请检查!', type: 'warning' })
-          } else {
-            this.dialogDaily = true
-            this.$nextTick(() => { this.$refs.DailyReport.init(1) })
-          }
+          this.dialogDaily = true
+          this.$nextTick(() => { this.$refs.DailyReport.init(1) })
           break
         case 3:
-          if (this.task_form.statusString !== '测试中') {
-            this.$message({ message: '存在状态不是【测试中】的任务,请将任务状态为【测试中】才可准出,请检查!', type: 'warning' })
-          } else {
-            this.dialogClient = true
-            this.$nextTick(() => { this.$refs.ClientReport.init(1, ele) })
-          }
+          this.dialogClient = true
+          this.$nextTick(() => { this.$refs.ClientReport.init(1, ele) })
           break
         case 4:
           this.modalShow = true
@@ -1445,7 +1413,6 @@ export default {
   color: #333B4A;
   margin: 1.5% 0;
   padding-bottom:1.5%;
-  border-bottom:1px solid #E9E9E9;
 }
 .div_priority {
   color: #ffffff;