| | |
| | | <el-space> |
| | | <el-button type="primary" :icon="Plus" @click="openDia(undefined, 'add')">新建</el-button> |
| | | <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button> |
| | | <!-- <el-button type="info" plain :icon="Download" @click="handleExport">导出</el-button> --> |
| | | <el-button type="info" plain :icon="Download" @click="handleExport">导出</el-button> |
| | | </el-space> |
| | | <!-- 表格组件 --> |
| | | <div> |
| | |
| | | }; |
| | | // 导出出库 |
| | | const handleExport = () => { |
| | | |
| | | const config = { api: "/salesRecord/export", name: "销售出库" }; |
| | | proxy.$modal |
| | | .confirm( |
| | | "是否要导出" + |
| | | (selectedRows.value.length > 0 |
| | | ? `选中的${selectedRows.value.length}条` |
| | | : "全部") + |
| | | "数据?" |
| | | ) |
| | | .then((res) => { |
| | | if (res) { |
| | | ElMessage.success("正在导出数据,请稍候..."); |
| | | exportData(config.api, config.name); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | const exportData = (api, name) => { |
| | | proxy.download( |
| | | api, |
| | | { exportIds: selectedRows.value.map((row) => row.id) }, |
| | | `${new Date().getTime()}${name}${new Date().toLocaleDateString("en-CA")}.xlsx` |
| | | ); |
| | | ElMessage.success("导出数据:" + name); |
| | | }; |
| | | // 选择行 |
| | | const handleSelectionChange = (selection) => { |