hand.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <el-form :model="quitForm" ref="quitForm" :rules="quitRules">
  4. <el-form-item prop="disposeContent">
  5. <el-input type="textarea" v-model.trim="quitForm.disposeContent" placeholder="请填写处理意见"></el-input>
  6. </el-form-item>
  7. </el-form>
  8. <div slot="footer" class="dialog-footer" style="text-align: right;">
  9. <el-button @click="$emit('close')">取 消</el-button>
  10. <el-button type="primary" @click="submit">确 定</el-button>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import { teacherAttendanceUpdate } from '../api'
  16. export default {
  17. props: ['detail'],
  18. data() {
  19. return {
  20. quitForm: {
  21. reason: null,
  22. },
  23. quitRules: {
  24. reason: [{ required: true, message: "请填写退团退费原因" }],
  25. },
  26. }
  27. },
  28. methods: {
  29. submit() {
  30. this.$refs.quitForm.validate(async valid => {
  31. if (valid) {
  32. try {
  33. await teacherAttendanceUpdate({
  34. id: this.detail.id,
  35. ...this.quitForm
  36. })
  37. this.$emit('close')
  38. this.$emit('submited')
  39. this.$message.success("提交成功")
  40. } catch (error) {}
  41. }
  42. })
  43. }
  44. }
  45. }
  46. </script>