ProjectSetupVertical.vue 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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_vertical_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="所属平台" isColumn>
  21. <view class="platform-tags" v-if="platformList.length > 0">
  22. <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>
  23. </view>
  24. <text v-else>--</text>
  25. </CommonInfoRow>
  26. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam || '--'" />
  27. <CommonInfoRow label="到账日期" :value="projectData?.arrivalDate ? formatDate(projectData.arrivalDate) : '--'" />
  28. <CommonInfoRow label="到账金额(元)" :value="projectData?.arrivalFunds || '--'" />
  29. <CommonInfoRow label="备注" :value="projectData?.remark || '--'" noBorder />
  30. </CommonSection>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { computed } from 'vue';
  35. import { useDict } from '@/hooks/useDict';
  36. import { formatDate } from '@/utils/date';
  37. import { formatWithComma } from '@/utils/format';
  38. import { verticalProjectStatusOptions, getStatusLabel } from '@/constants/index';
  39. import CommonSection from '@/components/ui/CommonSection.vue';
  40. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  41. const props = defineProps<{
  42. projectData: any;
  43. }>();
  44. const { getDictLabel } = useDict('sci_vertical_level', 'project_class', 'sci_leader_type');
  45. /**
  46. * 计算属性:所属平台解析
  47. */
  48. const platformList = computed(() => {
  49. const belong = props.projectData?.belongPlatform;
  50. if (belong) {
  51. if (belong === '其他') return [{ platformName: '其他' }];
  52. try {
  53. const data = JSON.parse(belong);
  54. return Array.isArray(data) ? data : [];
  55. } catch (e) {
  56. return [{ platformName: belong }];
  57. }
  58. }
  59. return [];
  60. });
  61. const amountUnitFormatter = (num: any) => {
  62. return formatWithComma(num);
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .setup-wrapper {
  67. width: 100%;
  68. padding-bottom: 20px;
  69. }
  70. .platform-tags {
  71. display: flex;
  72. flex-wrap: wrap;
  73. gap: 8rpx;
  74. justify-content: flex-start;
  75. width: 100%;
  76. box-sizing: border-box;
  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. max-width: 100%;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. }
  90. </style>