DutiesForm.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <view class="common-section-card">
  6. <view class="section-title">社会任职信息</view>
  7. <view class="info-row">
  8. <text class="label">人员姓名</text>
  9. <text class="value">{{ form.dutPersonnelName || form.memberName || '-' }}</text>
  10. </view>
  11. <view class="info-row">
  12. <text class="label">所属科室</text>
  13. <text class="value">{{ form.dutDeptName || form.deptName || '-' }}</text>
  14. </view>
  15. <view class="info-row">
  16. <text class="label">社会任职/兼职</text>
  17. <text class="value">{{ form.dutType === '10' ? '任职' : (form.dutType === '20' ? '兼职' : '-') }}</text>
  18. </view>
  19. <view class="info-row">
  20. <text class="label">社会任职机构名称</text>
  21. <text class="value">{{ form.dutCommitteeName || form.orgName || '-' }}</text>
  22. </view>
  23. <view class="info-row">
  24. <text class="label">任职级别</text>
  25. <text class="value">{{ getDictLabel('sci_duties_dutCommitteeLevel', form.dutCommitteeLevel) || getDictLabel('sci_duty_level', form.dutyLevel) || '-' }}</text>
  26. </view>
  27. <view class="info-row">
  28. <text class="label">任职类型</text>
  29. <text class="value">{{ getDictLabel('sci_duties_dutCommitteeType', form.dutCommitteeType) || '-' }}</text>
  30. </view>
  31. <view class="info-row">
  32. <text class="label">发证单位</text>
  33. <text class="value">{{ form.dutOrganizer || '-' }}</text>
  34. </view>
  35. <view class="info-row">
  36. <text class="label">职务</text>
  37. <text class="value">{{ form.dutDuties || form.positionName || '-' }}</text>
  38. </view>
  39. <view class="info-row">
  40. <text class="label">聘期</text>
  41. <text class="value">{{ (form.dutStartDate || form.startDate) || '-' }} 至 {{ (form.dutEndDate || form.endDate) || '至今' }}</text>
  42. </view>
  43. <view class="info-row"><text class="label">备注</text><text class="value">{{ form.remark || '-' }}</text></view>
  44. </view>
  45. <!-- 附件 -->
  46. <view class="common-section-card mt20" v-if="form.fileList?.length">
  47. <view class="section-title">证明材料</view>
  48. <view class="common-file-list">
  49. <view class="file-item" v-for="(file, index) in form.fileList" :key="index" @click="previewFile(file.fileUrl, file.fileName)">
  50. <view class="file-info">
  51. <text class="f-name">{{ file.fileName }}</text>
  52. <view class="f-meta">
  53. <text class="f-type">附件</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  61. </view>
  62. </template>
  63. <script setup lang="ts">
  64. import { ref, onMounted, watch } from 'vue';
  65. import { useDict } from '@/hooks/useDict';
  66. import { useDocumentApi } from '@/api/document';
  67. import { previewFile } from '@/utils/file';
  68. import to from 'await-to-js';
  69. const props = defineProps<{
  70. code: string;
  71. }>();
  72. const { getDictLabel } = useDict('sci_duties_dutCommitteeLevel', 'sci_duties_dutCommitteeType', 'sci_duty_level');
  73. const documentApi = useDocumentApi();
  74. const form = ref<any>(null);
  75. const loading = ref(false);
  76. const fetchData = async () => {
  77. if (!props.code) return;
  78. loading.value = true;
  79. const [err, res] = await to(documentApi.getDutiesById(props.code));
  80. if (!err && res?.data) {
  81. form.value = res.data;
  82. }
  83. loading.value = false;
  84. };
  85. onMounted(() => {
  86. fetchData();
  87. });
  88. watch(() => props.code, () => {
  89. fetchData();
  90. });
  91. </script>
  92. <style lang="scss" scoped>
  93. @import "./common.scss";
  94. </style>