qinzhipeng_v 5 жил өмнө
parent
commit
ac342c2305

+ 25 - 0
src/api/taskIndex.js

@@ -192,3 +192,28 @@ export function getTaskSumData(id) {
     method: 'get'
   })
 }
+
+// 获取任务排期历史记录
+export function scheduleGetTaskScheduleHistory(id) {
+  return request({
+    url: TeamManagement + `/schedule/getTaskScheduleHistory?id=` + id,
+    method: 'get'
+  })
+}
+
+// 锁定任务排期
+export function scheduleLockTaskSchedule(id) {
+  return request({
+    url: TeamManagement + `/schedule/lockTaskSchedule?id=` + id,
+    method: 'post'
+  })
+}
+
+// 解锁任务排期
+export function scheduleUnlockTaskSchedule(data, id) {
+  return request({
+    url: TeamManagement + `/schedule/unlockTaskSchedule?id=` + id,
+    method: 'post',
+    data
+  })
+}

+ 1 - 1
src/views/projectManage/requirement/requirementDetail.vue

@@ -116,7 +116,7 @@
             <div class="title-left-name">
               <div>需求计划
                 <el-tooltip class="item" effect="dark" :content="isScheduleLocked === 1? '点击解锁排期' : '点击锁定排期'" placement="top">
-                  <span class="titleStatus" @click="changeSchedule"><img :src="lock" style="width: 12.31px;display: inline-block; vertical-align: text-top;"> {{ isScheduleLocked === 1 ? '已锁定' : '未锁定' }}</span>
+                  <span class="titleStatus" @click="changeSchedule"><img :src="isScheduleLocked === 1 ? lock : Unlock" style="width: 12.31px;display: inline-block; vertical-align: text-top;"> {{ isScheduleLocked === 1 ? '已锁定' : '未锁定' }}</span>
                 </el-tooltip>
               </div>
             </div><br>

+ 41 - 20
src/views/projectManage/schedule.vue

@@ -1,8 +1,8 @@
 <template>
-  <el-dialog :title="isSchedule===1?'排期锁定': '排期解锁'" class="task" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
+  <el-dialog :title="isSchedule===0?'排期锁定': '排期解锁'" class="task" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
     <div class="blueStripe" />
-    <!-- <div v-if="isSchedule === 1" align="center">是否需要锁定当前需求的排期?</div> -->
-    <div v-if="isSchedule === 0" align="center">
+    <div v-if="isSchedule === 0" align="center">是否需要锁定当前{{ name === '需求'? '需求': "任务" }}的排期?</div>
+    <div v-if="isSchedule === 1" align="center">
       <el-form ref="numberValidateForm" :model="numberValidateForm" label-width="100px" class="demo-ruleForm">
         <el-form-item label="解锁原因" prop="age" :rules="[{ required: true, message: '解锁原因不能为空'}]">
           <el-select v-model="numberValidateForm.remarkType" style="width:100%;" placeholder="请选择" @change="changeArea">
@@ -16,14 +16,14 @@
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button size="min" @click="handleClose">取 消</el-button>
-      <el-button size="min" type="primary" @click="isSchedule === 1 ? determine : Unlock(numberValidateForm)">确 定</el-button>
+      <el-button size="min" type="primary" @click="isSchedule === 0 ? determine() : Unlock(numberValidateForm)">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
 import { scheduleLockRequireSchedule, scheduleUnlockRequireSchedule } from '@/api/requirement.js'
