review.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.auditReason" 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 bizOrderApi from '@/api/biz/bizOrderApi'
  26. import bizRecordApi from "@/api/biz/bizRecordApi";
  27. const emit = defineEmits({successful: null})
  28. const visible = ref(false);
  29. const submitLoading = ref(false)
  30. const labelCol = ref({span: 4})
  31. // 表单数据
  32. const formData = ref({})
  33. const showModal = (id) => {
  34. formData.value.id = id
  35. visible.value = true;
  36. };
  37. const onClose = () => {
  38. formData.value = {}
  39. visible.value = false
  40. };
  41. const onsubmit = (flag) => {
  42. if (flag === true) {
  43. if (!formData.value.auditReason) {
  44. message.error('审核驳回时,备注信息不能为空')
  45. return
  46. }
  47. }
  48. submitLoading.value = true
  49. formData.value.auditFlag = flag
  50. bizRecordApi.auditRecord(formData.value).then(() => {
  51. onClose()
  52. emit('successful', null)
  53. }).finally(() => {
  54. submitLoading.value = false
  55. })
  56. }
  57. // 抛出函数
  58. defineExpose({
  59. showModal
  60. })
  61. </script>
  62. <style scoped>
  63. </style>