qinzhipeng_v hace 5 años
padre
commit
e0de375885

+ 17 - 0
src/api/iteration.js

@@ -18,3 +18,20 @@ export function iterationCreate(data) {
     data
   })
 }
+
+// 编辑迭代
+export function iterationUpdate(data) {
+  return request({
+    url: TeamManagement + `/iteration/update`,
+    method: 'post',
+    data
+  })
+}
+
+// 获取迭代下需求
+export function iterationGetIreq(id) {
+  return request({
+    url: TeamManagement + `/iteration?id=` + id,
+    method: 'get'
+  })
+}

+ 2 - 2
src/styles/PublicStyle/index.scss

@@ -117,10 +117,10 @@
     left:50%;
     transform:translate(-50%,-50%);
   }
-/deep/ .el-dialog .el-dialog__body{
+  /deep/ .el-dialog .el-dialog__body{
     flex:1;
     overflow: auto;
-   }
+  }
 }
 
 .task {

+ 1 - 1
src/views/ToConfigure/configure.vue

@@ -500,7 +500,7 @@ export default {
         this.teamRoleEnum = res.data.teamRoleEnum // 团队属性
         this.memberRoleEnum = res.data.memberRoleEnum // lerader
         this.arr_team = this.teamRoleEnum.filter(item => {
-          return item.code <= 3
+          return item.code <= 4
         })
       })
     },

+ 177 - 13
src/views/projectManage/iteration/components/PlanningIteration.vue

@@ -1,17 +1,65 @@
 <template>
-  <el-dialog :visible.sync="visibleplanning" fullscreen :modal="false" :show="show" title="规划迭代" width="60%" @close="OnClose()">
-    <el-transfer
-      v-model="value"
-      filterable
-      :filter-method="filterMethod"
-      filter-placeholder="请输入城市拼音"
-      :data="data"
-    />
-
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="OnClose">取 消</el-button>
-      <el-button type="primary" @click="OnClose">确 定</el-button>
-    </span>
+  <el-dialog :visible.sync="visibleplanning" class="dialogBack" style=" background: #F2F3F6; color: #333B4A;" fullscreen :modal="false" :show="show" title="规划迭代" width="60%" @close="OnClose()">
+    <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="checked" style="margin-right: 10px;" />
+              <div class="titNameX">未规划的需求</div>
+            </div>
+            <el-input v-model="value1" style="width:30%;" clearable size="small" placeholder="搜索需求名称或ID" />
+          </div>
+          <el-divider />
+          <el-container>
+            <el-main class="scroll">
+              <div v-for="(item, index) in tableData" :key="index" class="Layout_space_between" style="margin: 10px 0;">
+                <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>
+              </div>
+            </el-main>
+            <el-footer style="text-align: center;">
+              <div class="solt">加载更多 </div>
+            </el-footer>
+          </el-container>
+        </div>
+
+        <div>
+          <div class="rectangle">····<i class="el-icon-arrow-right" /></div>
+          <div class="rectangle">d</div>
+        </div>
+
+        <div class="boxShadow">
+          <div class="Layout_flex_start" style="margin-left: 20px;">
+            <el-checkbox v-model="checked" />
+            <div class="titNameX" style="margin: 10px; line-height: 32px;">迭代</div>
+          </div>
+          <el-divider />
+          <el-container>
+            <el-main class="scroll">
+              <div v-for="(item, index) in tableData" :key="index" class="Layout_space_between" style="margin: 10px 0;">
+                <el-checkbox v-model="checked" />
+                <div class="priority">P0</div>
+                <div class="Requirement">我是一个需求</div>
+                <div class="RequirementId">REQUIERMENT-{{ item.id }}</div>
+                <div class="RequirementName">{{ item.name }}</div>
+              </div>
+            </el-main>
+            <el-footer style="text-align: center;">
+              <div class="solt">加载更多 </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-footer>
+    </el-container>
+
   </el-dialog>
 </template>
 
@@ -36,8 +84,11 @@ export default {
       return data
     }
     return {
+      checked: '',
+      tableData: [],
       visibleplanning: this.show,
       data: generateData(),
+      value1: '',
       value: [],
       filterMethod(query, item) {
         return item.pinyin.indexOf(query) > -1
@@ -52,7 +103,20 @@ export default {
       }
     }
   },
