gaoluyang
2 天以前 092f67b26c5ab06a479341f5af80ea8e1642d43e
src/views/reportAnalysis/projectProfit/index.vue
@@ -7,6 +7,7 @@
      <el-form-item>
        <el-button type="primary" @click="getTableData"> 搜索 </el-button>
        <el-button @click="resetFilters"> 重置 </el-button>
        <el-button @click="handleOut"> 导出 </el-button>
      </el-form-item>
    </el-form>
    <div class="table_list">
@@ -20,7 +21,7 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @pagination="onCurrentChange"
        @pagination="changePage"
      ></PIMTable>
    </div>
  </div>
@@ -29,7 +30,10 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { getPurchaseList } from "@/api/procurementManagement/projectProfit";
import { onMounted } from "vue";
import { onMounted, getCurrentInstance } from "vue";
import { ElMessageBox } from "element-plus";
const { proxy } = getCurrentInstance();
defineOptions({
  name: "项目利润",
@@ -93,6 +97,26 @@
  ]
);
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// 导出
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      proxy.download("/purchase/report/export", {}, "项目利润.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
onMounted(() => {
  getTableData();
});