feat: sale_quotation

This commit is contained in:
louis 2024-04-15 13:50:28 +08:00
parent 5b38710ddf
commit 783f92bf18
3 changed files with 26 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import * as vehicleUsage from './vehicleUsage';
import * as saleQuotationGroup from './saleQuotationGroup'; import * as saleQuotationGroup from './saleQuotationGroup';
import * as saleQuotationComponent from './saleQuotationComponent'; import * as saleQuotationComponent from './saleQuotationComponent';
import * as saleQuotationTemplate from './saleQuotationTemplate'; import * as saleQuotationTemplate from './saleQuotationTemplate';
import * as saleQuotation from './saleQuotation';
export default { export default {
auth, auth,
@ -70,4 +71,5 @@ export default {
saleQuotationGroup, saleQuotationGroup,
saleQuotationComponent, saleQuotationComponent,
saleQuotationTemplate, saleQuotationTemplate,
saleQuotation
}; };

View File

@ -0,0 +1,9 @@
import { request, type RequestOptions } from '@/utils/request';
const baseApi = '/api/sale_quotation/sale_quotation';
/** 导出原材料盘点表 GET /api/sale_quotation/export*/
export async function exportSaleQuotation(id: number, options?: RequestOptions) {
return request(`${baseApi}/export/${id}`, {
method: 'GET',
...(options || { responseType: 'blob', isReturnResult: false }),
});
}

View File

@ -26,6 +26,7 @@ import { useFormModal, useModal } from '@/hooks/useModal';
import { formSchemas } from './formSchemas'; import { formSchemas } from './formSchemas';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import fileDownload from 'js-file-download';
defineOptions({ defineOptions({
name: 'SaleQuotationTemplate', name: 'SaleQuotationTemplate',
}); });
@ -46,6 +47,7 @@ onMounted(() => {
dataIndex: 'ACTION', dataIndex: 'ACTION',
hideInSearch: true, hideInSearch: true,
actions: ({ record }) => [ actions: ({ record }) => [
{ {
icon: 'ant-design:edit-outlined', icon: 'ant-design:edit-outlined',
tooltip: '编辑', tooltip: '编辑',
@ -66,14 +68,25 @@ onMounted(() => {
onConfirm: () => delRowConfirm(record.id), onConfirm: () => delRowConfirm(record.id),
}, },
}, },
{
icon: 'ant-design:file-excel-outlined',
tooltip: '导出',
auth: {
perm: 'sale_quotation:sale_quotation:export',
effect: 'disable',
},
onClick: () => onExport(record),
},
], ],
}, },
]; ];
}); });
const onExport = async (record:TableListItem) => {
const response = await Api.saleQuotation.exportSaleQuotation(record.id);
fileDownload(response, `${record.name}.xls`);
}
/** /**
* @description 打开新增/编辑弹窗 * @description 打开新增/编辑弹窗