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