RegistrationReview.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <el-dialog
  3. :visible.sync="visible"
  4. v-bind="modalOptions"
  5. append-to-body
  6. >
  7. <el-form
  8. ref="formData"
  9. :model="formData"
  10. :rules="formRules"
  11. size="mini"
  12. label-suffix=":"
  13. label-width="150px"
  14. >
  15. <el-form-item label="报名ID" prop="signId">
  16. <el-input
  17. v-model="formData.signId" maxlength="20" placeholder="报名ID" disabled
  18. />
  19. </el-form-item>
  20. <el-form-item label="审核状态" prop="state">
  21. <el-radio-group v-model="formData.state">
  22. <el-radio label="1">报名成功</el-radio>
  23. <el-radio label="2">报名失败</el-radio>
  24. </el-radio-group>
  25. </el-form-item>
  26. <el-form-item label="备注" prop="remark">
  27. <el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" maxlength="520" :rows="3" show-word-limit />
  28. </el-form-item>
  29. </el-form>
  30. <template #footer>
  31. <span class="dialog-footer">
  32. <el-button size="mini" @click="handleClose">取 消</el-button>
  33. <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
  34. </span>
  35. </template>
  36. </el-dialog>
  37. </template>
  38. <script>
  39. import { activExamine } from '@/api/active'
  40. export default {
  41. name: 'RegistrationReview',
  42. components: {
  43. },
  44. data() {
  45. return {
  46. modalOptions: {
  47. closeOnClickModal: false,
  48. width: '620px',
  49. title: ''
  50. },
  51. visible: false,
  52. formData: {
  53. signId: '', // 报名id
  54. state: '1', // 审核状态 1-报名成功 2-报名失败
  55. remark: '' // 备注
  56. },
  57. formRules: {
  58. signId: [
  59. { required: true, message: '缺少报名信息' }
  60. ],
  61. state: [
  62. { required: true, message: '请选择状态' }
  63. ],
  64. remark: [
  65. { required: false, message: '请输入备注' }
  66. ]
  67. }
  68. }
  69. },
  70. methods: {
  71. handleClose() {
  72. this.visible = false
  73. },
  74. initList() {
  75. },
  76. handleOpen(params = {}) {
  77. this.$refs.formData && this.$refs.formData.resetFields()
  78. this.modalOptions.title = '店铺的报名审核'
  79. this.formData.signId = params.signId
  80. // this.formData = Object.assign(this.$options.data().formData, params)
  81. this.visible = true
  82. this.initList()
  83. },
  84. handleSubmit() {
  85. this.$refs.formData.validate(async (valid) => {
  86. if (valid) {
  87. const loading = this.$loading({ text: '加载中' })
  88. try {
  89. const { ...otps } = this.formData
  90. const params = {
  91. ...otps
  92. }
  93. await activExamine(params)
  94. loading.close()
  95. this.$message({ message: `处理成功!`, type: 'success' })
  96. this.$emit('success')
  97. this.visible = false
  98. } catch (e) {
  99. loading.close()
  100. } finally {
  101. loading.close()
  102. }
  103. } else {
  104. this.$message({ message: '请输入相关信息', type: 'warning' })
  105. return false
  106. }
  107. })
  108. }
  109. }
  110. }
  111. </script>