StandardForm.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. <view class="common-section-card">
  7. <view class="section-title">基本信息</view>
  8. <view class="info-row">
  9. <text class="label">标准名称</text>
  10. <text class="value">{{ form.standardName || '-' }}</text>
  11. </view>
  12. <view class="info-row">
  13. <text class="label">标准编号</text>
  14. <text class="value">{{ form.standardCode || '-' }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text class="label">标准类别</text>
  18. <text class="value">{{ getDictLabel('sci_standard_type', form.standardType) }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text class="label">所属单位</text>
  22. <text class="value">{{ form.deptName || '-' }}</text>
  23. </view>
  24. <view class="info-row">
  25. <text class="label">提交时间</text>
  26. <text class="value">{{ formatDate(form.submitTime, 'YYYY-MM-DD') }}</text>
  27. </view>
  28. <view class="info-row">
  29. <text class="label">是否已发布</text>
  30. <text class="value">{{ form.publishStatus === '10' ? '是' : '否' }}</text>
  31. </view>
  32. <template v-if="form.publishStatus === '10'">
  33. <view class="info-row">
  34. <text class="label">发布部门</text>
  35. <text class="value">{{ form.publishDeptName || '-' }}</text>
  36. </view>
  37. <view class="info-row">
  38. <text class="label">发布时间</text>
  39. <text class="value">{{ formatDate(form.publishTime, 'YYYY-MM-DD') }}</text>
  40. </view>
  41. </template>
  42. <view class="info-row">
  43. <text class="label">所属行业</text>
  44. <text class="value">{{ form.standardProfession || '-' }}</text>
  45. </view>
  46. <view class="info-row">
  47. <text class="label">标准属性</text>
  48. <text class="value">{{ getDictLabel('sci_standard_property', form.standardProperty) }}</text>
  49. </view>
  50. <view class="info-row house">
  51. <text class="label">备注</text>
  52. <text class="value">{{ form.remark || '-' }}</text>
  53. </view>
  54. </view>
  55. <!-- 制定人信息 -->
  56. <view class="common-section-card mt20" v-if="form.memberList?.length">
  57. <view class="section-title">制定人信息</view>
  58. <view class="member-list">
  59. <view class="member-item" v-for="(member, index) in form.memberList" :key="index">
  60. <view class="member-header">
  61. <text class="m-name">{{ member.memberName }}</text>
  62. <text class="m-tag">署名顺序: {{ member.signOrder }}</text>
  63. </view>
  64. <view class="m-body">
  65. <view class="m-line">
  66. <text class="l">作者类型:</text>
  67. <text class="v">{{ getDictLabel('sci_paper_author_type', member.memberType) }}</text>
  68. </view>
  69. <view class="m-line"><text class="l">职工号/学号:</text><text class="v">{{ member.memberCode || '-' }}</text></view>
  70. <view class="m-line">
  71. <text class="l">性别:</text>
  72. <text class="v">{{ member.gender === '10' ? '男' : member.gender === '20' ? '女' : '-' }}</text>
  73. </view>
  74. <view class="m-line">
  75. <text class="l">学历:</text>
  76. <text class="v">{{ getDictLabel('sci_academic_degree', member.educated) }}</text>
  77. </view>
  78. <view class="m-line">
  79. <text class="l">职称:</text>
  80. <text class="v">{{ getDictLabel('sci_discipline_job_title', member.technicalTitle) }}</text>
  81. </view>
  82. <view class="m-line"><text class="l">所属单位/学校:</text><text class="v">{{ member.deptName || '-' }}</text></view>
  83. <view class="m-line"><text class="l">贡献率:</text><text class="v">{{ member.contributionRate || 0 }}%</text></view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 附件信息 -->
  89. <AttachmentList
  90. v-if="form.fileName"
  91. :file="{ fileName: form.fileName, fileUrl: form.fileUrl }"
  92. title="审批附件"
  93. />
  94. </template>
  95. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  96. </view>
  97. </template>
  98. <script setup lang="ts">
  99. import { ref, onMounted, watch } from 'vue';
  100. import { useDict } from '@/hooks/useDict';
  101. import { useDocumentApi } from '@/api/document';
  102. import { formatDate } from '@/utils/date';
  103. import to from 'await-to-js';
  104. import AttachmentList from './AttachmentList.vue';
  105. const props = defineProps<{
  106. code: string;
  107. }>();
  108. const { getDictLabel } = useDict(
  109. 'sci_standard_type',
  110. 'sci_standard_property',
  111. 'sci_paper_author_type',
  112. 'sci_academic_degree',
  113. 'sci_discipline_job_title'
  114. );
  115. const documentApi = useDocumentApi();
  116. const form = ref<any>(null);
  117. const loading = ref(false);
  118. const fetchData = async () => {
  119. if (!props.code) return;
  120. loading.value = true;
  121. const [err, res] = await to(documentApi.getStandardByCode(props.code));
  122. if (!err && res?.data) {
  123. form.value = res.data;
  124. }
  125. loading.value = false;
  126. };
  127. onMounted(() => {
  128. fetchData();
  129. });
  130. watch(() => props.code, () => {
  131. fetchData();
  132. });
  133. </script>
  134. <style lang="scss" scoped>
  135. @import "./common.scss";
  136. .m-body {
  137. padding: 10rpx 0;
  138. .m-line {
  139. font-size: 26rpx;
  140. line-height: 1.6;
  141. display: flex;
  142. .l { color: #888; width: 180rpx; flex-shrink: 0; }
  143. .v { color: #333; }
  144. }
  145. }
  146. </style>