|
@@ -110,32 +110,49 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div slot="footer" class="box-justify">
|
|
|
- <div>
|
|
|
- <el-button
|
|
|
- type="default"
|
|
|
- icon="el-icon-caret-left"
|
|
|
- :disabled="prevDisabled"
|
|
|
- @click="toPrev"
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- type="default"
|
|
|
- icon="el-icon-caret-right"
|
|
|
- :disabled="nextDisabled"
|
|
|
- @click="toNext"
|
|
|
- ></el-button>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-button
|
|
|
- plain
|
|
|
- class="maintain"
|
|
|
- type="danger"
|
|
|
- @click="$emit('notPass', question.id)"
|
|
|
- >不通过</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" @click="$emit('pass', question.id)"
|
|
|
- >通过</el-button
|
|
|
- >
|
|
|
+ <div slot="footer">
|
|
|
+ <el-form
|
|
|
+ ref="modalFormComp"
|
|
|
+ :model="modalForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="审核意见" prop="auditRemark">
|
|
|
+ <el-input
|
|
|
+ v-model="modalForm.auditRemark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ maxlength="200"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="box-justify">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="default"
|
|
|
+ icon="el-icon-caret-left"
|
|
|
+ :disabled="prevDisabled"
|
|
|
+ @click="toPrev"
|
|
|
+ ></el-button>
|
|
|
+ <el-button
|
|
|
+ type="default"
|
|
|
+ icon="el-icon-caret-right"
|
|
|
+ :disabled="nextDisabled"
|
|
|
+ @click="toNext"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ plain
|
|
|
+ class="maintain"
|
|
|
+ type="danger"
|
|
|
+ @click="submit('NOT_PASS', question.id)"
|
|
|
+ >不通过</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="submit('PASS', question.id)"
|
|
|
+ >通过</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- <el-button @click="cancel">关闭</el-button> -->
|
|
|
</div>
|
|
@@ -144,7 +161,7 @@
|
|
|
|
|
|
<script>
|
|
|
import QuestionAnswer from "./QuestionAnswer.vue";
|
|
|
-
|
|
|
+import { auditQuestionApi } from "../api";
|
|
|
export default {
|
|
|
name: "QuestionPreviewLoopDialog",
|
|
|
components: { QuestionAnswer },
|
|
@@ -179,6 +196,25 @@ export default {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
question: {},
|
|
|
+ modalForm: {
|
|
|
+ auditRemark: "",
|
|
|
+ auditResult: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ auditRemark: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ console.log(value, this.modalForm.auditResult);
|
|
|
+ if (this.modalForm.auditResult === "NOT_PASS" && !value) {
|
|
|
+ return callback(new Error(`请输入审核意见`));
|
|
|
+ }
|
|
|
+
|
|
|
+ callback();
|
|
|
+ },
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -224,6 +260,20 @@ export default {
|
|
|
const typeQuestion = ["PARAGRAPH_MATCHING", "BANKED_CLOZE"];
|
|
|
return typeQuestion.includes(questionType);
|
|
|
},
|
|
|
+ async submit(type, id) {
|
|
|
+ this.modalForm.auditResult = type;
|
|
|
+ const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
+ if (!valid) return;
|
|
|
+
|
|
|
+ let datas = { ...this.modalForm };
|
|
|
+ datas.questionIds = [id].join();
|
|
|
+ const res = await auditQuestionApi(datas).catch(() => {});
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.cancel();
|
|
|
+ this.$bus.emit("updateBadge");
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|