hand.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div>
  3. <el-form :model="quitForm" ref="quitForm" :rules="quitRules">
  4. <el-form-item prop="disposeContent">
  5. <el-input
  6. type="textarea"
  7. v-model="quitForm.disposeContent"
  8. maxlength="99"
  9. show-word-limit
  10. placeholder="请填写处理意见"
  11. ></el-input>
  12. </el-form-item>
  13. </el-form>
  14. <div slot="footer" class="dialog-footer" style="text-align: right">
  15. <el-button @click="$emit('close')">取 消</el-button>
  16. <el-button type="primary" @click="submit">确 定</el-button>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import { teacherAttendanceUpdate } from "../api";
  22. export default {
  23. props: ["detail"],
  24. data() {
  25. return {
  26. quitForm: {
  27. disposeContent: '',
  28. },
  29. quitRules: {
  30. disposeContent: [{ required: true, message: "请填写退团退费原因" }],
  31. },
  32. };
  33. },
  34. mounted() {
  35. // console.log(this.detail.teacherAttendance.disposeContent);
  36. if (this.detail?.teacherAttendance?.disposeContent) {
  37. this.$set(
  38. this.quitForm,
  39. "disposeContent",
  40. this.detail.teacherAttendance.disposeContent
  41. );
  42. // this.quitForm.reason = this.detail?.teacherAttendance?.disposeContent
  43. }
  44. if(this.detail?.disposeContent){
  45. this.$set(
  46. this.quitForm,
  47. "disposeContent",
  48. this.detail.disposeContent
  49. );
  50. }
  51. },
  52. methods: {
  53. submit() {
  54. this.$refs.quitForm.validate(async (valid) => {
  55. if (valid) {
  56. try {
  57. await teacherAttendanceUpdate({
  58. id: this.detail.teacherAttendanceId,
  59. ...this.quitForm,
  60. });
  61. this.$emit("close");
  62. this.$emit("submited");
  63. this.$message.success("提交成功");
  64. } catch (error) {}
  65. }
  66. });
  67. },
  68. },
  69. };
  70. </script>