1
lkk
2025-04-21 333626d05a8ce4cf553e2a1e3fed1259d0814fb1
src/views/hosp/order/index.vue
@@ -161,12 +161,22 @@
    </div>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
      <!-- <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['hosp:order:export']"
          >导出</el-button
        >
      </el-col> -->
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-download"
          size="mini"
          @click="exportDialogVisible = true"
          v-hasPermi="['hosp:order:export']"
          >导出</el-button
        >
@@ -1536,6 +1546,21 @@
        <!-- <el-button @click="cancel">取 消</el-button> -->
      </div>
    </el-dialog>
    <el-dialog
      title="请选择导出范围"
      :visible.sync="exportDialogVisible"
      width="30%"
    >
      <el-radio-group v-model="exportType">
        <el-radio :label="'0'">当前页数据</el-radio>
        <el-radio :label="'1'">全部数据</el-radio>
      </el-radio-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="exportDialogVisible = false">取消</el-button>
        <el-button type="primary" @click="confirmExport">确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -1686,6 +1711,8 @@
      // 日期范围
      datetimerange: [],
      marryalls: 0,
      exportDialogVisible: false, // 控制弹框
      exportType: "0", // dqyorqbsj 的值,默认当前页
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -3114,10 +3141,27 @@
          this.Projectssopen = false;
        });
    },
    /** 导出按钮操作 */
    handleExport() {
      console.log(this.queryParams)
      this.$confirm("请选择导出范围", "导出数据", {
        distinguishCancelAndClose: true,
        confirmButtonText: "导出全部",
        cancelButtonText: "仅导出当前页",
        type: "warning",
      })
        .then(() => {
          // 用户点击了“导出全部”
          this.exportData(true);
        })
        .catch((action) => {
          if (action === "cancel") {
            // 用户点击了“仅导出当前页”
            this.exportData(false);
          }
        });
    },
    /** 导出按钮操作 */
    /*  handleExport() {
      console.log(this.queryParams);
      this.download(
        "/hosp/order/exportOrderList",
        {
@@ -3125,6 +3169,21 @@
        },
        `order_${new Date().getTime()}.xlsx`
      );
    }, */
    confirmExport() {
      this.exportDialogVisible = false;
      const exportParams = {
        ...this.queryParams,
        dqyorqbsj: this.exportType, // 添加这个字段
      };
      this.download(
        "/hosp/order/exportOrderList",
        exportParams,
        `order_${new Date().getTime()}.xlsx`
      );
    },
  },
};