+  mounted() {
+    setInterval(
+      this.tableData.push({
+        id: 'P0',
+        date: '2016-05-03',
+        name: '朱晓菲',
+        address: '上海市'
+      })
+      , 100)
+  },
   methods: {
+    getCheck(e) {
+      console.log(e)
+    },
     OnClose() {
       this.$emit('update:show', false)
     }
@@ -69,4 +133,104 @@ export default {
     overflow: auto;
     margin: 0;
 }
+
+ .dialogBack {
+  /deep/ .el-dialog__body {
+    padding: 10px;
+    font-size: 14px;
+    word-break: break-all;
+    background: #F2F3F6;
+    color: #333B4A;
+  }
+
+   .el-table td {
+    border-bottom: none;
+  }
+
+  .el-divider--horizontal {
+    border:1px solid rgba(238,238,238,1);
+    margin: 0;
+  }
+
+  .boxShadow {
+    background:rgba(255,255,255,1);
+    box-shadow:0px 0px 11px rgba(238,240,245,1);
+    opacity:1;
+    border-radius:7px;
+    width: 45%;
+    min-height: calc(100vh - 240px);
+    margin-bottom: 30px;
+  }
+
+  .solt {
+    font-size:12px;
+    font-family:MicrosoftYaHei;
+    line-height:14px;
+    color:rgba(153,153,153,1);
+    opacity:1;
+    cursor: pointer;
+  }
+
+  .rectangle {
+    width:50px;
+    height:146px;
+    margin: 10px 0;
+    background:rgba(255,255,255,1);
+    box-shadow:0px 0px 11px rgba(238,240,245,1);
+    opacity:1;
+  }
+
+  .titNameX {
+    width:84px;
+    font-size:14px;
+    font-family:PingFangSC-Medium;
+    color:rgba(74,74,74,1);
+    opacity:1;
+  }
+
+  .priority {
+    width:40px;
+    background:rgba(245,108,108,1);
+    opacity:1;
+    border-radius:4px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:17px;
+    color:rgba(255,255,255,1);
+    text-align: center;
+  }
+
+  .Requirement {
+    width:187px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:17px;
+    color:rgba(51,51,51,1);
+    opacity:1;
+  }
+
+  .RequirementId {
+    width:135px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:17px;
+    color:rgba(102,102,102,1);
+    opacity:1;
+  }
+
+  .RequirementName {
+    width:46px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:17px;
+    color:rgba(102,102,102,1);
+    opacity:1;
+  }
+
+  .scroll {
+    height: 464px;
+    overflow:scroll;
+    overflow-x: hidden;
+  }
+ }
  </style>

+ 24 - 9
src/views/projectManage/iteration/components/create.vue

@@ -7,7 +7,7 @@
       </el-form-item>
       <el-form-item label="开始日期">
         <el-date-picker
-          v-model="iteration.creatTime"
+          v-model="iteration.startTime"
           type="date"
           placeholder="选择日期时间"
           format="yyyy-MM-dd HH:mm:ss"
@@ -37,12 +37,13 @@
 
 <script>
 import '@/styles/PublicStyle/index.scss'
-import { iterationCreate } from '@/api/iteration.js'
+import { iterationCreate, iterationUpdate } from '@/api/iteration.js'
 export default {
   name: 'TemplateDialog',
   props: {
     show: { type: Boolean, default: false },
-    title: { type: String, default: '标题' }
+    title: { type: String, default: '标题' },
+    iterations: { type: Object, default: null }
   },
   data() {
     return {
@@ -65,6 +66,12 @@ export default {
       handler(show) {
         this.showIteration = this.show
       }
+    },
+    iterations: {
+      immediate: true,
+      handler(iterations) {
+        this.iteration = iterations === null ? {} : this.iterations
+      }
     }
   },
   methods: {
@@ -72,16 +79,24 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.iteration = {}
       this.$emit('update:show', false)
+      this.$emit('iteratioFilter')
     },
     createdIteration(val) { // 创建迭代
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
-          // val.creator = this.userInformation
-          console.log(val, '创建')
-          iterationCreate(val).then(res => {
-            this.$emit('update:show', false)
-            this.$emit('iteratioFilter')
-          })
+          if (this.title === '新建迭代') {
+            iterationCreate(val).then(res => {
+              this.$message({ showClose: true, message: res.msg, type: 'success' })
+              this.OnClose()
+            })
+          }
+          if (this.title === '迭代配置') {
+            delete val.creator
+            iterationUpdate(val).then(res => {
+              this.$message({ showClose: true, message: res.msg, type: 'success' })
+              this.OnClose()
+            })
+          }
         } else {
           return false
         }

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

@@ -27,10 +27,12 @@
 </template>
 
 <script>
+import { iterationGetIreq } from '@/api/iteration.js'
 export default {
   name: 'TemplateDialog',
   props: {
-    show: { type: Boolean, default: false }
+    show: { type: Boolean, default: false },
+    iterationId: { type: Number, default: null }
   },
   data() {
     return {
@@ -45,7 +47,16 @@ export default {
       }
     }
   },
+  mounted() {
+    this.getRequirement()
+  },
   methods: {
+    getRequirement() {
+      console.log(this.iterationId, 'dscs')
+      iterationGetIreq(this.iterationId).then(res => {
+
+      })
+    },
     OnClose() {
       this.$emit('update:show', false)
     }

+ 34 - 8
src/views/projectManage/iteration/details/iterationDetails.vue

@@ -3,7 +3,9 @@
     <el-header class="public_header">
       <div class="Layout_space_between">
         <div class="Layout_space_between">
-          <div class="themeName">迭代: 我是一个迭代</div>
+          <el-tooltip :disabled="iterationData.name && iterationData.name.length < 19 ? true : false" effect="dark" :content="iterationData.name" placement="bottom">
+            <span class="themeName">迭代 : {{ iterationData.name | ellipsis }}</span>
+          </el-tooltip>
           <el-select
             v-model="value"
             class="public_botton"
@@ -14,6 +16,7 @@
             }"
             size="mini"
             placeholder="请选择"
+            @change="changeIterationStatus(value)"
           >
             <el-option
               v-for="item in statusArr"
@@ -51,7 +54,7 @@
               :show-header="showHeader"
               @selection-change="handleSelectionChange"
             > -->
-            <el-table-column min-width="25">
+            <el-table-column min-width="30">
               <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" />
@@ -128,9 +131,9 @@
     </el-main>
     <el-footer class="public_footer" />
     <!-- 删除 dialog -->
-    <iteration-delete :show.sync="dialogVisible" />
-    <!-- 编辑 dialog -->
-    <iteration-create title="编辑迭代" width="60%" :show.sync="showIteration" />
+    <iteration-delete :show.sync="dialogVisible" :iteration-id="iterationId" />
+    <!-- 迭代配置 dialog -->
+    <iteration-create title="迭代配置" width="60%" :show.sync="showIteration" :iterations="iterationData" @iteratioFilter="iteratioFilter" />
     <!-- 规划迭代 dialog -->
     <planning-iteration :show.sync="visibleplanning" />
   </el-container>
@@ -143,12 +146,22 @@ 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 } from '@/api/iteration.js'
 export default {
   components: {
     iterationDelete,
     iterationCreate,
     planningIteration
   },
+  filters: {
+    ellipsis(value) {
+      if (!value) return ''
+      if (value.length > 20) {
+        return value.slice(0, 20) + '...'
+      }
+      return value
+    }
+  },
   data() {
     return {
       image_role: image_role,
@@ -156,7 +169,7 @@ export default {
       dialogVisible: false, // 删除(弹窗)
       showIteration: false, // 编辑迭代(弹窗)
       visibleplanning: false, // 规划迭代(弹窗)
-      value: '',
+      value: 0,
       tableData: [
         {
           id: '1',
@@ -195,15 +208,28 @@ export default {
           belongingProjectName: '上海市普陀区金沙江路 104 弄'
         }
       ],
-      expands: []
+      expands: [],
+      iterationId: this.$route.query.id,
+      iterationData: {}
     }
   },
   mounted() {
-    this.value = 0
+    this.iteratioFilter()
     this.rowDrop()
     this.setLabel()
   },
   methods: {
+    iteratioFilter() {
+      iterationList({ id: this.iterationId, curIndex: 1, pageSize: 15 }).then(res => {
+        this.iterationData = res.data.list[0]
+      })
+    },
+    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.iteratioFilter()
+      })
+    },
     setLabel() {
       const _this = this
       this.$nextTick(() => {

+ 53 - 7
src/views/projectManage/iteration/index.vue

@@ -18,7 +18,15 @@
           </el-select></div>
         <div class="Layout_space_between">
           <div class="searchName">创建人</div>
-          <el-input v-model="filterItems.creator" clearable size="small" placeholder="请输入姓名或邮箱前缀" @change="iteratioFilter(1)" />
+          <el-select v-model="filterItems.creator" size="small" clearable filterable remote placeholder="请输入姓名或者邮箱前缀" :remote-method="remoteMethod" style="width: 100%" @change="iteratioFilter(1)">
+            <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="test2(item, 0)">
+              <div style="display: flex;justify-content: start;">
+                <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.deptName }}</div>
+                <div style="min-width:80px">{{ item.name }}</div>
+                <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.idap }}</div>
+              </div>
+            </el-option>
+          </el-select>
         </div>
       </div>
     </el-header>
@@ -26,7 +34,7 @@
       <el-table :data="iterationTableData" style="width: 100%" show-overflow-tooltip="true">
         <el-table-column label="迭代名称" align="left" min-width="350" show-overflow-tooltip>
           <template slot-scope="scope">
-            <span class="iterationName" @click="cilckIterationName(scope.row.id)">{{ scope.row.name }}</span>
+            <span class="iterationName" @click="cilckIterationName(scope.row)">{{ scope.row.name }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="status" label="状态" align="center" min-width="150">
@@ -40,6 +48,7 @@
               }"
               class="public_botton"
               size="mini"
+              @change="changeIterationStatus(scope.row)"
             >
               <el-option v-for="item in statusArr" :key="item.value" :label="item.name" :value="item.value" />
             </el-select>
@@ -57,7 +66,7 @@
         :page-sizes="[15, 20, 30]"
         background
         :page-size="15"
-        layout="total, sizes, prev, pager, next, jumper"
+        layout="total, prev, pager, next, jumper"
         :total="total"
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
@@ -70,7 +79,8 @@
 <script>
 import '@/styles/PublicStyle/index.scss'
 import iterationCreate from '@/views/projectManage/iteration/components/create.vue'
-import { iterationList } from '@/api/iteration.js'
+import { memberQueryMemberInfoByIDAPorName } from '@/api/taskIndex'
+import { iterationList, iterationUpdate } from '@/api/iteration.js'
 
 export default {
   components: {
@@ -82,6 +92,8 @@ export default {
       iteration: {}, // 筛选项
       curIndex: 1, // 分页
       pageSize: 15, // 分页
+      options: [],
+      test: [],
       filterItems: {},
       arr: [],
       total: 0,
@@ -94,7 +106,7 @@ export default {
     this.iteratioFilter()
   },
   methods: {
-    iteratioFilter(e) { // 筛选change
+    iteratioFilter(e, val) { // 筛选change
       let data = {}
       e === 1 ? data = this.filterItems : this.filterItems = {}
       data.curIndex = this.curIndex
@@ -106,8 +118,41 @@ export default {
       })
     },
 
-    cilckIterationName(id) { // 迭代详情页跳转
-      this.$router.push({ name: '迭代详情', query: { id: '' }})
+    changeIterationStatus(e) { // 修改状态
+      iterationUpdate({ status: e.status, id: e.id, name: e.name }).then(res => {
+        this.$message({ showClose: true, message: res.msg, type: 'success' })
+        this.iteratioFilter()
+      })
+    },
+
+    cilckIterationName(data) { // 迭代详情页跳转
+      this.$router.push({ name: '迭代详情', query: { id: data.id }})
+    },
+
+    remoteMethod(query) {
+      // 人员查询
+      if (query !== '') {
+        setTimeout(() => {
+          memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
+            const obj = {}
+            this.options = res.data.reduce((cur, next) => {
+              obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
+              return cur
+            }, [])
+          })
+        }, 200)
+      } else {
+        this.options = []
+      }
+    },
+
+    test2(item, e) {
+      // 获取团队人员信息
+      if (typeof this.test[item.idap] === 'undefined') {
+        item.role = e
+        this.test[item.idap] = item
+      }
+      return item.idap
     },
 
     handleSizeChange(val) { // 每页 ${val} 条
@@ -153,6 +198,7 @@ export default {
   color:#409EFF;
   cursor: pointer;
 }
+
 }
 
 </style>