diff --git a/apps/web-antd/src/api/erp/sale/customer/index.ts b/apps/web-antd/src/api/erp/sale/customer/index.ts index 6cebd018c..1bcd1b31a 100644 --- a/apps/web-antd/src/api/erp/sale/customer/index.ts +++ b/apps/web-antd/src/api/erp/sale/customer/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpCustomerApi { - /** ERP 客户信息 */ + /** 客户信息 */ export interface Customer { id?: number; // 客户编号 name: string; // 客户名称 @@ -21,17 +21,10 @@ export namespace ErpCustomerApi { bankAccount: string; // 开户账号 bankAddress: string; // 开户地址 } - - /** 客户分页查询参数 */ - export interface CustomerPageParam extends PageParam { - name?: string; - mobile?: string; - status?: number; - } } /** 查询客户分页 */ -export function getCustomerPage(params: ErpCustomerApi.CustomerPageParam) { +export function getCustomerPage(params: PageParam) { return requestClient.get>( '/erp/customer/page', { params }, diff --git a/apps/web-antd/src/api/erp/sale/order/index.ts b/apps/web-antd/src/api/erp/sale/order/index.ts index 6aff41d82..c190a3dc1 100644 --- a/apps/web-antd/src/api/erp/sale/order/index.ts +++ b/apps/web-antd/src/api/erp/sale/order/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpSaleOrderApi { - /** ERP 销售订单信息 */ + /** 销售订单信息 */ export interface SaleOrder { id?: number; // 订单工单编号 no: string; // 销售订单号 @@ -25,6 +25,7 @@ export namespace ErpSaleOrderApi { items?: SaleOrderItem[]; // 销售订单产品明细列表 } + /** 销售订单项 */ export interface SaleOrderItem { id?: number; // 订单项编号 orderId?: number; // 采购订单编号 @@ -43,17 +44,10 @@ export namespace ErpSaleOrderApi { remark?: string; // 备注 stockCount?: number; // 库存数量(显示字段) } - - /** 销售订单分页查询参数 */ - export interface SaleOrderPageParam extends PageParam { - no?: string; - customerId?: number; - status?: number; - } } /** 查询销售订单分页 */ -export function getSaleOrderPage(params: ErpSaleOrderApi.SaleOrderPageParam) { +export function getSaleOrderPage(params: PageParam) { return requestClient.get>( '/erp/sale-order/page', { params }, diff --git a/apps/web-antd/src/api/erp/sale/out/index.ts b/apps/web-antd/src/api/erp/sale/out/index.ts index d78a91baf..a3e335af6 100644 --- a/apps/web-antd/src/api/erp/sale/out/index.ts +++ b/apps/web-antd/src/api/erp/sale/out/index.ts @@ -24,6 +24,7 @@ export namespace ErpSaleOutApi { items?: SaleOutItem[]; } + /** 销售出库项 */ export interface SaleOutItem { count?: number; id?: number; @@ -43,17 +44,10 @@ export namespace ErpSaleOutApi { warehouseId?: number; outCount?: number; } - - /** 销售出库分页查询参数 */ - export interface SaleOutPageParams extends PageParam { - no?: string; - customerId?: number; - status?: number; - } } /** 查询销售出库分页 */ -export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) { +export function getSaleOutPage(params: PageParam) { return requestClient.get>( '/erp/sale-out/page', { @@ -94,7 +88,7 @@ export function deleteSaleOut(ids: number[]) { } /** 导出销售出库 Excel */ -export function exportSaleOut(params: ErpSaleOutApi.SaleOutPageParams) { +export function exportSaleOut(params: any) { return requestClient.download('/erp/sale-out/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/sale/return/index.ts b/apps/web-antd/src/api/erp/sale/return/index.ts index adc718cc3..a0624cba2 100644 --- a/apps/web-antd/src/api/erp/sale/return/index.ts +++ b/apps/web-antd/src/api/erp/sale/return/index.ts @@ -23,6 +23,7 @@ export namespace ErpSaleReturnApi { items?: SaleReturnItem[]; } + /** 销售退货项 */ export interface SaleReturnItem { count?: number; id?: number; @@ -42,21 +43,10 @@ export namespace ErpSaleReturnApi { warehouseId?: number; returnCount?: number; } - - /** 销售退货分页查询参数 */ - export interface SaleReturnPageParams extends PageParam { - no?: string; - customerId?: number; - status?: number; - } } -/** - * 查询销售退货分页 - */ -export function getSaleReturnPage( - params: ErpSaleReturnApi.SaleReturnPageParams, -) { +/** 查询销售退货分页 */ +export function getSaleReturnPage(params: PageParam) { return requestClient.get>( '/erp/sale-return/page', { @@ -65,41 +55,31 @@ export function getSaleReturnPage( ); } -/** - * 查询销售退货详情 - */ +/** 查询销售退货详情 */ export function getSaleReturn(id: number) { return requestClient.get( `/erp/sale-return/get?id=${id}`, ); } -/** - * 新增销售退货 - */ +/** 新增销售退货 */ export function createSaleReturn(data: ErpSaleReturnApi.SaleReturn) { return requestClient.post('/erp/sale-return/create', data); } -/** - * 修改销售退货 - */ +/** 修改销售退货 */ export function updateSaleReturn(data: ErpSaleReturnApi.SaleReturn) { return requestClient.put('/erp/sale-return/update', data); } -/** - * 更新销售退货的状态 - */ +/** 更新销售退货的状态 */ export function updateSaleReturnStatus(id: number, status: number) { return requestClient.put('/erp/sale-return/update-status', null, { params: { id, status }, }); } -/** - * 删除销售退货 - */ +/** 删除销售退货 */ export function deleteSaleReturn(ids: number[]) { return requestClient.delete('/erp/sale-return/delete', { params: { @@ -108,12 +88,8 @@ export function deleteSaleReturn(ids: number[]) { }); } -/** - * 导出销售退货 Excel - */ -export function exportSaleReturn( - params: ErpSaleReturnApi.SaleReturnPageParams, -) { +/** 导出销售退货 Excel */ +export function exportSaleReturn(params: any) { return requestClient.download('/erp/sale-return/export-excel', { params, }); diff --git a/apps/web-antd/src/views/erp/finance/receipt/data.ts b/apps/web-antd/src/views/erp/finance/receipt/data.ts index 6c860a5db..259a0c9d2 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/data.ts +++ b/apps/web-antd/src/views/erp/finance/receipt/data.ts @@ -385,7 +385,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, { title: '操作', - width: 220, + width: 260, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/erp/finance/receipt/index.vue b/apps/web-antd/src/views/erp/finance/receipt/index.vue index 53e65c591..258de73fb 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/index.vue +++ b/apps/web-antd/src/views/erp/finance/receipt/index.vue @@ -196,6 +196,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ { label: row.status === 10 ? '审批' : '反审批', type: 'link', + icon: ACTION_ICON.AUDIT, auth: ['erp:finance-receipt:update-status'], popConfirm: { title: `确认${row.status === 10 ? '审批' : '反审批'}${row.no}吗?`, @@ -210,7 +211,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ label: $t('common.delete'), type: 'link', danger: true, - color: 'error', + icon: ACTION_ICON.DELETE, auth: ['erp:finance-receipt:delete'], popConfirm: { title: $t('ui.actionMessage.deleteConfirm', [row.no]), diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue index 9a9a773be..f26f53ea5 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue @@ -201,6 +201,7 @@ const [Modal, modalApi] = useVbenModal({ @update:items="handleUpdateItems" @update:total-price="handleUpdateTotalPrice" @update:receipt-price="handleUpdateReceiptPrice" + class="w-full" /> diff --git a/apps/web-ele/src/api/erp/sale/customer/index.ts b/apps/web-ele/src/api/erp/sale/customer/index.ts new file mode 100644 index 000000000..1bcd1b31a --- /dev/null +++ b/apps/web-ele/src/api/erp/sale/customer/index.ts @@ -0,0 +1,66 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpCustomerApi { + /** 客户信息 */ + export interface Customer { + id?: number; // 客户编号 + name: string; // 客户名称 + contact: string; // 联系人 + mobile: string; // 手机号码 + telephone: string; // 联系电话 + email: string; // 电子邮箱 + fax: string; // 传真 + remark: string; // 备注 + status: number; // 开启状态 + sort: number; // 排序 + taxNo: string; // 纳税人识别号 + taxPercent: number; // 税率 + bankName: string; // 开户行 + bankAccount: string; // 开户账号 + bankAddress: string; // 开户地址 + } +} + +/** 查询客户分页 */ +export function getCustomerPage(params: PageParam) { + return requestClient.get>( + '/erp/customer/page', + { params }, + ); +} + +/** 查询客户精简列表 */ +export function getCustomerSimpleList() { + return requestClient.get( + '/erp/customer/simple-list', + ); +} + +/** 查询客户详情 */ +export function getCustomer(id: number) { + return requestClient.get( + `/erp/customer/get?id=${id}`, + ); +} + +/** 新增客户 */ +export function createCustomer(data: ErpCustomerApi.Customer) { + return requestClient.post('/erp/customer/create', data); +} + +/** 修改客户 */ +export function updateCustomer(data: ErpCustomerApi.Customer) { + return requestClient.put('/erp/customer/update', data); +} + +/** 删除客户 */ +export function deleteCustomer(id: number) { + return requestClient.delete(`/erp/customer/delete?id=${id}`); +} + +/** 导出客户 Excel */ +export function exportCustomer(params: any) { + return requestClient.download('/erp/customer/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/sale/order/index.ts b/apps/web-ele/src/api/erp/sale/order/index.ts new file mode 100644 index 000000000..c190a3dc1 --- /dev/null +++ b/apps/web-ele/src/api/erp/sale/order/index.ts @@ -0,0 +1,98 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpSaleOrderApi { + /** 销售订单信息 */ + export interface SaleOrder { + id?: number; // 订单工单编号 + no: string; // 销售订单号 + customerId: number; // 客户编号 + accountId?: number; // 收款账户编号 + orderTime: Date; // 订单时间 + totalCount: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + status: number; // 状态 + remark: string; // 备注 + outCount: number; // 销售出库数量 + fileUrl?: string; // 附件地址 + inCount?: number; // 采购入库数量 + returnCount: number; // 销售退货数量 + totalProductPrice?: number; // 产品金额,单位:元 + discountPercent?: number; // 优惠率,百分比 + discountPrice?: number; // 优惠金额,单位:元 + depositPrice?: number; // 定金金额,单位:元 + items?: SaleOrderItem[]; // 销售订单产品明细列表 + } + + /** 销售订单项 */ + export interface SaleOrderItem { + id?: number; // 订单项编号 + orderId?: number; // 采购订单编号 + productId?: number; // 产品编号 + productName?: string; // 产品名称 + productBarCode?: string; // 产品条码 + productUnitId?: number; // 产品单位编号 + productUnitName?: string; // 产品单位名称 + productPrice?: number; // 产品单价,单位:元 + totalProductPrice?: number; // 产品总价,单位:元 + count?: number; // 数量 + totalPrice?: number; // 总价,单位:元 + taxPercent?: number; // 税率,百分比 + taxPrice?: number; // 税额,单位:元 + totalTaxPrice?: number; // 含税总价,单位:元 + remark?: string; // 备注 + stockCount?: number; // 库存数量(显示字段) + } +} + +/** 查询销售订单分页 */ +export function getSaleOrderPage(params: PageParam) { + return requestClient.get>( + '/erp/sale-order/page', + { params }, + ); +} + +/** 查询销售订单详情 */ +export function getSaleOrder(id: number) { + return requestClient.get( + `/erp/sale-order/get?id=${id}`, + ); +} + +/** 查询销售订单项列表 */ +export function getSaleOrderItemListByOrderId(orderId: number) { + return requestClient.get( + `/erp/sale-order/item/list-by-order-id?orderId=${orderId}`, + ); +} + +/** 新增销售订单 */ +export function createSaleOrder(data: ErpSaleOrderApi.SaleOrder) { + return requestClient.post('/erp/sale-order/create', data); +} + +/** 修改销售订单 */ +export function updateSaleOrder(data: ErpSaleOrderApi.SaleOrder) { + return requestClient.put('/erp/sale-order/update', data); +} + +/** 更新销售订单的状态 */ +export function updateSaleOrderStatus(id: number, status: number) { + return requestClient.put('/erp/sale-order/update-status', null, { + params: { id, status }, + }); +} + +/** 删除销售订单 */ +export function deleteSaleOrder(ids: number[]) { + return requestClient.delete('/erp/sale-order/delete', { + params: { ids: ids.join(',') }, + }); +} + +/** 导出销售订单 Excel */ +export function exportSaleOrder(params: any) { + return requestClient.download('/erp/sale-order/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/sale/out/index.ts b/apps/web-ele/src/api/erp/sale/out/index.ts new file mode 100644 index 000000000..a3e335af6 --- /dev/null +++ b/apps/web-ele/src/api/erp/sale/out/index.ts @@ -0,0 +1,95 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpSaleOutApi { + /** 销售出库信息 */ + export interface SaleOut { + id?: number; // 销售出库编号 + no?: string; // 销售出库号 + customerId?: number; // 客户编号 + saleUserId?: number; // 客户编号 + outTime?: Date; // 出库时间 + totalCount?: number; // 合计数量 + totalPrice?: number; // 合计金额,单位:元 + status?: number; // 状态 + remark?: string; // 备注 + discountPercent?: number; // 折扣百分比 + discountPrice?: number; // 折扣金额 + otherPrice?: number; // 其他费用 + totalProductPrice?: number; // 合计商品金额 + taxPrice?: number; // 合计税额 + totalTaxPrice?: number; // 合计税额 + fileUrl?: string; // 附件地址 + items?: SaleOutItem[]; + } + + /** 销售出库项 */ + export interface SaleOutItem { + count?: number; + id?: number; + orderItemId?: number; + productBarCode?: string; + productId?: number; + productName: string; + productPrice: number; + productUnitId?: number; + productUnitName?: string; + totalProductPrice?: number; + remark: string; + stockCount?: number; + taxPercent?: number; + taxPrice?: number; + totalPrice?: number; + warehouseId?: number; + outCount?: number; + } +} + +/** 查询销售出库分页 */ +export function getSaleOutPage(params: PageParam) { + return requestClient.get>( + '/erp/sale-out/page', + { + params, + }, + ); +} + +/** 查询销售出库详情 */ +export function getSaleOut(id: number) { + return requestClient.get(`/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(id: number, status: number) { + return requestClient.put('/erp/sale-out/update-status', null, { + params: { id, status }, + }); +} + +/** 删除销售出库 */ +export function deleteSaleOut(ids: number[]) { + return requestClient.delete('/erp/sale-out/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出销售出库 Excel */ +export function exportSaleOut(params: any) { + return requestClient.download('/erp/sale-out/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/sale/return/index.ts b/apps/web-ele/src/api/erp/sale/return/index.ts new file mode 100644 index 000000000..a0624cba2 --- /dev/null +++ b/apps/web-ele/src/api/erp/sale/return/index.ts @@ -0,0 +1,96 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpSaleReturnApi { + /** 销售退货信息 */ + export interface SaleReturn { + id?: number; // 销售退货编号 + no?: string; // 销售退货号 + customerId?: number; // 客户编号 + returnTime?: Date; // 退货时间 + totalCount?: number; // 合计数量 + totalPrice?: number; // 合计金额,单位:元 + status?: number; // 状态 + remark?: string; // 备注 + discountPercent?: number; // 折扣百分比 + discountPrice?: number; // 折扣金额 + otherPrice?: number; // 其他费用 + totalProductPrice?: number; // 合计商品金额 + taxPrice?: number; // 合计税额 + totalTaxPrice?: number; // 合计税额 + fileUrl?: string; // 附件地址 + items?: SaleReturnItem[]; + } + + /** 销售退货项 */ + export interface SaleReturnItem { + count?: number; + id?: number; + orderItemId?: number; + productBarCode?: string; + productId?: number; + productName: string; + productPrice: number; + productUnitId?: number; + productUnitName?: string; + totalProductPrice?: number; + remark: string; + stockCount?: number; + taxPercent?: number; + taxPrice?: number; + totalPrice?: number; + warehouseId?: number; + returnCount?: number; + } +} + +/** 查询销售退货分页 */ +export function getSaleReturnPage(params: PageParam) { + return requestClient.get>( + '/erp/sale-return/page', + { + params, + }, + ); +} + +/** 查询销售退货详情 */ +export function getSaleReturn(id: number) { + return requestClient.get( + `/erp/sale-return/get?id=${id}`, + ); +} + +/** 新增销售退货 */ +export function createSaleReturn(data: ErpSaleReturnApi.SaleReturn) { + return requestClient.post('/erp/sale-return/create', data); +} + +/** 修改销售退货 */ +export function updateSaleReturn(data: ErpSaleReturnApi.SaleReturn) { + return requestClient.put('/erp/sale-return/update', data); +} + +/** 更新销售退货的状态 */ +export function updateSaleReturnStatus(id: number, status: number) { + return requestClient.put('/erp/sale-return/update-status', null, { + params: { id, status }, + }); +} + +/** 删除销售退货 */ +export function deleteSaleReturn(ids: number[]) { + return requestClient.delete('/erp/sale-return/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出销售退货 Excel */ +export function exportSaleReturn(params: any) { + return requestClient.download('/erp/sale-return/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/views/erp/finance/receipt/data.ts b/apps/web-ele/src/views/erp/finance/receipt/data.ts new file mode 100644 index 000000000..28f23c400 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/data.ts @@ -0,0 +1,590 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; +import { erpPriceInputFormatter } from '@vben/utils'; + +import { getAccountSimpleList } from '#/api/erp/finance/account'; +import { getCustomerSimpleList } from '#/api/erp/sale/customer'; +import { getSimpleUserList } from '#/api/system/user'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 表单的配置项 */ +export function useFormSchema(formType: string): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'no', + label: '收款单号', + component: 'Input', + componentProps: { + placeholder: '系统自动生成', + disabled: true, + }, + }, + { + fieldName: 'receiptTime', + label: '收款时间', + component: 'DatePicker', + componentProps: { + disabled: formType === 'detail', + placeholder: '选择收款时间', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + class: '!w-full', + }, + rules: 'required', + }, + { + fieldName: 'customerId', + label: '客户', + component: 'ApiSelect', + componentProps: { + disabled: formType === 'detail', + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + labelField: 'name', + valueField: 'id', + }, + rules: 'required', + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + autoSize: { minRows: 1, maxRows: 1 }, + disabled: formType === 'detail', + }, + formItemClass: 'col-span-2', + }, + { + fieldName: 'fileUrl', + label: '附件', + component: 'FileUpload', + componentProps: { + maxNumber: 1, + maxSize: 10, + accept: [ + 'pdf', + 'doc', + 'docx', + 'xls', + 'xlsx', + 'txt', + 'jpg', + 'jpeg', + 'png', + ], + showDescription: formType !== 'detail', + disabled: formType === 'detail', + }, + formItemClass: 'col-span-3', + }, + { + fieldName: 'items', + label: '销售出库、退货单', + component: 'Input', + formItemClass: 'col-span-3', + }, + { + fieldName: 'accountId', + label: '收款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择收款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'totalPrice', + label: '合计收款', + component: 'InputNumber', + componentProps: { + placeholder: '合计收款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + controlsPosition: 'right', + class: '!w-full', + }, + }, + { + fieldName: 'discountPrice', + label: '优惠金额', + component: 'InputNumber', + componentProps: { + disabled: formType === 'detail', + placeholder: '请输入优惠金额', + precision: 2, + formatter: erpPriceInputFormatter, + controlsPosition: 'right', + class: '!w-full', + }, + }, + { + fieldName: 'receiptPrice', + label: '实际收款', + component: 'InputNumber', + componentProps: { + placeholder: '实际收款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + controlsPosition: 'right', + class: '!w-full', + }, + dependencies: { + triggerFields: ['totalPrice', 'discountPrice'], + componentProps: (values) => { + const totalPrice = values.totalPrice || 0; + const discountPrice = values.discountPrice || 0; + values.receiptPrice = totalPrice - discountPrice; + return {}; + }, + }, + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'bizNo', + title: '销售单据编号', + minWidth: 200, + }, + { + field: 'totalPrice', + title: '应收金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'receiptedPrice', + title: '已收金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'receiptPrice', + title: '本次收款', + minWidth: 115, + fixed: 'right', + slots: { default: 'receiptPrice' }, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '收款单号', + component: 'Input', + componentProps: { + placeholder: '请输入收款单号', + allowClear: true, + }, + }, + { + fieldName: 'receiptTime', + label: '收款时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'accountId', + label: '收款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择收款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + { + fieldName: 'bizNo', + label: '销售单号', + component: 'Input', + componentProps: { + placeholder: '请输入销售单号', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '收款单号', + width: 180, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'receiptTime', + title: '收款时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'financeUserName', + title: '财务人员', + minWidth: 120, + }, + { + field: 'accountName', + title: '收款账户', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '合计收款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'discountPrice', + title: '优惠金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'receiptPrice', + title: '实际收款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 90, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 销售出库单选择表单的配置项 */ +export function useSaleOutGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '出库单号', + component: 'Input', + componentProps: { + placeholder: '请输入出库单号', + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择客户', + }, + }, + { + fieldName: 'receiptStatus', + label: '收款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未收款', value: 0 }, + { label: '部分收款', value: 1 }, + { label: '全部收款', value: 2 }, + ], + placeholder: '请选择收款状态', + allowClear: true, + }, + }, + ]; +} + +/** 销售出库单选择列表的字段 */ +export function useSaleOutGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '出库单号', + width: 200, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'outTime', + title: '出库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应收金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'receiptPrice', + title: '已收金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unReceiptPrice', + title: '未收金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.receiptPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} + +/** 销售退货单选择表单的配置项 */ +export function useSaleReturnGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '退货单号', + component: 'Input', + componentProps: { + placeholder: '请输入退货单号', + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择客户', + }, + }, + { + fieldName: 'refundStatus', + label: '退款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未退款', value: 0 }, + { label: '部分退款', value: 1 }, + { label: '全部退款', value: 2 }, + ], + placeholder: '请选择退款状态', + allowClear: true, + }, + }, + ]; +} + +/** 销售退货单选择列表的字段 */ +export function useSaleReturnGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '退货单号', + width: 200, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'returnTime', + title: '退货时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'refundPrice', + title: '已退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unRefundPrice', + title: '未退金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.refundPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/finance/receipt/index.vue b/apps/web-ele/src/views/erp/finance/receipt/index.vue new file mode 100644 index 000000000..53a84eecf --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/index.vue @@ -0,0 +1,226 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/receipt/modules/form.vue b/apps/web-ele/src/views/erp/finance/receipt/modules/form.vue new file mode 100644 index 000000000..8464cceb4 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/modules/form.vue @@ -0,0 +1,209 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/receipt/modules/item-form.vue b/apps/web-ele/src/views/erp/finance/receipt/modules/item-form.vue new file mode 100644 index 000000000..c82383f32 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/modules/item-form.vue @@ -0,0 +1,299 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/receipt/modules/sale-out-select.vue b/apps/web-ele/src/views/erp/finance/receipt/modules/sale-out-select.vue new file mode 100644 index 000000000..b5d2def59 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/modules/sale-out-select.vue @@ -0,0 +1,110 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/receipt/modules/sale-return-select.vue b/apps/web-ele/src/views/erp/finance/receipt/modules/sale-return-select.vue new file mode 100644 index 000000000..8bef7177d --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/receipt/modules/sale-return-select.vue @@ -0,0 +1,114 @@ + + +