src/views/basicData/customerFile/index.vue
@@ -263,92 +263,107 @@
      </template>
    </el-dialog>
    <!-- 近3年财务报表上传 -->
    <el-dialog title="近3年财务报表上传"
    <el-dialog title="近3年财务报表"
               v-model="reportDialogVisible"
               width="900px"
               width="980px"
               @close="closeReportDialog">
      <div class="report-customer">客户:{{ reportCustomer.customerName }}</div>
      <el-form :model="reportForm"
               label-width="90px"
               inline
               class="report-form">
        <el-form-item label="报表年度">
          <el-select v-model="reportForm.reportYear"
                     placeholder="请选择年度"
                     style="width: 150px">
            <el-option v-for="year in reportYears"
                       :key="year"
                       :label="year + '年'"
                       :value="year" />
          </el-select>
        </el-form-item>
        <el-form-item label="报表名称">
          <el-input v-model="reportForm.reportName"
                    placeholder="例如:2025年度财务报表"
                    style="width: 260px"
                    clearable />
        </el-form-item>
      </el-form>
      <FileUpload v-model="reportForm.reportFiles"
                  :limit="5"
                  :file-size="20"
                  :file-type="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'zip', 'rar']" />
      <div class="report-actions">
        <el-button type="primary"
                   :loading="reportSaving"
                   @click="saveReport">保存上传</el-button>
        <el-button @click="resetReportForm">重置</el-button>
      <div class="report-dialog-head">
        <div>
          <div class="report-dialog-head__label">当前客户</div>
          <div class="report-dialog-head__name">{{ reportCustomer.customerName }}</div>
        </div>
        <el-tag type="primary" effect="light">
          已上传 {{ reportRows.length }} / 3 个年度
        </el-tag>
      </div>
      <el-table :data="reportRows"
                border
                size="small"
                style="margin-top: 16px">
        <el-table-column prop="reportYear"
                         label="年度"
                         width="90"
                         align="center" />
        <el-table-column prop="reportName"
                         label="报表名称"
                         min-width="180"
                         show-overflow-tooltip />
        <el-table-column label="报表附件"
                         min-width="260">
          <template #default="scope">
            <FileUpload v-model="scope.row.reportFiles"
                        disabled
                        :is-show-tip="false" />
          </template>
        </el-table-column>
        <el-table-column prop="uploadUserName"
                         label="上传人"
                         width="110" />
        <el-table-column prop="updateTime"
                         label="上传时间"
                         width="170" />
        <el-table-column label="审批状态"
                         width="100"
                         align="center">
          <template #default="scope">
            <el-tag :type="reportStatusTag(scope.row.auditStatus)">
              {{ reportStatusText(scope.row.auditStatus) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作"
                         width="140"
                         align="center">
          <template #default="scope">
            <el-button type="primary"
                       link
                       @click="editReport(scope.row)">修改</el-button>
            <el-button type="danger"
                       link
                       @click="deleteReport(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div v-if="reportRows.length === 0"
           class="no-record">暂无财务报表,请按年度上传近3年财务报表</div>
      <div class="report-layout">
        <div class="report-upload-card">
          <div class="report-card-title">上传或替换报表</div>
          <div class="report-card-tip">每个年度保存一组报表文件,再次保存将更新该年度记录。</div>
          <el-form :model="reportForm" label-position="top" class="report-form">
            <el-form-item label="报表年度">
              <el-select
                v-model="reportForm.reportYear"
                placeholder="请选择年度"
                style="width: 100%"
                @change="selectReportYear"
              >
                <el-option
                  v-for="year in reportYears"
                  :key="year"
                  :label="year + '年'"
                  :value="year"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="报表名称">
              <el-input
                v-model="reportForm.reportName"
                placeholder="例如:2026年度财务报表"
                clearable
              />
            </el-form-item>
            <el-form-item label="报表附件">
              <FileUpload
                v-model="reportForm.reportFiles"
                :limit="5"
                :file-size="20"
                :file-type="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'zip', 'rar']"
              />
            </el-form-item>
          </el-form>
          <div class="report-actions">
            <el-button type="primary" :loading="reportSaving" @click="saveReport">
              {{ reportYearRecord(reportForm.reportYear) ? "保存修改" : "保存上传" }}
            </el-button>
            <el-button @click="resetReportForm">清空</el-button>
          </div>
        </div>
        <div class="report-year-list">
          <div class="report-card-title">近3年上传情况</div>
          <div
            v-for="year in reportYears"
            :key="year"
            class="report-year-card"
            :class="{ 'is-empty': !reportYearRecord(year) }"
          >
            <div class="report-year-card__year">{{ year }}年</div>
            <template v-if="reportYearRecord(year)">
              <div class="report-year-card__body">
                <div class="report-year-card__name">
                  {{ reportYearRecord(year).reportName || year + "年度财务报表" }}
                </div>
                <div class="report-year-card__meta">
                  上传人:{{ reportYearRecord(year).uploadUserName || "-" }} ·
                  {{ reportYearRecord(year).updateTime || "-" }}
                </div>
                <FileUpload
                  v-model="reportYearRecord(year).reportFiles"
                  disabled
                  :is-show-tip="false"
                />
              </div>
              <div class="report-year-card__actions">
                <el-tag :type="reportStatusTag(reportYearRecord(year).auditStatus)">
                  {{ reportStatusText(reportYearRecord(year).auditStatus) }}
                </el-tag>
                <el-button type="primary" link @click="editReport(reportYearRecord(year))">
                  修改
                </el-button>
                <el-button type="danger" link @click="deleteReport(reportYearRecord(year))">
                  删除
                </el-button>
              </div>
            </template>
            <template v-else>
              <div class="report-year-card__empty">尚未上传</div>
              <el-button type="primary" link @click="selectReportYear(year)">立即上传</el-button>
            </template>
          </div>
        </div>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeReportDialog">关闭</el-button>
@@ -921,8 +936,12 @@
  const loadReports = customerId => {
    listCustomerFinancialReport({ customerId }).then(res => {
      reportRows.value = res.data || [];
      selectReportYear(reportForm.reportYear);
    });
  };
  const reportYearRecord = year =>
    reportRows.value.find(item => Number(item.reportYear) === Number(year));
  const reportStatusText = status => {
    if (status === 1) return "已通过";
@@ -937,17 +956,26 @@
  const resetReportForm = () => {
    reportForm.reportYear = nowYear;
    reportForm.reportName = "";
    reportForm.reportName = `${nowYear}年度财务报表`;
    reportForm.reportFiles = "";
  };
  const selectReportYear = year => {
    reportForm.reportYear = Number(year);
    const current = reportYearRecord(year);
    reportForm.reportName = current?.reportName || `${year}年度财务报表`;
    reportForm.reportFiles = current?.reportFiles || "";
  };
  const editReport = row => {
    reportForm.reportYear = row.reportYear;
    reportForm.reportName = row.reportName;
    reportForm.reportFiles = row.reportFiles;
    selectReportYear(row.reportYear);
  };
  const saveReport = () => {
    if (!reportForm.reportName?.trim()) {
      proxy.$modal.msgWarning("请输入报表名称");
      return;
    }
    if (!reportForm.reportFiles) {
      proxy.$modal.msgWarning("请上传财务报表附件");
      return;
@@ -1073,17 +1101,130 @@
    font-size: 14px;
  }
  .report-customer {
    font-size: 14px;
    color: #606266;
    margin-bottom: 12px;
  .report-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #eef5ff, #f8fbff);
    border: 1px solid #dbe9fb;
    border-radius: 10px;
    &__label {
      margin-bottom: 3px;
      font-size: 12px;
      color: #8491a5;
    }
    &__name {
      font-size: 17px;
      font-weight: 700;
      color: #23334d;
    }
  }
  .report-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .report-upload-card,
  .report-year-list {
    padding: 18px;
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
  }
  .report-card-title {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #26364d;
  }
  .report-card-tip {
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.6;
    color: #8a95a6;
  }
  .report-form {
    margin-bottom: 4px;
    :deep(.el-form-item) {
      margin-bottom: 14px;
    }
  }
  .report-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
  }
  .report-year-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    margin-top: 12px;
    background: #f9fbfe;
    border: 1px solid #dfe7f2;
    border-radius: 9px;
    &.is-empty {
      align-items: center;
      color: #98a2b3;
      background: #fafafa;
      border-style: dashed;
    }
    &__year {
      flex: 0 0 58px;
      padding: 6px 8px;
      font-weight: 700;
      color: #1254b5;
      text-align: center;
      background: #eaf2ff;
      border-radius: 6px;
    }
    &__body {
      flex: 1;
      min-width: 0;
    }
    &__name {
      margin-bottom: 5px;
      font-weight: 600;
      color: #303b4c;
    }
    &__meta {
      margin-bottom: 5px;
      font-size: 12px;
      color: #8a95a6;
    }
    &__actions {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 4px;
    }
    &__empty {
      flex: 1;
      font-size: 13px;
    }
  }
  @media (max-width: 900px) {
    .report-layout {
      grid-template-columns: 1fr;
    }
  }
</style>