feat: sale_quotation
This commit is contained in:
parent
5b38710ddf
commit
783f92bf18
|
@ -35,6 +35,7 @@ import * as vehicleUsage from './vehicleUsage';
|
|||
import * as saleQuotationGroup from './saleQuotationGroup';
|
||||
import * as saleQuotationComponent from './saleQuotationComponent';
|
||||
import * as saleQuotationTemplate from './saleQuotationTemplate';
|
||||
import * as saleQuotation from './saleQuotation';
|
||||
|
||||
export default {
|
||||
auth,
|
||||
|
@ -70,4 +71,5 @@ export default {
|
|||
saleQuotationGroup,
|
||||
saleQuotationComponent,
|
||||
saleQuotationTemplate,
|
||||
saleQuotation
|
||||
};
|
||||
|
|
|
@ -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 }),
|
||||
});
|
||||
}
|
|
@ -26,6 +26,7 @@ import { useFormModal, useModal } from '@/hooks/useModal';
|
|||
import { formSchemas } from './formSchemas';
|
||||
|
||||
import { ref, onMounted } from 'vue';
|
||||
import fileDownload from 'js-file-download';
|
||||
defineOptions({
|
||||
name: 'SaleQuotationTemplate',
|
||||
});
|
||||
|
@ -46,6 +47,7 @@ onMounted(() => {
|
|||
dataIndex: 'ACTION',
|
||||
hideInSearch: true,
|
||||
actions: ({ record }) => [
|
||||
|
||||
{
|
||||
icon: 'ant-design:edit-outlined',
|
||||
tooltip: '编辑',
|
||||
|
@ -66,14 +68,25 @@ onMounted(() => {
|
|||
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 打开新增/编辑弹窗
|
||||
|
|
Loading…
Reference in New Issue