qinzhipeng_v 5 years ago
parent
commit
dc53cb7b8c

+ 36 - 0
src/api/iteration.js

@@ -61,3 +61,39 @@ export function iterationRequire(data) {
     data
   })
 }
+
+// 更新需求所属迭代
+export function iterationUpdateBelongingIteration(data) {
+  return request({
+    url: TeamManagement + `/iteration/updateBelongingIteration`,
+    method: 'post',
+    data
+  })
+}
+
+// 规划迭代时,左边栏筛选需求
+export function requirementQueryRequirementInfoList(data) {
+  return request({
+    url: TeamManagement + `/requirement/queryRequirementInfoList`,
+    method: 'post',
+    data
+  })
+}
+
+// 更新迭代下的需求状态
+export function iterationUpdateReqStatus(data) {
+  return request({
+    url: TeamManagement + `/iteration/updateReqStatus`,
+    method: 'post',
+    data
+  })
+}
+
+// 迭代下的需求顺序变化
+export function iterationOrder(data, id) {
+  return request({
+    url: TeamManagement + `/iteration/order?iterationId=` + id,
+    method: 'post',
+    data
+  })
+}

BIN
src/assets/右箭头2.png


BIN
src/assets/建立档案@2x.png


BIN
src/assets/空白页@2x.png


+ 4 - 0
src/icons/svg/左箭头.svg

@@ -0,0 +1,4 @@
+
+
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590981239116" class="icon" viewBox="0 0 1559 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1092" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.359375" height="16"><defs><style type="text/css"></style></defs><path d="M1486.0737 449.268591a73.83371 73.83371 0 1 0 73.83371 73.83371 73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" opacity=".498" p-id="1093"></path><path d="M1194.416922 449.268591A73.83371 73.83371 0 1 0 1268.250632 523.102301a73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" opacity=".498" p-id="1094"></path><path d="M902.760144 449.336703a73.83371 73.83371 0 1 0 73.83371 73.833711 73.83371 73.83371 0 0 0-73.83371-73.833711z" fill="#409EFF" opacity=".498" p-id="1095"></path><path d="M611.103366 449.268591a73.83371 73.83371 0 1 0 73.83371 73.83371 73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" opacity=".498" p-id="1096"></path><path d="M12.26021 472.358654L472.154317 12.464547a77.511773 77.511773 0 0 1 104.416123 104.416123l-395.051217 395.051218 395.051217 395.051217a77.511773 77.511773 0 0 1-104.416123 104.416123L12.26021 551.437009a71.44978 71.44978 0 0 1 0-79.21458z" fill="#409EFF" opacity=".498" p-id="1097"></path></svg>
+		

+ 4 - 0
src/icons/svg/左箭头1.svg

@@ -0,0 +1,4 @@
+
+
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590981348999" class="icon" viewBox="0 0 1559 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1220" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.359375" height="16"><defs><style type="text/css"></style></defs><path d="M1486.0737 449.268591a73.83371 73.83371 0 1 0 73.83371 73.83371 73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" p-id="1221"></path><path d="M1194.416922 449.268591A73.83371 73.83371 0 1 0 1268.250632 523.102301a73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" p-id="1222"></path><path d="M902.760144 449.336703a73.83371 73.83371 0 1 0 73.83371 73.833711 73.83371 73.83371 0 0 0-73.83371-73.833711z" fill="#409EFF" p-id="1223"></path><path d="M611.103366 449.268591a73.83371 73.83371 0 1 0 73.83371 73.83371 73.83371 73.83371 0 0 0-73.83371-73.83371z" fill="#409EFF" p-id="1224"></path><path d="M12.26021 472.358654L472.154317 12.464547a77.511773 77.511773 0 0 1 104.416123 104.416123l-395.051217 395.051218 395.051217 395.051217a77.511773 77.511773 0 0 1-104.416123 104.416123L12.26021 551.437009a71.44978 71.44978 0 0 1 0-79.21458z" fill="#409EFF" p-id="1225"></path></svg>
+		

