Browse Source

任务新建优化

qinzhipeng_v 5 years ago
parent
commit
ba3b8e1a2c

+ 9 - 4
src/views/projectManage/dialog_vue.vue

@@ -151,12 +151,12 @@ export default {
             var that = this
             setTimeout(function() {
               that.task_form = {}
+              that.ascription_project = true
               that.$set(that.task_form, 'source', 3)
               that.$set(that.task_form, 'notest', 0)
               that.$set(that.task_form, 'followVersion', '')
-              that.ascription_project = true
-              that.$set(that.task_form, 'requireId', res.data[0].name)
-              that.$set(that.task_form, 'projectId', res.data[0].name)
+              that.$set(that.task_form, 'requireId', res.data[0].id)
+              that.$set(that.task_form, 'projectId', res.data[0].id)
               that.task_form.followVersion === '' ? that.show_Client = false : ''
             }, 300)
           })
@@ -207,6 +207,7 @@ export default {
     create_task(e) { // 创建任务(保存)
       this.$refs['task_form'].validate((valid) => {
         if (valid) {
+          console.log(e, 'created')
           var taskInfoDO = e
           taskInfoDO.followVersion = e.followVersion
           taskInfoDO.source = e.source
@@ -252,7 +253,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 {

+ 14 - 21
src/views/projectManage/projectList/projectViewDetails.vue

@@ -732,6 +732,7 @@ export default {
         pageSize: 15,
         curIndex: 1
       },
+      user: {},
       projectOb: {},
       bizTypeOb: {},
       sourceTypeOb: {},
@@ -766,6 +767,7 @@ export default {
     },
     get_list() {
       // 获取项目ID(查询)
+      this.user = { name: this.userNames, ename: this.userInformation, id: '' }
       this.textarea === '' ? (this.Addition = true) : (this.Addition2 = true)
       var url = window.location.href // 获取url中"?"符后的字串
       this.projectId = url.split('?id=')
@@ -884,7 +886,6 @@ export default {
       })
     },
     Milepost_Submission(e) {
-      console.log(e)
       // 里程碑(提交)
       this.$refs['form'].validate(valid => {
         if (valid) {
@@ -894,11 +895,7 @@ export default {
           milestone.title = e.title
           milestone.mtime = e.mtime
           milestone.description = e.description
-          var user = {
-            name: this.userNames,
-            ename: this.userInformation,
-            id: ''
-          }
+          var user = this.user
           if (this.title_name === '创建里程碑') {
             mileStoneCreate({ milestone, user }).then(res => {
               this.$message({
@@ -953,14 +950,11 @@ export default {
       this.$refs['project_from'].validate(valid => {
         if (valid) {
           var projectInfo = e
-          var user = {
-            name: this.userNames,
-            ename: this.userInformation,
-            id: ''
-          }
+          var user = this.user
           projectUpdate({ projectInfo, user }).then(res => {
             if (res.code === 200) {
               this.modify_project = false
+              this.get_list()
               this.$message({
                 message: res.msg,
                 type: 'success',
@@ -979,7 +973,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 {
@@ -988,13 +986,10 @@ export default {
     },
     handleCommand(command) {
       // 修改状态
-      // if(this.form_query.statusString === command.label) {
-      //    this.$message({ message: '', type: 'error', duration: 1000, offset: 150 })
-      // }
       this.$set(this.form_query, 'statusString', command.label)
       this.project_from.status = command.value
       var projectInfo = this.project_from
-      var user = { name: this.userNames, ename: this.userInformation, id: '' }
+      var user = this.user
       projectUpdate({ projectInfo, user }).then(res => {
         if (res.code === 200) {
           this.$message({
@@ -1029,7 +1024,7 @@ export default {
         this.Addition = true
       }
       var projectInfo = this.form_query
-      var user = { name: this.userNames, ename: this.userInformation, id: '' }
+      var user = this.user
       projectUpdate({ projectInfo, user }).then(res => {
         if (res.code === 200) {
           this.$message({
@@ -1088,12 +1083,10 @@ export default {
         this.$refs.task_createdUpdata.init(2)
       })
     },
-    handleSizeChange(size) {
-      //  分页
+    handleSizeChange(size) { //  分页
       this.pageSize = size
     },
-    handleCurrentChange(curIndex) {
-      //  分页
+    handleCurrentChange(curIndex) { //  分页
       this.curIndex = curIndex
     }
   }

+ 5 - 1
src/views/projectManage/taskList/taskIndex.vue

@@ -360,7 +360,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 {