InitiativeProcessInstance.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <Dialog
  3. v-model="dialogVisible"
  4. title="标本出库申请驳回原因:"
  5. width="800"
  6. v-loading="formLoading">
  7. <el-form
  8. ref="initiativeFormRef"
  9. v-loading="formLoading"
  10. v-if="outboundData"
  11. >
  12. <text>{{ outboundData.processInstanceId }}</text>
  13. </el-form>
  14. <template #footer>
  15. <el-button @click="close">关闭</el-button>
  16. </template>
  17. </Dialog>
  18. </template>
  19. <script setup lang="ts">
  20. import {ref} from "vue";
  21. import {SpecimenOutboundApi} from '@/api/museums/specimenoutbound'
  22. defineOptions({name: 'InitiativeProcessInstance'})
  23. const formLoading = ref(false) // 表单的加载中
  24. const dialogVisible = ref(false) // 弹窗的是否展示
  25. const formType = ref('')
  26. const {query} = useRoute() // 查询参数
  27. let outboundData = ref(null)
  28. /** 打开弹窗 */
  29. const open = async (type: string, id?: number) => {
  30. dialogVisible.value = true
  31. formType.value = type
  32. if (id) {
  33. formLoading.value = true
  34. try {
  35. const data = await SpecimenOutboundApi.getSpecimenOutboundPage(id)
  36. formData.value = data;
  37. console.log(data)
  38. } finally {
  39. formLoading.value = false
  40. }
  41. }
  42. }
  43. defineExpose({open}) // 提供 open 方法,用于打开弹窗
  44. /** 关闭弹窗 */
  45. const close = () => {
  46. dialogVisible.value = false;
  47. };
  48. const formData = ref({
  49. infoId: undefined,
  50. processInstanceId: undefined,
  51. })
  52. /**查看驳回信息*/
  53. const fetchData = async () => {
  54. try {
  55. console.log(query.dataId)
  56. let res: any = await SpecimenOutboundApi.getSpecimenOutboundPage(query.dataId)
  57. console.log(res)
  58. outboundData.value = res
  59. console.log(outboundData.value)
  60. } finally {
  61. }
  62. }
  63. // // 在组件加载时获取数据
  64. onMounted(async () => {
  65. await fetchData()
  66. })
  67. </script>