ConferenceForm.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="document-form">
  3. <uv-loading-icon v-if="loading" mode="circle" text="正在加载学术会议详情..."></uv-loading-icon>
  4. <template v-else-if="form">
  5. <!-- 基本信息 -->
  6. <CommonSection title="基本信息" :isFirst="true">
  7. <CommonInfoRow label="会议名称" :value="form.codTitle" />
  8. <CommonInfoRow label="会议类型" :value="getLecTypeLabel(form.codType)" />
  9. <CommonInfoRow label="主办单位" :value="form.codOrganizer" />
  10. <CommonInfoRow label="会议日期" :value="formatDate(form.codStartTime) + '~~' + formatDate(form.codEndTime)" />
  11. <CommonInfoRow label="主讲人" :value="form.applicantName" />
  12. <CommonInfoRow label="会议地址" :value="form.codAddress" />
  13. <CommonInfoRow label="所属平台" isColumn>
  14. <view class="platform-tags">
  15. <template v-if="platformList.length > 0">
  16. <uv-tags v-for="(p, index) in platformList" :key="index" :text="p.platformName === '其他' ? '其他' : (p.platformType ? p.platformName + ' (' + p.platformType + ')' : p.platformName)" type="primary" plain size="mini" class="mr5"></uv-tags>
  17. </template>
  18. <text v-else>-</text>
  19. </view>
  20. </CommonInfoRow>
  21. <CommonInfoRow label="所属团队" :value="form.belongTeam || '-'" isColumn />
  22. <CommonInfoRow label="审批状态" :value="getApprovalStatusLabel(form.approvalStatus)" />
  23. <CommonInfoRow label="会议简介" :value="form.codBriefInfo" isColumn />
  24. </CommonSection>
  25. <!-- 学术贡献 -->
  26. <CommonSection title="学术贡献">
  27. <CommonInfoRow label="论文题目" :value="form.paperName" />
  28. <CommonInfoRow label="第一作者" :value="form.firstName" />
  29. <CommonInfoRow label="通讯作者" :value="form.phoneName" />
  30. <CommonInfoRow label="交流方式" :value="getDictLabel('sci_communicate_type', form.communicateType)" />
  31. <CommonInfoRow label="论文摘要" :value="form.paperSummary" isColumn />
  32. </CommonSection>
  33. <!-- 相关附件 -->
  34. <AttachmentList :list="uploadList" title="相关附件" />
  35. <!-- 审批信息 -->
  36. <CommonSection title="审批信息" v-if="form.id">
  37. <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_academic_conferences" />
  38. </CommonSection>
  39. </template>
  40. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  41. </view>
  42. </template>
  43. <script setup lang="ts">
  44. import { ref, onMounted, watch, computed } from 'vue';
  45. import { useDict } from '@/hooks/useDict';
  46. import { useDocumentApi } from '@/api/document';
  47. import { formatDate } from '@/utils/date';
  48. import to from 'await-to-js';
  49. import AttachmentList from './AttachmentList.vue';
  50. import FlowTable from '@/pages/project/components/detail/FlowTable.vue';
  51. import CommonSection from '@/components/ui/CommonSection.vue';
  52. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  53. const props = defineProps<{
  54. code: string;
  55. }>();
  56. const { getDictLabel } = useDict('sci_communicate_type');
  57. const documentApi = useDocumentApi();
  58. const form = ref<any>(null);
  59. const loading = ref(false);
  60. const LecTypeList = [
  61. { value: '50', label: '院内会议' },
  62. { value: '10', label: '学校会议' },
  63. { value: '20', label: '省级会议' },
  64. { value: '30', label: '国内学术会议' },
  65. { value: '40', label: '国际学术会议' }
  66. ];
  67. const getLecTypeLabel = (value: string | number) => {
  68. const item = LecTypeList.find(i => i.value === String(value));
  69. return item ? item.label : (value || '-');
  70. };
  71. const getApprovalStatusLabel = (status: string | number) => {
  72. const map: Record<string, string> = {
  73. '10': '待提交',
  74. '20': '审批中',
  75. '30': '审批通过',
  76. '40': '审批退回'
  77. };
  78. return map[String(status)] || '-';
  79. };
  80. const platformList = computed(() => {
  81. if (form.value?.belongPlatform) {
  82. try {
  83. const data = JSON.parse(form.value.belongPlatform);
  84. return Array.isArray(data) ? data : [];
  85. } catch (e) {
  86. if (form.value.belongPlatform === '其他') return [{ platformName: '其他' }];
  87. return [{ platformName: form.value.belongPlatform }];
  88. }
  89. }
  90. return [];
  91. });
  92. const uploadList = computed(() => {
  93. if (!form.value) return [];
  94. const list = [];
  95. try {
  96. if (form.value.codNotice) {
  97. const notice = JSON.parse(form.value.codNotice);
  98. if (notice && notice.url) {
  99. list.push({ ...notice, type: '会议通知' });
  100. }
  101. }
  102. if (form.value.codDocument) {
  103. const doc = JSON.parse(form.value.codDocument);
  104. if (doc && doc.url) {
  105. list.push({ ...doc, type: '相关文档' });
  106. }
  107. }
  108. } catch (e) {
  109. console.error('Failed to parse attachment JSON', e);
  110. }
  111. return list;
  112. });
  113. const fetchData = async () => {
  114. if (!props.code) return;
  115. loading.value = true;
  116. const [err, res] = await to(documentApi.getConferenceById(props.code));
  117. if (!err && res?.data) {
  118. form.value = res.data;
  119. }
  120. loading.value = false;
  121. };
  122. onMounted(() => {
  123. fetchData();
  124. });
  125. watch(() => props.code, () => {
  126. fetchData();
  127. });
  128. </script>
  129. <style lang="scss" scoped>
  130. @import "./common.scss";
  131. </style>