DESKTOP-6GG29MI\dell
2025-08-29 2ae418b2ccd80953f017ca72530fd78f2eae9a42
eladmin-web-master/src/views/project/project/index.vue
@@ -122,6 +122,20 @@
        >
          报告生成
        </el-button>
        <el-button
          slot="right"
          v-permission="permission.download"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-download"
          style="margin-left: 4px !important;"
          v-loading="downloadProgressLoading"
          :disabled="crud.selections.length === 0"
          @click="doExportProjectProgress()"
        >
          项目进度导出
        </el-button>
      </crudOperation>
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="690px">
@@ -433,6 +447,7 @@
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
import constant from '@/utils/constant'
import { downloadFile } from '@/utils/index'
const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, companyId: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, contractPrePrice: null, projectPrice: null, liableUserId: null, liableUserIdList: [], planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
@@ -551,7 +566,9 @@
      // 报告生成参数
      generateReportParam: {
        loading: false
      }
      },
      // 加载
      downloadProgressLoading: false
    }
  },
  computed: {
@@ -816,6 +833,21 @@
      }).catch(() => {
        that.$message({ type: 'info', message: '已取消操作' })
      })
    },
    // 执行项目进度导出
    doExportProjectProgress() {
      const that = this
      const projects = that.crud.selections.map(p => p.id)
      if (projects.length > 0) {
        that.downloadProgressLoading = true
        that.crud.crudMethod.downloadProjectProgress({ idInList: projects }).then(result => {
          downloadFile(result, '项目进度导出数据', 'xlsx')
        }).catch(e => {
          that.$message.error(e.message)
        }).finally(() => {
          that.downloadProgressLoading = false;
        })
      }
    }
  }
}