src/views/salesManagement/invoiceRegistration/index.vue)| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /invoiceRegistration/export | 导出开票登记列表(与页面列表口径一致) |
请求参数(form 表单):
导出范围规则:**勾选了行则按勾选导出(传 ids);未勾选导出全部数据(不传参数)**。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | List<Long> | 否 | 勾选的销售台账 ID 集合,form 序列化形如 ids[0]=1&ids[1]=2;传了则仅导出这些行,不传导出全部 |
响应: Excel 二进制流(blob),文件名建议 开票登记信息.xlsx,列固定为:
| 列名 | 说明 |
|---|---|
| 销售合同号 | sales_contract_no |
| 客户合同号 | customer_contract_no |
| 客户名称 | customer_name |
| 合同金额 | sales_ledger.contract_amount |
| 已开票金额 | 开票台账 invoice_ledger 汇总,口径同列表页 |
| 未开票金额 | 合同金额 - 已开票金额 |
<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>
// 导出:勾选则导出选中行,未勾选导出全部
const handleOut = () => {
const exportIds = selectedRows.value.map((item) => item.id);
const confirmMsg = exportIds.length
? `已选中 ${exportIds.length} 条数据,将导出选中内容,是否确认?`
: "未选中数据,将导出全部数据,是否确认?";
ElMessageBox.confirm(confirmMsg, "导出", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const params = exportIds.length ? { ids: exportIds } : {};
proxy.download("/invoiceRegistration/export", params, "开票登记信息.xlsx");
})
.catch(() => {
proxy.$modal.msg("已取消");
});
};
proxy.download 即可,不要按 GET 调用。/sales/ledger/listPage,导出与其口径一致;接口路径不变(/invoiceRegistration/export),仅返回列内容由原来的"开票登记+产品明细"改为合同维度 6 列。