CircuitForm.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. <CommonSection title="基本信息" :isFirst="true">
  7. <CommonInfoRow label="集成电路布图名称" :value="form.circuitName" />
  8. <CommonInfoRow label="所属单位" :value="form.deptName" />
  9. <CommonInfoRow label="学校署名" :value="getDictLabel('sci_circuit_signature', form.circuitSchoolSignature)" />
  10. <CommonInfoRow label="登记证书号" :value="form.circuitCertificateCode" />
  11. <CommonInfoRow label="申请日期" :value="formatDate(form.applicationDate)" />
  12. <CommonInfoRow label="权利人" :value="form.obligee" />
  13. <CommonInfoRow label="权利人地址" :value="form.obligeeAddress" />
  14. <CommonInfoRow label="布图设计登记号" :value="form.circuitCode" />
  15. <CommonInfoRow label="完成日期" :value="formatDate(form.finishDate)" />
  16. <CommonInfoRow label="颁证日期" :value="formatDate(form.issueDate)" />
  17. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  18. </CommonSection>
  19. <!-- 完成人信息 -->
  20. <CommonSection title="完成人信息" v-if="form.memberList?.length">
  21. <view class="member-list">
  22. <view class="member-item" v-for="(member, index) in form.memberList" :key="index">
  23. <view class="member-header">
  24. <view class="m-left">
  25. <text class="m-name">{{ member.memberName }}</text>
  26. <text class="m-type-tag blue">{{ getDictLabel('sci_paper_author_type', member.memberType) }}</text>
  27. </view>
  28. <text class="m-tag" v-if="member.signOrder">署名顺序: {{ member.signOrder }}</text>
  29. </view>
  30. <view class="m-body">
  31. <view class="m-line"><text class="l">职工号/学号:</text><text class="v">{{ member.memberCode || '-' }}</text></view>
  32. <view class="m-line">
  33. <text class="l">性别:</text>
  34. <text class="v">{{ member.gender === '10' ? '男' : member.gender === '20' ? '女' : '-' }}</text>
  35. </view>
  36. <view class="m-line">
  37. <text class="l">学历:</text>
  38. <text class="v">{{ getDictLabel('sci_academic_degree', member.educated) }}</text>
  39. </view>
  40. <view class="m-line">
  41. <text class="l">职称:</text>
  42. <text class="v">{{ getDictLabel('sci_discipline_job_title', member.technicalTitle) }}</text>
  43. </view>
  44. <view class="m-line"><text class="l">单位/学校:</text><text class="v">{{ member.deptName || '-' }}</text></view>
  45. <view class="m-line"><text class="l">贡献率:</text><text class="v">{{ member.contributionRate || 0 }}%</text></view>
  46. </view>
  47. </view>
  48. </view>
  49. </CommonSection>
  50. <!-- 附件信息 -->
  51. <AttachmentList :list="mergedFileList" title="审批附件" />
  52. </template>
  53. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  54. </view>
  55. </template>
  56. <script setup lang="ts">
  57. import { ref, onMounted, watch, computed } from 'vue';
  58. import { useDict } from '@/hooks/useDict';
  59. import { useDocumentApi } from '@/api/document';
  60. import { formatDate } from '@/utils/date';
  61. import to from 'await-to-js';
  62. import CommonSection from '@/components/ui/CommonSection.vue';
  63. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  64. import AttachmentList from './AttachmentList.vue';
  65. const props = defineProps<{
  66. code: string;
  67. }>();
  68. const { getDictLabel } = useDict(
  69. 'sci_circuit_signature',
  70. 'sci_paper_author_type',
  71. 'sci_academic_degree',
  72. 'sci_discipline_job_title'
  73. );
  74. const documentApi = useDocumentApi();
  75. const form = ref<any>(null);
  76. const loading = ref(false);
  77. const mergedFileList = computed(() => {
  78. if (!form.value?.fileName || !form.value?.fileUrl) return [];
  79. return [{
  80. fileName: form.value.fileName,
  81. fileUrl: form.value.fileUrl,
  82. fileType: '审批附件'
  83. }];
  84. });
  85. const fetchData = async () => {
  86. if (!props.code) return;
  87. loading.value = true;
  88. const [err, res] = await to(documentApi.getCircuitByCode(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. </style>