| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <template>
- <view class="document-form">
- <uv-loading-icon v-if="loading" mode="circle" text="正在加载标准详情..."></uv-loading-icon>
- <template v-else-if="form">
- <!-- 基本信息 -->
- <CommonSection title="基本信息" :isFirst="true">
- <CommonInfoRow label="标准名称" :value="form.standardName" />
- <CommonInfoRow label="标准编号" :value="form.standardCode" />
- <CommonInfoRow label="标准类别" :value="getDictLabel('sci_standard_type', form.standardType)" />
- <CommonInfoRow label="所属单位" :value="form.deptName" />
- <CommonInfoRow label="提交时间" :value="formatDate(form.submitTime)" />
- <CommonInfoRow label="是否已发布" :value="form.publishStatus === '10' ? '是' : '否'" />
- <template v-if="form.publishStatus === '10'">
- <CommonInfoRow label="发布部门" :value="form.publishDeptName" />
- <CommonInfoRow label="发布时间" :value="formatDate(form.publishTime)" />
- </template>
- <CommonInfoRow label="所属行业" :value="form.standardProfession" />
- <CommonInfoRow label="标准属性" :value="getDictLabel('sci_standard_property', form.standardProperty)" />
- <CommonInfoRow label="备注" :value="form.remark" isColumn />
- </CommonSection>
- <!-- 制定人信息 -->
- <CommonSection title="制定人信息" v-if="form.memberList?.length">
- <view class="member-list">
- <view class="member-item" v-for="(member, index) in form.memberList" :key="index">
- <view class="member-header">
- <view class="m-left">
- <text class="m-name">{{ member.memberName }}</text>
- <text class="m-type-tag blue">{{ getDictLabel('sci_paper_author_type', member.memberType) }}</text>
- </view>
- <text class="m-tag" v-if="member.signOrder">署名顺序: {{ member.signOrder }}</text>
- </view>
- <view class="m-body">
- <view class="m-line"><text class="l">职工号/学号:</text><text class="v">{{ member.memberCode || '-' }}</text></view>
- <view class="m-line">
- <text class="l">性别:</text>
- <text class="v">{{ member.gender === '10' ? '男' : member.gender === '20' ? '女' : '-' }}</text>
- </view>
- <view class="m-line">
- <text class="l">学历:</text>
- <text class="v">{{ getDictLabel('sci_academic_degree', member.educated) }}</text>
- </view>
- <view class="m-line">
- <text class="l">职称:</text>
- <text class="v">{{ getDictLabel('sci_discipline_job_title', member.technicalTitle) }}</text>
- </view>
- <view class="m-line"><text class="l">单位/学校:</text><text class="v">{{ member.deptName || '-' }}</text></view>
- <view class="m-line"><text class="l">贡献率:</text><text class="v">{{ member.contributionRate || 0 }}%</text></view>
- </view>
- </view>
- </view>
- </CommonSection>
- <!-- 附件信息 -->
- <AttachmentList :list="mergedFileList" title="审批附件" />
- </template>
- <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
- </view>
- </template>
- <script setup lang="ts">
- import { ref, onMounted, watch, computed } from 'vue';
- import { useDict } from '@/hooks/useDict';
- import { useDocumentApi } from '@/api/document';
- import { formatDate } from '@/utils/date';
- import to from 'await-to-js';
- import CommonSection from '@/components/ui/CommonSection.vue';
- import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
- import AttachmentList from './AttachmentList.vue';
- const props = defineProps<{
- code: string;
- }>();
- const { getDictLabel } = useDict(
- 'sci_standard_type',
- 'sci_standard_property',
- 'sci_paper_author_type',
- 'sci_academic_degree',
- 'sci_discipline_job_title'
- );
- const documentApi = useDocumentApi();
- const form = ref<any>(null);
- const loading = ref(false);
- const mergedFileList = computed(() => {
- if (!form.value?.fileName || !form.value?.fileUrl) return [];
- return [{
- fileName: form.value.fileName,
- fileUrl: form.value.fileUrl,
- fileType: '审批附件'
- }];
- });
- const fetchData = async () => {
- if (!props.code) return;
- loading.value = true;
- const [err, res] = await to(documentApi.getStandardByCode(props.code));
- if (!err && res?.data) {
- form.value = res.data;
- }
- loading.value = false;
- };
- onMounted(() => {
- fetchData();
- });
- watch(() => props.code, () => {
- fetchData();
- });
- </script>
- <style lang="scss" scoped>
- @import "./common.scss";
- </style>
|