ProjectSetupSafety.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="setup-wrapper">
  3. <CommonSection title="立项概览" :isFirst="true">
  4. <CommonInfoRow label="项目编号" :value="projectData?.projectCode" />
  5. <CommonInfoRow label="项目名称" :value="projectData?.projectName" />
  6. <CommonInfoRow label="项目学科分类" :value="getDictLabel('project_class', projectData?.disciplineFirstName)" />
  7. <CommonInfoRow label="负责人类型" :value="getDictLabel('sci_leader_type', projectData?.projectLeaderType)" />
  8. <CommonInfoRow v-if="projectData?.isClinicalTrial === '20'" label="项目类别" :value="getDictLabel('sci_pjt_class', projectData?.projectClass)" />
  9. <CommonInfoRow label="合同类别" :value="getDictLabel('contract_type', projectData?.contractType)" />
  10. <CommonInfoRow label="项目状态" :value="getStatusLabel(safetyProjectStatusOptions, projectData?.projectStatus)" />
  11. <CommonInfoRow label="签订日期" :value="formatDate(projectData?.signDate)" />
  12. <CommonInfoRow label="统计年度" :value="projectData?.statisticalYear" />
  13. <CommonInfoRow label="开始日期" :value="formatDate(projectData?.planStartDate)" />
  14. <CommonInfoRow label="结束日期" :value="formatDate(projectData?.planEndDate)" />
  15. <CommonInfoRow label="承接部门" :value="projectData?.deptName" />
  16. <CommonInfoRow label="负责人" :value="projectData?.projectLeaderName" />
  17. <CommonInfoRow label="负责人电话" :value="projectData?.projectLeaderPhone" />
  18. <CommonInfoRow label="合同经费(元)" :value="formatWithComma(projectData?.contractFunds)" isAmount />
  19. <CommonInfoRow label="配套经费(元)" :value="formatWithComma(projectData?.supportFunds)" isAmount />
  20. <CommonInfoRow label="总金额(元)" :value="formatWithComma((Number(projectData?.contractFunds || 0) + Number(projectData?.supportFunds || 0) + Number(projectData?.selfFunds || 0)))" isAmount />
  21. <CommonInfoRow label="到账金额(元)" :value="formatWithComma(projectData?.arrivalFunds)" isAmount />
  22. <CommonInfoRow label="到账日期" :value="formatDate(projectData?.arrivalDate)" />
  23. <CommonInfoRow label="所属平台">
  24. <view class="platform-tags" v-if="platformList.length > 0">
  25. <view v-for="(item, index) in platformList" :key="index" class="platform-tag">
  26. {{ item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})` }}
  27. </view>
  28. </view>
  29. <text v-else>--</text>
  30. </CommonInfoRow>
  31. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam" :noBorder="true" />
  32. </CommonSection>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. import { computed } from 'vue';
  37. import { useDict } from '@/hooks/useDict';
  38. import { formatWithComma } from '@/utils/format';
  39. import { formatDate } from '@/utils/date';
  40. import { safetyProjectStatusOptions, getStatusLabel } from '@/constants/index';
  41. import CommonSection from '@/components/ui/CommonSection.vue';
  42. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  43. const { getDictLabel } = useDict('project_class', 'sci_leader_type', 'sci_pjt_class', 'contract_type');
  44. /**
  45. * 安评项目 立项信息展示组件
  46. */
  47. const props = defineProps<{
  48. /** 项目主数据详情 */
  49. projectData: any;
  50. }>();
  51. /**
  52. * 平台信息解析
  53. */
  54. const platformList = computed(() => {
  55. const belong = props.projectData?.belongPlatform;
  56. if (belong) {
  57. if (belong === '其他') return [{ platformName: '其他' }];
  58. try {
  59. const data = JSON.parse(belong);
  60. return Array.isArray(data) ? data : [];
  61. } catch (e) {
  62. return [{ platformName: belong }];
  63. }
  64. }
  65. return [];
  66. });
  67. </script>
  68. <style lang="scss" scoped>
  69. .setup-wrapper {
  70. padding-bottom: 30rpx;
  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>