DutiesForm.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. <CommonSection title="社会任职信息" :isFirst="true">
  6. <CommonInfoRow label="人员姓名" :value="form.dutPersonnelName || form.memberName" />
  7. <CommonInfoRow label="所属科室" :value="form.dutDeptName || form.deptName" />
  8. <CommonInfoRow label="社会任职/兼职" :value="form.dutType === '10' ? '任职' : (form.dutType === '20' ? '兼职' : '-')" />
  9. <CommonInfoRow label="社会任职机构名称" :value="form.dutCommitteeName || form.orgName" />
  10. <CommonInfoRow label="任职级别" :value="getDictLabel('sci_duties_dutCommitteeLevel', form.dutCommitteeLevel) || getDictLabel('sci_duty_level', form.dutyLevel)" />
  11. <CommonInfoRow label="任职类型" :value="getDictLabel('sci_duties_dutCommitteeType', form.dutCommitteeType)" />
  12. <CommonInfoRow label="发证单位" :value="form.dutOrganizer" />
  13. <CommonInfoRow label="职务" :value="form.dutDuties || form.positionName" />
  14. <CommonInfoRow label="聘期" :value="formatDate(form.dutStartDate || form.startDate) + ' 至 ' + formatDate(form.dutEndDate || form.endDate)" />
  15. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  16. </CommonSection>
  17. <!-- 附件 -->
  18. <AttachmentList :list="form.fileList" title="证明材料" />
  19. </template>
  20. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  21. </view>
  22. </template>
  23. <script setup lang="ts">
  24. import { ref, onMounted, watch } from 'vue';
  25. import { useDict } from '@/hooks/useDict';
  26. import { useDocumentApi } from '@/api/document';
  27. import { formatDate } from '@/utils/date';
  28. import to from 'await-to-js';
  29. import CommonSection from '@/components/ui/CommonSection.vue';
  30. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  31. import AttachmentList from './AttachmentList.vue';
  32. const props = defineProps<{
  33. code: string;
  34. }>();
  35. const { getDictLabel } = useDict('sci_duties_dutCommitteeLevel', 'sci_duties_dutCommitteeType', 'sci_duty_level');
  36. const documentApi = useDocumentApi();
  37. const form = ref<any>(null);
  38. const loading = ref(false);
  39. const fetchData = async () => {
  40. if (!props.code) return;
  41. loading.value = true;
  42. const [err, res] = await to(documentApi.getDutiesById(props.code));
  43. if (!err && res?.data) {
  44. form.value = res.data;
  45. }
  46. loading.value = false;
  47. };
  48. onMounted(() => {
  49. fetchData();
  50. });
  51. watch(() => props.code, () => {
  52. fetchData();
  53. });
  54. </script>
  55. <style lang="scss" scoped>
  56. @import "./common.scss";
  57. </style>