Forráskód Böngészése

缺陷状态流转

qinzhipeng_v 5 éve
szülő
commit
99a9cc1376

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

@@ -223,7 +223,7 @@
 .public_task {
   /deep/ .el-dialog__title {
     line-height: 24px;
-    font-size: 18px;
+    font-size: 16px;
     color: #303133;
     padding-left: 10px;
 }

+ 28 - 120
src/views/projectManage/bugList/bugindex.vue

@@ -547,7 +547,7 @@
       <div class="blueStripe" />
       <el-form ref="statusDialogForm" label-width="110px" label-position="left" :model="statusDialogForm" :rules="rules">
         <el-form-item v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'" label="修复结果" prop="repairResult" class="bug_manage_dialog">
-          <el-select v-model="statusDialogForm.repairResult" style="width: 100%">
+          <el-select v-model="statusDialogForm.repairResult" style="width: 100%" @change="modifyResult(statusDialogForm.repairResult)">
             <el-option v-for="item in repairResultEnumList" :key="item.code" :label="item.name" :value="item.code" />
           </el-select>
         </el-form-item>
@@ -680,7 +680,9 @@ export default {
         repairResult: [{ required: true, message: '请选择修复结果', trigger: ['blur', 'change'] }],
         reasonOrDesc: [{ required: true, message: '请输入Reopen原因', trigger: ['blur', 'change'] }]
       },
-      statusDialogForm: {},
+      statusDialogForm: {
+        repairResult: 1
+      },
       bugListType: 2,
       props: { multiple: true },
       reopens: [{ code: 1, name: '是' }, { code: 0, name: '否' }],
@@ -706,11 +708,7 @@ export default {
       bugQuery: '', // bug详情
       business_platform_Modular: [], // 所属模块
       bugQueryModel: '',
-      commentShow: true, // 评论为空默认显示
-      content: '', // 评论
-      comment_content: '', // 评论内容
       fileList: [], // 储存附件
-      dis: false,
       commentTxt: [],
       pageSize: 15,
       curIndex: 1,
@@ -723,7 +721,6 @@ export default {
       stratAndEnd: [], // 创建日期
       tableData: [],
       dialogVisible: false,
-      accessory: [],
       loading: false,
       options: [],
       test: [], // 人员查询
@@ -835,9 +832,6 @@ export default {
     modalClose() {
       this.getBugList()
     },
-    selectStatus(row) {
-      row.isSelected = !row.isSelected
-    },
     blurEvent(row, status) {
       this.staData = row
       this.statusId = status
@@ -856,13 +850,32 @@ export default {
       })
       this.statusDialogTitle = data
       this.statusDialogForm = {}
+      if (status === 2) {
+        this.$set(this.statusDialogForm, 'repairResult', 1)
+      }
+      if (status === 3) {
+        this.$set(this.statusDialogForm, 'repairResult', row.repairResult)
+        this.$set(this.statusDialogForm, 'bugReason', row.bugReason)
+      }
       this.statusDialogVisible = true
     },
-    bugStatusChange(row) {
-      row.isSelected = !row.isSelected
-      this.$nextTick(() => {
-        this.$refs.inputVal.focus()
-      })
+    modifyResult(val) { // 修复结果
+      switch (val) {
+        case 9:
+          this.$set(this.statusDialogForm, 'bugReason', 9)
+          break
+        case 11:
+          this.$set(this.statusDialogForm, 'bugReason', 11)
+          break
+        case 2:
+          this.$set(this.statusDialogForm, 'bugReason', 10)
+          break
+        case 3:
+          this.$set(this.statusDialogForm, 'bugReason', 12)
+          break
+        default: this.$set(this.statusDialogForm, 'bugReason', '')
+          break
+      }
     },
     statusDialogConfirm() { // 点击确定 验证 修改
       this.$refs.statusDialogForm.validate((valid) => {
@@ -954,26 +967,6 @@ export default {
       this.dialogImageUrl = file.url
       this.dialogVisible = true
     },
-
-    // 文件上传时的钩子
-    progress(event, file, fileList) {
-      this.dis = true
-    },
-
-    // 上传成功回调
-    handleChange(response, file, fileList) {
-      this.fileDbList.push({
-        name: file.name,
-        url: 'http:' + file.response.url
-      })
-      this.accessory = JSON.stringify(this.fileDbList)
-      this.dis = false
-      this.$message({
-        showClose: true,
-        message: '文件上传成功',
-        type: 'success'
-      })
-    },
     click_bugName(e) {
       this.bugQuery = JSON.parse(
         JSON.stringify(this.tableData.filter(value => value.id === e)[0])
@@ -1209,89 +1202,4 @@ export default {
   padding-left: 10px;
   width: 73px;
 }
-// .btns .el-input__suffix {
-//     // display: none;
-//     visibility: hidden;
-// }
-// .btns :hover {
-//  /deep/ .el-input__suffix {
-//     // display: inline-block;
-//     visibility: inherit;
-//   }
-// }
-.item{
-  /deep/ input {
-    color: rgb(126, 211, 33);
-    border: 1px solid rgb(126, 211, 33);
-     border-color: rgb(126, 211, 33) !important;
-         font-weight: 900;
-  }
-  /deep/ .el-input__suffix {
-    color: rgb(126, 211, 33) !important;
-    right: 1px;
-  }
-  /deep/ .el-select__caret {
-    color: rgb(126, 211, 33) !important;
-  }
-}
-.item1 {
-  /deep/ input {
-    color: rgb(255, 204, 102);
-     border: 1px solid rgb(255, 204, 102);
-     border-color: rgb(255, 204, 102) !important;
-         font-weight: 900;
-  }
-  /deep/ .el-input__suffix {
-    color: rgb(255, 204, 102) !important;
-    right: 1px;
-  }
-  /deep/ .el-select__caret {
-    color: rgb(255, 204, 102) !important;
-  }
-}
-.item2 {
-  /deep/ input {
-    color: rgb(245, 108, 108);
-    border: 1px solid rgb(245, 108, 108);
-    border-color: rgb(245, 108, 108) !important;
-        font-weight: 900;
-  }
-   /deep/ .el-input__suffix {
-    color: rgb(245, 108, 108) !important;
-    right: 1px;
-  }
-  /deep/ .el-select__caret {
-   color: rgb(245, 108, 108) !important;
-  }
-}
-.item3 {
-  /deep/ input {
-    color: #D675F0;
-    border: 1px solid #D675F0;
-    border-color: #D675F0 !important;
-        font-weight: 900;
-  }
-    /deep/ .el-input__suffix {
-    color: #D675F0 !important;
-    right: 1px;
-  }
-   /deep/ .el-select__caret {
-   color: #D675F0 !important;
-  }
-}
-.item-color {
-  /deep/ input {
-    color: rgb(106, 180, 255);
-    border: 1px solid rgb(106, 180, 255);
-    border-color: rgb(106, 180, 255) !important;
-        font-weight: 900;
-  }
-    /deep/ .el-input__suffix {
-    color: rgb(106, 180, 255) !important;
-    right: 1px;
-  }
-   /deep/ .el-select__caret {
-   color: rgb(106, 180, 255) !important;
-  }
-}
 </style>

+ 106 - 145
src/views/projectManage/bugList/details/index.vue

@@ -6,10 +6,10 @@
       <dropdown
         v-if="map.bugEnumList && typeof bug.status !== 'undefined'"
         v-model="map.bugEnumList[bug.status]"
-        :options="enums.bugEnumList"
+        :options="bugStatusList(map.bugEnumList[bug.status])"
         :size="'small'"
         :class="{
-          'item-color' : map.bugEnumList[bug.status] === '待修复' || '修复中',
+          'item-color' : map.bugEnumList[bug.status] === '待修复',
           'item' : map.bugEnumList[bug.status] === '已完成',
           'item1' : map.bugEnumList[bug.status] === '待测试',
           'item2' : map.bugEnumList[bug.status] === 'Reopen',
@@ -68,7 +68,14 @@
                     v-if="map.bugEnumList && typeof bug.status !== 'undefined'"
                     v-model="map.bugEnumList[bug.status]"
                     size="small"
-                    :options="enums.bugEnumList"
+                    :class="{
+                      'item-color' : map.bugEnumList[bug.status] === '待修复',
+                      'item' : map.bugEnumList[bug.status] === '已完成',
+                      'item1' : map.bugEnumList[bug.status] === '待测试',
+                      'item2' : map.bugEnumList[bug.status] === 'Reopen',
+                      'item3' : map.bugEnumList[bug.status] === 'Hold'
+                    }"
+                    :options="bugStatusList(map.bugEnumList[bug.status])"
                     class="button_status"
                     @command="openStatsDialog"
                   />
@@ -167,6 +174,9 @@
                       class="bug_manage_div"
                     >{{ map.repairResultEnumList[bug.repairResult]?map.repairResultEnumList[bug.repairResult]:'未修复' }}</div>
                   </el-form-item>
+                  <el-form-item label="Hold次数">
+                    <div style="padding-left: 15px" class="bug_manage_div">{{ bug.holdCount }}</div>
+                  </el-form-item>
 
                 </el-form>
               </el-aside>
@@ -500,30 +510,15 @@
                 >
                   <div class="image-name">{{ file.name }}</div>
                 </el-tooltip>
-                <img
-                  class="el-upload-list__item-thumbnail detail-img"
-                  :src="file.url"
-                  alt=""
-                >
+                <img class="el-upload-list__item-thumbnail detail-img" :src="file.url" alt="">
                 <span class="el-upload-list__item-actions">
-                  <span
-                    class="el-upload-list__item-preview"
-                    @click="handlePictureCardPreview(file)"
-                  >
+                  <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
                     <i class="el-icon-zoom-in" />
                   </span>
-                  <span
-                    v-if="!disabled"
-                    class="el-upload-list__item-delete"
-                    @click="handleDownload(file)"
-                  >
+                  <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
                     <i class="el-icon-download" />
                   </span>
-                  <span
-                    v-if="!disabled"
-                    class="el-upload-list__item-delete"
-                    @click="handleRemoveImage(file)"
-                  >
+                  <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemoveImage(file)">
                     <i class="el-icon-delete" />
                   </span>
                 </span>
@@ -542,15 +537,9 @@
           <el-divider v-if="type !== 'page'" /><br>
           <div>
             <div v-for="(item,index) in comments" :key="index" class="animated bounceInRight">
-              <div
-                style="font-size:14px;color:#333B4A;display: inline-block;"
-              >{{ item.commentInfo.name }}</div>
-              <div
-                style="margin-left:20px;display: inline-block;color: #9B9B9B;font-size:12px"
-              >{{ item.commentInfo.gmtCreater }}</div>
-              <p
-                style="font-size:14px;color:#333B4A;margin-top: 10px;white-space: pre-line;"
-              >{{ item.commentInfo.content }}</p>
+              <div style="font-size:14px;color:#333B4A;display: inline-block;">{{ item.commentInfo.name }}</div>
+              <div style="margin-left:20px;display: inline-block;color: #9B9B9B;font-size:12px">{{ item.commentInfo.gmtCreater }}</div>
+              <p style="font-size:14px;color:#333B4A;margin-top: 10px;white-space: pre-line;">{{ item.commentInfo.content }}</p>
               <br>
             </div>
             <el-input
@@ -571,80 +560,31 @@
         v-if="statusDialogVisible"
         :visible.sync="statusDialogVisible"
         width="33%"
-        class="bug_manage_dialog"
+        :title="statusDialogTitle"
+        class="public_task"
         :append-to-body="true"
         :close-on-click-modal="false"
       >
-        <template v-slot:title>
-          <div style="display:flex;align-items: center;">
-            <div style="width:4px;height:15px;background:#409EFF;border-radius:1px;" />
-            <div
-              style="width:83px;height:18px;font-size:16px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px"
-            >{{ statusDialogTitle }}</div>
-          </div>
-        </template>
-        <el-form
-          v-if="statusDialogTitle !== '删除确认'"
-          label-width="110px"
-          label-position="left"
-          :model="statusDialogForm"
-          :rules="rules"
-        >
-          <el-form-item
-            v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'"
-            label="缺陷原因"
-            prop="bugReason"
-          >
-            <el-select v-model="statusDialogForm.bugReason" style="width: 100%">
-              <el-option
-                v-for="item in enums.bugReasonEnumList"
-                :key="item.code"
-                :label="item.name"
-                :value="item.code"
-              />
+        <div class="blueStripe" />
+        <el-form v-if="statusDialogTitle !== '删除确认'" label-width="110px" label-position="left" :model="statusDialogForm" :rules="rules">
+          <el-form-item v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'" label="修复结果" prop="repairResult" class="bug_manage_dialog">
+            <el-select v-model="statusDialogForm.repairResult" style="width: 100%" @change="modifyResult(statusDialogForm.repairResult)">
+              <el-option v-for="item in enums.repairResultEnumList" :key="item.code" :label="item.name" :value="item.code" />
             </el-select>
           </el-form-item>
-          <el-form-item
-            v-if="statusDialogTitle === '待测试'"
-            label="修复方式"
-            class="bug_manage_dialog bug_manage_dialog_fixMethod"
-          >
-            <el-input
-              v-model="statusDialogForm.reasonOrDesc"
-              type="textarea"
-              placeholder="请输入具体原因和修复方式"
-              maxlength="300"
-              show-word-limit
-              rows="4"
-            />
-          </el-form-item>
-          <el-form-item
-            v-if="statusDialogTitle === '已完成'"
-            label="修复结果"
-            prop="repairResult"
-            class="bug_manage_dialog"
-          >
-            <el-select
-              v-model="statusDialogForm.repairResult"
-              style="width: 100%"
-            >
-              <el-option
-                v-for="item in enums.repairResultEnumList"
-                :key="item.code"
-                :label="item.name"
-                :value="item.code"
-              />
+          <el-form-item v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'" label="缺陷原因" prop="bugReason" class="bug_manage_dialog">
+            <el-select v-model="statusDialogForm.bugReason" style="width: 100%">
+              <el-option v-for="item in enums.bugReasonEnumList" :key="item.code" :label="item.name" :value="item.code" />
             </el-select>
           </el-form-item>
+          <el-form-item v-if="statusDialogTitle === '待测试'" label="修复方式" class="bug_manage_dialog bug_manage_dialog_fixMethod">
+            <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" placeholder="请输入具体原因,得出结论的过程,具体修复过程或方式" maxlength="300" show-word-limit rows="4" />
+          </el-form-item>
           <el-form-item v-if="statusDialogTitle === 'Reopen'" label="Reopen原因" prop="reasonOrDesc">
-            <el-input
-              v-model="statusDialogForm.reasonOrDesc"
-              type="textarea"
-              placeholder="请输入Reopen"
-              maxlength="300"
-              show-word-limit
-              rows="4"
-            />
+            <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" placeholder="请输入Reopen" maxlength="300" show-word-limit rows="4" />
+          </el-form-item>
+          <el-form-item v-if="statusDialogTitle === 'Hold'" label="Hold原因" prop="reasonOrDesc">
+            <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" maxlength="300" show-word-limit rows="4" />
           </el-form-item>
         </el-form>
         <div v-else style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
@@ -687,8 +627,7 @@
 <script>
 import fackClickOutSide from './fackClickOutSide.js'
 import E from 'wangeditor'
-// import Utils from '../../../../util.js'
-// import { settingGetTypeMap } from '@/api/taskIndex'
+import '@/styles/PublicStyle/index.scss'
 import { getCommentList, addComment, getMemberInfo } from '@/api/requirement.js'
 import {
   bugDetails,
@@ -874,18 +813,6 @@ export default {
     this.bugGetEnum()
     this.$nextTick(() => {
       this.bugGet(this.id, false).then(res => {
-        // this.assignerOptions = []
-        // for (const i in this.bug.assignerList.length) {
-        //   this.searchUser(this.bug.assigner[i]).then(res => {
-        //     this.assignerOptions = res.data
-        //   })
-        // }
-        // this.currentHandlerOptions = []
-        // for (const i in this.bug.currentHandlerList.length) {
-        //   this.searchUser(this.bug.currentHandler[i]).then(res => {
-        //     this.currentHandlerOptions = res.data
-        //   })
-        // }
         this.PersonnelData()
         this.changeWidthOnBlur()
         releaseList().then(res => {
@@ -933,6 +860,24 @@ export default {
         })
       }
     },
+    modifyResult(val) { // 修复结果
+      switch (val) {
+        case 9:
+          this.$set(this.statusDialogForm, 'bugReason', 9)
+          break
+        case 11:
+          this.$set(this.statusDialogForm, 'bugReason', 11)
+          break
+        case 2:
+          this.$set(this.statusDialogForm, 'bugReason', 10)
+          break
+        case 3:
+          this.$set(this.statusDialogForm, 'bugReason', 12)
+          break
+        default: this.$set(this.statusDialogForm, 'bugReason', '')
+          break
+      }
+    },
     listen(event) {
       event.preventDefault() // 阻止浏览器默认换行操作
       return false
@@ -1067,10 +1012,7 @@ export default {
         this.$message.warning('评论不能为空')
         return
       }
-      addComment({
-        commentInfo: { joinId: this.id, type: 2, content: this.commentContent },
-        user: { ename: this.userInformation }
-      }).then(res => {
+      addComment({ commentInfo: { joinId: this.id, type: 2, content: this.commentContent }, user: { ename: this.userInformation }}).then(res => {
         if (res.code === 200) {
           this.getCommentList()
         }
@@ -1118,6 +1060,33 @@ export default {
       this.bug.bugName = this.bugNameForm.bugName
       this.bugUpdate(this.bug, 'title')
     },
+    bugStatusList(status) { // 不同状态返回不同的option
+      if (status === '待修复') {
+        return this.enums.bugEnumList.filter(item => {
+          return item.code === 0 || item.code === 2 || item.code === 5
+        })
+      }
+      if (status === '待测试') {
+        return this.enums.bugEnumList.filter(item => {
+          return item.code === 2 || item.code === 3 || item.code === 4
+        })
+      }
+      if (status === '已完成') {
+        return this.enums.bugEnumList.filter(item => {
+          return item.code === 3
+        })
+      }
+      if (status === 'Reopen') {
+        return this.enums.bugEnumList.filter(item => {
+          return item.code === 2 || item.code === 5 || item.code === 4
+        })
+      }
+      if (status === 'Hold') {
+        return this.enums.bugEnumList.filter(item => {
+          return item.code === 5 || item.code === 2
+        })
+      }
+    },
     RichText() {
       this.editor = new E('#wage', '#wage1')
       this.editor.customConfig.zIndex = 0
@@ -1244,11 +1213,7 @@ export default {
       })
     },
     bugDelete() {
-      const userData = {
-        id: '',
-        ename: this.userInformation,
-        name: this.userNames
-      }
+      const userData = { id: '', ename: this.userInformation, name: this.userNames }
       return bugDelete(userData, this.bug.id).then(res => {
         return res
       })
@@ -1348,13 +1313,20 @@ export default {
     openStatsDialog(item) {
       this.statusDialogForm = JSON.parse(JSON.stringify(this.bug))
       this.statusDialogForm.status = item.code
-      if (item.name === '待修复' || item.name === '修复中' || item.name === 'Hold') {
-        this.bugUpdate(this.statusDialogForm, 'title')
-          .then(res => {
-            this.bugGet(this.bug.id, false)
-          })
+      if (item.name === '待修复') {
+        this.bugUpdate(this.statusDialogForm, 'title').then(res => {
+          this.bugGet(this.bug.id, false)
+        })
         return
       }
+      if (item.name === '待测试') {
+        this.$set(this.statusDialogForm, 'repairResult', 1)
+        this.$set(this.statusDialogForm, 'bugReason', '')
+      }
+      if (item.name === '已完成') {
+        this.$set(this.statusDialogForm, 'repairResult', this.bug.repairResult)
+        this.$set(this.statusDialogForm, 'bugReason', this.bug.bugReason)
+      }
       this.statusDialogTitle = item.name
       this.statusDialogVisible = true
     },
@@ -1374,28 +1346,18 @@ export default {
           }
         })
       } else if (this.statusDialogTitle === '待测试') {
-        if (
-          typeof this.statusDialogForm.bugReason === 'undefined' ||
-          this.statusDialogForm.bugReason === null
-        ) {
+        if (typeof this.statusDialogForm.bugReason === 'undefined' || this.statusDialogForm.bugReason === null) {
           this.$message.warning('请选择缺陷原因')
         }
-        this.postDialogForm()
-          .then(res => {
-            this.getCommentList()
-          })
+        this.postDialogForm().then(res => {
+          this.getCommentList()
+        })
       } else if (this.statusDialogTitle === '已完成') {
-        if (
-          typeof this.statusDialogForm.bugReason === 'undefined' ||
-          this.statusDialogForm.bugReason === null
-        ) {
+        if (typeof this.statusDialogForm.bugReason === 'undefined' || this.statusDialogForm.bugReason === null) {
           this.$message.warning('请选择缺陷原因')
           return
         }
-        if (
-          typeof this.statusDialogForm.repairResult === 'undefined' ||
-          this.statusDialogForm.repairResult === null
-        ) {
+        if (typeof this.statusDialogForm.repairResult === 'undefined' || this.statusDialogForm.repairResult === null) {
           this.$message.warning('请选择修复结果')
           return
         }
@@ -1405,10 +1367,9 @@ export default {
           this.$message.warning('请输入Reopen原因')
           return
         }
-        this.postDialogForm()
-          .then(res => {
-            this.getCommentList()
-          })
+        this.postDialogForm().then(res => {
+          this.getCommentList()
+        })
         // this.addComment()
         this.statusDialogVisible = false
       }