+ 200 - 67
src/views/projectManage/iteration/components/PlanningIteration.vue

@@ -3,63 +3,78 @@
     <el-container>
       <el-main style="padding: 0;" class="public_main Layout_space_between">
         <div class="boxShadow">
-          <div style="margin:10px;" class="Layout_space_between">
-            <div class="Layout_flex_start" style="margin-left: 10px;">
-              <el-checkbox v-model="checkedLeft" style="margin-right: 10px;" />
-              <div class="titNameX">未规划的需求</div>
+          <div style="margin: 0 10px;" class="Layout_space_between">
+            <div class="Layout_flex_start">
+              <el-checkbox v-model="checkAllLeft" :indeterminate="isIndeterminateLeft" class="titNameX" style="margin: 10px; line-height: 32px;" @change="handleCheckAllChange1" />未规划的需求
             </div>
-            <el-input v-model="value1" style="width:30%;" clearable size="small" placeholder="搜索需求名称或ID" />
+            <el-input v-model="value1" style="width:30%;" clearable size="small" placeholder="搜索需求名称或ID" @input="search(value1)" />
           </div>
           <el-divider />
           <el-container>
-            <el-main class="scroll" style="max-height: calc(100vh - 370px);">
-              <div v-for="(item, index) in tableData" :key="index" class="Layout_space_between" style="margin: 10px 0;" @click="checkedOne(checkOne.name)">
-                <el-checkbox v-model="item.checked" @change="getCheck(item)" />
-                <div class="priority">P0</div>
-                <div class="Requirement">我是一个需求</div>
-                <div class="RequirementId">REQUIERMENT-{{ item.id }}</div>
-                <div class="RequirementName">朱晓菲</div>
+            <el-main class="scroll" style="height: calc(100vh - 370px);">
+              <el-checkbox-group v-if="citiesLeft.length>0" v-model="checkedCitiesLeft" @change="handleCheckedCitiesChange1">
+                <el-checkbox v-for="item in citiesLeft" :key="item.id" :label="item" class="Layout_flex_start" style="margin: 10px 0;">
+                  <span class="priority">{{ item.priorityName }}</span>
+                  <span class="Requirement">{{ item.name | ellipsis }}</span>
+                  <span class="RequirementId">{{ item.requirementDisplayId }}</span>
+                  <span class="RequirementName">{{ item.pm.name }}</span>
+                </el-checkbox>
+              </el-checkbox-group>
+              <div v-else style="text-align: center; height: 100%">
+                <div class="imgCenter">
+                  <img class="imagePng" src="@/assets/空白页@2x.png" alt="">
+                  <div class="TipsName">当前没有未规划的需求</div>
+                </div>
               </div>
             </el-main>
             <el-footer style="text-align: center;">
-              <div class="solt">加载更多 </div>
+              <div v-if="citiesLeft.length > 15" class="solt" @click="LoadMore">加载更多 </div>
             </el-footer>
           </el-container>
         </div>
 
         <div>
           <div class="rectangle">
-            <svg-icon icon-class="右箭头" />
-            <svg-icon v-if="checkedLeft.length > 0" icon-class="右箭头1" />
+            <svg-icon v-if="leftArray.length === 0" icon-class="右箭头" />
+            <svg-icon v-if="leftArray.length > 0" icon-class="右箭头1" @click="torightLeft(1)" />
+          </div>
+          <div class="rectangle">
+            <svg-icon v-if="rightArray.length === 0" icon-class="左箭头" />
+            <svg-icon v-if="rightArray.length > 0" icon-class="左箭头1" @click="torightLeft(2)" />
           </div>
-          <div class="rectangle">d</div>
         </div>
 
         <div class="boxShadow">
