RewardForm.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. <!-- 1. 项目信息 -->
  6. <CommonSection title="项目信息" :isFirst="true">
  7. <CommonInfoRow label="项目名称" :value="form.projectName" />
  8. <CommonInfoRow label="项目类型" :value="getProjectTypeName(form.projectType)" />
  9. <CommonInfoRow label="项目编号" :value="form.projectNo" />
  10. <CommonInfoRow label="负责人" :value="form.projectIncharge" />
  11. <CommonInfoRow label="预算金额" :value="form.projectBudgetAmount" suffix=" 万元" isAmount />
  12. <CommonInfoRow label="已分割绩效" :value="form.projectIssuedAmount" suffix=" 万元" isAmount />
  13. <CommonInfoRow label="未分割绩效" :value="form.projectNotIssuedAmount" suffix=" 万元" isAmount />
  14. <CommonInfoRow label="项目到账" :value="form.projectReceivedAmount" suffix=" 万元" isAmount />
  15. <CommonInfoRow label="绩效总额" :value="form.projectRewardAmount" suffix=" 万元" isAmount />
  16. <CommonInfoRow label="备注摘要" :value="form.remark" isColumn />
  17. </CommonSection>
  18. <!-- 2. 分割明细 -->
  19. <CommonSection title="分割明细" v-if="form.detail?.length">
  20. <view class="member-list">
  21. <view class="member-item" v-for="(item, index) in form.detail" :key="index">
  22. <view class="m-header">
  23. <text class="m-name">{{ item.memberName }}</text>
  24. <text class="m-no">{{ item.memberNo }}</text>
  25. </view>
  26. <view class="m-row">
  27. <text class="ml">工作单位</text>
  28. <text class="pv">{{ item.unit || '-' }}</text>
  29. </view>
  30. <view class="m-row">
  31. <text class="ml">分割金额</text>
  32. <text class="pv primary-color">¥{{ item.amount }} 元</text>
  33. </view>
  34. <view class="m-row">
  35. <text class="ml">创建时间</text>
  36. <text class="pv">{{ formatDate(item.createdTime) }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </CommonSection>
  41. <!-- 3. 附件 -->
  42. <AttachmentList :list="form.fileList" title="相关附件" />
  43. </template>
  44. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  45. </view>
  46. </template>
  47. <script setup lang="ts">
  48. import { ref, onMounted, watch } from 'vue';
  49. import { useDocumentApi } from '@/api/document';
  50. import { formatDate } from '@/utils/date';
  51. import to from 'await-to-js';
  52. import CommonSection from '@/components/ui/CommonSection.vue';
  53. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  54. import AttachmentList from './AttachmentList.vue';
  55. const props = defineProps<{
  56. code: string;
  57. }>();
  58. const documentApi = useDocumentApi();
  59. const form = ref<any>(null);
  60. const loading = ref(false);
  61. const getProjectTypeName = (val: string) => {
  62. const map: Record<string, string> = {
  63. '10': '纵向项目',
  64. '20': '横向项目',
  65. '30': '内部项目',
  66. '40': '重点学科',
  67. };
  68. return map[val] || val;
  69. };
  70. const fetchData = async () => {
  71. if (!props.code) return;
  72. loading.value = true;
  73. const [err, res] = await to(documentApi.getFundRewardById(props.code));
  74. if (!err && res?.data) {
  75. form.value = res.data;
  76. }
  77. loading.value = false;
  78. };
  79. onMounted(() => {
  80. fetchData();
  81. });
  82. watch(() => props.code, () => {
  83. fetchData();
  84. });
  85. </script>
  86. <style lang="scss" scoped>
  87. @import "./common.scss";
  88. .member-list {
  89. .member-item {
  90. background: #f8fafc;
  91. border-radius: 12rpx;
  92. padding: 24rpx;
  93. margin-bottom: 20rpx;
  94. border: 1rpx solid #f1f5f9;
  95. &:last-child { margin-bottom: 0; }
  96. .m-header {
  97. display: flex;
  98. justify-content: space-between;
  99. align-items: center;
  100. margin-bottom: 16rpx;
  101. padding-bottom: 16rpx;
  102. border-bottom: 1rpx dashed #e2e8f0;
  103. .m-name { font-size: 28rpx; color: #1e293b; font-weight: 700; }
  104. .m-no { font-size: 24rpx; color: #64748b; }
  105. }
  106. .m-row {
  107. display: flex;
  108. justify-content: space-between;
  109. margin-top: 10rpx;
  110. font-size: 26rpx;
  111. .ml { color: #64748b; }
  112. .pv { color: #334155; font-weight: 500; }
  113. }
  114. }
  115. }
  116. </style>