CopyrightForm.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.copyrightCode" />
  8. <CommonInfoRow label="著作权名称" :value="form.copyrightName" />
  9. <CommonInfoRow label="登记号" :value="form.registerCode" />
  10. <CommonInfoRow label="著作权类型" :value="getDictLabel('sci_copyright_type', form.copyrightType)" />
  11. <CommonInfoRow label="学科门类" :value="getDictLabel('subj_category', form.subjCategory)" />
  12. <CommonInfoRow label="一级学科" :value="form.disciplineName" />
  13. <CommonInfoRow label="所属单位" :value="form.deptName" />
  14. <CommonInfoRow label="出版日期" :value="formatDate(form.publicationDate)" />
  15. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  16. </CommonSection>
  17. <!-- 作者信息 -->
  18. <CommonSection title="作者信息" v-if="form.memberList?.length">
  19. <view class="member-list">
  20. <view class="member-item" v-for="(member, index) in form.memberList" :key="index">
  21. <view class="member-header">
  22. <view class="m-left">
  23. <text class="m-name">{{ member.memberName }}</text>
  24. <text class="m-type-tag blue">{{ getDictLabel('sci_paper_author_type', member.memberType) }}</text>
  25. </view>
  26. <text class="m-tag" v-if="member.signOrder">署名顺序: {{ member.signOrder }}</text>
  27. </view>
  28. <view class="m-body">
  29. <view class="m-line"><text class="l">职工号/学号:</text><text class="v">{{ member.memberCode || '-' }}</text></view>
  30. <view class="m-line">
  31. <text class="l">性别:</text>
  32. <text class="v">{{ member.gender === '10' ? '男' : member.gender === '20' ? '女' : '-' }}</text>
  33. </view>
  34. <view class="m-line">
  35. <text class="l">学历:</text>
  36. <text class="v">{{ getDictLabel('sci_academic_degree', member.educated) }}</text>
  37. </view>
  38. <view class="m-line">
  39. <text class="l">职称:</text>
  40. <text class="v">{{ getDictLabel('sci_discipline_job_title', member.technicalTitle) }}</text>
  41. </view>
  42. <view class="m-line"><text class="l">单位/学校:</text><text class="v">{{ member.deptName || '-' }}</text></view>
  43. <view class="m-line"><text class="l">贡献率:</text><text class="v">{{ member.contributionRate || 0 }}%</text></view>
  44. </view>
  45. </view>
  46. </view>
  47. </CommonSection>
  48. <!-- 附件信息 -->
  49. <AttachmentList :list="mergedFileList" title="审批附件" />
  50. </template>
  51. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  52. </view>
  53. </template>
  54. <script setup lang="ts">
  55. import { ref, onMounted, watch, computed } from 'vue';
  56. import { useDict } from '@/hooks/useDict';
  57. import { useDocumentApi } from '@/api/document';
  58. import { formatDate } from '@/utils/date';
  59. import to from 'await-to-js';
  60. import CommonSection from '@/components/ui/CommonSection.vue';
  61. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  62. import AttachmentList from './AttachmentList.vue';
  63. const props = defineProps<{
  64. code: string;
  65. }>();
  66. const { getDictLabel } = useDict(
  67. 'sci_copyright_type',
  68. 'subj_category',
  69. 'sci_paper_author_type',
  70. 'sci_academic_degree',
  71. 'sci_discipline_job_title'
  72. );
  73. const documentApi = useDocumentApi();
  74. const form = ref<any>(null);
  75. const loading = ref(false);
  76. const mergedFileList = computed(() => {
  77. if (!form.value?.fileName || !form.value?.fileUrl) return [];
  78. return [{
  79. fileName: form.value.fileName,
  80. fileUrl: form.value.fileUrl,
  81. fileType: '审批附件'
  82. }];
  83. });
  84. const fetchData = async () => {
  85. if (!props.code) return;
  86. loading.value = true;
  87. const [err, res] = await to(documentApi.getCopyrightByCode(props.code));
  88. if (!err && res?.data) {
  89. form.value = res.data;
  90. }
  91. loading.value = false;
  92. };
  93. onMounted(() => {
  94. fetchData();
  95. });
  96. watch(() => props.code, () => {
  97. fetchData();
  98. });
  99. </script>
  100. <style lang="scss" scoped>
  101. @import "./common.scss";
  102. </style>