ProjectSetupVertical.vue 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="setup-wrapper">
  3. <CommonSection title="立项概览" isFirst>
  4. <CommonInfoRow label="项目名称" :value="projectData?.projectName" />
  5. <CommonInfoRow label="学科类型" :value="getDictLabel('project_class', projectData?.projectClass)" />
  6. <CommonInfoRow label="项目来源单位" :value="projectData?.projectSource" />
  7. <CommonInfoRow label="负责人" :value="projectData?.projectLeaderName" />
  8. <CommonInfoRow label="负责人类型" :value="getDictLabel('sci_leader_type', projectData?.projectLeaderType)" />
  9. <CommonInfoRow label="项目级别" :value="getDictLabel('sci_pjt_level', projectData?.projectLevel)" />
  10. <CommonInfoRow label="项目分类" :value="projectData?.projectClazzName" />
  11. <CommonInfoRow label="项目状态" :value="getStatusLabel(verticalProjectStatusOptions, projectData?.projectStatus)" />
  12. <CommonInfoRow label="立项日期" :value="projectData?.approvalDate ? formatDate(projectData.approvalDate) : '--'" />
  13. <CommonInfoRow label="开始日期" :value="projectData?.planStartDate ? formatDate(projectData.planStartDate) : '--'" />
  14. <CommonInfoRow label="计划结题日期" :value="projectData?.planEndDate ? formatDate(projectData.planEndDate) : '--'" />
  15. <CommonInfoRow label="合同经费(元)" :value="amountUnitFormatter(projectData?.contractFunds)" isAmount />
  16. <CommonInfoRow label="批准经费(元)" :value="amountUnitFormatter(projectData?.approvedFunds)" isAmount />
  17. <CommonInfoRow label="配套经费(元)" :value="amountUnitFormatter(projectData?.supportFunds)" isAmount />
  18. <CommonInfoRow label="外拨经费(元)" :value="amountUnitFormatter(projectData?.outsourcedFunds)" isAmount />
  19. <CommonInfoRow label="所属年度" :value="projectData?.statisticalYear || '--'" />
  20. <CommonInfoRow label="所属平台">
  21. <view class="platform-tags" v-if="platformList.length > 0">
  22. <view v-for="(item, index) in platformList" :key="index" class="platform-tag">
  23. {{ item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})` }}
  24. </view>
  25. </view>
  26. <text v-else>--</text>
  27. </CommonInfoRow>
  28. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam || '--'" />
  29. <CommonInfoRow label="到账日期" :value="projectData?.arrivalDate ? formatDate(projectData.arrivalDate) : '--'" />
  30. <CommonInfoRow label="到账金额(元)" :value="projectData?.arrivalFunds || '--'" />
  31. <CommonInfoRow label="备注" :value="projectData?.remark || '--'" noBorder />
  32. </CommonSection>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. import { computed } from 'vue';
  37. import { useDict } from '@/hooks/useDict';
  38. import { formatDate } from '@/utils/date';
  39. import { formatWithComma } from '@/utils/format';
  40. import { verticalProjectStatusOptions, getStatusLabel } from '@/constants/index';
  41. import CommonSection from '@/components/ui/CommonSection.vue';
  42. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  43. const props = defineProps<{
  44. projectData: any;
  45. }>();
  46. const { getDictLabel } = useDict('sci_pjt_level', 'project_class', 'sci_leader_type');
  47. /**
  48. * 计算属性:所属平台解析
  49. */
  50. const platformList = computed(() => {
  51. const belong = props.projectData?.belongPlatform;
  52. if (belong) {
  53. if (belong === '其他') return [{ platformName: '其他' }];
  54. try {
  55. const data = JSON.parse(belong);
  56. return Array.isArray(data) ? data : [];
  57. } catch (e) {
  58. return [{ platformName: belong }];
  59. }
  60. }
  61. return [];
  62. });
  63. const amountUnitFormatter = (num: any) => {
  64. return formatWithComma(num);
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .setup-wrapper {
  69. width: 100%;
  70. padding-bottom: 20px;
  71. }
  72. .platform-tags {
  73. display: flex;
  74. flex-wrap: wrap;
  75. gap: 8rpx;
  76. justify-content: flex-end;
  77. }
  78. .platform-tag {
  79. font-size: 24rpx;
  80. background-color: #e6f7ff;
  81. color: #1a9cff;
  82. padding: 4rpx 16rpx;
  83. border-radius: 6rpx;
  84. border: 1px solid #bae7ff;
  85. }
  86. </style>