AchEvaluationForm.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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="所属平台" isColumn>
  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.remark" isColumn />
  27. </CommonSection>
  28. <!-- 完成人信息 -->
  29. <CommonSection title="完成人信息" v-if="form.personList?.length">
  30. <view class="member-list">
  31. <view class="member-item" v-for="(row, index) in form.personList" :key="index">
  32. <view class="member-header">
  33. <view class="m-left">
  34. <text class="m-name">{{ row.personName }}</text>
  35. <text class="m-type-tag blue">{{ getDictLabel('enacted_person_type', row.personType) }}</text>
  36. </view>
  37. <text class="m-tag" v-if="row.contributionRate">{{ row.contributionRate }}% 贡献率</text>
  38. </view>
  39. <view class="m-body">
  40. <view class="m-line" v-if="row.workUnitName"><text class="l">工作单位:</text><text class="v">{{ row.workUnitName }}</text></view>
  41. <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>
  42. </view>
  43. </view>
  44. </view>
  45. </CommonSection>
  46. <!-- 标注经济来源 -->
  47. <CommonSection title="标注经济来源" v-if="form.projectList?.length">
  48. <view class="achievement-card" v-for="(item, index) in form.projectList" :key="index">
  49. <view class="a-row">
  50. <text class="al">关联类型:</text>
  51. <text class="av">{{ item.sourceType === '10' ? '项目' : '学科' }}</text>
  52. </view>
  53. <view class="a-row">
  54. <text class="al">关联名称:</text>
  55. <text class="av">{{ item.projectName || '-' }}</text>
  56. </view>
  57. </view>
  58. </CommonSection>
  59. <!-- 附件信息 -->
  60. <AttachmentList :list="mergedFileList" title="电子附件" />
  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 CommonSection from '@/components/ui/CommonSection.vue';
  73. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  74. const props = defineProps<{
  75. code: string | number;
  76. }>();
  77. const { getDictLabel } = useDict('enacted_person_type', 'sci_academic_degree', 'sci_achieve_evaluation', 'sci_discipline_job_title');
  78. const documentApi = useDocumentApi();
  79. const form = ref<any>(null);
  80. const loading = ref(false);
  81. const platformList = computed(() => {
  82. if (form.value?.belongPlatform) {
  83. try {
  84. const data = JSON.parse(form.value.belongPlatform);
  85. return Array.isArray(data) ? data : [];
  86. } catch (e) {
  87. if (form.value.belongPlatform === '其他') return [{ platformName: '其他' }];
  88. return [{ platformName: form.value.belongPlatform }];
  89. }
  90. }
  91. return [];
  92. });
  93. const mergedFileList = computed(() => {
  94. if (!form.value) return [];
  95. const list: any[] = [];
  96. if (form.value.evalCertificates) {
  97. try {
  98. const file = JSON.parse(form.value.evalCertificates);
  99. list.push({ fileName: file.name || '评价证书', fileUrl: file.url, fileType: '评价证书' });
  100. } catch (e) {}
  101. }
  102. if (form.value.coWorkFile) {
  103. try {
  104. const file = JSON.parse(form.value.coWorkFile);
  105. list.push({ fileName: file.name || '合作单位文件', fileUrl: file.url, fileType: '合作文件' });
  106. } catch (e) {}
  107. }
  108. return list;
  109. });
  110. const fetchData = async () => {
  111. if (!props.code) return;
  112. loading.value = true;
  113. const [err, res] = await to(documentApi.getEvaluationByCode(props.code));
  114. if (!err && res?.data) {
  115. form.value = res.data;
  116. }
  117. loading.value = false;
  118. };
  119. onMounted(() => {
  120. fetchData();
  121. });
  122. watch(() => props.code, () => {
  123. fetchData();
  124. });
  125. </script>
  126. <style lang="scss" scoped>
  127. @import "./common.scss";
  128. </style>