reviewfinance.vue 1.9 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.settleReason" 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(false)" type="primary" danger>审核驳回</a-button>
  18. <a-button type="primary" @click="onsubmit(true)">审核通过</a-button>
  19. </a-spin>
  20. </template>
  21. </a-modal>
  22. </template>
  23. <script setup>
  24. import {message} from 'ant-design-vue';
  25. import bizSettleApi from '@/api/biz/bizSettleApi'
  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 === false) {
  42. if (!formData.value.settleReason) {
  43. message.error('审核驳回时,备注信息不能为空')
  44. return
  45. }
  46. }
  47. submitLoading.value = true
  48. formData.value.auditFlag = flag
  49. bizSettleApi.auditFinance(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>