SpontaneityFormPlan.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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">
  9. <text class="label">项目名称</text>
  10. <text class="value">{{ form.projectName || '-' }}</text>
  11. </view>
  12. <view class="info-row">
  13. <text class="label">项目级别</text>
  14. <text class="value">{{ getDictLabel('sci_pjt_level', form.projectLevel) }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text class="label">项目来源</text>
  18. <text class="value">{{ form.projectSource || '-' }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text class="label">计划日期</text>
  22. <text class="value">{{ formatDate(form.startDate, 'YYYY-MM-DD') }} 至 {{ formatDate(form.endDate, 'YYYY-MM-DD') }}</text>
  23. </view>
  24. <view class="info-row">
  25. <text class="label">研究类型</text>
  26. <text class="value">{{ getDictLabel('sci_pjt_type', form.studyType) }}</text>
  27. </view>
  28. <view class="info-row">
  29. <text class="label">所属科室</text>
  30. <text class="value">{{ form.deptName || '-' }}</text>
  31. </view>
  32. <view class="info-row">
  33. <text class="label">统计年度</text>
  34. <text class="value">{{ form.statisticalYear || '-' }}</text>
  35. </view>
  36. <view class="info-row">
  37. <text class="label">项目负责人</text>
  38. <text class="value">{{ form.projectLeaderName || '-' }}</text>
  39. </view>
  40. <view class="info-row">
  41. <text class="label">负责人电话</text>
  42. <text class="value">{{ form.projectLeaderPhone || '-' }}</text>
  43. </view>
  44. <view class="info-row">
  45. <text class="label">负责人邮箱</text>
  46. <text class="value">{{ form.projectLeaderMail || '-' }}</text>
  47. </view>
  48. <view class="info-row" v-if="form.isEthics === '10'">
  49. <text class="label">伦理时间</text>
  50. <text class="value">{{ form.ethicsTime || '-' }}</text>
  51. </view>
  52. <view class="info-row column">
  53. <text class="label">研究内容</text>
  54. <text class="value remark">{{ form.researchSection || '-' }}</text>
  55. </view>
  56. <view class="info-row column">
  57. <text class="label">研究方向</text>
  58. <text class="value remark">{{ form.researchDirection || '-' }}</text>
  59. </view>
  60. <view class="info-row column">
  61. <text class="label">预期成果</text>
  62. <text class="value remark">{{ form.expectedResults || '-' }}</text>
  63. </view>
  64. </view>
  65. <!-- 附件信息 -->
  66. <AttachmentList :list="form.fileList" />
  67. </template>
  68. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  69. </view>
  70. </template>
  71. <script setup lang="ts">
  72. import { ref, onMounted, watch } from 'vue';
  73. import { useDict } from '@/hooks/useDict';
  74. import { useDocumentApi } from '@/api/document';
  75. import { formatDate } from '@/utils/date';
  76. import to from 'await-to-js';
  77. import AttachmentList from './AttachmentList.vue';
  78. const props = defineProps<{
  79. code: string;
  80. }>();
  81. const { getDictLabel } = useDict('sci_pjt_level', 'sci_pjt_type');
  82. const documentApi = useDocumentApi();
  83. const form = ref<any>(null);
  84. const loading = ref(false);
  85. const fetchData = async () => {
  86. if (!props.code) return;
  87. loading.value = true;
  88. const [err, res] = await to(documentApi.getSpontaneityPlanByCode(props.code));
  89. if (!err && res?.data) {
  90. form.value = res.data;
  91. }
  92. loading.value = false;
  93. };
  94. onMounted(() => {
  95. fetchData();
  96. });
  97. watch(() => props.code, () => {
  98. fetchData();
  99. });
  100. </script>
  101. <style lang="scss" scoped>
  102. @import "./common.scss";
  103. .file-list {
  104. .file-item {
  105. padding: 20rpx;
  106. background: #f8f9fc;
  107. border-radius: 12rpx;
  108. margin-bottom: 16rpx;
  109. .m-header {
  110. margin-bottom: 8rpx;
  111. font-size: 24rpx;
  112. .m-type { color: #888; }
  113. .m-required { color: #ff4d4f; margin-left: 5rpx; }
  114. }
  115. .m-name {
  116. font-size: 28rpx;
  117. color: var(--primary-color);
  118. word-break: break-all;
  119. }
  120. }
  121. }
  122. </style>