| | |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
| | | <el-button @click="resetForm"> 重置 </el-button> |
| | | <el-button @click="handleOut" type="primary">导出</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | }; |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | const exportIds = selectedRows.value.map((item) => item.id); |
| | | const confirmMsg = exportIds.length |
| | | ? `已选中 ${exportIds.length} 条数据,将导出选中内容,是否确认?` |
| | | : "未选中数据,将导出全部数据,是否确认?"; |
| | | ElMessageBox.confirm(confirmMsg, "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/invoiceRegistration/export", {}, "开票登记信息.xlsx"); |
| | | // 勾选则导出选中行,未勾选导出全部 |
| | | const params = exportIds.length ? { ids: exportIds } : {}; |
| | | proxy.download("/invoiceRegistration/export", params, "开票登记信息.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |