review.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <a-modal v-model:visible="visible" title="审核">
  3. <a-form ref="formRef" :label-col="labelCol" :model="formData" layout="horizontal">
  4. <a-form-item v-show="false">
  5. <a-input v-model:value="formData.id"></a-input>
  6. </a-form-item>
  7. <a-form-item
  8. label="审核备注"
  9. name="auditingRemark"
  10. >
  11. <a-textarea v-model:value="formData.appointmentReason" placeholder="请输入审核备注"
  12. :auto-size="{ minRows: 3, maxRows: 5 }"/>
  13. </a-form-item>
  14. </a-form>
  15. <template #footer>
  16. <a-spin :spinning="submitLoading">
  17. <a-button style="margin-right: 8px" @click="onsubmit(true)" type="primary" danger>审核驳回</a-button>
  18. <a-button type="primary" @click="onsubmit(false)">审核通过</a-button>
  19. </a-spin>
  20. </template>
  21. </a-modal>
  22. </template>
  23. <script setup>
  24. import {message} from 'ant-design-vue';
  25. import bizAppointmentRecordApi from '@/api/biz/bizAppointmentRecordApi'
  26. const emit = defineEmits({successful: null})
  27. const visible = ref(false);
  28. const submitLoading = ref(false)
  29. const labelCol = ref({span: 4})
  30. // 表单数据
  31. const formData = ref({})
  32. const showModal = (id) => {
  33. formData.value.id = id
  34. visible.value = true;
  35. };
  36. const onClose = () => {
  37. formData.value = {}
  38. visible.value = false
  39. };
  40. const onsubmit = (flag) => {
  41. if (flag === true) {
  42. if (!formData.value.appointmentReason) {
  43. message.error('审核驳回时,备注信息不能为空')
  44. return
  45. }
  46. }
  47. submitLoading.value = true
  48. formData.value.auditFlag = flag
  49. bizAppointmentRecordApi.auditTemp(formData.value).then(() => {
  50. onClose()
  51. emit('successful', null)
  52. }).finally(() => {
  53. submitLoading.value = false
  54. })
  55. }
  56. // 抛出函数
  57. defineExpose({
  58. showModal
  59. })
  60. </script>
  61. <style scoped>
  62. </style>