reedliuqing_i 5 years ago
parent
commit
002fd3fcca

+ 3 - 3
src/api/requirement.js

@@ -83,9 +83,9 @@ export function getBugStatusMapInfo(data) {
 
 export function getTaskByRequireId(data) {
   return request({
-    url: requestIp + '/task/list',
-    method: 'post',
-    data
+    url: requestIp + '/task/listByTaskId',
+    method: 'get',
+    params: data
   })
 }
 

+ 64 - 45
src/views/projectManage/requirement/details/index.vue

@@ -78,13 +78,13 @@
           class="div_requirment_info"
         >
           <el-row>
-            <el-col :span="8">归属的项目:</el-col>
-            <el-col :span="16">
+            <el-col :span="6">归属的项目:</el-col>
+            <el-col :span="18">
               <div
                 style="display: inline-block;color: #409EFF"
               >{{ requirement.belongingProjectName }}</div>
               <el-button
-                style="float: right"
+                style="position: absolute;top: 5px;right: 0"
                 type="primary"
                 size="mini"
                 @click="updateDialogVisible = true"
@@ -92,34 +92,34 @@
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">业务线:</el-col>
-            <el-col :span="16">{{ requirement.bizName }}</el-col>
+            <el-col :span="6">业务线:</el-col>
+            <el-col :span="18">{{ requirement.bizName }}</el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">优先级:</el-col>
-            <el-col :span="16">{{ requirement.priorityName }}</el-col>
+            <el-col :span="6">优先级:</el-col>
+            <el-col :span="18">{{ requirement.priorityName }}</el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">需求来源:</el-col>
-            <el-col :span="16">{{ requirement.sourceTypeName }}</el-col>
+            <el-col :span="6">需求来源:</el-col>
+            <el-col :span="18">{{ requirement.sourceTypeName }}</el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">PM:</el-col>
-            <el-col :span="16">{{ getPmName() }}</el-col>
+            <el-col :span="6">PM:</el-col>
+            <el-col :span="18">{{ getPmName() }}</el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">PRD链接:</el-col>
-            <el-col :span="16">
+            <el-col :span="6">PRD链接:</el-col>
+            <el-col :span="18">
               <el-link type="primary" :href="requirement.mrdUrl">{{ requirement.mrdUrl }}</el-link>
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="8">是否跟版:</el-col>
-            <el-col :span="16">{{ requirement.dependOnRelease? '是':'否' }}</el-col>
+            <el-col :span="6">是否跟版:</el-col>
+            <el-col :span="18">{{ requirement.dependOnRelease? '是':'否' }}</el-col>
           </el-row>
           <el-row v-if="requirement.dependOnRelease">
-            <el-col :span="8">涉及的客户端:</el-col>
-            <el-col :span="16">{{ getAppClientName() }}</el-col>
+            <el-col :span="6">涉及的客户端:</el-col>
+            <el-col :span="18">{{ getAppClientName() }}</el-col>
           </el-row>
         </div>
       </el-aside>
@@ -141,13 +141,16 @@
         highlight-current-row
         :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF',textAlign: 'center'}"
         :cell-style="{textAlign: 'center'}"
-        @current-change="handleCurrentRowChange"
       >
-        <el-table-column prop="name" label="任务名" min-width="20%" />
+        <el-table-column prop="name" label="任务名" min-width="20%">
+          <template v-slot="scope">
+            <div style="cursor: pointer;" @click="getToTaskDetails(scope.row.id)">{{ scope.row.name }}</div>
+          </template>
+        </el-table-column>
         <el-table-column prop="beginTime" label="排期" min-width="15%">
           <template
             v-slot="scope"
-          >{{ scope.row.beginTime.substring(2,10).replace(/-/g,'/') + ' ~ ' +scope.row.endTime.substring(2,10).replace(/-/g,'/') }}</template>
+          >{{ getSchedule(scope.row) }}</template>
         </el-table-column>
         <el-table-column prop="statusString" label="状态" min-width="10%">
           <template v-slot="scope">
@@ -159,7 +162,7 @@
         </el-table-column>
         <el-table-column prop="rate" label="任务进展" min-width="15%">
           <template v-slot="scope">
-            <el-progress :percentage="Number(scope.row.rate.replace(/%/g,''))" />
+            <el-progress :percentage="Number(scope.row.rate?scope.row.rate.replace(/%/g,''):0)" />
           </template>
         </el-table-column>
         <el-table-column prop="rdObject" label="开发负责人" min-width="10%">
@@ -174,21 +177,16 @@
         <el-table-column prop="qaList" label="测试" min-width="10%">
           <template v-slot="scope">{{ getQaOrRdNameList(scope.row.qaList) }}</template>
         </el-table-column>
-      </el-table>123
-      <el-container style="margin: 2%;font-size: 14px;color: #333333">
-        <el-aside width="30%">
-          <div>预期上线版本:123</div>
-          <div>
-            <span style="visibility: hidden">预期上线版本:</span>123
-          </div>
-        </el-aside>
-        <el-aside width="70%">
-          <div>实际上线版本:123</div>
-          <div>
-            <span style="visibility: hidden">实际上线版本:</span>123
-          </div>
-        </el-aside>
-      </el-container>
+      </el-table>
+      <div style="margin:0 2%;padding: 2% 0;border-bottom: 1px solid #D8D8D8;font-size: 14px;color: #333333">排期汇总:{{ getScheduleCollect() }}</div>
+      <el-row style="margin: 2%;font-size: 14px;color: #333333">
+        <el-col :span="8">
+          <div v-for="(item,index) in task.preOnlineVersion" :key="index" style="margin-bottom:10px"> <span :style="{visibility: index===0?'visible ':'hidden'}">预期上线版本:</span>{{ item }}</div>
+        </el-col>
+        <el-col :span="16">
+          <div v-for="(item,index) in task.preOnlineVersion" :key="index" style="margin-bottom:10px"> <span :style="{visibility: index===0?'visible ':'hidden'}">实际上线版本:</span>{{ item }}</div>
+        </el-col>
+      </el-row>
     </el-main>
     <el-main style="margin: 2%;" class="layout_main requirement_details_layout_main">
       <div style="font-size: 18px;margin-bottom: 2%">
@@ -420,7 +418,12 @@ export default {
         ]
       },
       comments: [],
