feat:【antd】【erp 系统】sale/out 部分重构(列表 ok)
This commit is contained in:
@@ -23,6 +23,7 @@ export namespace ErpSaleOutApi {
|
|||||||
fileUrl?: string; // 附件地址
|
fileUrl?: string; // 附件地址
|
||||||
items?: SaleOutItem[];
|
items?: SaleOutItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SaleOutItem {
|
export interface SaleOutItem {
|
||||||
count?: number;
|
count?: number;
|
||||||
id?: number;
|
id?: number;
|
||||||
@@ -49,17 +50,9 @@ export namespace ErpSaleOutApi {
|
|||||||
customerId?: number;
|
customerId?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 销售出库状态更新参数 */
|
|
||||||
export interface SaleOutStatusParams {
|
|
||||||
id: number;
|
|
||||||
status: number;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 查询销售出库分页 */
|
||||||
* 查询销售出库分页
|
|
||||||
*/
|
|
||||||
export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) {
|
export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) {
|
||||||
return requestClient.get<PageResult<ErpSaleOutApi.SaleOut>>(
|
return requestClient.get<PageResult<ErpSaleOutApi.SaleOut>>(
|
||||||
'/erp/sale-out/page',
|
'/erp/sale-out/page',
|
||||||
@@ -69,39 +62,29 @@ export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 查询销售出库详情 */
|
||||||
* 查询销售出库详情
|
|
||||||
*/
|
|
||||||
export function getSaleOut(id: number) {
|
export function getSaleOut(id: number) {
|
||||||
return requestClient.get<ErpSaleOutApi.SaleOut>(`/erp/sale-out/get?id=${id}`);
|
return requestClient.get<ErpSaleOutApi.SaleOut>(`/erp/sale-out/get?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 新增销售出库 */
|
||||||
* 新增销售出库
|
|
||||||
*/
|
|
||||||
export function createSaleOut(data: ErpSaleOutApi.SaleOut) {
|
export function createSaleOut(data: ErpSaleOutApi.SaleOut) {
|
||||||
return requestClient.post('/erp/sale-out/create', data);
|
return requestClient.post('/erp/sale-out/create', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 修改销售出库 */
|
||||||
* 修改销售出库
|
|
||||||
*/
|
|
||||||
export function updateSaleOut(data: ErpSaleOutApi.SaleOut) {
|
export function updateSaleOut(data: ErpSaleOutApi.SaleOut) {
|
||||||
return requestClient.put('/erp/sale-out/update', data);
|
return requestClient.put('/erp/sale-out/update', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 更新销售出库的状态 */
|
||||||
* 更新销售出库的状态
|
export function updateSaleOutStatus(id: number, status: number) {
|
||||||
*/
|
|
||||||
export function updateSaleOutStatus(params: ErpSaleOutApi.SaleOutStatusParams) {
|
|
||||||
return requestClient.put('/erp/sale-out/update-status', null, {
|
return requestClient.put('/erp/sale-out/update-status', null, {
|
||||||
params,
|
params: { id, status },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 删除销售出库 */
|
||||||
* 删除销售出库
|
|
||||||
*/
|
|
||||||
export function deleteSaleOut(ids: number[]) {
|
export function deleteSaleOut(ids: number[]) {
|
||||||
return requestClient.delete('/erp/sale-out/delete', {
|
return requestClient.delete('/erp/sale-out/delete', {
|
||||||
params: {
|
params: {
|
||||||
@@ -110,9 +93,7 @@ export function deleteSaleOut(ids: number[]) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 导出销售出库 Excel */
|
||||||
* 导出销售出库 Excel
|
|
||||||
*/
|
|
||||||
export function exportSaleOut(params: ErpSaleOutApi.SaleOutPageParams) {
|
export function exportSaleOut(params: ErpSaleOutApi.SaleOutPageParams) {
|
||||||
return requestClient.download('/erp/sale-out/export-excel', {
|
return requestClient.download('/erp/sale-out/export-excel', {
|
||||||
params,
|
params,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { getSimpleUserList } from '#/api/system/user';
|
|||||||
import { getRangePickerDefaultProps } from '#/utils';
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 表单的配置项 */
|
/** 表单的配置项 */
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
fieldName: 'id',
|
fieldName: 'id',
|
||||||
@@ -82,6 +82,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入备注',
|
placeholder: '请输入备注',
|
||||||
autoSize: { minRows: 1, maxRows: 1 },
|
autoSize: { minRows: 1, maxRows: 1 },
|
||||||
|
disabled: formType === 'detail',
|
||||||
},
|
},
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
},
|
},
|
||||||
@@ -103,7 +104,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
'jpeg',
|
'jpeg',
|
||||||
'png',
|
'png',
|
||||||
],
|
],
|
||||||
showDescription: true,
|
showDescription: formType !== 'detail',
|
||||||
|
disabled: formType === 'detail',
|
||||||
},
|
},
|
||||||
formItemClass: 'col-span-3',
|
formItemClass: 'col-span-3',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
url="https://doc.iocoder.cn/erp/sale/"
|
url="https://doc.iocoder.cn/erp/sale/"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<FormModal @success="handleRefresh" />
|
|
||||||
|
|
||||||
|
<FormModal @success="handleRefresh" />
|
||||||
<Grid table-title="销售订单列表">
|
<Grid table-title="销售订单列表">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<TableAction
|
<TableAction
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
const data = modalApi.getData<{ id?: number; type: string }>();
|
const data = modalApi.getData<{ id?: number; type: string }>();
|
||||||
formType.value = data.type;
|
formType.value = data.type;
|
||||||
formApi.setDisabled(formType.value === 'detail');
|
formApi.setDisabled(formType.value === 'detail');
|
||||||
|
formApi.updateSchema(useFormSchema(formType.value));
|
||||||
if (!data || !data.id) {
|
if (!data || !data.id) {
|
||||||
// 新增时,默认选中账户
|
// 新增时,默认选中账户
|
||||||
const accountList = await getAccountSimpleList();
|
const accountList = await getAccountSimpleList();
|
||||||
|
|||||||
Reference in New Issue
Block a user