|
|
@@ -150,6 +150,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</primary-question-card>
|
|
|
+
|
|
|
+ <el-dialog title="审核不通过原因" v-model="checkDialogVisible" width="30%" center
|
|
|
+ :before-close="handleCheckDialogClose">
|
|
|
+ <el-space direction="vertical">
|
|
|
+ <el-space direction="vertical" :fill="true">
|
|
|
+ <el-checkbox-group v-model="failCheckList">
|
|
|
+ <el-checkbox v-for="(item, index) in failCheckOption" :label="item" class="fail-check-option"/>
|
|
|
+ </el-checkbox-group>
|
|
|
+ <el-input v-model="failCheckInput" placeholder="请输入原因"/>
|
|
|
+ </el-space>
|
|
|
+ <el-button type="primary" @click="deny">提交</el-button>
|
|
|
+ </el-space>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -236,10 +249,30 @@ export default {
|
|
|
// 新旧题目的解析是否相同
|
|
|
isAnalysisEqual() {
|
|
|
return this.oldQuestionVO.analysis === this.newQuestionVO.analysis;
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ denyReason() {
|
|
|
+ let denyReason = "";
|
|
|
+ for (let reason of this.failCheckList) {
|
|
|
+ denyReason += reason + ", ";
|
|
|
+ }
|
|
|
+ denyReason += this.failCheckInput;
|
|
|
+ return denyReason;
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ checkDialogVisible: false,
|
|
|
+ // 审核失败的原因
|
|
|
+ failCheckOption: [
|
|
|
+ '题目中存在错误', '题目与相关内容无关', '题目中存在敏感词', '其他'
|
|
|
+ ],
|
|
|
+ failCheckInput: "",
|
|
|
+ failCheckList: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
map,
|
|
|
|
|
|
@@ -299,43 +332,95 @@ export default {
|
|
|
|
|
|
// 审核不通过更新的题目
|
|
|
disapproveQuestion() {
|
|
|
- const _this = this;
|
|
|
- _this.oldQuestionVO.state = "APPROVED";
|
|
|
+ this.checkDialogVisible = true;
|
|
|
+ // const _this = this;
|
|
|
+ // _this.oldQuestionVO.state = "APPROVED";
|
|
|
+ // let record = {
|
|
|
+ // userId: store.state.user.id,
|
|
|
+ // operationType: "Refuse",
|
|
|
+ // }
|
|
|
+ // _this.$api.updateQuestion(_this.oldQuestionVO)
|
|
|
+ // .then(res => {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'error',
|
|
|
+ // message: '修改审核不通过!'
|
|
|
+ // });
|
|
|
+ // console.log("UpdatingQuestionCard-refuse");
|
|
|
+ // console.log(res);
|
|
|
+ // record.questionId = res.data.result.id;
|
|
|
+ // record.time = new Date();
|
|
|
+ // // 审核通过,添加操作记录
|
|
|
+ // _this.$api.createRecord(record)
|
|
|
+ // .then(res1 => {
|
|
|
+ // console.log("Updating-refuse-createRecord");
|
|
|
+ // console.log(res1);
|
|
|
+ // }).catch(err1 => {
|
|
|
+ // console.log(err1);
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // _this.$notify.error({
|
|
|
+ // title: '错误',
|
|
|
+ // message: '通过失败'
|
|
|
+ // });
|
|
|
+ // console.log(err);
|
|
|
+ // });
|
|
|
+ // _this.$api.deleteQuestionById(_this.newQuestionVO.id).then(res => {
|
|
|
+ // console.log("中间状态题目删除成功");
|
|
|
+ // }).catch(err => {
|
|
|
+ // console.log(err);
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 关闭审核dialog前的方法
|
|
|
+ handleCheckDialogClose(done) {
|
|
|
+ const _this = this
|
|
|
+ _this.$confirm('此操作将丢失填写信息, 是否继续?', '提示')
|
|
|
+ .then(() => {
|
|
|
+ _this.failCheckList = []
|
|
|
+ _this.failCheckInput = ""
|
|
|
+ done()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 拒绝通过
|
|
|
+ deny() {
|
|
|
+ let reason = this.denyReason
|
|
|
+ this.questionvo.state = "REFUSED";
|
|
|
let record = {
|
|
|
userId: store.state.user.id,
|
|
|
operationType: "Refuse",
|
|
|
}
|
|
|
- _this.$api.updateQuestion(_this.oldQuestionVO)
|
|
|
+ this.$api.updateQuestion(this.oldQuestionVO)
|
|
|
.then(res => {
|
|
|
- _this.$message({
|
|
|
- type: 'error',
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
message: '修改审核不通过!'
|
|
|
});
|
|
|
- console.log("UpdatingQuestionCard-refuse");
|
|
|
+ console.log("checkQuestionCard-deny")
|
|
|
console.log(res);
|
|
|
record.questionId = res.data.result.id;
|
|
|
record.time = new Date();
|
|
|
- // 审核通过,添加操作记录
|
|
|
- _this.$api.createRecord(record)
|
|
|
+ record.remark = reason;
|
|
|
+ // 审核拒绝,添加操作记录
|
|
|
+ this.$api.createRecord(record)
|
|
|
.then(res1 => {
|
|
|
- console.log("Updating-refuse-createRecord");
|
|
|
+ console.log("checkQuestionCard-deny-createRecord");
|
|
|
console.log(res1);
|
|
|
}).catch(err1 => {
|
|
|
console.log(err1);
|
|
|
})
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- _this.$notify.error({
|
|
|
+ this.$notify.error({
|
|
|
title: '错误',
|
|
|
- message: '通过失败'
|
|
|
+ message: '拒绝失败'
|
|
|
});
|
|
|
console.log(err);
|
|
|
- });
|
|
|
- _this.$api.deleteQuestionById(_this.newQuestionVO.id).then(res => {
|
|
|
- console.log("中间状态题目删除成功");
|
|
|
- }).catch(err => {
|
|
|
- console.log(err);
|
|
|
- })
|
|
|
+ })
|
|
|
+ this.failCheckList = []
|
|
|
+ this.failCheckInput = ""
|
|
|
+ this.checkDialogVisible = false
|
|
|
},
|
|
|
|
|
|
mockDisapproveQuestion() {
|