-          <div class="Layout_flex_start" style="margin-left: 20px;">
-            <el-checkbox v-model="checkedRight" :indeterminate="isIndeterminate" @change="handleCheckAllChange" />
-            <div class="titNameX" style="margin: 10px; line-height: 32px;">迭代</div>
+          <div class="Layout_flex_start" style="margin-left: 10px;">
+            <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" class="titNameX" style="margin: 10px; line-height: 32px;" @change="handleCheckAllChange" />迭代
           </div>
           <el-divider />
           <el-container>
-            <el-main class="scroll" style="max-height: calc(100vh - 370px);">
-              <div v-for="(item, index) in RequirementSet" :key="index" class="Layout_space_between" style="margin: 10px 0;">
-                <el-checkbox v-model="item.index" @change="cheRight(item, item.index)" />
-                <div class="priority">{{ item.priorityName }}</div>
-                <div class="Requirement">{{ item.name }}</div>
-                <div class="RequirementId">{{ item.requirementDisplayId }}</div>
-                <div v-for="(val, num) in item.pm" :key="num" class="RequirementName">{{ val.name }}</div>
+            <el-main class="scroll" style="height: calc(100vh - 370px);">
+              <el-checkbox-group v-if="cities.length>0" v-model="checkedCities" @change="handleCheckedCitiesChange">
+                <el-checkbox v-for="item in cities" :key="item.id" :label="item" class="Layout_flex_start" style="margin: 10px 0;">
+                  <span class="priority">{{ item.priorityName }}</span>
+                  <span class="Requirement">{{ item.name | ellipsis }}</span>
+                  <span class="RequirementId">{{ item.requirementDisplayId }}</span>
+                  <span class="RequirementName">{{ item.pm.name }}</span>
+                </el-checkbox>
+              </el-checkbox-group>
+              <div v-else style="text-align: center; height: 100%">
+                <div class="imgCenter">
+                  <img class="imagePng" src="@/assets/空白页@2x.png" alt="">
+                  <div class="TipsName">当前迭代没有任何需求</div>
+                </div>
               </div>
             </el-main>
             <el-footer style="text-align: center;">
-              <div class="solt">加载更多 </div>
+              <div v-if="cities.length > 15" class="solt" @click="LoadMore">加载更多 </div>
             </el-footer>
           </el-container>
         </div>
       </el-main>
       <el-footer class="public_footer">
         <el-button @click="OnClose">取 消</el-button>
-        <el-button type="primary" @click="OnClose">确 定</el-button>
+        <el-button type="primary" @click="addRequired()">确 定</el-button>
       </el-footer>
     </el-container>
 
@@ -68,26 +83,39 @@
 
 <script>
 import '@/styles/PublicStyle/index.scss'
