Selaa lähdekoodia

Merge branch 'dev' into dev-mlchen-eom-index

mlchen 2 viikkoa sitten
vanhempi
commit
71c688d7f4

+ 82 - 0
src/api/reportForms/reportForms.js

@@ -0,0 +1,82 @@
+import request from '@/utils/request';
+
+// 去掉空查询条件,避免空字符串被后端当成过滤条件
+function formatParams(params) {
+  const result = {};
+  Object.keys(params || {}).forEach((key) => {
+    const value = params[key];
+    if (value !== '' && value !== null && value !== undefined) {
+      result[key] = value;
+    }
+  });
+  return result;
+}
+
+// 导出接口异常时后端返回的是 json 而不是文件流,这里解析出错误提示,避免下载到内容是报错的文件
+async function resolveExportBlob(res) {
+  const data = res.data;
+  const type = data && data.type ? data.type : '';
+  if (type.indexOf('application/json') > -1) {
+    let message = '导出失败';
+    try {
+      const json = JSON.parse(await data.text());
+      message = json.message || json.msg || message;
+    } catch (e) {
+      message = '导出失败';
+    }
+    return Promise.reject(new Error(message));
+  }
+  return data;
+}
+
+/**
+ * 销售报表分页
+ */
+export async function getSaleReportPage(params) {
+  const res = await request.post(
+    '/eom/report/saleShipment/page',
+    formatParams(params)
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 销售报表全量导出
+ */
+export async function exportSaleReport(params) {
+  const res = await request.post(
+    '/eom/report/saleShipment/export',
+    formatParams(params),
+    { responseType: 'blob' }
+  );
+  return resolveExportBlob(res);
+}
+
+/**
+ * 采购报表分页
+ */
+export async function getPurchaseReportPage(params) {
+  const res = await request.post(
+    '/eom/report/purchaseExecution/page',
+    formatParams(params)
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 采购报表全量导出
+ */
+export async function exportPurchaseReport(params) {
+  const res = await request.post(
+    '/eom/report/purchaseExecution/export',
+    formatParams(params),
+    { responseType: 'blob' }
+  );
+  return resolveExportBlob(res);
+}

+ 539 - 0
src/views/reportForms/purchaseReport/index.vue

@@ -0,0 +1,539 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="ele-border-lighter form-content">
+        <!-- 查询区:等宽栅格排列,控件统一占满列宽,避免各控件宽度不一 -->
+        <el-form
+          :inline="true"
+          size="small"
+          label-width="90px"
+          class="report-search-form"
+          @submit.native.prevent
+        >
+          <div class="report-search-form__fields">
+            <el-form-item label="开始时间:">
+              <el-date-picker
+                v-model="queryForm.startCreateTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择开始时间"
+                clearable
+              ></el-date-picker>
+            </el-form-item>
+            <el-form-item label="结束时间:">
+              <el-date-picker
+                v-model="queryForm.endCreateTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择结束时间"
+                clearable
+              ></el-date-picker>
+            </el-form-item>
+            <el-form-item label="项目名称:">
+              <el-input
+                v-model="queryForm.projectName"
+                placeholder="请输入项目名称"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="请购人:">
+              <el-input
+                v-model="queryForm.requisitioner"
+                placeholder="请输入请购人"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="请购单号:">
+              <el-input
+                v-model="queryForm.requisitionNumber"
+                placeholder="请输入请购单号"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="物料名称:">
+              <el-input
+                v-model="queryForm.materialName"
+                placeholder="请输入物料名称"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="采购方:">
+              <el-input
+                v-model="queryForm.procuringentity"
+                placeholder="请输入采购方"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="采购单号:">
+              <el-input
+                v-model="queryForm.purchaseOrderNumber"
+                placeholder="请输入采购单号"
+                clearable
+                @keyup.enter.native="handleSearch"
+              ></el-input>
+            </el-form-item>
+          </div>
+          <div class="report-search-form__actions">
+            <el-button icon="el-icon-refresh-left" @click="handleReset">
+              重置
+            </el-button>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="handleSearch"
+            >
+              查询
+            </el-button>
+          </div>
+        </el-form>
+
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 504px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :page-size="20"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-download"
+              class="ele-btn-icon"
+              :loading="exportLoading"
+              @click="handleExport"
+            >
+              导出
+            </el-button>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import { getPurchaseReportPage, exportPurchaseReport } from '@/api/reportForms/reportForms';
+  import { download } from '@/utils/file';
+  import { formatDate } from '@/utils/dateUtils';
+
+  // 导出文件的 mime 类型
+  const XLSX_TYPE =
+    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
+
+  // 空值统一展示为空,不显示 null / undefined
+  function emptyFormatter(row, column, cellValue) {
+    return cellValue === null || cellValue === undefined ? '' : cellValue;
+  }
+
+  // 查询区初始条件
+  function initQueryForm() {
+    return {
+      startCreateTime: '',
+      endCreateTime: '',
+      projectName: '',
+      requisitioner: '',
+      requisitionNumber: '',
+      materialName: '',
+      procuringentity: '',
+      purchaseOrderNumber: ''
+    };
+  }
+
+  export default {
+    data() {
+      return {
+        exportLoading: false, // 导出中状态
+        queryForm: initQueryForm(),
+        // 当前已生效的查询条件(不含分页字段),导出使用它而不是当前页数据
+        activeWhere: {},
+        columns: [
+          {
+            prop: 'productCode',
+            label: '项目编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'productName',
+            label: '项目名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'requirementDate',
+            label: '请购日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'requisitioner',
+            label: '请购人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'requirementCode',
+            label: '请购单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'materialName',
+            label: '物料名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'specification',
+            label: '物料规格',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'applyCount',
+            label: '申请数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'measuringUnit',
+            label: '单位',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaseDate',
+            label: '采购日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaser',
+            label: '采购人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaseOrderNo',
+            label: '采购单号/合同号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            // 合同号后端已自带 '/' 前缀,这里直接拼接,不再加分隔符
+            formatter: (row) => {
+              const orderNo = row.purchaseOrderNo || '';
+              const contractNo = row.contractNo || '';
+              return orderNo + contractNo;
+            }
+          },
+          {
+            prop: 'supplierName',
+            label: '供应商',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaseCount',
+            label: '采购数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaseUnitPrice',
+            label: '采购单价',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'purchaseTotalAmount',
+            label: '采购总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'unpurchasedCount',
+            label: '未采购数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'receiveDates',
+            label: '采购到货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'receiveCount',
+            label: '采购到货数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'unreceivedCount',
+            label: '采购未到货数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'inboundDates',
+            label: '入库日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'inboundCount',
+            label: '入库数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'paymentMode',
+            label: '付款方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'requestPaymentTime',
+            label: '请款时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'requestedAmount',
+            label: '已请货款金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'unrequestedAmount',
+            label: '未请货款金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'paymentTime',
+            label: '付款时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'paidAmount',
+            label: '已付款金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'unpaidAmount',
+            label: '未付款金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'progressNode',
+            label: '目前节点',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'invoiceNo',
+            label: '发票号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'invoiceAmount',
+            label: '发票金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'invoiceDate',
+            label: '发票日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        // 记录当前生效的查询条件,导出时使用(不带 pageNum / pageSize)
+        this.activeWhere = { ...where };
+        return getPurchaseReportPage({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      /* 组装查询条件,空值不提交 */
+      buildWhere() {
+        const where = {};
+        Object.keys(this.queryForm).forEach((key) => {
+          const value = this.queryForm[key];
+          if (value !== '' && value !== null && value !== undefined) {
+            where[key] = value;
+          }
+        });
+        return where;
+      },
+      /* 查询 */
+      handleSearch() {
+        this.$refs.table.reload({ page: 1, where: this.buildWhere() });
+      },
+      /* 重置 */
+      handleReset() {
+        this.queryForm = initQueryForm();
+        this.$refs.table.reload({ page: 1, where: {} });
+      },
+      /* 全量导出:按当前已生效的查询条件导出全部数据,不是当前页 */
+      async handleExport() {
+        if (this.exportLoading) {
+          return;
+        }
+        this.exportLoading = true;
+        try {
+          const blob = await exportPurchaseReport(this.activeWhere);
+          const name = `采购报表_${formatDate(
+            new Date(),
+            'yyyyMMddHHmmss'
+          )}.xlsx`;
+          download(new Blob([blob], { type: XLSX_TYPE }), name);
+          this.$message.success('导出成功');
+        } catch (e) {
+          this.$message.error(e && e.message ? e.message : '导出失败');
+        } finally {
+          this.exportLoading = false;
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .report-search-form {
+    margin-bottom: 12px;
+    padding: 12px 12px 8px;
+    background: #fafbfd;
+    border: 1px solid #eef1f6;
+    border-radius: 6px;
+
+    /* 条件区:自适应等宽栅格,列对齐;窗口变窄时按整列换行,不会出现参差 */
+    &__fields {
+      display: grid;
+      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
+      gap: 10px 16px;
+    }
+
+    /* 操作区:靠右并与条件区用分隔线隔开,避免和条件行混排 */
+    &__actions {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 8px;
+      padding-top: 8px;
+      border-top: 1px solid #eef1f6;
+    }
+
+    /* element-ui 的 inline 模式让表单项收缩宽度(inline-block),
+       各控件按自身内容宽度渲染才会参差不齐;这里改成 flex:
+       标签定宽、控件撑满剩余宽度,输入框与日期框因此等宽等高 */
+    :deep(.el-form-item) {
+      display: flex;
+      align-items: center;
+      margin: 0;
+    }
+
+    :deep(.el-form-item__label) {
+      flex: 0 0 auto;
+      padding-right: 8px;
+      line-height: 32px;
+    }
+
+    :deep(.el-form-item__content) {
+      display: block;
+      flex: 1 1 auto;
+      min-width: 0;
+      line-height: 32px;
+    }
+
+    :deep(.el-input),
+    :deep(.el-date-editor.el-input) {
+      width: 100%;
+    }
+  }
+</style>

+ 339 - 0
src/views/reportForms/saleReport/index.vue

@@ -0,0 +1,339 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="ele-border-lighter form-content">
+        <!-- 查询区:与采购报表同一套查询面板;条件只有 2 个,操作按钮与条件同行右对齐 -->
+        <el-form
+          :inline="true"
+          size="small"
+          label-width="90px"
+          class="report-search-form"
+          @submit.native.prevent
+        >
+          <div class="report-search-form__fields">
+            <el-form-item label="开始时间:">
+              <el-date-picker
+                v-model="queryForm.startCreateTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择开始时间"
+                clearable
+              ></el-date-picker>
+            </el-form-item>
+            <el-form-item label="结束时间:">
+              <el-date-picker
+                v-model="queryForm.endCreateTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择结束时间"
+                clearable
+              ></el-date-picker>
+            </el-form-item>
+          </div>
+          <div class="report-search-form__actions">
+            <el-button icon="el-icon-refresh-left" @click="handleReset">
+              重置
+            </el-button>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="handleSearch"
+            >
+              查询
+            </el-button>
+          </div>
+        </el-form>
+
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 405px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :page-size="20"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-download"
+              class="ele-btn-icon"
+              :loading="exportLoading"
+              @click="handleExport"
+            >
+              导出
+            </el-button>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import { getSaleReportPage, exportSaleReport } from '@/api/reportForms/reportForms';
+  import { download } from '@/utils/file';
+  import { formatDate } from '@/utils/dateUtils';
+
+  // 导出文件的 mime 类型
+  const XLSX_TYPE =
+    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
+
+  // 空值统一展示为空,不显示 null / undefined
+  function emptyFormatter(row, column, cellValue) {
+    return cellValue === null || cellValue === undefined ? '' : cellValue;
+  }
+
+  // 查询区初始条件
+  function initQueryForm() {
+    return {
+      startCreateTime: '',
+      endCreateTime: ''
+    };
+  }
+
+  export default {
+    data() {
+      return {
+        exportLoading: false, // 导出中状态
+        queryForm: initQueryForm(),
+        // 当前已生效的查询条件(不含分页字段),导出使用它而不是当前页数据
+        activeWhere: {},
+        columns: [
+          {
+            prop: 'serialNumber',
+            label: '序号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'salesmanName',
+            label: '销售人员',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'projectName',
+            label: '项目名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'partaName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'productBrand',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'createTime',
+            label: '发货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'docNo',
+            label: '发货单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'trayNum',
+            label: '托盘数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'carCount',
+            label: '装货车',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'carNo',
+            label: '车牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'saleCount',
+            label: '发货数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+          {
+            prop: 'elementCount',
+            label: '车数',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: emptyFormatter
+          },
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        // 记录当前生效的查询条件,导出时使用(不带 pageNum / pageSize)
+        this.activeWhere = { ...where };
+        return getSaleReportPage({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      /* 组装查询条件,空值不提交 */
+      buildWhere() {
+        const where = {};
+        Object.keys(this.queryForm).forEach((key) => {
+          const value = this.queryForm[key];
+          if (value !== '' && value !== null && value !== undefined) {
+            where[key] = value;
+          }
+        });
+        return where;
+      },
+      /* 查询 */
+      handleSearch() {
+        this.$refs.table.reload({ page: 1, where: this.buildWhere() });
+      },
+      /* 重置 */
+      handleReset() {
+        this.queryForm = initQueryForm();
+        this.$refs.table.reload({ page: 1, where: {} });
+      },
+      /* 全量导出:按当前已生效的查询条件导出全部数据,不是当前页 */
+      async handleExport() {
+        if (this.exportLoading) {
+          return;
+        }
+        this.exportLoading = true;
+        try {
+          const blob = await exportSaleReport(this.activeWhere);
+          const name = `销售报表_${formatDate(
+            new Date(),
+            'yyyyMMddHHmmss'
+          )}.xlsx`;
+          download(new Blob([blob], { type: XLSX_TYPE }), name);
+          this.$message.success('导出成功');
+        } catch (e) {
+          this.$message.error(e && e.message ? e.message : '导出失败');
+        } finally {
+          this.exportLoading = false;
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .report-search-form {
+    display: flex;
+    align-items: center;
+    gap: 16px;
+    margin-bottom: 12px;
+    padding: 12px 12px 8px;
+    background: #fafbfd;
+    border: 1px solid #eef1f6;
+    border-radius: 6px;
+
+    /* 条件区:等宽栅格,列宽上限 360px,两个条件不会被拉成超宽输入框 */
+    &__fields {
+      flex: 1 1 auto;
+      min-width: 0;
+      display: grid;
+      grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
+      gap: 10px 16px;
+    }
+
+    /* 操作区:与条件同一行右对齐,条件少时不再单独占一行 */
+    &__actions {
+      flex: 0 0 auto;
+      display: flex;
+      align-items: center;
+    }
+
+    /* element-ui 的 inline 模式让表单项收缩宽度(inline-block),
+       各控件按自身内容宽度渲染才会参差不齐;这里改成 flex:
+       标签定宽、控件撑满剩余宽度,输入框与日期框因此等宽等高 */
+    :deep(.el-form-item) {
+      display: flex;
+      align-items: center;
+      margin: 0;
+    }
+
+    :deep(.el-form-item__label) {
+      flex: 0 0 auto;
+      padding-right: 8px;
+      line-height: 32px;
+    }
+
+    :deep(.el-form-item__content) {
+      display: block;
+      flex: 1 1 auto;
+      min-width: 0;
+      line-height: 32px;
+    }
+
+    :deep(.el-input),
+    :deep(.el-date-editor.el-input) {
+      width: 100%;
+    }
+  }
+</style>