SciAchievementSoftware.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. <CommonSection title="基本信息" :isFirst="true">
  6. <CommonInfoRow label="软件名称" :value="form.softwareName" />
  7. <CommonInfoRow label="著作权人" :value="form.applicant" />
  8. <CommonInfoRow label="所属单位" :value="form.organization" />
  9. <CommonInfoRow label="版本号" :value="form.version" />
  10. <CommonInfoRow label="开发完成日期" :value="form.developmentFinishDate ? formatDate(form.developmentFinishDate, 'YYYY-MM-DD') : '-'" />
  11. <CommonInfoRow label="首次发表日期" :value="form.firstPublishDate ? formatDate(form.firstPublishDate, 'YYYY-MM-DD') : '-'" />
  12. <CommonInfoRow label="成果归属单位" :value="getDictLabel('achievement_owner_unit', form.achievementOwnerUnit) || form.achievementOwnerUnit || '-'" />
  13. <CommonInfoRow label="权利范围" :value="getDictLabel('rights_scope', form.rightsScope) || form.rightsScope || '-'" />
  14. <CommonInfoRow label="权利取得方式" :value="getDictLabel('rights_acquire_method', form.rightsAcquireMethod) || form.rightsAcquireMethod || '-'" />
  15. <CommonInfoRow label="开发方式" :value="getDictLabel('development_method', form.developmentMethod) || form.developmentMethod || '-'" />
  16. <!-- 合作单位(仅开发方式为合作开发时显示) -->
  17. <CommonInfoRow v-if="form.developmentMethod === '20'" label="合作单位" :value="form.partnerUnit || '-'" />
  18. <CommonInfoRow label="所属平台">
  19. <view class="platform-tags">
  20. <template v-if="platformList.length > 0">
  21. <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>
  22. </template>
  23. <text v-else>-</text>
  24. </view>
  25. </CommonInfoRow>
  26. <CommonInfoRow label="所属团队" :value="form.belongTeam || '-'" />
  27. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  28. </CommonSection>
  29. <AttachmentList :file="attachment" title="佐证附件" />
  30. <!-- 审批记录 -->
  31. <CommonSection title="审批记录" v-if="form.id">
  32. <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_achievement_software" />
  33. </CommonSection>
  34. </template>
  35. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  36. </view>
  37. </template>
  38. <script setup lang="ts">
  39. import { ref, onMounted, watch, computed } from 'vue';
  40. import { useDict } from '@/hooks/useDict';
  41. import { useDocumentApi } from '@/api/document';
  42. import { formatDate } from '@/utils/date';
  43. import to from 'await-to-js';
  44. import AttachmentList from './AttachmentList.vue';
  45. import FlowTable from '@/pages/project/components/detail/FlowTable.vue';
  46. import CommonSection from '@/components/ui/CommonSection.vue';
  47. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  48. const props = defineProps<{
  49. code: string;
  50. }>();
  51. const { getDictLabel } = useDict('achievement_owner_unit', 'rights_scope', 'rights_acquire_method', 'development_method');
  52. const documentApi = useDocumentApi();
  53. const form = ref<any>(null);
  54. const loading = ref(false);
  55. const platformList = computed(() => {
  56. if (form.value?.belongPlatform) {
  57. try {
  58. const data = JSON.parse(form.value.belongPlatform);
  59. return Array.isArray(data) ? data : [];
  60. } catch (e) {
  61. if (form.value.belongPlatform === '其他') return [{ platformName: '其他' }];
  62. return [{ platformName: form.value.belongPlatform }];
  63. }
  64. }
  65. return [];
  66. });
  67. const attachment = computed(() => {
  68. if (form.value?.fileUrl) {
  69. return {
  70. fileName: form.value.fileName || '佐证附件',
  71. fileUrl: form.value.fileUrl
  72. };
  73. }
  74. return null;
  75. });
  76. const fetchData = async () => {
  77. if (!props.code) return;
  78. loading.value = true;
  79. const [err, res] = await to(documentApi.getSoftwareAchievementById(props.code));
  80. if (!err && res?.data) {
  81. form.value = res.data;
  82. }
  83. loading.value = false;
  84. };
  85. onMounted(() => {
  86. fetchData();
  87. });
  88. watch(() => props.code, () => {
  89. fetchData();
  90. });
  91. </script>
  92. <style lang="scss" scoped>
  93. @import "./common.scss";
  94. </style>