end.vue 1.8 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.endReason" 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 type="primary" @click="onsubmit(true)">结束</a-button>
  18. </a-spin>
  19. </template>
  20. </a-modal>
  21. </template>
  22. <script setup>
  23. import {message} from 'ant-design-vue';
  24. import bizOrderApi from '@/api/biz/bizOrderApi'
  25. import bizLoadAppointApi from "@/api/biz/bizLoadAppointApi";
  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.endReason) {
  43. message.error('结束时,说明信息不能为空')
  44. return
  45. }
  46. }
  47. submitLoading.value = true
  48. formData.value.auditFlag = flag
  49. bizLoadAppointApi.endLoad(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>