ProjectSetupHorizontal.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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="所属平台" isColumn>
  27. <view class="platform-tags" v-if="platformList.length > 0">
  28. <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>
  29. </view>
  30. <text v-else>--</text>
  31. </CommonInfoRow>
  32. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam" noBorder />
  33. </CommonSection>
  34. </view>
  35. </template>
  36. <script setup lang="ts">
  37. import { computed } from 'vue';
  38. import { useDict } from '@/hooks/useDict';
  39. import { formatDate } from '@/utils/date';
  40. import { formatWithComma } from '@/utils/format';
  41. import { horizontalProjectStatusOptions, getStatusLabel } from '@/constants/index';
  42. import CommonSection from '@/components/ui/CommonSection.vue';
  43. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  44. const props = defineProps<{
  45. projectData: any;
  46. }>();
  47. const { getDictLabel } = useDict(
  48. 'project_class',
  49. 'sci_leader_type',
  50. 'sci_pjt_class',
  51. 'contract_type'
  52. );
  53. /**
  54. * 计算属性:所属平台解析
  55. */
  56. const platformList = computed(() => {
  57. const belong = props.projectData?.belongPlatform;
  58. if (belong) {
  59. if (belong === '其他') return [{ platformName: '其他' }];
  60. try {
  61. const data = JSON.parse(belong);
  62. return Array.isArray(data) ? data : [];
  63. } catch (e) {
  64. return [{ platformName: belong }];
  65. }
  66. }
  67. return [];
  68. });
  69. /**
  70. * 平台信息显示转换
  71. */
  72. const platformDisplay = computed(() => {
  73. const belong = props.projectData?.belongPlatform;
  74. if (belong) {
  75. if (belong === '其他') return '其他';
  76. try {
  77. const data = JSON.parse(belong);
  78. if (Array.isArray(data)) {
  79. return data.map((item: any) => item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})`).join(', ');
  80. }
  81. } catch (e) {
  82. return belong;
  83. }
  84. }
  85. return '--';
  86. });
  87. const amountUnitFormatter = (num: any) => {
  88. return formatWithComma(num);
  89. };
  90. </script>
  91. <style lang="scss" scoped>
  92. .setup-wrapper {
  93. width: 100%;
  94. padding-bottom: 20px;
  95. }
  96. .platform-tags {
  97. display: flex;
  98. flex-wrap: wrap;
  99. gap: 8rpx;
  100. justify-content: flex-start;
  101. width: 100%;
  102. box-sizing: border-box;
  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. max-width: 100%;
  112. overflow: hidden;
  113. text-overflow: ellipsis;
  114. white-space: nowrap;
  115. }
  116. .party-card {
  117. background-color: #f7f9fc;
  118. border-radius: 12rpx;
  119. padding: 24rpx;
  120. margin-bottom: 20rpx;
  121. &:last-child {
  122. margin-bottom: 0;
  123. }
  124. .party-title {
  125. font-size: 28rpx;
  126. font-weight: bold;
  127. color: #1c9bfd;
  128. margin-bottom: 16rpx;
  129. border-bottom: 2rpx solid rgba(#1c9bfd, 0.1);
  130. padding-bottom: 12rpx;
  131. }
  132. }
  133. </style>