账单导出
This commit is contained in:
@@ -24,7 +24,7 @@ export async function exportBill(id: number) {
|
||||
return downloadBlob(`/recon/bill/${id}/export`, {}, '门店账单.xlsx');
|
||||
}
|
||||
|
||||
/** 批量导出账单:同一门店合并工作表,不同门店拆分为多个工作表 */
|
||||
/** 批量导出账单:同一门店数据合并为一张表,不同门店拆分为多个工作表 */
|
||||
export async function exportBills(ids: number[]) {
|
||||
return downloadBlob('/recon/bill/batch-export', { ids }, '门店账单_批量导出.xlsx');
|
||||
}
|
||||
|
||||
@@ -99,7 +99,10 @@ function SearchForm<T extends Record<string, any> = any>(props: SearchFormProps<
|
||||
|
||||
const resetButton = (
|
||||
<Button
|
||||
onClick={() => form.resetFields()}
|
||||
onClick={() => {
|
||||
form.resetFields();
|
||||
form.submit();
|
||||
}}
|
||||
{...submitter?.resetButtonProps}
|
||||
>
|
||||
{submitter?.resetText || t('xin.table.search.reset')}
|
||||
|
||||
@@ -225,7 +225,7 @@ export default function XinTable<T extends Record<string, any> = any>(props: Xin
|
||||
// 移除 空值
|
||||
Object.keys(searchValues).forEach((key) => {
|
||||
const value = searchValues[key];
|
||||
if (value === '' || value === undefined || value === null) {
|
||||
if (value === '' || value === undefined || value === null || (isArray(value) && value.length === 0)) {
|
||||
delete searchValues[key];
|
||||
} else if (dayjs.isDayjs(value)) {
|
||||
dateSearch[key] = value.format('YYYY-MM-DD');
|
||||
@@ -235,12 +235,14 @@ export default function XinTable<T extends Record<string, any> = any>(props: Xin
|
||||
delete searchValues[key];
|
||||
}
|
||||
});
|
||||
const params: RequestParams = {
|
||||
...requestParams,
|
||||
...searchValues,
|
||||
...dateSearch,
|
||||
page: 1,
|
||||
};
|
||||
const params: RequestParams = { ...requestParams };
|
||||
// 先移除上一次搜索条件,再写入当前表单值,避免清空或重置后旧条件仍留在请求中
|
||||
columns.forEach((column) => {
|
||||
if (!column.hideInSearch && column.dataIndex) {
|
||||
delete params[String(column.dataIndex)];
|
||||
}
|
||||
});
|
||||
Object.assign(params, searchValues, dateSearch, { page: 1 });
|
||||
setRequestParams(params);
|
||||
await handleRequest(params);
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ const BillPage: React.FC = () => {
|
||||
// 单独导出(每行一张账单,账单内明细按商品合并)
|
||||
const [exportingId, setExportingId] = useState<number | null>(null);
|
||||
|
||||
// 批量导出(同一门店合并工作表,不同门店拆分工作表)
|
||||
// 批量导出(同一门店账单数据合并为一张表,不同门店拆分工作表)
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
|
||||
const [batchExporting, setBatchExporting] = useState(false);
|
||||
|
||||
@@ -435,7 +435,7 @@ const BillPage: React.FC = () => {
|
||||
<Text type="secondary">
|
||||
采购单完成后在「采购单」页生成,每个门店单独一张;账单总金额 = 商品金额 + 配送费 + 附加金额(周转筐/托盘)+ 售后金额(可正负);
|
||||
每行可单独导出为一个 Excel(账单内明细按商品合并);也可勾选多张账单批量导出,
|
||||
同一门店合并在一张工作表,不同门店自动拆分为多个工作表。
|
||||
同一门店的账单数据合并为一张表(同商品汇总),不同门店自动拆分为多个工作表。
|
||||
</Text>
|
||||
</div>
|
||||
<XinTable<IBill> {...tableProps} />
|
||||
|
||||
Reference in New Issue
Block a user