AuditPaper.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <el-form label-width="120px">
  3. <el-form-item label="审核结果">
  4. <el-select v-model="auditForm.auditResult" disabled>
  5. <el-option label="通过" value="PASS"></el-option>
  6. <el-option label="不通过" value="NOT_PASS"></el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="审核意见" style="margin-top: 15px">
  10. <el-input
  11. v-model="auditForm.auditRemark"
  12. type="textarea"
  13. placeholder="请输入内容"
  14. maxlength="200"
  15. ></el-input>
  16. </el-form-item>
  17. <div class="text-center" style="margin-top: 10px">
  18. <el-button type="primary" @click="submitAudit">确定</el-button>
  19. </div>
  20. </el-form>
  21. </template>
  22. <script>
  23. import { QUESTION_API } from "@/constants/constants.js";
  24. import { mapState } from "vuex";
  25. export default {
  26. props: {
  27. paperIds: {
  28. type: Array,
  29. default: () => [],
  30. },
  31. auditResult: {
  32. type: String,
  33. default: "",
  34. },
  35. },
  36. data() {
  37. return {
  38. auditForm: { paperIds: [], auditResult: "", auditRemark: "" },
  39. loading: false,
  40. };
  41. },
  42. computed: {
  43. ...mapState({ user: (state) => state.user }),
  44. },
  45. //初始化查询
  46. created() {
  47. this.init();
  48. },
  49. methods: {
  50. init() {
  51. this.auditForm.paperIds = this.paperIds;
  52. this.auditForm.auditResult = this.auditResult;
  53. },
  54. submitAudit() {
  55. this.$http
  56. .post(
  57. QUESTION_API + "/paper/audit",
  58. new URLSearchParams(this.auditForm)
  59. )
  60. .then(() => {
  61. this.$notify({
  62. message: "保存成功",
  63. type: "success",
  64. });
  65. this.loading = false;
  66. this.$emit("afterAudit");
  67. })
  68. .catch((err) => {
  69. this.loading = false;
  70. this.$notify({
  71. type: "error",
  72. message: err.response.data.desc,
  73. });
  74. this.$emit("afterAudit");
  75. });
  76. },
  77. },
  78. };
  79. </script>