ProjectSetupHorizontal.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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('contract_type', projectData?.contractType)" />
  12. <CommonInfoRow label="项目状态" :value="getStatusLabel(horizontalProjectStatusOptions, 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 === '其他' ? item.platformName : `${item.platformName} (${item.platformType})` }}
  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 { horizontalProjectStatusOptions, getStatusLabel } from '@/constants/index';
  44. import CommonSection from '@/components/ui/CommonSection.vue';
  45. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  46. const props = defineProps<{
  47. projectData: any;
  48. }>();
  49. const { getDictLabel } = useDict(
  50. 'project_class',
  51. 'sci_leader_type',
  52. 'sci_pjt_class',
  53. 'contract_type'
  54. );
  55. /**
  56. * 计算属性:所属平台解析
  57. */
  58. const platformList = computed(() => {
  59. const belong = props.projectData?.belongPlatform;
  60. if (belong) {
  61. if (belong === '其他') return [{ platformName: '其他' }];
  62. try {
  63. const data = JSON.parse(belong);
  64. return Array.isArray(data) ? data : [];
  65. } catch (e) {
  66. return [{ platformName: belong }];
  67. }
  68. }
  69. return [];
  70. });
  71. /**
  72. * 平台信息显示转换
  73. */
  74. const platformDisplay = computed(() => {
  75. const belong = props.projectData?.belongPlatform;
  76. if (belong) {
  77. if (belong === '其他') return '其他';
  78. try {
  79. const data = JSON.parse(belong);
  80. if (Array.isArray(data)) {
  81. return data.map((item: any) => item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})`).join(', ');
  82. }
  83. } catch (e) {
  84. return belong;
  85. }
  86. }
  87. return '--';
  88. });
  89. const amountUnitFormatter = (num: any) => {
  90. return formatWithComma(num);
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .setup-wrapper {
  95. width: 100%;
  96. padding-bottom: 20px;
  97. }
  98. .platform-tags {
  99. display: flex;
  100. flex-wrap: wrap;
  101. gap: 8rpx;
  102. justify-content: flex-end;
  103. }
  104. .platform-tag {
  105. font-size: 24rpx;
  106. background-color: #e6f7ff;
  107. color: #1a9cff;
  108. padding: 4rpx 16rpx;
  109. border-radius: 6rpx;
  110. border: 1px solid #bae7ff;
  111. }
  112. .party-card {
  113. background-color: #f7f9fc;
  114. border-radius: 12rpx;
  115. padding: 24rpx;
  116. margin-bottom: 20rpx;
  117. &:last-child {
  118. margin-bottom: 0;
  119. }
  120. .party-title {
  121. font-size: 28rpx;
  122. font-weight: bold;
  123. color: #1c9bfd;
  124. margin-bottom: 16rpx;
  125. border-bottom: 2rpx solid rgba(#1c9bfd, 0.1);
  126. padding-bottom: 12rpx;
  127. }
  128. }
  129. </style>