吉安感知网项目-前端
张含笑
2026-01-31 3993136da4d39536095b9180187dc29dda32a672
feat:机构需求变更
2 files modified
31 ■■■■ changed files
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/agenciesApi.js 3 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue 28 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/agenciesApi.js
@@ -57,10 +57,11 @@
}
// 导出模板
export const agenciesExportTemplateApi = () => {
export const agenciesExportTemplateApi = params => {
  return request({
    url: `/blade-system/dept/export-template`,
    method: 'get',
    params,
    responseType: 'blob',
  })
}
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
@@ -53,7 +53,8 @@
    <div class="gd-table-container" v-loading="loading">
      <div class="gd-table-content gd-table-content-bg">
        <el-table class="gd-table" :data="list">
        <el-table class="gd-table" :data="list" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="46" />
          <el-table-column label="序号" width="80">
            <template v-slot="{ $index }">
              {{ $index + 1 }}
@@ -174,6 +175,7 @@
const dialogVisible = ref(false)
const regionOptions = ref([]) // 区域选项
const dictObj = ref({}) // 字典对象
const selectedFiles = ref([]) // 勾选的文件列表
// 树形选择器配置
const treeSelectProps = {
@@ -181,8 +183,6 @@
  label: 'name',
  children: 'children'
}
// 导入机构相关
const isShowImportView = ref(false)
const importFileName = ref('')
@@ -324,6 +324,11 @@
  }
}
// 勾选值设置
function handleSelectionChange(rows) {
  selectedFiles.value = rows
}
// 导出模板
async function handleExportTemplate() {
  templateExportLoading.value = true
@@ -396,15 +401,26 @@
// 导出机构
async function handleExport() {
  // 检查是否有选中的数据
  if (selectedFiles.value.length === 0) {
    ElMessage.warning('请选择要导出的机构')
    return
  }
  exportLoading.value = true
  try {
    const res = await agenciesExportApi(searchParams.value)
    const params = {}
    params.deptIds = selectedFiles.value.map(i => i.id)
    // 调用导出API
    const res = await agenciesExportApi(params)
    const blob = new Blob([res.data])
    const url = URL.createObjectURL(blob)
    const a = document.createElement('a')
    a.href = url
    // `机构列表${new Date().getTime()}.xlsx`
    a.download = `机构列表.xlsx`
        // `机构列表${new Date().getTime()}.xlsx`
    const fileName = `机构列表.xlsx`
    a.download = fileName
    document.body.appendChild(a)
    a.click()
    document.body.removeChild(a)