-import { iterationRequire } from '@/api/iteration.js'
+import { iterationRequire, iterationUpdateBelongingIteration, requirementQueryRequirementInfoList } from '@/api/iteration.js'
 export default {
   name: 'TemplateDialog',
+  filters: {
+    ellipsis(value) {
+      if (!value) return ''
+      if (value.length > 10) {
+        return value.slice(0, 10) + '...'
+      }
+      return value
+    }
+  },
   props: {
     show: { type: Boolean, default: false },
     iterationId: { type: String, default: null }
   },
   data() {
     return {
-      checkedRight: ['测试迭代1'],
+      checkAll: false,
+      checkAllLeft: false,
+      cities: [],
+      citiesLeft: [],
+      isIndeterminate: true,
+      isIndeterminateLeft: true,
       checkedCities: [],
+      checkedCitiesLeft: [],
       checkedLeft: '',
-      tableData: [],
       visibleplanning: this.show,
-      isIndeterminate: false,
       value1: '',
-      RequirementSet: [],
-      arr: [],
-      value: [],
-      checkStatusList: ''
+      leftArray: [],
+      rightArray: [],
+      reqRight: [],
+      size: 50
     }
   },
   watch: {
@@ -102,35 +130,109 @@ export default {
     this.getRequirement()
   },
   methods: {
-    handleCheckAllChange(val) {
-      // this.checkedCities = this.RequirementSet
-      // this.isIndeterminate = false
+    getRequirement() { // 获取需求
+      this.leftArray = []
+      this.rightArray = []
+      iterationRequire({ id: Number(this.iterationId), curIndex: 1, pageSize: 50 }).then(res => {
+        this.citiesLeft = res.data.left.list // 无归属需求
+        this.cities = res.data.right.list // 迭代下需求
+      })
+    },
+
+    handleCheckAllChange(val) { // 迭代下需求全选
+      this.checkAllLeft = false
+      this.checkedCitiesLeft = []
+      this.checkedCities = val ? this.cities : []
+      this.rightArray = this.checkedCities
+      this.isIndeterminate = false
+    },
+
+    handleCheckedCitiesChange(value) { // 迭代下需求单选
+      this.checkedCitiesLeft = []
+      this.rightArray = value
+      const checkedCount = value.length
+      this.checkAll = checkedCount === this.cities.length
+      this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length
     },
-    checkedOne: function(value) {
-      // 同显示,判断是否存在的同时,获取其索引(如果存在的话)
-      const idIndex = this.checkStatusList.indexOf(value)
-      if (idIndex >= 0) {
-        // 如果已经包含了该id, 则去除(单选按钮由选中变为非选中状态)
-        this.checkStatusList.splice(idIndex, 1)
-      } else {
-        // 选中该checkbox
-        this.checkStatusList.push(value)
+
+    handleCheckAllChange1(val) { // 无归属需求全选
+      this.checkAll = false
+      this.checkedCities = []
+      this.checkedCitiesLeft = val ? this.citiesLeft : []
+      this.leftArray = this.checkedCitiesLeft
+      this.isIndeterminateLeft = false
+    },
+
+    handleCheckedCitiesChange1(value) { // 无归属需求单选
+      this.checkedCities = []
+      this.leftArray = value
+      const checkedCount = value.length
+      this.checkAllLeft = checkedCount === this.citiesLeft.length
+      this.isIndeterminateLeft = checkedCount > 0 && checkedCount < this.citiesLeft.length
+    },
+
+    torightLeft(e) { // 添加删除需求
+      if (e === 1) {
+        this.cities = this.leftArray.concat(this.cities)
+        this.leftArray.map(val => {
+          this.citiesLeft = this.citiesLeft.filter(item => {
+            return item.id !== val.id
+          })
+        })
+        this.reqRight = this.leftArray
       }
+      if (e === 2) {
+        this.citiesLeft = this.rightArray.concat(this.citiesLeft)
+        this.rightArray.map(val => {
+          this.cities = this.cities.filter(item => {
+            return item.id !== val.id
+          })
+        })
+        this.reqRight = this.rightArray
+      }
+      this.leftArray = []
+      this.rightArray = []
+      this.checkedCitiesLeft = []
+      this.checkedCities = []
     },
-    getRequirement() {
-      iterationRequire({ id: Number(this.iterationId), curIndex: 1, pageSize: 50 }).then(res => {
-        this.tableData = res.data.left.list
-        this.RequirementSet = res.data.right.list
+    addRequired() { // 保存迭代下需求
+      const requirementIds = []
+      const requiredArr = []
+      this.cities.map(item => {
+        requirementIds.push(item.id)
+      })
+      this.reqRight.map(item => {
+        requiredArr.push(item.id)
+      })
+      const data = [
+        { id: -1, requirementIds: requiredArr.toString() },
+        { id: Number(this.iterationId), name: '测试', requirementIds: requirementIds.toString() }
+      ]
+      iterationUpdateBelongingIteration(data).then(res => {
+        if (res.code === 200) {
+          this.$emit('update:show', false)
+          this.$message({ showClose: true, message: '保存成功', type: res.msg })
+        }
       })
     },
-    cheRight(e, ele) {
-      console.log(e, ele, 'dd')
+
+    LoadMore() { // 加载更多
+      requirementQueryRequirementInfoList({ name: '', curIndex: 1, pageSize: this.size + 50, iterationId: -1, bizId: '' }).then(res => {
+        this.citiesLeft = res.data.list
+        this.size = this.size + 50
+      })
     },
-    getCheck(e) {
-      console.log(e)
+
+    search(value) { // 需求查询
+      requirementQueryRequirementInfoList({ name: value, curIndex: 1, pageSize: this.size + 50, iterationId: -1, bizId: '' }).then(res => {
+        this.citiesLeft = res.data.list
+      })
     },
-    OnClose() {
+
+    OnClose() { // 关闭弹窗
+      this.size = 50
       this.$emit('update:show', false)
+      this.$emit('iteratioFilter')
     }
   }
 }
@@ -155,8 +257,16 @@ export default {
     color: #333B4A;
   }
 
-   .el-table td {
-    border-bottom: none;
+  /deep/ .el-checkbox__label {
+    display: inline-block;
+    padding-left: 10px;
+    line-height: 19px;
+    font-size: 14px;
+    font-weight: normal;
+    width: -webkit-fill-available;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
   }
 
   .el-divider--horizontal {
@@ -175,13 +285,15 @@ export default {
   }
 
   .solt {
-    font-size:12px;
-    font-family:MicrosoftYaHei;
-    line-height:14px;
-    color:rgba(153,153,153,1);
-    opacity:1;
+    font-size: 12px;
+    font-family: MicrosoftYaHei;
+    line-height: 14px;
+    color: #999999;
+    opacity: 1;
     cursor: pointer;
-    margin-top: 8%;
+    position: relative;
+    top: 50%;
+    transform: translateY(-50%);
   }
 
   .rectangle {
@@ -197,14 +309,14 @@ export default {
   }
 
   .titNameX {
-    width:84px;
+    width:13px;
     font-size:14px;
     font-family:PingFangSC-Medium;
     color:rgba(74,74,74,1);
     opacity:1;
   }
 
-  .priority {
+  .Layout_space_between .priority {
     width:40px;
     background:rgba(245,108,108,1);
     opacity:1;
@@ -214,6 +326,7 @@ export default {
     line-height:17px;
     color:rgba(255,255,255,1);
     text-align: center;
+    display: inline-block;
   }
 
   .Requirement {
@@ -242,5 +355,25 @@ export default {
     color:rgba(102,102,102,1);
     opacity:1;
   }
+
+  .imgCenter {
+     position: relative;
+     top: 50%; /*偏移*/
+     transform: translateY(-50%);
+  }
+
+  .imagePng {
+     display: inline-block;
+     width: 100px;
+  }
+
+  .TipsName {
+    font-size:12px;
+    font-family:MicrosoftYaHei;
+    line-height:14px;
+    color:rgba(191,198,220,1);
+    opacity:1;
+  }
  }
+
  </style>

+ 1 - 1
src/views/projectManage/iteration/components/delete.vue

@@ -8,7 +8,7 @@
         <div v-for="(item, index) in RequirementSet" :key="index" class="Layout_space_between" style="margin: 10px 30px;">
           <div class="Requirement">REQUIERMENT-{{ item.id }}</div>
           <div class="Requirement" style="width:367px; text-align: left;">{{ item.name }}</div>
-          <div v-for="(val, num) in item.pm" :key="num" class="Requirement">PM: {{ val.name }}</div>
+          <div class="Requirement">PM: {{ item.pm.name }}</div>
         </div>
       </div>
     </div>

+ 140 - 36
src/views/projectManage/iteration/details/iterationDetails.vue

@@ -36,29 +36,66 @@
     <el-main class="public_main">
       <div class="table-wrap">
         <div class="table-box">
+          <div v-if="showHeader === false" class="Layout_space_between" style="padding: 9px 0;border-bottom:1px solid rgba(242,243,246,1);">
+            <div class="Layout_flex_start" style="width: 90%">
+              <el-checkbox v-model="checkAlls" style="margin-left: 53px;" @change="toggleSelection(checkAll)" />
+              <div style="margin: 0 8% 0 10px" class="startCheck"> 已选择 {{ 1 }} 个</div>
+              <div class="iterationCode"><img class="iterationImage" src="@/assets/建立档案@2x.png"> 移除迭代</div>
+              <div style="margin: 0 5%" class="iterationCode"><img class="iterationImage" src="@/assets/建立档案@2x.png"> 变更迭代</div>
+              <div class="iterationCode"><img class="iterationImage" src="@/assets/建立档案@2x.png">
+                <el-dropdown trigger="click">
+                  <span class="iterationCode">
+                    变更状态
+                  </span>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item icon="el-icon-plus">黄金糕</el-dropdown-item>
+                    <el-dropdown-item icon="el-icon-circle-plus">狮子头</el-dropdown-item>
+                    <el-dropdown-item icon="el-icon-circle-plus-outline">螺蛳粉</el-dropdown-item>
+                    <el-dropdown-item icon="el-icon-check">双皮奶</el-dropdown-item>
+                    <el-dropdown-item icon="el-icon-circle-check">蚵仔煎</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+                <!-- <el-select
+                  v-model="changeStatus"
+                  :class="{
+                    'status_color': scope.row.status === 0,
+                    'status_color1': scope.row.status === 1,
+                    'status_color3': scope.row.status === 3,
+                    'status_color4': scope.row.status === 5,
+                    'status_color2': scope.row.status === 9
+                  }"
+                  class="public_botton"
+                  size="mini"
+                  @change="iterationUpdateReqStatus(scope.row)"
+                >
+                  <el-option v-for="item in requiredArray" :key="item.code" :label="item.msg" :value="item.code" />
+                </el-select> -->
+              </div>
+            </div>
+            <div class="endCheck">取消选择</div>
+          </div>
           <el-table
             ref="topicTable"
             :data="RequirementSet"
             size="small"
             row-key="id"
+            :show-header="showHeader"
             :expand-row-keys="expands"
             :header-cell-style="{ color: '#4A4A4A', fontSize: '14px', fontWeight: '550', textAlign: 'center' }"
+            show-overflow-tooltip="true"
             @row-click="rowClick"
+            @selection-change="handleSelectionChange"
           >
             <!-- <el-table
               ref="planTable"
-              :data="all_task.data.list"
               style="width: 100%;"
-              :header-cell-style="{ color: '#4A4A4A', fontSize: '14px', fontWeight: '550', textAlign: 'center' }"
-              show-overflow-tooltip="true"
-              :show-header="showHeader"
               @selection-change="handleSelectionChange"
             > -->
-            <el-table-column min-width="30">
+            <el-table-column width="35">
               <img style="display: inline-block; width: 14px; vertical-align: middle;" :src="image_role">
             </el-table-column>
-            <el-table-column type="selection" min-width="30" align="center" />
-            <el-table-column type="expand" min-width="25" label-class-name="use">
+            <el-table-column type="selection" width="50" align="center" />
+            <el-table-column type="expand" width="35" label-class-name="use">
               <template slot-scope="props">
                 <el-table
                   :data="tableData"
@@ -105,7 +142,7 @@
                 {{ scope.row.name }}
               </template>
             </el-table-column>
-            <el-table-column label="状态" min-width="100" show-overflow-tooltip align="center">
+            <el-table-column label="状态" min-width="100" align="center">
               <template v-slot="scope">
                 <el-select
                   v-model="scope.row.status"
@@ -118,7 +155,7 @@
                   }"
                   class="public_botton"
                   size="mini"
-                  @change="updateRequirementStatus(scope.row)"
+                  @change="iterationUpdateReqStatus(scope.row)"
                 >
                   <el-option v-for="item in requiredArray" :key="item.code" :label="item.msg" :value="item.code" />
                 </el-select>
@@ -141,7 +178,7 @@
             </el-table-column>
             <el-table-column label="PRD链接" min-width="100" show-overflow-tooltip align="center">
               <template v-slot="scope">
-                {{ scope.row.mrdUrl }}
+                <el-link :href="scope.row.mrdUrl" target="_blank">{{ scope.row.mrdUrl }}</el-link>
               </template>
             </el-table-column>
           </el-table>
@@ -154,7 +191,7 @@
     <!-- 迭代配置 dialog -->
     <iteration-create title="迭代配置" width="60%" :show.sync="showIteration" :iterations="iterationData" @iteratioFilter="iteratioFilter" />
     <!-- 规划迭代 dialog -->
-    <planning-iteration :show.sync="visibleplanning" :iteration-id="iterationId" />
+    <planning-iteration :show.sync="visibleplanning" :iteration-id="iterationId" @iteratioFilter="iteratioFilter" />
   </el-container>
 </template>
 
@@ -165,7 +202,7 @@ import iterationCreate from '@/views/projectManage/iteration/components/create.v
 import planningIteration from '@/views/projectManage/iteration/components/PlanningIteration.vue'
 import Sortable from 'sortablejs'
 import image_role from '@/assets/麻将@2x.png'
-import { iterationList, iterationUpdate, iterationRequire } from '@/api/iteration.js'
+import { iterationList, iterationUpdate, iterationRequire, iterationUpdateReqStatus, iterationOrder } from '@/api/iteration.js'
 import { showRequirementEnum, updateRequirementStatus } from '@/api/requirement.js'
 export default {
   components: {
@@ -190,6 +227,10 @@ export default {
       showIteration: false, // 编辑迭代(弹窗)
       visibleplanning: false, // 规划迭代(弹窗)
       requiredArray: [], // 需求状态
+      showHeader: true, // 是否显示表头
+      checkAll: [],
+      changeStatus: '变更状态',
+      checkAlls: false,
       tableData: [
         {
           id: '1',
@@ -208,24 +249,6 @@ export default {
           name: '秦志鹏',
           mrdUrl: 'www.baidu.com',
           belongingProjectName: '上海市普陀区金沙江路 102 弄'
-        },
-        {
-          id: '3',
-          priority: 1,
-          priorityName: 'P1',
-          status: 0,
-          name: '廖子君',
-          mrdUrl: 'www.baidu.com',
-          belongingProjectName: '上海市普陀区金沙江路 103 弄'
-        },
-        {
-          id: '4',
-          priority: 1,
-          priorityName: 'P1',
-          status: 0,
-          name: '王子乾',
-          mrdUrl: 'www.baidu.com',
-          belongingProjectName: '上海市普陀区金沙江路 104 弄'
         }
       ],
       expands: [],
@@ -242,7 +265,7 @@ export default {
   methods: {
     async iteratioFilter() {
       const list = iterationList({ id: this.iterationId, curIndex: 1, pageSize: 15 })
-      const requiredList = iterationRequire({ id: Number(this.iterationId), curIndex: 1, pageSize: 50 })
+      const requiredList = iterationRequire({ id: this.iterationId, curIndex: 1, pageSize: 50 })
       const requirementEnum = showRequirementEnum()
       const listRes = await list
       const listRequire = await requiredList
@@ -250,10 +273,11 @@ export default {
       this.iterationData = listRes.data.list[0]
       this.RequirementSet = listRequire.data.right.list
       this.requiredArray = requiredstatus.data.requirementStatus
+      this.checkAll = this.RequirementSet
     },
     changeIterationStatus(e) { // 修改状态
       iterationUpdate({ status: e, id: this.iterationData.id, name: this.iterationData.name }).then(res => {
-        this.$message({ showClose: true, message: res.msg, type: 'success' })
+        this.$message({ showClose: true, message: '状态更改成功!', type: res.msg })
         this.iteratioFilter()
       })
     },
@@ -273,8 +297,17 @@ export default {
         cellDiv.appendChild(node)
       })
     },
-    updateRequirementStatus(val) {
-      console.log(val, 'ddddd')
+    iterationUpdateReqStatus(ele) {
+      iterationUpdateReqStatus({ reqIds: [ele.id], newStatus: ele.status }).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+          this.iteratioFilter()
+        } else {
+          this.$message.warning(res.msg)
+        }
+      })
+    },
+    updateRequirementStatus(val) { // 修改迭代状态
       const modifier = localStorage.getItem('username')
       updateRequirementStatus({ id: val.id, status: val.status, modifier: modifier }).then(res => {
         if (res.code === 200) {
@@ -285,6 +318,30 @@ export default {
       }
       )
     },
+
+    toggleSelection(rows) {
+      if (rows) {
+        rows.forEach(row => {
+          this.$refs.topicTable.toggleRowSelection(row)
+        })
+        console.log(rows, 'dcs')
+      } else {
+        this.$refs.topicTable.clearSelection()
+        console.log(rows, 'ds')
+      }
+    },
+
+    handleSelectionChange(val) {
+      console.log(val, 'sss')
+      if (val.length === 0) {
+        this.showHeader = true
+      } else {
+        this.showHeader = false
+      }
+
+      val.length === this.RequirementSet.length ? this.checkAlls = true : this.checkAlls = false
+    },
+
     cellDivClick(ele) {
       console.log(ele)
       const expandState = ele.getAttribute('isExpand') // 获取属性is-expand的值
@@ -323,8 +380,22 @@ export default {
       const _this = this
       Sortable.create(tbody, {
         onEnd({ newIndex, oldIndex }) {
-          const currRow = _this.tableData.splice(oldIndex, 1)[0]
-          _this.tableData.splice(newIndex, 0, currRow)
+          const currRow = _this.RequirementSet.splice(oldIndex, 1)[0]
+          _this.RequirementSet.splice(newIndex, 0, currRow)
+          const obj = {
+            id: [],
+            iterationId: ''
+          }
+          _this.RequirementSet.map(item => {
+            obj.iterationId = item.iterationId
+            obj.id.push(item.id)
+          })
+          iterationOrder(obj.id, obj.iterationId).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.iteratioFilter()
+            }
+          })
         }
       })
     }
@@ -367,6 +438,39 @@ export default {
 cursor: pointer;
 }
 
+.iterationImage {
+  display: inline-block;
+  width: 13.46px;
+}
+
+.iterationCode {
+  font-size:14px;
+  font-family:PingFang SC;
+  font-weight:400;
+  line-height:20px;
+  color:rgba(51,51,51,1);
+  opacity:1;
+}
+
+.endCheck {
+  width:58px;
+  font-size:14px;
+  font-family:PingFang SC;
+  font-weight:400;
+  line-height:20px;
+  color:rgba(68,68,68,1);
+  opacity:1;
+}
+
+.startCheck {
+  width:82px;
+  font-size:14px;
+  font-family:PingFangSC-Medium;
+  line-height:20px;
+  color:rgba(74,74,74,1);
+  opacity:1;
+}
+
 }
 
 </style>

+ 1 - 1
src/views/projectManage/iteration/index.vue

@@ -121,7 +121,7 @@ export default {
 
     changeIterationStatus(e) { // 修改状态
       iterationUpdate({ status: e.status, id: e.id, name: e.name }).then(res => {
-        this.$message({ showClose: true, message: res.msg, type: 'success' })
+        this.$message({ showClose: true, message: '状态更改成功!', type: res.msg })
         this.iteratioFilter()
       })
     },