SciAchievementStandard.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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.standardName" />
  8. <CommonInfoRow label="标准编号" :value="form.standardCode" />
  9. <CommonInfoRow label="成果所属单位" :value="form.achievementBelongUnitName" />
  10. <CommonInfoRow label="提交部门" :value="form.commitDeptName" />
  11. <CommonInfoRow label="提交日期" :value="formatDate(form.commitDate, 'YYYY-MM-DD')" />
  12. <CommonInfoRow label="是否已发布" :value="form.isPublished === '10' ? '是' : '否'" />
  13. <CommonInfoRow label="发布日期" :value="formatDate(form.publishDate, 'YYYY-MM-DD')" />
  14. <CommonInfoRow label="单位排名" :value="form.unitRanking" />
  15. <CommonInfoRow label="所有制定单位" :value="form.belongEnactedUnit" isColumn />
  16. <CommonInfoRow label="所有参与人员" :value="form.belongEngagePersonal" isColumn />
  17. <CommonInfoRow label="标准类型" :value="getDictLabel('achievement_standard_type', form.standardType)" />
  18. <CommonInfoRow label="归属年度" :value="form.belongYear" />
  19. <CommonInfoRow label="归属团队" :value="form.belongTeam" />
  20. <view class="info-row">
  21. <text class="label">归属平台</text>
  22. <view class="platform-tags">
  23. <template v-if="platformList.length > 0">
  24. <uv-tags v-for="(item, index) in platformList" :key="index" :text="item.platformName === '其他' ? '其他' : (item.platformType ? item.platformName + ' (' + item.platformType + ')' : item.platformName)" type="primary" plain size="mini" class="mr5"></uv-tags>
  25. </template>
  26. <text v-else>-</text>
  27. </view>
  28. </view>
  29. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  30. </CommonSection>
  31. <!-- 附件 -->
  32. <AttachmentList :file="attachment" title="标准电子版" />
  33. <!-- 制定人信息 -->
  34. <view class="common-section-card mt20" v-if="form.enactedPersonal?.length">
  35. <view class="section-title">制定人信息</view>
  36. <view class="achievement-card" v-for="(item, index) in form.enactedPersonal" :key="index">
  37. <view class="a-header mb20">
  38. <text class="a-name">{{ item.enactedPersonName }}</text>
  39. <text class="a-tag">{{ getDictLabel('enacted_person_type', item.enactedPersonType) }}</text>
  40. </view>
  41. <view class="a-body">
  42. <view class="a-row">
  43. <text class="al">学位:</text>
  44. <text class="av">{{ getDictLabel('sci_academic_degree', item.enactedPersonDegree) }}</text>
  45. </view>
  46. <view class="a-row">
  47. <text class="al">贡献率:</text>
  48. <text class="av">{{ item.contributionRate }}%</text>
  49. </view>
  50. <view class="a-row">
  51. <text class="al">工作单位:</text>
  52. <text class="av">{{ item.workUnitName || '-' }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 审批记录 -->
  58. <CommonSection title="审批记录" v-if="form.id">
  59. <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_achievement_standard" />
  60. </CommonSection>
  61. </template>
  62. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  63. </view>
  64. </template>
  65. <script setup lang="ts">
  66. import { ref, onMounted, watch, computed } from 'vue';
  67. import { useDict } from '@/hooks/useDict';
  68. import { useDocumentApi } from '@/api/document';
  69. import { formatDate } from '@/utils/date';
  70. import to from 'await-to-js';
  71. import AttachmentList from './AttachmentList.vue';
  72. import FlowTable from '@/pages/project/components/detail/FlowTable.vue';
  73. import CommonSection from '@/components/ui/CommonSection.vue';
  74. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  75. const props = defineProps<{
  76. code: string;
  77. }>();
  78. const { getDictLabel } = useDict('achievement_standard_type', 'enacted_person_type', 'sci_academic_degree');
  79. const documentApi = useDocumentApi();
  80. const form = ref<any>(null);
  81. const loading = ref(false);
  82. const attachment = computed(() => {
  83. if (form.value?.standardFile) {
  84. try {
  85. return JSON.parse(form.value.standardFile);
  86. } catch (e) {
  87. return null;
  88. }
  89. }
  90. return null;
  91. });
  92. const platformDisplay = computed(() => {
  93. const belong = form.value?.belongPlatform;
  94. if (belong) {
  95. if (belong === '其他') return '其他';
  96. try {
  97. const data = JSON.parse(belong);
  98. if (Array.isArray(data)) {
  99. return data.map((item: any) => item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})`).join(', ');
  100. }
  101. return belong;
  102. } catch (e) {
  103. return belong;
  104. }
  105. }
  106. return '-';
  107. });
  108. const platformList = computed(() => {
  109. const belong = form.value?.belongPlatform;
  110. if (belong) {
  111. try {
  112. const data = JSON.parse(belong);
  113. if (Array.isArray(data)) {
  114. return data;
  115. }
  116. } catch (e) {
  117. return [];
  118. }
  119. }
  120. return [];
  121. });
  122. const fetchData = async () => {
  123. if (!props.code) return;
  124. loading.value = true;
  125. // 直接通过 ID 获取以对齐 PC 逻辑
  126. const [err, res] = await to(documentApi.getAchievementStandardById(props.code));
  127. if (!err && res?.data) {
  128. form.value = res.data;
  129. }
  130. loading.value = false;
  131. };
  132. onMounted(() => {
  133. fetchData();
  134. });
  135. watch(() => props.code, () => {
  136. fetchData();
  137. });
  138. </script>
  139. <style lang="scss" scoped>
  140. @import "./common.scss";
  141. .info-row {
  142. display: flex;
  143. justify-content: space-between;
  144. padding: 24rpx 0;
  145. border-bottom: 2rpx dashed #f5f5f5;
  146. font-size: 28rpx;
  147. .label {
  148. color: #343a3f;
  149. width: 200rpx;
  150. flex-shrink: 0;
  151. margin-right: 20rpx;
  152. }
  153. }
  154. </style>