HorizontalForm.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="document-form">
  3. <uv-loading-icon v-if="loading" mode="circle" text="正在加载横向项目详情..."></uv-loading-icon>
  4. <template v-else-if="form">
  5. <!-- 基本信息 -->
  6. <view class="common-section-card">
  7. <view class="section-title">基本信息</view>
  8. <view class="info-row"><text class="label">项目名称</text><text class="value">{{ form.projectName }}</text></view>
  9. <view class="info-row"><text class="label">院内编号</text><text class="value">{{ form.projectNo || '-' }}</text></view>
  10. <view class="info-row">
  11. <text class="label">研究类型</text>
  12. <text class="value">{{ form.isClinicalTrial === '10' ? '临床试验' : '横向其他' }}</text>
  13. </view>
  14. <view class="info-row"><text class="label">项目来源</text><text class="value">{{ form.projectSource || '-' }}</text></view>
  15. <view class="info-row">
  16. <text class="label">项目{{ form.isClinicalTrial === '10' ? '级别' : '类别' }}</text>
  17. <text class="value">{{ getDictLabel(form.isClinicalTrial === '10' ? 'sci_proj_type' : 'sci_pjt_class', form.projectClass) }}</text>
  18. </view>
  19. <view class="info-row"><text class="label">立项单位</text><text class="value">{{ form.deptName }}</text></view>
  20. <view class="info-row"><text class="label">主要研究者</text><text class="value">{{ form.projectLeaderName }}</text></view>
  21. <view class="info-row"><text class="label">负责人电话</text><text class="value">{{ form.projectLeaderPhone || '-' }}</text></view>
  22. <view class="info-row"><text class="label">项目时间</text><text class="value">{{ form.startDate }} 至 {{ form.endDate }}</text></view>
  23. <view class="info-row"><text class="label">签订时间</text><text class="value">{{ form.signDate || '-' }}</text></view>
  24. <view class="info-row">
  25. <text class="label">经费(元)</text>
  26. <text class="value primary-color">¥{{ form.contractFunds || 0 }}</text>
  27. </view>
  28. <view class="info-row" v-if="form.isClinicalTrial === '10'"><text class="label">招募人数</text><text class="value">{{ form.memberNum || 0 }}</text></view>
  29. </view>
  30. <!-- 三方信息 -->
  31. <view class="common-section-card mt20">
  32. <view class="section-title">三方信息</view>
  33. <view class="info-row"><text class="label">甲方名称</text><text class="value">{{ form.firstPartyName || '-' }}</text></view>
  34. <view class="info-row"><text class="label">甲方负责人</text><text class="value">{{ form.firstPartyBehalf || '-' }}</text></view>
  35. <view class="info-row"><text class="label">乙方名称</text><text class="value">{{ form.secondPartyName || '-' }}</text></view>
  36. <view class="info-row"><text class="label">乙方负责人</text><text class="value">{{ form.secondPartyBehalf || '-' }}</text></view>
  37. <view class="info-row" v-if="form.thirdPartyName"><text class="label">丙方名称</text><text class="value">{{ form.thirdPartyName }}</text></view>
  38. </view>
  39. <!-- 成员信息 -->
  40. <view class="common-section-card mt20" v-if="form.member?.length">
  41. <view class="section-title">成员信息</view>
  42. <view class="member-list">
  43. <view class="member-item" v-for="(row, index) in form.member" :key="index">
  44. <view class="member-header">
  45. <text class="m-name">{{ row.memberName }}</text>
  46. <text class="m-tag">{{ row.projectRole === '10' ? '负责人' : '参与人' }}</text>
  47. </view>
  48. <view class="m-body">
  49. <view class="m-line" v-if="row.deptName"><text class="l">所属科室:</text><text class="v">{{ row.deptName }}</text></view>
  50. <view class="m-line" v-if="row.technicalTitle"><text class="l">职称:</text><text class="v">{{ row.technicalTitle }}</text></view>
  51. <view class="m-line" v-if="row.degree"><text class="l">学位:</text><text class="v">{{ getDictLabel('sci_academic_degree', row.degree) }}</text></view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 附件信息 -->
  57. <view class="common-section-card mt20" v-if="form.files?.length">
  58. <view class="section-title">附件资料</view>
  59. <view class="common-file-list">
  60. <view class="file-item" v-for="(file, index) in form.files" :key="index" @click="previewFile(file.fileUrl, file.fileName)">
  61. <view class="file-info">
  62. <text class="f-name">{{ file.fileName }}</text>
  63. <view class="f-meta">
  64. <text class="f-type">{{ file.fileType || '附件' }}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  72. </view>
  73. </template>
  74. <script setup lang="ts">
  75. import { ref, onMounted, watch } from 'vue';
  76. import { useDict } from '@/hooks/useDict';
  77. import { useDocumentApi } from '@/api/document';
  78. import { previewFile } from '@/utils/file';
  79. import to from 'await-to-js';
  80. const props = defineProps<{
  81. code: string;
  82. }>();
  83. const { getDictLabel } = useDict('sci_proj_type', 'sci_pjt_class', 'sci_academic_degree');
  84. const documentApi = useDocumentApi();
  85. const form = ref<any>(null);
  86. const loading = ref(false);
  87. const fetchData = async () => {
  88. if (!props.code) return;
  89. loading.value = true;
  90. const [err, res] = await to(documentApi.getHorizontalByCode(props.code));
  91. if (!err && res?.data) {
  92. form.value = res.data;
  93. }
  94. loading.value = false;
  95. };
  96. onMounted(() => {
  97. fetchData();
  98. });
  99. watch(() => props.code, () => {
  100. fetchData();
  101. });
  102. </script>
  103. <style lang="scss" scoped>
  104. @import "./common.scss";
  105. </style>