| | |
| | | </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 |
| | | > |
| | |
| | | <!-- <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> |
| | | |
| | |
| | | // 日期范围 |
| | | datetimerange: [], |
| | | marryalls: 0, |
| | | exportDialogVisible: false, // 控制弹框 |
| | | exportType: "0", // dqyorqbsj 的值,默认当前页 |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | 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", |
| | | { |
| | |
| | | }, |
| | | `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` |
| | | ); |
| | | }, |
| | | }, |
| | | }; |