VerticalForm.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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.projectName || '-' }}</text>
  11. </view>
  12. <view class="info-row">
  13. <text class="label">项目分类</text>
  14. <text class="value">{{ form.projectClazzName || '-' }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text class="label">项目级别</text>
  18. <text class="value">{{ getDictLabel('sci_pjt_level', form.projectLevel) }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text class="label">项目来源</text>
  22. <text class="value">{{ form.projectSource || '-' }}</text>
  23. </view>
  24. <view class="info-row">
  25. <text class="label">统计年度</text>
  26. <text class="value">{{ form.statisticalYear || '-' }}</text>
  27. </view>
  28. <view class="info-row">
  29. <text class="label">项目执行期</text>
  30. <text class="value">{{ form.planStartDate || '-' }} 至 {{ form.planEndDate || '-' }}</text>
  31. </view>
  32. <view class="info-row">
  33. <text class="label">研究类型</text>
  34. <text class="value">{{ getDictLabel('sci_pjt_type', form.studyType) }}</text>
  35. </view>
  36. <view class="info-row">
  37. <text class="label">所属科室</text>
  38. <text class="value">{{ form.deptName || '-' }}</text>
  39. </view>
  40. <view class="info-row">
  41. <text class="label">负责人</text>
  42. <text class="value">{{ form.projectLeaderName || '-' }}</text>
  43. </view>
  44. <view class="info-row">
  45. <text class="label">负责人电话</text>
  46. <text class="value">{{ form.projectLeaderPhone || '-' }}</text>
  47. </view>
  48. <view class="info-row">
  49. <text class="label">负责人邮箱</text>
  50. <text class="value">{{ form.projectLeaderMail || '-' }}</text>
  51. </view>
  52. <view class="info-row">
  53. <text class="label">是否中医药</text>
  54. <text class="value">{{ form.isMedicine === '10' ? '是' : '否' }}</text>
  55. </view>
  56. <view class="info-row">
  57. <text class="label">包干制项目</text>
  58. <text class="value">{{ form.isLumpSum === '10' ? '是' : '否' }}</text>
  59. </view>
  60. </view>
  61. <!-- 立项信息 -->
  62. <view class="common-section-card mt20">
  63. <view class="section-title">立项信息</view>
  64. <view class="info-row"><text class="label">获批时间</text><text class="value">{{ form.approvalDate || '-' }}</text></view>
  65. <view class="info-row"><text class="label">获批编号</text><text class="value">{{ form.projectNo || '-' }}</text></view>
  66. <view class="info-row">
  67. <text class="label">财政拨款</text>
  68. <view class="amount-val">
  69. <text class="num">{{ formatAmount(form.approvedFunds) }}</text>
  70. <text class="unit">万元</text>
  71. </view>
  72. </view>
  73. <view class="info-row">
  74. <text class="label">匹配经费</text>
  75. <view class="amount-val">
  76. <text class="num">{{ formatAmount(form.supportFunds) }}</text>
  77. <text class="unit">万元</text>
  78. </view>
  79. </view>
  80. <view class="info-row">
  81. <text class="label">自筹经费</text>
  82. <view class="amount-val">
  83. <text class="num">{{ formatAmount(form.selfFunds) }}</text>
  84. <text class="unit">万元</text>
  85. </view>
  86. </view>
  87. <view class="info-row">
  88. <text class="label">总经费</text>
  89. <view class="amount-val primary">
  90. <text class="num">{{ formatAmount(form.totalAmount) }}</text>
  91. <text class="unit">万元</text>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- 成员信息 -->
  96. <view class="common-section-card mt20" v-if="form.memberList?.length">
  97. <view class="section-title">成员信息</view>
  98. <view class="member-list">
  99. <view class="member-item" v-for="(row, index) in form.memberList" :key="index">
  100. <view class="member-header">
  101. <view class="name-box">
  102. <text class="m-name">{{ row.memberName }}</text>
  103. <text class="m-tag leader" v-if="row.projectRole === '10'">负责人</text>
  104. <text class="m-tag" v-else-if="row.projectRole === '20'">主要参与人</text>
  105. <text class="m-tag" v-else>一般参与人</text>
  106. </view>
  107. <text class="m-type-tag" v-if="row.memberType">{{ row.memberType === '10' ? '本院人员' : row.memberType === '20' ? '非本院人员' : '研究生' }}</text>
  108. </view>
  109. <view class="m-body">
  110. <view class="m-line" v-if="row.deptName"><text class="l">所属科室:</text><text class="v">{{ row.deptName }}</text></view>
  111. <view class="m-line" v-if="row.technicalTitle"><text class="l">职称:</text><text class="v">{{ row.technicalTitle }}</text></view>
  112. <view class="m-line" v-if="row.degree"><text class="l">学位:</text><text class="v">{{ getDictLabel('sci_academic_degree', row.degree) }}</text></view>
  113. <view class="m-line column" v-if="row.responsibleContent">
  114. <text class="l">负责内容:</text>
  115. <text class="v remark">{{ row.responsibleContent }}</text>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- 附件信息 -->
  122. <AttachmentList :list="form.fileList" />
  123. </template>
  124. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  125. </view>
  126. </template>
  127. <script setup lang="ts">
  128. import { ref, onMounted, watch } from 'vue';
  129. import { useDict } from '@/hooks/useDict';
  130. import { useDocumentApi } from '@/api/document';
  131. import { formatAmount } from '@/utils/format';
  132. import to from 'await-to-js';
  133. import AttachmentList from './AttachmentList.vue';
  134. const props = defineProps<{
  135. code: string;
  136. }>();
  137. const { getDictLabel } = useDict('sci_pjt_level', 'sci_pjt_type', 'sci_academic_degree');
  138. const documentApi = useDocumentApi();
  139. const form = ref<any>(null);
  140. const loading = ref(false);
  141. const fetchData = async () => {
  142. if (!props.code) return;
  143. loading.value = true;
  144. const [err, res] = await to(documentApi.getVerticalByCode(props.code));
  145. if (!err && res?.data) {
  146. form.value = res.data;
  147. }
  148. loading.value = false;
  149. };
  150. onMounted(() => {
  151. fetchData();
  152. });
  153. watch(() => props.code, () => {
  154. fetchData();
  155. });
  156. </script>
  157. <style lang="scss" scoped>
  158. @import "./common.scss";
  159. .amount-val {
  160. display: flex;
  161. align-items: baseline;
  162. justify-content: flex-end;
  163. .num {
  164. font-size: 30rpx;
  165. font-weight: bold;
  166. color: #444;
  167. }
  168. .unit {
  169. font-size: 22rpx;
  170. color: #999;
  171. margin-left: 4rpx;
  172. }
  173. &.primary .num {
  174. color: #1c9bfd;
  175. font-size: 34rpx;
  176. }
  177. }
  178. .member-item {
  179. background-color: #fcfdfe;
  180. border: 1rpx solid #eff3f8;
  181. border-radius: 12rpx;
  182. padding: 24rpx;
  183. margin-bottom: 20rpx;
  184. .member-header {
  185. display: flex;
  186. justify-content: space-between;
  187. align-items: center;
  188. margin-bottom: 20rpx;
  189. padding-bottom: 16rpx;
  190. border-bottom: 1rpx solid #f1f5f9;
  191. .name-box {
  192. display: flex;
  193. align-items: center;
  194. .m-name {
  195. font-size: 30rpx;
  196. font-weight: 600;
  197. color: #333;
  198. }
  199. .m-tag {
  200. font-size: 20rpx;
  201. padding: 2rpx 12rpx;
  202. border-radius: 4rpx;
  203. margin-left: 12rpx;
  204. background-color: #f1f5f9;
  205. color: #64748b;
  206. &.leader {
  207. background-color: #eff6ff;
  208. color: #1c9bfd;
  209. }
  210. }
  211. }
  212. .m-type-tag {
  213. font-size: 22rpx;
  214. color: #94a3b8;
  215. }
  216. }
  217. .m-body {
  218. .m-line {
  219. display: flex;
  220. font-size: 26rpx;
  221. margin-bottom: 8rpx;
  222. &.column {
  223. flex-direction: column;
  224. .l { margin-bottom: 8rpx; }
  225. }
  226. .l {
  227. color: #94a3b8;
  228. width: 140rpx;
  229. flex-shrink: 0;
  230. }
  231. .v {
  232. color: #475569;
  233. flex: 1;
  234. &.remark {
  235. background-color: #f8fafc;
  236. padding: 16rpx;
  237. border-radius: 8rpx;
  238. font-size: 24rpx;
  239. color: #64748b;
  240. line-height: 1.5;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .file-info {
  247. display: flex;
  248. align-items: center;
  249. padding: 20rpx;
  250. background-color: #f8fbfd;
  251. border-radius: 12rpx;
  252. border: 1rpx solid #eef2f7;
  253. margin-bottom: 16rpx;
  254. .file-text-box {
  255. margin-left: 16rpx;
  256. flex: 1;
  257. display: flex;
  258. flex-direction: column;
  259. .file-name {
  260. font-size: 26rpx;
  261. color: #1c9bfd;
  262. word-break: break-all;
  263. }
  264. .file-tag {
  265. font-size: 20rpx;
  266. color: #94a3b8;
  267. margin-top: 4rpx;
  268. }
  269. }
  270. }
  271. </style>