ProjectAuditForm.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="document-form">
  3. <uv-loading-icon v-if="loading" mode="circle" :text="'正在加载' + title + '详情...'"></uv-loading-icon>
  4. <template v-else-if="form">
  5. <view class="common-section-card">
  6. <view class="section-title">{{ title }}管理详情</view>
  7. <view class="info-row"><text class="label">项目名称</text><text class="value">{{ form.projectName }}</text></view>
  8. <view class="info-row"><text class="label">所属科室</text><text class="value">{{ form.deptName }}</text></view>
  9. <view class="info-row"><text class="label">负责人</text><text class="value">{{ form.projectLeaderName }}</text></view>
  10. <view class="info-row"><text class="label">申请日期</text><text class="value">{{ form.applyDate }}</text></view>
  11. <view class="info-row"><text class="label">审核年份</text><text class="value">{{ form.auditYear }}</text></view>
  12. <view class="info-row"><text class="label">进度说明</text><text class="value">{{ form.progressDesc || '-' }}</text></view>
  13. <view class="info-row"><text class="label">备注</text><text class="value">{{ form.remark || '-' }}</text></view>
  14. </view>
  15. <!-- 附件 -->
  16. <view class="common-section-card mt20" v-if="form.fileList?.length">
  17. <view class="section-title">相关附件</view>
  18. <view class="common-file-list">
  19. <view class="file-item" v-for="(file, index) in form.fileList" :key="index" @click="previewFile(file.fileUrl, file.fileName)">
  20. <view class="file-info">
  21. <text class="f-name">{{ file.fileName }}</text>
  22. <view class="f-meta">
  23. <text class="f-type">附件</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref, computed, onMounted, watch } from 'vue';
  35. import { useDocumentApi } from '@/api/document';
  36. import { previewFile } from '@/utils/file';
  37. import to from 'await-to-js';
  38. const props = defineProps<{
  39. code: string;
  40. defCode: string;
  41. }>();
  42. const title = computed(() => props.defCode === 'sci_project_inspection' ? '中期检查' : '结项审核');
  43. const documentApi = useDocumentApi();
  44. const form = ref<any>(null);
  45. const loading = ref(false);
  46. const fetchData = async () => {
  47. if (!props.code) return;
  48. loading.value = true;
  49. const [err, res] = await to(documentApi.getProjectAuditById(props.code));
  50. if (!err && res?.data) {
  51. form.value = res.data;
  52. }
  53. loading.value = false;
  54. };
  55. onMounted(() => {
  56. fetchData();
  57. });
  58. watch(() => props.code, () => {
  59. fetchData();
  60. });
  61. </script>
  62. <style lang="scss" scoped>
  63. @import "./common.scss";
  64. </style>