zhouwx
2025-04-03 515a8f4d3ceebd79cc6617ad44cb500b8d99ea6e
专家导出
已修改2个文件
54 ■■■■■ 文件已修改
src/api/projectManage.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyReview/projectManage/index.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/projectManage.js
@@ -116,3 +116,11 @@
    })
}
// 导出专家
export function exportExpertData(params) {
    return request({
        url: '/system/management/selectProjectData',
        method: 'get',
        params: params
    })
}
src/views/safetyReview/projectManage/index.vue
@@ -137,11 +137,20 @@
        </div>
      </template>
      <template #footer>
        <div style="flex: auto">
        <div style="display: flex;align-items: center;justify-content: space-between">
          <vue3-json-excel
              :json-data="expertList"
              :fields="fields"
              name="专家汇总表.xlsx"
          >
            <el-button type="primary" plain @click="handleExport">导出专家汇总表</el-button>
          </vue3-json-excel>
          <div>
          <el-button type="primary" @click="searchClick">查询</el-button>
          <el-button type="warning" @click="reset">重置</el-button>
          <el-button @click="confirmClick">取消</el-button>
          </div>
        </div>
      </template>
    </el-drawer>
@@ -154,7 +163,7 @@
// import {delProject, getProjectList, getProjectStatistics} from "@/api/projectManage/project";
import {ElMessage, ElMessageBox} from "element-plus";
import Cookies from "js-cookie"
import {delProject, exportData, getProjectList, getProjectNum} from "@/api/projectManage";
import {delProject, exportData, exportExpertData, getProjectList, getProjectNum} from "@/api/projectManage";
// import * as XLSX from 'xlsx';
import XLSX from 'xlsx-js-style';
import {listDept} from "@/api/system/dept";
@@ -191,6 +200,16 @@
  }
});
const expertList = ref([])
// 导出表格
const fields = ref({
  '姓名':'expertName',
  '处室':'deptName',
  '专家费': 'expertFee',
  '申请时间': 'createTime',
  '事由': 'projectName',
});
const searchTime = ref([]);
const area = ref([]);
const stateList = ref([
@@ -224,6 +243,7 @@
  getList()
  getDeptList()
  getStatistics()
  exportEData()
  // getArea();
  // getBusinessList();
  // getRiskList();
@@ -254,6 +274,25 @@
  }
}
const exportEData = async () => {
  const {pageSize,pageNum,step,...data} = search.queryParams
  const res = await exportExpertData(data);
  if (res.code == 200) {
    if(res.data && res.data.length > 0){
      expertList.value = res.data
    }else {
      expertList.value = []
    }
  } else {
    ElMessage.warning(res.message)
  }
}
const handleExport = () => {
  if(expertList.value && expertList.value.length == 0){
    ElMessage.warning('暂无数据导出')
  }
}
function getDeptList() {
  listDept({
    deptName: undefined,
@@ -472,6 +511,7 @@
  }
  getList();
  getStatistics();
  exportEData()
  showDrawer.value = false;
}
const reset = () => {