-import { configShowTaskEnum } from '@/api/taskIndex.js'
+import { configShowTaskEnum, scheduleLockTaskSchedule, scheduleUnlockTaskSchedule } from '@/api/taskIndex.js'
 export default {
   props: {
     visible: { type: Boolean, default: false },
@@ -45,6 +45,12 @@ export default {
   watch: {
     visible(val) {
       this.dialogVisible = val
+    },
+    isScheduleLocked(val) {
+      this.isSchedule = val
+    },
+    name(val) {
+      this.codeName = val
     }
   },
   created() {
@@ -56,6 +62,7 @@ export default {
       this.scheduleOperateReason = res.data.scheduleOperateReason
     },
     async determine() {
+      alert('1')
       if (this.name === '需求') {
         const res = await scheduleLockRequireSchedule(this.requireId)
         if (res.code === 200) {
@@ -65,24 +72,38 @@ export default {
         }
       }
       if (this.name === '任务') {
-        this.$refs.numberValidateForm.validate((valid) => {
-          if (valid) {
-            alert('submit!')
-          } else {
-            console.log('error submit!!')
-            return false
-          }
-        })
+        const res = await scheduleLockTaskSchedule(this.requireId)
+        if (res.code === 200) {
+          this.dialogVisible = false
+          this.$emit('updataData')
+          this.$message({ message: '已锁定当前任务排期', type: 'success', duration: 1000, offset: 150 })
+        }
       }
     },
     Unlock(ele) {
-      alert()
-      const res = scheduleUnlockRequireSchedule(ele, this.requireId)
-      if (res.code === 200) { alert() }
-      this.$message({ message: '已解锁当前需求排期', type: 'success', duration: 1000, offset: 150 })
-      this.dialogVisible = false
-      this.$emit('updataData')
-      // }
+      alert('0')
+      this.$refs.numberValidateForm.validate((valid) => {
+        if (valid) {
+          if (this.name === '需求') {
+            scheduleUnlockRequireSchedule(ele, this.requireId).then(res => {
+              if (res.code === 200) {
+                this.$message({ message: '已解锁当前需求排期', type: 'success', duration: 1000, offset: 150 })
+                this.dialogVisible = false
+                this.$emit('updataData')
+              }
+            })
+          }
+          if (this.name === '任务') {
+            scheduleUnlockTaskSchedule(ele, this.requireId).then(res => {
+              if (res.code === 200) {
+                this.$message({ message: '已解锁当任务求排期', type: 'success', duration: 1000, offset: 150 })
+                this.dialogVisible = false
+                this.$emit('updataData')
+              }
+            })
+          }
+        }
+      })
     },
     handleClose() {
       this.dialogVisible = false

+ 9 - 3
src/views/projectManage/taskList/components/scheduleList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="schedule-list" :class="className">
-    <el-col align="right" class="add-schedule"><span @click="addSchedule()"><i class="el-icon-circle-plus-outline" />添加排期</span></el-col>
+    <!-- <el-col align="right" class="add-schedule"><span @click="addSchedule()"><i class="el-icon-circle-plus-outline" />添加排期</span></el-col> -->
     <el-table
       :id="'schedule-'+id"
       :data="scheduleList"
@@ -30,6 +30,7 @@
       >
         <template slot-scope="scope">
           {{ getType(scope.row.type) }}
+          <img class="public_image" :src="scope.row.isScheduleLocked === 0 ? Unlock : lock">
         </template>
       </el-table-column>
       <el-table-column
@@ -65,8 +66,8 @@
         show-overflow-tooltip
       >
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="editSchedule(scope.row)">编辑</el-button>
-          <el-button type="text" size="small" @click="deleteSchedule(scope.row)">删除</el-button>
+          <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="editSchedule(scope.row)">编辑</el-button>
+          <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="deleteSchedule(scope.row)">删除</el-button>
         </template>
       </el-table-column>
 
@@ -98,6 +99,8 @@ import 'moment/locale/zh-cn'
 import { listByTask, sortForTask } from '@/api/projectViewDetails'
 import modifySchedule from './modifySchedule'
 import move from '@/assets/麻将@2x.png'
+import lock from '@/assets/lock.png' // 排期锁定图标
+import Unlock from '@/assets/Unlock.png' // 排期锁定图标
 export default {
   components: {
     modifySchedule
@@ -126,6 +129,8 @@ export default {
   },
   data() {
     return {
+      Unlock: Unlock, // 解锁排期
+      lock: lock, // 锁定排期
       move: move,
       scheduleList: [],
       scheduleDetail: {},
@@ -145,6 +150,7 @@ export default {
     },
     typeList: {
       handler(newV, oldV) {
+        this.scheduleList = newV
         this.taskScheduleEvent = newV
       },
       immediate: true

+ 84 - 13
src/views/projectManage/taskList/taskViewDetail.vue

@@ -114,19 +114,47 @@
           <div class="el-main-title">
             <div class="title-left-icon" />
             <div class="title-left-name">
-              <div class="require-plan">
-                任务计划
-                <span><i class="el-icon-warning-outline" />每个任务仅支持一次提测和一次准出,请合理拆解后任务再排期</span>
+              <div>任务计划
+                <el-tooltip class="item" effect="dark" :content="isScheduleLocked === 1? '点击解锁排期' : '点击锁定排期'" placement="top">
+                  <span class="titleStatus" @click="changeSchedule"><img :src="isScheduleLocked === 1 ? lock: Unlock" style="width: 12.31px;display: inline-block; vertical-align: text-top;"> {{ isScheduleLocked === 1 ? '已锁定' : '未锁定' }}</span>
+                </el-tooltip>
               </div>
             </div>
           </div>
-          <div>
-            <schedule-list
-              :id="taskId"
-              :type-list="taskScheduleEvent"
-              class-name="white"
-            />
-          </div>
+          <section class="main-section">
+            <div class="allTips">
+              <div class="tips">
+                <i class="el-icon-warning-outline" />每个任务仅支持一次提测和一次准出,请合理拆解后任务再排期<br>
+                每个任务仅支持一次提测和一次准出,请合理拆解后任务再排期
+              </div>
+              <div class="Layout_space_between">
+                <div v-show="BackToTheLatest === false" class="Scheduling" style="margin-right: 160px;"><img :src="scheduling"> 回到最新</div>
+                <div v-show="BackToTheLatest === true" class="Scheduling" style="margin-right: 160px;" @click="clickAddScheduling()"><i class="el-icon-circle-plus-outline" />添加排期</div>
+                <div align="left" class="Scheduling" @click="scheduleHiHide"><img :src="scheduling"> 排期变更记录</div>
+              </div>
+            </div>
+          </section>
+          <el-container>
+            <el-main style="padding: 0;">
+              <schedule-list :id="taskId" ref="taskSchedule" :type-list="taskScheduleEvent" class-name="white" />
+            </el-main>
+            <el-aside v-if="lockHide" class="SchedulingAside">
+              <div v-for="(item, index) in SchedulingContent" :key="index" class="SchedulingDiv" @click="clickScheduling(item)">
+                <div class="SchedulingTow">
+                  <img v-if="item.type === 2" :src="lock" class="image">
+                  <img v-if="item.type === 1" :src="Unlock" class="image">
+                </div>
+                <i v-show="index < SchedulingContent.length - 1" />
+                <div class="timeline">
+                  <div class="modifyTime">{{ item.modifyTime }}</div>
+                  <div>{{ item.operatorObject.name !== null ? item.operatorObject.name : '' }} <span class="btn">{{ item.operation }}</span></div>
+                  <div v-if="item.remarkTypeName"><span class="modifyTime">{{ '解锁原因 : ' }}</span>{{ item.remarkTypeName }}</div>
+                  <div v-if="item.remark"><span class="modifyTime">{{ '具体描述 : ' }}</span>{{ item.remark }}</div>
+                </div>
+              </div>
+              <div v-if="SchedulingContent.length === 0" style="width: 270px; text-align: center;"> 暂无排期变更记录!</div>
+            </el-aside>
+          </el-container>
         </section>
         <section class="main-section">
           <div class="el-main-title">
@@ -204,6 +232,9 @@
       </el-dialog>
       <!-- 删除 -->
       <task-dialog v-if="showTaskDialog" :show.sync="showTaskDialog" :task-id="taskIds.id" :status-name="taskIds.statusString" @getList="taskGet" />
+      <!-- 排期锁定 -->
+      <schedule :visible.sync="scheduleVisble" :name="'任务'" :is-schedule-locked="isScheduleLocked" :require-id="taskId" @updataData="getScheduleGetTaskScheduleHistory" />
+      <!-- 排期锁定 -->
       <drawer
         ref="drawer"
         title="任务成员"
@@ -229,9 +260,11 @@ import {
   taskUpdate,
   commentCreate,
   commentList,
-  configShowRequirementVersionEnum
+  configShowRequirementVersionEnum,
+  scheduleGetTaskScheduleHistory
 } from '@/api/taskIndex'
-import { projectListProject } from '@/api/requirement.js'
+import { listByTask } from '@/api/projectViewDetails'
+import { projectListProject, scheduleGetHistoryScheduleById } from '@/api/requirement.js'
 import searchPeople from '@/components/select/searchPeople'
 import textArea from '@/components/input/textArea'
 import drawer from '@/views/projectManage/Drawer'
@@ -250,6 +283,11 @@ import stage1 from '@/assets/detailPage/正常状态.png'
 import stage2 from '@/assets/detailPage/延期状态.png'
 import taskDialog from '@/views/projectManage/taskList/dialog/taskDialog' // 任务状态修改(已上线/已提测/已准出)
 import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷表格
+import scheduling from '@/assets/scheduling.png'
+import lock from '@/assets/lock.png' // 排期锁定图标
+import Unlock from '@/assets/Unlock.png' // 排期锁定图标
+import '@/styles/PublicStyle/index.scss'
+import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
 export default {
   components: {
     searchPeople,
@@ -265,7 +303,8 @@ export default {
     DailyReport,
     ClientReport,
     taskDialog,
-    bugTableDialog
+    bugTableDialog,
+    schedule
   },
   filters: {
     ellipsis(value, num) {
@@ -278,6 +317,14 @@ export default {
   },
   data() {
     return {
+      LockState: {}, // 锁定状态
+      Unlock: Unlock, // 解锁排期
+      lock: lock, // 锁定排期
+      scheduleVisble: false, // 排期锁定
+      BackToTheLatest: true, // 显示添加排期按钮
+      scheduling: scheduling, // 排期变更记录图标
+      lockHide: false, // 隐藏排期变更记录
+      SchedulingContent: [], // 排期历史变更记录
       stageImg: stage,
       normalImg: stage1,
       warningImg: stage2,
@@ -295,6 +342,7 @@ export default {
       dependList: [{ msg: '否', code: 2 }, { msg: '是', code: 1 }], // 是否跟版
       form_query: {},
       display: false, // 设置成员弹框
+      isScheduleLocked: '', // 锁定状态1锁定0未锁定
       num: 0, // 成员数量
       image_url: image_url, // 成员icon
       updateVisible: false, // 编辑任务弹框
@@ -320,6 +368,7 @@ export default {
     this.getBelongProject()
     this.getRequireList()
     this.getCommentList()
+    this.getScheduleGetTaskScheduleHistory()
     this.$store.state.data.status = true
     this.$store.state.data.bizId = true
   },
@@ -328,6 +377,21 @@ export default {
     this.$store.state.data.bizId = false
   },
   methods: {
+    async getScheduleGetTaskScheduleHistory() {
+      this.scheduleVisble = false
+      const res = await scheduleGetTaskScheduleHistory(this.taskId)
+      this.SchedulingContent = res.data
+      const res1 = await listByTask(this.taskId)
+      this.isScheduleLocked = res1.data.isScheduleLocked
+    },
+    async clickScheduling(ele) {
+      const res = await scheduleGetHistoryScheduleById(ele.id)
+      this.taskScheduleEvent = res.data.schedulDetailResponses
+      this.BackToTheLatest = false
+    },
+    changeSchedule() { // 修改锁定状态
+      this.scheduleVisble = true
+    },
     async changeArea(e) { // area修改
       const taskInfoDO = _.cloneDeep(this.form_query)
       const user = {
@@ -424,6 +488,13 @@ export default {
         }
       }
     },
+    clickAddScheduling() { // 模拟调用自组件方法
+      this.$refs.taskSchedule.addSchedule()
+    },
+    scheduleHiHide() { // 排期变更显示隐藏
+      this.lockHide = !this.lockHide
+      this.BackToTheLatest = true
+    },
     childVal(val) {
       this.num = val
     },