ProjectSetupSafety.vue 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="所属平台" isColumn>
  24. <view class="platform-tags" v-if="platformList.length > 0">
  25. <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>
  26. </view>
  27. <text v-else>--</text>
  28. </CommonInfoRow>
  29. <CommonInfoRow label="所属团队" :value="projectData?.belongTeam" :noBorder="true" />
  30. </CommonSection>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { computed } from 'vue';
  35. import { useDict } from '@/hooks/useDict';
  36. import { formatWithComma } from '@/utils/format';
  37. import { formatDate } from '@/utils/date';
  38. import { safetyProjectStatusOptions, getStatusLabel } from '@/constants/index';
  39. import CommonSection from '@/components/ui/CommonSection.vue';
  40. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  41. const { getDictLabel } = useDict('project_class', 'sci_leader_type', 'sci_pjt_class', 'contract_type');
  42. /**
  43. * 安评项目 立项信息展示组件
  44. */
  45. const props = defineProps<{
  46. /** 项目主数据详情 */
  47. projectData: any;
  48. }>();
  49. /**
  50. * 平台信息解析
  51. */
  52. const platformList = computed(() => {
  53. const belong = props.projectData?.belongPlatform;
  54. if (belong) {
  55. if (belong === '其他') return [{ platformName: '其他' }];
  56. try {
  57. const data = JSON.parse(belong);
  58. return Array.isArray(data) ? data : [];
  59. } catch (e) {
  60. return [{ platformName: belong }];
  61. }
  62. }
  63. return [];
  64. });
  65. </script>
  66. <style lang="scss" scoped>
  67. .setup-wrapper {
  68. padding-bottom: 30rpx;
  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>