HorizontalBidForm.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. <CommonSection title="基本信息" :isFirst="true">
  7. <CommonInfoRow label="项目名称" :value="form.projectName" />
  8. <CommonInfoRow label="项目编号" :value="form.projectCode" />
  9. <CommonInfoRow label="来源单位" :value="form.sourceUnit" />
  10. <CommonInfoRow label="开标时间" :value="form.bidTime ? formatDate(form.bidTime, 'YYYY-MM-DD HH:mm') : '-'" />
  11. <CommonInfoRow label="招标平台" :value="form.bidPlatform" />
  12. <CommonInfoRow label="申请人" :value="form.applyUser" />
  13. <CommonInfoRow label="所属学院" :value="form.deptName" />
  14. <CommonInfoRow label="负责人" :value="form.leaderUser" />
  15. <CommonInfoRow label="负责人电话" :value="form.leaderUserPhone" />
  16. <CommonInfoRow label="委托人" :value="form.entrustUser" />
  17. <CommonInfoRow label="备注" :value="form.remark" isColumn />
  18. </CommonSection>
  19. <!-- 借款信息 -->
  20. <CommonSection title="借款信息">
  21. <CommonInfoRow label="是否借款" :value="form.isLoan === 1 ? '是' : '否'" />
  22. <template v-if="form.isLoan === 1">
  23. <CommonInfoRow label="支付方式" :value="form.paymentMode" />
  24. <CommonInfoRow label="保证金金额" :value="'¥' + (form.guaranteeAmount || 0)" isAmount />
  25. <CommonInfoRow label="保证金作为中介服务费" :value="form.isAgentAmount === 1 ? '是' : '否'" />
  26. </template>
  27. </CommonSection>
  28. <!-- 附件信息 -->
  29. <AttachmentList :list="allFiles" title="附件资料" />
  30. </template>
  31. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  32. </view>
  33. </template>
  34. <script setup lang="ts">
  35. import { ref, onMounted, watch, computed } from 'vue';
  36. import { formatDate } from '@/utils/date';
  37. import AttachmentList from './AttachmentList.vue';
  38. import CommonSection from '@/components/ui/CommonSection.vue';
  39. import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
  40. import { useDocumentApi } from '@/api/document';
  41. import to from 'await-to-js';
  42. const props = defineProps<{
  43. code: string | number;
  44. }>();
  45. const documentApi = useDocumentApi();
  46. const form = ref<any>(null);
  47. const loading = ref(false);
  48. const allFiles = computed(() => {
  49. if (!form.value) return [];
  50. const list: any[] = [];
  51. // 主附件
  52. if (form.value.fileUrl) {
  53. list.push({
  54. fileName: form.value.fileName || '主附件',
  55. fileUrl: form.value.fileUrl,
  56. fileType: '招标附件'
  57. });
  58. }
  59. // 借款附件
  60. const loanFiles = form.value.loanFileList || form.value.loanFiles || [];
  61. if (Array.isArray(loanFiles)) {
  62. loanFiles.forEach((f: any) => {
  63. if (f.fileUrl) {
  64. list.push({
  65. fileName: f.fileName || f.fileType,
  66. fileUrl: f.fileUrl,
  67. fileType: '借款附件'
  68. });
  69. }
  70. });
  71. }
  72. return list;
  73. });
  74. const fetchData = async () => {
  75. if (!props.code) return;
  76. loading.value = true;
  77. try {
  78. const [err, res] = await to(documentApi.getHorizontalBidByCode(props.code));
  79. if (!err && res?.data) {
  80. form.value = res.data;
  81. }
  82. } catch (error) {
  83. console.error('Fetch HorizontalBid error:', error);
  84. }
  85. loading.value = false;
  86. };
  87. onMounted(() => {
  88. fetchData();
  89. });
  90. watch(() => props.code, () => {
  91. fetchData();
  92. });
  93. </script>
  94. <style lang="scss" scoped>
  95. @import "./common.scss";
  96. </style>