AchEvaluationForm.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.evalName" />
  8. <CommonInfoRow label="评价号" :value="form.evalCode" />
  9. <CommonInfoRow label="评价部门" :value="form.evalDeptName" />
  10. <CommonInfoRow label="评价日期" :value="form.evalDate ? formatDate(form.evalDate) : '-'" />
  11. <CommonInfoRow label="评价结果" :value="getDictLabel('sci_achieve_evaluation', form.evalResult)" />
  12. <CommonInfoRow label="完成方式" :value="form.completeWay === '10' ? '独立完成' : '与外单位合作'" />
  13. <CommonInfoRow v-if="form.completeWay === '20'" label="合作单位名称" :value="form.coWorkDeptName" />
  14. <CommonInfoRow label="成果所属单位" :value="form.belongDeptName" />
  15. <CommonInfoRow label="所属年份" :value="form.belongYear" />
  16. <CommonInfoRow label="学校署名" :value="form.schoolSigned === '10' ? '第一单位' : '非第一单位'" />
  17. <CommonInfoRow label="完成单位" :value="form.completeDeptName" />
  18. <CommonInfoRow label="所属平台">
  19. <view class="platform-tags">
  20. <template v-if="platformList.length > 0">
  21. <text v-for="(p, index) in platformList" :key="index" class="platform-tag">
  22. {{ p.platformName }}
  23. </text>
  24. </template>
  25. <text v-else>-</text>
  26. </view>
  27. </CommonInfoRow>
  28. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  29. </CommonSection>
  30. <!-- 完成人信息 -->
  31. <CommonSection title="完成人信息" v-if="form.personList?.length">
  32. <view class="member-list">
  33. <view class="member-item" v-for="(row, index) in form.personList" :key="index">
  34. <view class="member-header">
  35. <view class="m-left">
  36. <text class="m-name">{{ row.personName }}</text>
  37. <text class="m-type-tag blue">{{ getDictLabel('enacted_person_type', row.personType) }}</text>
  38. </view>
  39. <text class="m-tag" v-if="row.contributionRate">{{ row.contributionRate }}% 贡献率</text>
  40. </view>
  41. <view class="m-body">
  42. <view class="m-line" v-if="row.workUnitName"><text class="l">工作单位:</text><text class="v">{{ row.workUnitName }}</text></view>
  43. <view class="m-line"><text class="l">学位/职称:</text><text class="v">{{ getDictLabel('sci_academic_degree', row.personDegree) || '-' }} / {{ getDictLabel('sci_discipline_job_title', row.personJobTitle) || '-' }}</text></view>
  44. </view>
  45. </view>
  46. </view>
  47. </CommonSection>
  48. <!-- 标注经济来源 -->
  49. <CommonSection title="标注经济来源" v-if="form.projectList?.length">
  50. <view class="achievement-card" v-for="(item, index) in form.projectList" :key="index">
  51. <view class="a-row">
  52. <text class="al">关联类型:</text>
  53. <text class="av">{{ item.sourceType === '10' ? '项目' : '学科' }}</text>
  54. </view>
  55. <view class="a-row">
  56. <text class="al">关联名称:</text>
  57. <text class="av">{{ item.projectName || '-' }}</text>
  58. </view>
  59. </view>
  60. </CommonSection>
  61. <!-- 附件信息 -->
  62. <AttachmentList :list="mergedFileList" title="电子附件" />
  63. </template>
  64. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  65. </view>
  66. </template>
  67. <script setup lang="ts">
  68. import { ref, onMounted, watch, computed } from 'vue';
  69. import { useDict } from '@/hooks/useDict';
  70. import { useDocumentApi } from '@/api/document';
  71. import { formatDate } from '@/utils/date';
  72. import to from 'await-to-js';
  73. import AttachmentList from './AttachmentList.vue';
  74. import CommonSection from '@/components/ui/CommonSection.vue';
  75. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  76. const props = defineProps<{
  77. code: string | number;
  78. }>();
  79. const { getDictLabel } = useDict('enacted_person_type', 'sci_academic_degree', 'sci_achieve_evaluation', 'sci_discipline_job_title');
  80. const documentApi = useDocumentApi();
  81. const form = ref<any>(null);
  82. const loading = ref(false);
  83. const platformList = computed(() => {
  84. if (form.value?.belongPlatform) {
  85. try {
  86. const data = JSON.parse(form.value.belongPlatform);
  87. return Array.isArray(data) ? data : [];
  88. } catch (e) {
  89. if (form.value.belongPlatform === '其他') return [{ platformName: '其他' }];
  90. return [{ platformName: form.value.belongPlatform }];
  91. }
  92. }
  93. return [];
  94. });
  95. const mergedFileList = computed(() => {
  96. if (!form.value) return [];
  97. const list: any[] = [];
  98. if (form.value.evalCertificates) {
  99. try {
  100. const file = JSON.parse(form.value.evalCertificates);
  101. list.push({ fileName: file.name || '评价证书', fileUrl: file.url, fileType: '评价证书' });
  102. } catch (e) {}
  103. }
  104. if (form.value.coWorkFile) {
  105. try {
  106. const file = JSON.parse(form.value.coWorkFile);
  107. list.push({ fileName: file.name || '合作单位文件', fileUrl: file.url, fileType: '合作文件' });
  108. } catch (e) {}
  109. }
  110. return list;
  111. });
  112. const fetchData = async () => {
  113. if (!props.code) return;
  114. loading.value = true;
  115. const [err, res] = await to(documentApi.getEvaluationByCode(props.code));
  116. if (!err && res?.data) {
  117. form.value = res.data;
  118. }
  119. loading.value = false;
  120. };
  121. onMounted(() => {
  122. fetchData();
  123. });
  124. watch(() => props.code, () => {
  125. fetchData();
  126. });
  127. </script>
  128. <style lang="scss" scoped>
  129. @import "./common.scss";
  130. </style>