ProjectClosing.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="module-container">
  3. <uv-empty v-if="projectStore.fetchConclusionLoading" mode="list" text="加载中..."></uv-empty>
  4. <view v-else-if="!projectStore.conclusionList || projectStore.conclusionList.length === 0" class="empty-wrap">
  5. <uv-empty mode="data" text="暂无结题信息"></uv-empty>
  6. </view>
  7. <view v-else class="list-wrapper">
  8. <CommonListCard
  9. v-for="(item, index) in projectStore.conclusionList"
  10. :key="index"
  11. :title="(index + 1) + '. ' + (item.batchName || '未知批次')"
  12. :statusLabel="getStatusLabel(item.approvalStatus)"
  13. :statusType="getStatusType(item.approvalStatus)"
  14. >
  15. <CommonInfoRow label="项目名称" :value="item.projectTitle || '--'" />
  16. <CommonInfoRow label="负责人" :value="item.projectHeadName || '--'" />
  17. <CommonInfoRow label="开始日期" :value="item.projectStartDate ? formatDate(item.projectStartDate) : '--'" />
  18. <CommonInfoRow label="结束日期" :value="item.projectEndDate ? formatDate(item.projectEndDate) : '--'" noBorder />
  19. </CommonListCard>
  20. </view>
  21. </view>
  22. </template>
  23. <script setup lang="ts">
  24. import { watch } from 'vue';
  25. import { useProjectStore } from '@/store/modules/project';
  26. import { formatDate } from '@/utils/date';
  27. import CommonListCard from '@/components/ui/CommonListCard.vue';
  28. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  29. const props = defineProps<{
  30. projectId: number;
  31. projectType: string;
  32. }>();
  33. const projectStore = useProjectStore();
  34. watch(() => props.projectId, (id) => {
  35. if (id) {
  36. projectStore.fetchConclusion(id, props.projectType);
  37. }
  38. }, { immediate: true });
  39. const getStatusLabel = (status: number | string) => {
  40. if (status == 10) return '待提交';
  41. if (status == 20) return '审批中';
  42. if (status == 30) return '审批通过';
  43. if (status == 40) return '审批退回';
  44. return '未知';
  45. };
  46. const getStatusType = (status: number | string) => {
  47. if (status == 10) return 'info';
  48. if (status == 20) return 'primary';
  49. if (status == 30) return 'success';
  50. if (status == 40) return 'error';
  51. return 'info';
  52. };
  53. </script>
  54. <style lang="scss" scoped>
  55. .module-container {
  56. min-height: 400rpx;
  57. position: relative;
  58. }
  59. .empty-wrap {
  60. min-height: 300rpx;
  61. display: flex;
  62. justify-content: center;
  63. align-items: center;
  64. }
  65. .list-wrapper {
  66. display: flex;
  67. flex-direction: column;
  68. gap: 20rpx;
  69. }
  70. </style>