AuditPaper.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <el-form>
  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. ></el-input>
  15. </el-form-item>
  16. <div class="text-center" style="margin-top: 10px">
  17. <el-button type="primary" @click="submitAudit">确定</el-button>
  18. </div>
  19. </el-form>
  20. </template>
  21. <script>
  22. import { QUESTION_API } from "@/constants/constants.js";
  23. import { mapState } from "vuex";
  24. export default {
  25. props: {
  26. paperIds: {
  27. type: Array,
  28. default: () => [],
  29. },
  30. auditResult: {
  31. type: String,
  32. default: "",
  33. },
  34. },
  35. data() {
  36. return {
  37. auditForm: { paperIds: [], auditResult: "", auditRemark: "" },
  38. loading: false,
  39. };
  40. },
  41. computed: {
  42. ...mapState({ user: (state) => state.user }),
  43. },
  44. //初始化查询
  45. created() {
  46. this.init();
  47. },
  48. methods: {
  49. init() {
  50. this.auditForm.paperIds = this.paperIds;
  51. this.auditForm.auditResult = this.auditResult;
  52. },
  53. submitAudit() {
  54. this.$http
  55. .post(
  56. QUESTION_API + "/paper/audit",
  57. new URLSearchParams(this.auditForm)
  58. )
  59. .then(() => {
  60. this.$notify({
  61. message: "保存成功",
  62. type: "success",
  63. });
  64. this.loading = false;
  65. this.$emit("afterAudit");
  66. })
  67. .catch((err) => {
  68. this.loading = false;
  69. this.$notify({
  70. type: "error",
  71. message: err.response.data.desc,
  72. });
  73. });
  74. },
  75. },
  76. };
  77. </script>
  78. <style scoped src="../styles/Common.css"></style>