fix(用例评审):用例评审输入评论后无法从通过切换为未通过

--bug=1010120 --user=李敏 [测试跟踪]github #10249用例评审评论展示错乱 https://www.tapd.cn/55049933/s/1108872
This commit is contained in:
limin-fit2 2022-02-25 14:33:04 +08:00 committed by jianxing
parent 99a69b1c4d
commit 1e3e6a83de
1 changed files with 23 additions and 10 deletions

View File

@ -216,7 +216,7 @@ export default {
hasZentaoId: false,
formLabelWidth: '100px',
isCustomFiledActive: false,
oldReviewStatus: 'Pass'
oldReviewStatus: 'Prepare'
};
},
props: {
@ -294,29 +294,34 @@ export default {
param.reviewId = this.testCase.reviewId;
param.status = status;
if (status === 'UnPass') {
if ((this.testCase.reviewStatus === 'Pass' || this.testCase.reviewStatus === 'Prepare') && this.$refs.reviewComment.form.description.length < 1) {
this.oldReviewStatus = this.testCase.reviewStatus;
this.testCase.reviewStatus = status;
this.testCase.reviewStatus = 'UnPass';
//
if (this.oldReviewStatus === 'Prepare' && this.comments.length < 1) {
this.$refs.reviewComment.inputLight();
this.$warning(this.$t('test_track.comment.description_is_null'));
} else if (this.$refs.reviewComment.form.description.length > 0) {
//
this.$refs.reviewComment.inputLight();
this.$warning(this.$t('test_track.comment.submit_description'));
} else if (this.comments.length > 0) {
this.oldReviewStatus = this.testCase.reviewStatus;
this.testCase.reviewStatus = status;
} else if (this.oldReviewStatus === 'Pass') {
//
this.$refs.reviewComment.inputLight();
this.$warning(this.$t('test_track.comment.description_is_null'));
} else {
//
this.$post('/test/review/case/edit', param, () => {
this.$success(this.$t('commons.save_success'));
this.updateTestCases(param);
this.setReviewStatus(this.testCase.reviewId);
this.testCase.reviewStatus = status;
//
this.testCases[this.index].reviewStatus = status;
//
this.oldReviewStatus = status;
if (this.index < this.testCases.length - 1) {
this.handleNext();
}
});
} else {
this.$refs.reviewComment.inputLight();
this.$warning(this.$t('test_track.comment.description_is_null'));
}
} else {
this.$post('/test/review/case/edit', param, () => {
@ -324,10 +329,13 @@ export default {
this.updateTestCases(param);
this.setReviewStatus(this.testCase.reviewId);
this.testCase.reviewStatus = status;
//
this.testCases[this.index].reviewStatus = status;
if (this.index < this.testCases.length - 1) {
this.handleNext();
}
//
this.oldReviewStatus = status;
});
}
},
@ -342,6 +350,7 @@ export default {
this.updateTestCases(param);
this.setReviewStatus(this.testCase.reviewId);
this.oldReviewStatus = status;
//
this.testCases[this.index].reviewStatus = status;
if (this.index < this.testCases.length - 1) {
this.handleNext();
@ -395,7 +404,9 @@ export default {
parseCustomField(item, this.testCaseTemplate, null, buildTestCaseOldFields(item));
this.isCustomFiledActive = true;
this.testCase = item;
this.oldReviewStatus = this.testCase.reviewStatus;
if (!this.testCase.actualResult) {
// ,使
this.testCase.actualResult = this.testCaseTemplate.actualResult;
}
this.getComments(item);
@ -418,6 +429,8 @@ export default {
},
openTestCaseEdit(testCase, tableData) {
this.showDialog = true;
//
this.oldReviewStatus = testCase.reviewStatus;
this.activeTab = 'detail';
this.getComments(testCase);
this.hasTapdId = false;