SciAchievementStandard.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. <view class="common-section-card">
  7. <view class="section-title">基本信息</view>
  8. <view class="info-row"><text class="label">标准名称</text><text class="value">{{ form.standardName || '-' }}</text></view>
  9. <view class="info-row"><text class="label">标准编号</text><text class="value">{{ form.standardCode || '-' }}</text></view>
  10. <view class="info-row"><text class="label">成果所属单位</text><text class="value">{{ form.achievementBelongUnitName || '-' }}</text></view>
  11. <view class="info-row"><text class="label">提交部门</text><text class="value">{{ form.commitDeptName || '-' }}</text></view>
  12. <view class="info-row"><text class="label">提交日期</text><text class="value">{{ formatDate(form.commitDate, 'YYYY-MM-DD') }}</text></view>
  13. <view class="info-row"><text class="label">是否已发布</text><text class="value">{{ form.isPublished === '10' ? '是' : '否' }}</text></view>
  14. <view class="info-row"><text class="label">发布日期</text><text class="value">{{ formatDate(form.publishDate, 'YYYY-MM-DD') }}</text></view>
  15. <view class="info-row"><text class="label">单位排名</text><text class="value">{{ form.unitRanking || '-' }}</text></view>
  16. <view class="info-row column">
  17. <text class="label">所有制定单位</text>
  18. <text class="value remark">{{ form.belongEnactedUnit || '-' }}</text>
  19. </view>
  20. <view class="info-row column">
  21. <text class="label">所有参与人员</text>
  22. <text class="value remark">{{ form.belongEngagePersonal || '-' }}</text>
  23. </view>
  24. <view class="info-row">
  25. <text class="label">标准类型</text>
  26. <text class="value">{{ getDictLabel('achievement_standard_type', form.standardType) }}</text>
  27. </view>
  28. <view class="info-row"><text class="label">归属年度</text><text class="value">{{ form.belongYear || '-' }}</text></view>
  29. <view class="info-row"><text class="label">归属团队</text><text class="value">{{ form.belongTeam || '-' }}</text></view>
  30. <view class="info-row"><text class="label">归属平台</text><text class="value">{{ form.belongPlatform || '-' }}</text></view>
  31. <view class="info-row column">
  32. <text class="label">备注</text>
  33. <text class="value remark">{{ form.remark || '-' }}</text>
  34. </view>
  35. </view>
  36. <!-- 制定人信息 -->
  37. <view class="common-section-card mt20" v-if="form.enactedPersonal?.length">
  38. <view class="section-title">制定人信息</view>
  39. <view class="achievement-card" v-for="(item, index) in form.enactedPersonal" :key="index">
  40. <view class="a-header">
  41. <text class="a-name">{{ item.enactedPersonName }}</text>
  42. <text class="a-tag">{{ getDictLabel('enacted_person_type', item.enactedPersonType) }}</text>
  43. </view>
  44. <view class="a-body">
  45. <view class="a-row">
  46. <text class="al">学位:</text>
  47. <text class="av">{{ getDictLabel('sci_academic_degree', item.enactedPersonDegree) }}</text>
  48. </view>
  49. <view class="a-row">
  50. <text class="al">贡献率:</text>
  51. <text class="av">{{ item.contributionRate }}%</text>
  52. </view>
  53. <view class="a-row">
  54. <text class="al">工作单位:</text>
  55. <text class="av">{{ item.workUnitName || '-' }}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- 附件 -->
  61. <AttachmentList :file="attachment" title="附件资料" />
  62. </template>
  63. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  64. </view>
  65. </template>
  66. <script setup lang="ts">
  67. import { ref, onMounted, watch, computed } from 'vue';
  68. import { useDict } from '@/hooks/useDict';
  69. import { useDocumentApi } from '@/api/document';
  70. import { formatDate } from '@/utils/date';
  71. import to from 'await-to-js';
  72. import AttachmentList from './AttachmentList.vue';
  73. const props = defineProps<{
  74. code: string;
  75. }>();
  76. const { getDictLabel } = useDict('achievement_standard_type', 'enacted_person_type', 'sci_academic_degree');
  77. const documentApi = useDocumentApi();
  78. const form = ref<any>(null);
  79. const loading = ref(false);
  80. const attachment = computed(() => {
  81. if (form.value?.standardFile) {
  82. try {
  83. return JSON.parse(form.value.standardFile);
  84. } catch (e) {
  85. return null;
  86. }
  87. }
  88. return null;
  89. });
  90. const fetchData = async () => {
  91. if (!props.code) return;
  92. loading.value = true;
  93. // 直接通过 ID 获取以对齐 PC 逻辑
  94. const [err, res] = await to(documentApi.getAchievementStandardById(props.code));
  95. if (!err && res?.data) {
  96. form.value = res.data;
  97. }
  98. loading.value = false;
  99. };
  100. onMounted(() => {
  101. fetchData();
  102. });
  103. watch(() => props.code, () => {
  104. fetchData();
  105. });
  106. </script>
  107. <style lang="scss" scoped>
  108. @import "./common.scss";
  109. </style>