| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <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="form.achievementBelongUnitName" />
- <CommonInfoRow label="提交部门" :value="form.commitDeptName" />
- <CommonInfoRow label="提交日期" :value="formatDate(form.commitDate, 'YYYY-MM-DD')" />
- <CommonInfoRow label="是否已发布" :value="form.isPublished === '10' ? '是' : '否'" />
- <CommonInfoRow label="发布日期" :value="formatDate(form.publishDate, 'YYYY-MM-DD')" />
- <CommonInfoRow label="单位排名" :value="form.unitRanking" />
- <CommonInfoRow label="所有制定单位" :value="form.belongEnactedUnit" isColumn />
- <CommonInfoRow label="所有参与人员" :value="form.belongEngagePersonal" isColumn />
- <CommonInfoRow label="标准类型" :value="getDictLabel('achievement_standard_type', form.standardType)" />
- <CommonInfoRow label="归属年度" :value="form.belongYear" />
- <CommonInfoRow label="归属团队" :value="form.belongTeam" />
- <view class="info-row">
- <text class="label">归属平台</text>
- <view class="platform-tags">
- <template v-if="platformList.length > 0">
- <uv-tags v-for="(item, index) in platformList" :key="index" :text="item.platformName === '其他' ? '其他' : (item.platformType ? item.platformName + ' (' + item.platformType + ')' : item.platformName)" type="primary" plain size="mini" class="mr5"></uv-tags>
- </template>
- <text v-else>-</text>
- </view>
- </view>
- <CommonInfoRow label="备注" :value="form.remark" isColumn />
- </CommonSection>
- <!-- 附件 -->
- <AttachmentList :file="attachment" title="标准电子版" />
- <!-- 制定人信息 -->
- <view class="common-section-card mt20" v-if="form.enactedPersonal?.length">
- <view class="section-title">制定人信息</view>
- <view class="achievement-card" v-for="(item, index) in form.enactedPersonal" :key="index">
- <view class="a-header mb20">
- <text class="a-name">{{ item.enactedPersonName }}</text>
- <text class="a-tag">{{ getDictLabel('enacted_person_type', item.enactedPersonType) }}</text>
- </view>
- <view class="a-body">
- <view class="a-row">
- <text class="al">学位:</text>
- <text class="av">{{ getDictLabel('sci_academic_degree', item.enactedPersonDegree) }}</text>
- </view>
- <view class="a-row">
- <text class="al">贡献率:</text>
- <text class="av">{{ item.contributionRate }}%</text>
- </view>
- <view class="a-row">
- <text class="al">工作单位:</text>
- <text class="av">{{ item.workUnitName || '-' }}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 审批记录 -->
- <CommonSection title="审批记录" v-if="form.id">
- <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_achievement_standard" />
- </CommonSection>
- </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 AttachmentList from './AttachmentList.vue';
- import FlowTable from '@/pages/project/components/detail/FlowTable.vue';
- import CommonSection from '@/components/ui/CommonSection.vue';
- import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
- const props = defineProps<{
- code: string;
- }>();
- const { getDictLabel } = useDict('achievement_standard_type', 'enacted_person_type', 'sci_academic_degree');
- const documentApi = useDocumentApi();
- const form = ref<any>(null);
- const loading = ref(false);
- const attachment = computed(() => {
- if (form.value?.standardFile) {
- try {
- return JSON.parse(form.value.standardFile);
- } catch (e) {
- return null;
- }
- }
- return null;
- });
- const platformDisplay = computed(() => {
- const belong = form.value?.belongPlatform;
- if (belong) {
- if (belong === '其他') return '其他';
- try {
- const data = JSON.parse(belong);
- if (Array.isArray(data)) {
- return data.map((item: any) => item.platformName === '其他' ? item.platformName : `${item.platformName} (${item.platformType})`).join(', ');
- }
- return belong;
- } catch (e) {
- return belong;
- }
- }
- return '-';
- });
- const platformList = computed(() => {
- const belong = form.value?.belongPlatform;
- if (belong) {
- try {
- const data = JSON.parse(belong);
- if (Array.isArray(data)) {
- return data;
- }
- } catch (e) {
- return [];
- }
- }
- return [];
- });
- const fetchData = async () => {
- if (!props.code) return;
- loading.value = true;
- // 直接通过 ID 获取以对齐 PC 逻辑
- const [err, res] = await to(documentApi.getAchievementStandardById(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";
- .info-row {
- display: flex;
- justify-content: space-between;
- padding: 24rpx 0;
- border-bottom: 2rpx dashed #f5f5f5;
- font-size: 28rpx;
- .label {
- color: #343a3f;
- width: 200rpx;
- flex-shrink: 0;
- margin-right: 20rpx;
- }
- }
- </style>
|