ProjectSetupHorizontal.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="setup-wrapper">
  3. <!-- 立项概览 -->
  4. <CommonSection title="立项概览" isFirst>
  5. <CommonInfoRow label="项目编号" :value="projectData?.projectCode" />
  6. <CommonInfoRow label="项目名称" :value="projectData?.projectName" />
  7. <CommonInfoRow label="项目学科分类" :value="getDictLabel('project_class', projectData?.disciplineFirstName)" />
  8. <CommonInfoRow label="负责人类型" :value="getDictLabel('sci_leader_type', projectData?.projectLeaderType)" />
  9. <CommonInfoRow v-if="projectData?.isClinicalTrial === '20'" label="项目类别"
  10. :value="getDictLabel('sci_pjt_class', projectData?.projectClass)" />
  11. <CommonInfoRow label="合同类别" :value="getDictLabel('sci_contract_type', projectData?.contractType)" />
  12. <CommonInfoRow label="项目状态" :value="getDictLabel('project_status', projectData?.projectStatus)" />
  13. <CommonInfoRow label="签订日期" :value="projectData?.signDate ? formatDate(projectData.signDate) : '--'" />
  14. <CommonInfoRow label="统计年度" :value="projectData?.statisticalYear" />
  15. <CommonInfoRow label="开始日期" :value="projectData?.planStartDate ? formatDate(projectData.planStartDate) : '--'" />
  16. <CommonInfoRow label="结束日期" :value="projectData?.planEndDate ? formatDate(projectData.planEndDate) : '--'" />
  17. <CommonInfoRow label="承接部门" :value="projectData?.deptName" />
  18. <CommonInfoRow label="负责人" :value="projectData?.projectLeaderName" />
  19. <CommonInfoRow label="负责人电话" :value="projectData?.projectLeaderPhone" />
  20. <CommonInfoRow label="合同经费(元)" :value="amountUnitFormatter(projectData?.contractFunds)" isAmount />
  21. <CommonInfoRow label="配套经费(元)" :value="amountUnitFormatter(projectData?.supportFunds)" isAmount />
  22. <CommonInfoRow label="总金额(元)" :value="amountUnitFormatter(projectData?.totalAmount)" isAmount />
  23. <CommonInfoRow label="到账金额(元)" :value="amountUnitFormatter(projectData?.arrivalFunds)" isAmount />
  24. <CommonInfoRow label="到账日期" :value="projectData?.arrivalDate ? formatDate(projectData.arrivalDate) : '--'" />
  25. <!-- 所属平台 -->
  26. <CommonInfoRow label="所属平台">
  27. <view class="platform-tags" v-if="platformList.length > 0">
  28. <view v-for="(item, index) in platformList" :key="index" class="platform-tag">
  29. {{ item.platformName }}
  30. </view>
  31. </view>
  32. <text v-else>-</text>
  33. </CommonInfoRow>
  34. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam" noBorder />
  35. </CommonSection>
  36. </view>
  37. </template>
  38. <script setup lang="ts">
  39. import { computed } from 'vue';
  40. import { useDict } from '@/hooks/useDict';
  41. import { formatDate } from '@/utils/date';
  42. import { formatWithComma } from '@/utils/format';
  43. import CommonSection from '@/components/ui/CommonSection.vue';
  44. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  45. const props = defineProps<{
  46. projectData: any;
  47. }>();
  48. const { getDictLabel } = useDict(
  49. 'project_class',
  50. 'sci_leader_type',
  51. 'sci_pjt_class',
  52. 'sci_contract_type',
  53. 'project_status'
  54. );
  55. /**
  56. * 计算属性:所属平台解析
  57. */
  58. const platformList = computed(() => {
  59. if (props.projectData?.belongPlatform) {
  60. try {
  61. const data = JSON.parse(props.projectData.belongPlatform);
  62. return Array.isArray(data) ? data : [];
  63. } catch (e) {
  64. return [];
  65. }
  66. }
  67. return [];
  68. });
  69. const amountUnitFormatter = (num: any) => {
  70. return formatWithComma(num);
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. .setup-wrapper {
  75. width: 100%;
  76. padding-bottom: 20px;
  77. }
  78. .platform-tags {
  79. display: flex;
  80. flex-wrap: wrap;
  81. gap: 8rpx;
  82. justify-content: flex-end;
  83. }
  84. .platform-tag {
  85. font-size: 24rpx;
  86. background-color: #e6f7ff;
  87. color: #1a9cff;
  88. padding: 4rpx 16rpx;
  89. border-radius: 6rpx;
  90. border: 1px solid #bae7ff;
  91. }
  92. .party-card {
  93. background-color: #f7f9fc;
  94. border-radius: 12rpx;
  95. padding: 24rpx;
  96. margin-bottom: 20rpx;
  97. &:last-child {
  98. margin-bottom: 0;
  99. }
  100. .party-title {
  101. font-size: 28rpx;
  102. font-weight: bold;
  103. color: #1c9bfd;
  104. margin-bottom: 16rpx;
  105. border-bottom: 2rpx solid rgba(#1c9bfd, 0.1);
  106. padding-bottom: 12rpx;
  107. }
  108. }
  109. </style>