-      commentContent: null
+      commentContent: null,
+      task: {
+        reqStartTime: null,
+        reqEndTime: null,
+        preOnlineVersion: []
+      }
     }
   },
   mounted() {
@@ -433,10 +436,22 @@ export default {
     this.getCommentList()
   },
   methods: {
+    getScheduleCollect() {
+      if (this.task.reqStartTime && this.task.reqEndTime) {
+        return this.task.reqStartTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日' + ' ~ ' + this.task.reqEndTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日'
+      }
+      return ''
+    },
+    getSchedule(row) {
+      if (row.beginTime && row.endTime) {
+        return row.beginTime.substring(2, 10).replace(/-/g, '/') + ' ~ ' + row.endTime.substring(2, 10).replace(/-/g, '/')
+      }
+      return '无'
+    },
     getCommentList() {
       getCommentList({ type: 4, joinId: this.id }).then(res => {
         this.comments = res.data
-        console.log(this.comments)
+        this.commentContent = ''
       })
     },
     addComment() {
@@ -504,9 +519,12 @@ export default {
     },
     getTaskByRequireId() {
       getTaskByRequireId({
-        requireId: this.id
+        id: this.id
       }).then(res => {
-        this.tableData = res.data
+        this.task = res.data
+        this.task.preOnlineVersion = ['123', '123', '456']
+        console.log(this.task)
+        this.tableData = res.data.taskDetails
         this.loading.table = false
       })
     },
@@ -572,7 +590,8 @@ export default {
     },
     createTask() {},
     updateRequirementStatus(status) {
-      updateRequirementStatus({ id: this.id, status: status.code }).then(
+      const modifier = localStorage.getItem('username')
+      updateRequirementStatus({ id: this.id, status: status.code, modifier: modifier }).then(
         res => {
           if (res.code === 200) {
             this.getRequirementById()
@@ -589,16 +608,16 @@ export default {
       }
       return arr.join(',')
     },
-    handleCurrentRowChange(val) {
-      this.$router.push({ name: '任务', params: { id: val.id + '' }})
+    getToTaskDetails(id) {
+      // this.$router.push({ name: '任务', params: { id: id + '' }})
     }
   }
 }
 </script>
 
 <style scoped>
-.div_requirment_info .el-row {
-  line-height: 35px;
+.div_requirment_info .el-row .el-col {
+  margin: 10px 0;
 }
 .layout_header,
 .layout_aside,

+ 0 - 1
src/views/projectManage/requirement/list/create.vue

@@ -199,7 +199,6 @@ export default {
     },
     confirm: function() {
       for (const i in this.form) {
-        console.log(i)
         if (!this.form[i]) {
           if (i === 'name') {
             this.$message.warning('需求名称为空,请输入需求名称')

+ 137 - 103
src/views/projectManage/requirement/list/index.vue

@@ -1,97 +1,115 @@
 <template>
   <div class="container">
     <el-header class="requirement-header">
-      <el-input id="basicName1" v-model="searchForm.name" placeholder="需求名称" style="width: 8%;" />
-      <el-dropdown @command="handleCommand">
-        <span class="el-dropdown-link">
-          {{ searchTitle.project }}
-          <i class="el-icon-arrow-down el-icon--right" />
-        </span>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item
-            v-for="(item,index) in searchInfo.belongingProject"
-            :key="index"
-            :command="{value: item,flag: 1}"
-          >{{ item.msg }}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-dropdown @command="handleCommand">
-        <span class="el-dropdown-link">
-          {{ searchTitle.businessline }}
-          <i class="el-icon-arrow-down el-icon--right" />
-        </span>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item
-            v-for="(item,index) in searchInfo.bizType"
-            :key="index"
-            :command="{value: item,flag: 2}"
-          >{{ item.msg }}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-dropdown @command="handleCommand">
-        <span class="el-dropdown-link">
-          {{ searchTitle.source }}
-          <i class="el-icon-arrow-down el-icon--right" />
-        </span>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item
-            v-for="(item,index) in searchInfo.sourceType"
-            :key="index"
-            :command="{value: item,flag: 3}"
-          >{{ item.msg }}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-dropdown @command="handleCommand">
-        <span class="el-dropdown-link">
-          {{ searchTitle.priority }}
-          <i class="el-icon-arrow-down el-icon--right" />
-        </span>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item
-            v-for="(item,index) in searchInfo.priority"
-            :key="index"
-            :command="{value: item,flag: 4}"
-          >{{ item.msg }}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-select
-        id="basicName2"
-        v-model="searchForm.pm"
-        filterable
-        remote
-        placeholder="PM"
-        :remote-method="searchUser"
-        :loading="userLoading"
-      >
-        <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
-          <div style="text-align: center">
-            <span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
-            <span>{{ item.name }}</span>
-            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deptName }}</span>
-          </div>
-        </el-option>
-      </el-select>
-      <el-select
-        id="basicName3"
-        v-model="searchForm.creator"
-        filterable
-        remote
-        placeholder="创建人"
-        :remote-method="searchUser"
-        :loading="userLoading"
-      >
-        <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
-          <div style="text-align: center">
-            <span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
-            <span>{{ item.name }}</span>
-            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deptName }}</span>
+      <el-row>
+        <el-col :span="3">
+          <el-input id="requirement_basicName1" v-model="searchForm.name" placeholder="需求名称" />
+        </el-col>
+        <el-col :span="3">
+          <el-dropdown @command="handleCommand">
+            <span class="el-dropdown-link">
+              {{ getTitle(searchTitle.project) }}
+              <i class="el-icon-arrow-down el-icon--right" />
+            </span>
+            <el-dropdown-menu slot="dropdown" class="requirement_el-dropdown-menu">
+              <el-dropdown-item
+                v-for="(item,index) in searchInfo.belongingProject"
+                :key="index"
+                :command="{value: item,flag: 1}"
+              >{{ item.msg }}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-col>
+        <el-col :span="3">
+          <el-dropdown @command="handleCommand">
+            <span class="el-dropdown-link">
+              {{ getTitle(searchTitle.businessline) }}
+              <i class="el-icon-arrow-down el-icon--right" />
+            </span>
+            <el-dropdown-menu slot="dropdown" class="requirement_el-dropdown-menu">
+              <el-dropdown-item
+                v-for="(item,index) in searchInfo.bizType"
+                :key="index"
+                :command="{value: item,flag: 2}"
+              >{{ item.msg }}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-col>
+        <el-col :span="3">
+          <el-dropdown @command="handleCommand">
+            <span class="el-dropdown-link">
+              {{ getTitle(searchTitle.source) }}
+              <i class="el-icon-arrow-down el-icon--right" />
+            </span>
+            <el-dropdown-menu slot="dropdown" class="requirement_el-dropdown-menu">
+              <el-dropdown-item
+                v-for="(item,index) in searchInfo.sourceType"
+                :key="index"
+                :command="{value: item,flag: 3}"
+              >{{ item.msg }}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-col>
+        <el-col :span="3">
+          <el-dropdown @command="handleCommand">
+            <span class="el-dropdown-link">
+              {{ getTitle(searchTitle.priority) }}
+              <i class="el-icon-arrow-down el-icon--right" />
+            </span>
+            <el-dropdown-menu slot="dropdown" class="requirement_el-dropdown-menu">
+              <el-dropdown-item
+                v-for="(item,index) in searchInfo.priority"
+                :key="index"
+                :command="{value: item,flag: 4}"
+              >{{ item.msg }}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-col>
+        <el-col :span="3">
+          <el-select
+            id="requirement_basicName2"
+            v-model="searchForm.pm"
+            filterable
+            remote
+            placeholder="PM"
+            :remote-method="searchUser"
+            :loading="userLoading"
+          >
+            <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
+              <div style="text-align: center">
+                <span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
+                <span>{{ item.name }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deptName }}</span>
+              </div>
+            </el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="3">
+          <el-select
+            id="requirement_basicName3"
+            v-model="searchForm.creator"
+            filterable
+            remote
+            placeholder="创建人"
+            :remote-method="searchUser"
+            :loading="userLoading"
+          >
+            <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
+              <div style="text-align: center">
+                <span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
+                <span>{{ item.name }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deptName }}</span>
+              </div>
+            </el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="3">
+          <div style="float: right">
+            <el-button type="primary" size="mini" @click="getTableData">查询</el-button>
+            <el-button size="mini" @click="reset">重置</el-button>
           </div>
-        </el-option>
-      </el-select>
-      <div>
-        <el-button type="primary" size="mini" @click="getTableData">查询</el-button>
-        <el-button size="mini" @click="reset">重置</el-button>
-      </div>
+        </el-col>
+      </el-row>
     </el-header>
     <el-main class="requirement-main">
       <div style="font-size: 18px;margin: 2%">
@@ -111,25 +129,32 @@
         highlight-current-row
         :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF',textAlign: 'center'}"
         :cell-style="{textAlign: 'center'}"
-        @current-change="handleCurrentRowChange"
       >
         <el-table-column prop="priority" label="优先级" sortable min-width="8%">
           <template v-slot="scope">
             <div class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</div>
           </template>
         </el-table-column>
-        <el-table-column prop="name" label="需求名称" min-width="15%" />
-        <el-table-column prop="belongingProject" label="归属的项目" min-width="10%">
+        <el-table-column prop="name" label="需求名称" min-width="15%">
+          <template v-slot="scope">
+            <div style="cursor: pointer;" @click="getToRequirementDetails(scope.row.id)">{{ scope.row.name }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="belongingProjectName" label="归属的项目" min-width="10%">
           <template v-slot="scope">
             {{ getProjectName(scope.row.belongingProject) }}
           </template>
         </el-table-column>
         <el-table-column prop="bizId" label="业务线" min-width="10%">
           <template v-slot="scope">
-            {{ getBizName(scope.row.belongingProject) }}
+            {{ getBizName(scope.row.bizId) }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="pm" label="产品" min-width="10%">
+          <template v-slot="scope">
+            {{ scope.row.pm[0]?scope.row.pm[0].name:'无' }}
           </template>
         </el-table-column>
-        <el-table-column prop="pm" label="产品" min-width="10%" />
         <el-table-column prop="taskCount" label="任务总数" min-width="8%" />
         <el-table-column prop="bugCount" label="bug总数" min-width="8%" />
         <el-table-column prop="creator" label="创建人" min-width="10%" />
@@ -220,6 +245,13 @@ export default {
     })
   },
   methods: {
+    getTitle(str) {
+      if (str.length <= 6) {
+        return str
+      } else {
+        return str.substring(0, 6) + '...'
+      }
+    },
     getTableData() {
       this.loading = true
       getRequirement(this.searchForm).then(res => {
@@ -333,8 +365,8 @@ export default {
       }
       return ret
     },
-    handleCurrentRowChange(val) {
-      this.$router.push({ name: '需求详情', params: { id: val.id + '' }})
+    getToRequirementDetails(id) {
+      this.$router.push({ name: '需求详情', params: { id: id + '' }})
     }
   }
 }
@@ -342,6 +374,7 @@ export default {
 
 <style scoped>
 .el-dropdown-link {
+  white-space: nowrap;
   cursor: pointer;
   color: #333333;
 }
@@ -352,9 +385,7 @@ export default {
   margin: 1%;
   background-color: #ffffff;
   border-radius: 8px;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
+  line-height: 60px;
 }
 .requirement-main {
   margin: 0 1%;
@@ -381,14 +412,17 @@ export default {
 .requirement-header .el-input__inner {
   border: none;
 }
-#basicName1::-webkit-input-placeholder {
+#requirement_basicName1::-webkit-input-placeholder {
   color: #333333;
 }
-#basicName2::-webkit-input-placeholder {
+#requirement_basicName2::-webkit-input-placeholder {
   color: #333333;
 }
-#basicName3::-webkit-input-placeholder {
+#requirement_basicName3::-webkit-input-placeholder {
   color: #333333;
 }
 .requirement-main .el-table .el-table__body tr:hover td { color: #409EFF; background: #EEF0F5; } /*hover时字体, 背景颜色*/
+.requirement_el-dropdown-menu {
+  max-height: 300px !important;
+  overflow: auto !important;}
 </style>

+ 11 - 5
src/views/projectManage/version/list/index.vue

@@ -5,7 +5,7 @@
         <el-col :span="3">
           <el-dropdown @command="handleCommand">
             <span class="el-dropdown-link">
-              {{ searchTitle.client }}
+              {{ getTitle(searchTitle.client) }}
               <i class="el-icon-arrow-down el-icon--right" />
             </span>
             <el-dropdown-menu slot="dropdown">
@@ -20,7 +20,7 @@
         <el-col :span="5">
           <el-dropdown @command="handleCommand">
             <span class="el-dropdown-link">
-              {{ searchTitle.version }}
+              {{ getTitle(searchTitle.version) }}
               <i class="el-icon-arrow-down el-icon--right" />
             </span>
             <el-dropdown-menu slot="dropdown">
@@ -45,7 +45,6 @@
         highlight-current-row
         :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF',textAlign: 'center'}"
         :cell-style="{textAlign: 'center'}"
-        @current-change="handleCurrentRowChange"
       >
         <el-table-column prop="priority" label="优先级" min-width="6%">
           <template v-slot="scope">
@@ -54,7 +53,7 @@
         </el-table-column>
         <el-table-column prop="requirementName" label="需求名称" min-width="20%">
           <template v-slot="scope">
-            <div>
+            <div style="cursor: pointer;" @click="getToRequirementDetails(scope.row.id)">
               {{ scope.row.requirementName }}
               <div v-if="scope.row.delay" class="div_requirement_name">{{ searchTitle.version +'版本已延期' }}</div>
             </div>
@@ -273,6 +272,13 @@ export default {
     this.showVersionEnum()
   },
   methods: {
+    getTitle(str) {
+      if (str.length <= 6) {
+        return str
+      } else {
+        return str.substring(0, 6) + '...'
+      }
+    },
     handleCommand(command) {
       switch (command.flag) {
         case 1:
@@ -296,7 +302,7 @@ export default {
       }
       this.getVersionHomePageList()
     },
-    handleCurrentRowChange(val) {
+    getToRequirementDetails(val) {
       // this.$router.push({ name: '版本详情', params: { id: val.id + '' }})
     },
     // 分页pageSize选择