浏览代码

任务创建

qinzhipeng_v 5 年之前
父节点
当前提交
d1b5a5763b
共有 2 个文件被更改,包括 32 次插入16 次删除
  1. 16 1
      src/views/projectManage/dialog_vue.vue
  2. 16 15
      src/views/projectManage/taskList/taskViewDetails.vue

+ 16 - 1
src/views/projectManage/dialog_vue.vue

@@ -147,6 +147,7 @@ export default {
           var url = window.location.href // 获取url中"?"符后的字串
           this.projectId = url.split('?id=')
           projectList({ id: Number(this.projectId[1]), curIndex: 1, pageSize: 15 }).then(res => {
+            console.log(res, 'dccdcdc')
             this.dialogFormVisible = true
             var that = this
             setTimeout(function() {
@@ -210,8 +211,22 @@ export default {
           console.log(e, 'created')
           var taskInfoDO = e
           taskInfoDO.followVersion = e.followVersion
-          taskInfoDO.source = e.source
           taskInfoDO.notest = e.notest
+          taskInfoDO.source = e.source
+          switch (taskInfoDO.source) {
+            case 1: // 无归属
+              taskInfoDO.requireId = '-1'
+              taskInfoDO.projectId = '-1'
+              break
+            case 2: // 需求
+              taskInfoDO.requireId = e.requireId
+              taskInfoDO.projectId = ''
+              break
+            case 3: // 项目
+              taskInfoDO.requireId = '-1'
+              taskInfoDO.projectId = e.projectId
+              break
+          }
           if (e.cliType) {
             e.cliType !== '' ? taskInfoDO.bizId = e.cliType[0] : taskInfoDO.bizId = null
             e.cliType !== '' ? taskInfoDO.type = e.cliType[1] : taskInfoDO.type = null

+ 16 - 15
src/views/projectManage/taskList/taskViewDetails.vue

@@ -859,18 +859,21 @@ export default {
         item.id === e ? (eventID = item) : ''
       })
       this.dialogFormVisible = true
-      var start1 = eventID.startTime.split(/\s+/)
-      var start2 = eventID.endTime.split(/\s+/)
+      var start1 = eventID.startTime !== null ? eventID.startTime.split(/\s+/) : ''
+      var start2 = eventID.endTime !== null ? eventID.endTime.split(/\s+/) : ''
+
       this.form = eventID
-      this.$set(this.form, 'date_start', [start1[0] + 'T' + start1[1] + '.000Z', start2[0] + 'T' + start2[1] + '.000Z'])
+      if (eventID.startTime !== null) {
+        this.$set(this.form, 'date_start', [start1[0] + 'T' + start1[1] + '.000Z', start2[0] + 'T' + start2[1] + '.000Z'])
+      } else {
+        this.$set(this.form, 'date_start', '')
+      }
       this.options = this.form.peopleObject
       if (this.form.peopleObject !== null && this.form.peopleObject !== '') {
         const peopleArr = this.form.peopleObject.map((eachPeople) => eachPeople.idap)
         this.$set(this.form, 'peoples', peopleArr)
       }
-      this.form.noHoliday === 1
-        ? (this.form.noHoliday = false)
-        : (this.form.noHoliday = true)
+      this.form.noHoliday === 1 ? (this.form.noHoliday = false) : (this.form.noHoliday = true)
     },
     blur_describe(e) {
       this.describe = false
@@ -884,7 +887,11 @@ export default {
         setTimeout(() => {
           this.loading = false
           memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
-            this.options = res.data
+            const obj = {}
+            this.options = res.data.reduce((cur, next) => {
+              obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
+              return cur
+            }, [])
           })
         }, 200)
       } else {
@@ -919,9 +926,7 @@ export default {
       this.$refs['form'].validate(valid => {
         if (valid) {
           var schedule = e
-          e.noHoliday === true
-            ? (schedule.noHoliday = 0)
-            : (schedule.noHoliday = 1)
+          e.noHoliday === true ? (schedule.noHoliday = 0) : (schedule.noHoliday = 1)
           schedule.peopleObject = e.peoples
           schedule.startTime = e.date_start[0]
           schedule.endTime = e.date_start[1]
@@ -929,11 +934,7 @@ export default {
           this.taskScheduleEvent.map(item => {
             item.code === e.type ? (schedule.name = item.msg) : ''
           })
-          var user = {
-            name: this.userNames,
-            ename: this.userInformation,
-            id: ''
-          }
+          var user = { name: this.userNames, ename: this.userInformation, id: '' }
           ScheduleUpdate({ schedule, user }).then(res => {
             if (res.code === 200) {
               this.dialogFormVisible = false