diff --git a/apps/web-antd/src/api/erp/purchase/in/index.ts b/apps/web-antd/src/api/erp/purchase/in/index.ts index f807e2800..060e1bcb8 100644 --- a/apps/web-antd/src/api/erp/purchase/in/index.ts +++ b/apps/web-antd/src/api/erp/purchase/in/index.ts @@ -23,6 +23,8 @@ export namespace ErpPurchaseInApi { taxPrice?: number; // 合计税额 items?: PurchaseInItem[]; // 采购入库明细 } + + /** 采购项信息 */ export interface PurchaseInItem { count?: number; id?: number; @@ -42,21 +44,10 @@ export namespace ErpPurchaseInApi { warehouseId?: number; inCount?: number; } - - /** 采购入库分页查询参数 */ - export interface PurchaseInPageParams extends PageParam { - no?: string; - supplierId?: number; - status?: number; - } } -/** - * 查询采购入库分页 - */ -export function getPurchaseInPage( - params: ErpPurchaseInApi.PurchaseInPageParams, -) { +/** 查询采购入库分页 */ +export function getPurchaseInPage(params: PageParam) { return requestClient.get>( '/erp/purchase-in/page', { @@ -65,32 +56,24 @@ export function getPurchaseInPage( ); } -/** - * 查询采购入库详情 - */ +/** 查询采购入库详情 */ export function getPurchaseIn(id: number) { return requestClient.get( `/erp/purchase-in/get?id=${id}`, ); } -/** - * 新增采购入库 - */ +/** 新增采购入库 */ export function createPurchaseIn(data: ErpPurchaseInApi.PurchaseIn) { return requestClient.post('/erp/purchase-in/create', data); } -/** - * 修改采购入库 - */ +/** 修改采购入库 */ export function updatePurchaseIn(data: ErpPurchaseInApi.PurchaseIn) { return requestClient.put('/erp/purchase-in/update', data); } -/** - * 更新采购入库的状态 - */ +/** 更新采购入库的状态 */ export function updatePurchaseInStatus(id: number, status: number) { return requestClient.put('/erp/purchase-in/update-status', null, { params: { @@ -100,9 +83,7 @@ export function updatePurchaseInStatus(id: number, status: number) { }); } -/** - * 删除采购入库 - */ +/** 删除采购入库 */ export function deletePurchaseIn(ids: number[]) { return requestClient.delete('/erp/purchase-in/delete', { params: { @@ -111,12 +92,8 @@ export function deletePurchaseIn(ids: number[]) { }); } -/** - * 导出采购入库 Excel - */ -export function exportPurchaseIn( - params: ErpPurchaseInApi.PurchaseInPageParams, -) { +/** 导出采购入库 Excel */ +export function exportPurchaseIn(params: any) { return requestClient.download('/erp/purchase-in/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/purchase/order/index.ts b/apps/web-antd/src/api/erp/purchase/order/index.ts index e2cc7a214..e59dcf68e 100644 --- a/apps/web-antd/src/api/erp/purchase/order/index.ts +++ b/apps/web-antd/src/api/erp/purchase/order/index.ts @@ -3,27 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpPurchaseOrderApi { - /** ERP 采购订单项信息 */ - export interface PurchaseOrderItem { - 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; // 库存数量(显示字段) - } - - /** ERP 采购订单信息 */ + /** 采购订单信息 */ export interface PurchaseOrder { id?: number; // 订单工单编号 no?: string; // 采购订单号 @@ -51,24 +31,29 @@ export namespace ErpPurchaseOrderApi { items?: PurchaseOrderItem[]; // 订单项列表 } - /** 采购订单分页查询参数 */ - export interface PurchaseOrderPageParam extends PageParam { - no?: string; - supplierId?: number; - productId?: number; - orderTime?: string[]; - status?: number; - remark?: string; - creator?: string; - inStatus?: number; - returnStatus?: number; + /** 采购订单项信息 */ + export interface PurchaseOrderItem { + 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 getPurchaseOrderPage( - params: ErpPurchaseOrderApi.PurchaseOrderPageParam, -) { +export function getPurchaseOrderPage(params: PageParam) { return requestClient.get>( '/erp/purchase-order/page', { params }, diff --git a/apps/web-antd/src/api/erp/purchase/return/index.ts b/apps/web-antd/src/api/erp/purchase/return/index.ts index 4114f1908..315ceeadb 100644 --- a/apps/web-antd/src/api/erp/purchase/return/index.ts +++ b/apps/web-antd/src/api/erp/purchase/return/index.ts @@ -1,4 +1,4 @@ -import type { PageParam, PageResult } from '@vben/request'; +import type { PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; @@ -19,6 +19,8 @@ export namespace ErpPurchaseReturnApi { otherPrice?: number; // 其他费用 items?: PurchaseReturnItem[]; } + + /** 采购退货项 */ export interface PurchaseReturnItem { count?: number; id?: number; @@ -37,27 +39,10 @@ export namespace ErpPurchaseReturnApi { totalPrice?: number; warehouseId?: number; } - - /** 采购退货分页查询参数 */ - export interface PurchaseReturnPageParams extends PageParam { - no?: string; - supplierId?: number; - status?: number; - } - - /** 采购退货状态更新参数 */ - export interface PurchaseReturnStatusParams { - id: number; - status: number; - } } -/** - * 查询采购退货分页 - */ -export function getPurchaseReturnPage( - params: ErpPurchaseReturnApi.PurchaseReturnPageParams, -) { +/** 查询采购退货分页 */ +export function getPurchaseReturnPage(params: any) { return requestClient.get>( '/erp/purchase-return/page', { @@ -66,45 +51,35 @@ export function getPurchaseReturnPage( ); } -/** - * 查询采购退货详情 - */ +/** 查询采购退货详情 */ export function getPurchaseReturn(id: number) { return requestClient.get( `/erp/purchase-return/get?id=${id}`, ); } -/** - * 新增采购退货 - */ +/** 新增采购退货 */ export function createPurchaseReturn( data: ErpPurchaseReturnApi.PurchaseReturn, ) { return requestClient.post('/erp/purchase-return/create', data); } -/** - * 修改采购退货 - */ +/** 修改采购退货 */ export function updatePurchaseReturn( data: ErpPurchaseReturnApi.PurchaseReturn, ) { return requestClient.put('/erp/purchase-return/update', data); } -/** - * 更新采购退货的状态 - */ +/** 更新采购退货的状态 */ export function updatePurchaseReturnStatus(id: number, status: number) { return requestClient.put('/erp/purchase-return/update-status', null, { params: { id, status }, }); } -/** - * 删除采购退货 - */ +/** 删除采购退货 */ export function deletePurchaseReturn(ids: number[]) { return requestClient.delete('/erp/purchase-return/delete', { params: { @@ -113,12 +88,8 @@ export function deletePurchaseReturn(ids: number[]) { }); } -/** - * 导出采购退货 Excel - */ -export function exportPurchaseReturn( - params: ErpPurchaseReturnApi.PurchaseReturnPageParams, -) { +/** 导出采购退货 Excel */ +export function exportPurchaseReturn(params: any) { return requestClient.download('/erp/purchase-return/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/purchase/supplier/index.ts b/apps/web-antd/src/api/erp/purchase/supplier/index.ts index fb74b9f37..42c4196b0 100644 --- a/apps/web-antd/src/api/erp/purchase/supplier/index.ts +++ b/apps/web-antd/src/api/erp/purchase/supplier/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpSupplierApi { - /** ERP 供应商信息 */ + /** 供应商信息 */ export interface Supplier { id?: number; // 供应商编号 name: string; // 供应商名称 @@ -21,17 +21,10 @@ export namespace ErpSupplierApi { bankAccount: string; // 开户账号 bankAddress: string; // 开户地址 } - - /** 供应商分页查询参数 */ - export interface SupplierPageParam extends PageParam { - name?: string; - mobile?: string; - status?: number; - } } /** 查询供应商分页 */ -export function getSupplierPage(params: ErpSupplierApi.SupplierPageParam) { +export function getSupplierPage(params: PageParam) { return requestClient.get>( '/erp/supplier/page', { params }, diff --git a/apps/web-ele/src/api/erp/purchase/in/index.ts b/apps/web-ele/src/api/erp/purchase/in/index.ts new file mode 100644 index 000000000..060e1bcb8 --- /dev/null +++ b/apps/web-ele/src/api/erp/purchase/in/index.ts @@ -0,0 +1,100 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpPurchaseInApi { + /** 采购入库信息 */ + export interface PurchaseIn { + id?: number; // 入库工单编号 + no?: string; // 采购入库号 + supplierId?: number; // 供应商编号 + inTime?: Date; // 入库时间 + totalCount?: number; // 合计数量 + totalPrice?: number; // 合计金额,单位:元 + status?: number; // 状态 + remark?: string; // 备注 + outCount?: number; // 采购出库数量 + returnCount?: number; // 采购退货数量 + discountPercent?: number; // 折扣百分比 + discountPrice?: number; // 折扣金额 + paymentPrice?: number; // 实际支付金额 + otherPrice?: number; // 其他费用 + totalProductPrice?: number; // 合计商品金额 + taxPrice?: number; // 合计税额 + items?: PurchaseInItem[]; // 采购入库明细 + } + + /** 采购项信息 */ + export interface PurchaseInItem { + 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; + inCount?: number; + } +} + +/** 查询采购入库分页 */ +export function getPurchaseInPage(params: PageParam) { + return requestClient.get>( + '/erp/purchase-in/page', + { + params, + }, + ); +} + +/** 查询采购入库详情 */ +export function getPurchaseIn(id: number) { + return requestClient.get( + `/erp/purchase-in/get?id=${id}`, + ); +} + +/** 新增采购入库 */ +export function createPurchaseIn(data: ErpPurchaseInApi.PurchaseIn) { + return requestClient.post('/erp/purchase-in/create', data); +} + +/** 修改采购入库 */ +export function updatePurchaseIn(data: ErpPurchaseInApi.PurchaseIn) { + return requestClient.put('/erp/purchase-in/update', data); +} + +/** 更新采购入库的状态 */ +export function updatePurchaseInStatus(id: number, status: number) { + return requestClient.put('/erp/purchase-in/update-status', null, { + params: { + id, + status, + }, + }); +} + +/** 删除采购入库 */ +export function deletePurchaseIn(ids: number[]) { + return requestClient.delete('/erp/purchase-in/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出采购入库 Excel */ +export function exportPurchaseIn(params: any) { + return requestClient.download('/erp/purchase-in/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/purchase/order/index.ts b/apps/web-ele/src/api/erp/purchase/order/index.ts new file mode 100644 index 000000000..e59dcf68e --- /dev/null +++ b/apps/web-ele/src/api/erp/purchase/order/index.ts @@ -0,0 +1,97 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpPurchaseOrderApi { + /** 采购订单信息 */ + export interface PurchaseOrder { + id?: number; // 订单工单编号 + no?: string; // 采购订单号 + supplierId?: number; // 供应商编号 + supplierName?: string; // 供应商名称 + orderTime?: Date | string; // 订单时间 + totalCount?: number; // 合计数量 + totalPrice?: number; // 合计金额,单位:元 + totalProductPrice?: number; // 产品金额,单位:元 + discountPercent?: number; // 优惠率,百分比 + discountPrice?: number; // 优惠金额,单位:元 + depositPrice?: number; // 定金金额,单位:元 + accountId?: number; // 结算账户编号 + status?: number; // 状态 + remark?: string; // 备注 + fileUrl?: string; // 附件地址 + inCount?: number; // 采购入库数量 + count?: number; // 数量 + returnCount?: number; // 采购退货数量 + inStatus?: number; // 入库状态 + returnStatus?: number; // 退货状态 + productNames?: string; // 产品名称列表 + creatorName?: string; // 创建人名称 + createTime?: Date; // 创建时间 + items?: PurchaseOrderItem[]; // 订单项列表 + } + + /** 采购订单项信息 */ + export interface PurchaseOrderItem { + 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 getPurchaseOrderPage(params: PageParam) { + return requestClient.get>( + '/erp/purchase-order/page', + { params }, + ); +} + +/** 查询采购订单详情 */ +export function getPurchaseOrder(id: number) { + return requestClient.get( + `/erp/purchase-order/get?id=${id}`, + ); +} + +/** 新增采购订单 */ +export function createPurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) { + return requestClient.post('/erp/purchase-order/create', data); +} + +/** 修改采购订单 */ +export function updatePurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) { + return requestClient.put('/erp/purchase-order/update', data); +} + +/** 更新采购订单的状态 */ +export function updatePurchaseOrderStatus(id: number, status: number) { + return requestClient.put('/erp/purchase-order/update-status', null, { + params: { id, status }, + }); +} + +/** 删除采购订单 */ +export function deletePurchaseOrder(ids: number[]) { + return requestClient.delete('/erp/purchase-order/delete', { + params: { ids: ids.join(',') }, + }); +} + +/** 导出采购订单 Excel */ +export function exportPurchaseOrder(params: any) { + return requestClient.download('/erp/purchase-order/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/purchase/return/index.ts b/apps/web-ele/src/api/erp/purchase/return/index.ts new file mode 100644 index 000000000..315ceeadb --- /dev/null +++ b/apps/web-ele/src/api/erp/purchase/return/index.ts @@ -0,0 +1,96 @@ +import type { PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpPurchaseReturnApi { + /** 采购退货信息 */ + export interface PurchaseReturn { + id?: number; // 采购退货编号 + no?: string; // 采购退货号 + supplierId?: number; // 供应商编号 + returnTime?: Date; // 退货时间 + totalCount?: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + discountPercent?: number; // 折扣百分比 + discountPrice?: number; // 折扣金额 + status?: number; // 状态 + remark?: string; // 备注 + totalTaxPrice?: number; // 合计税额 + otherPrice?: number; // 其他费用 + items?: PurchaseReturnItem[]; + } + + /** 采购退货项 */ + export interface PurchaseReturnItem { + 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; + } +} + +/** 查询采购退货分页 */ +export function getPurchaseReturnPage(params: any) { + return requestClient.get>( + '/erp/purchase-return/page', + { + params, + }, + ); +} + +/** 查询采购退货详情 */ +export function getPurchaseReturn(id: number) { + return requestClient.get( + `/erp/purchase-return/get?id=${id}`, + ); +} + +/** 新增采购退货 */ +export function createPurchaseReturn( + data: ErpPurchaseReturnApi.PurchaseReturn, +) { + return requestClient.post('/erp/purchase-return/create', data); +} + +/** 修改采购退货 */ +export function updatePurchaseReturn( + data: ErpPurchaseReturnApi.PurchaseReturn, +) { + return requestClient.put('/erp/purchase-return/update', data); +} + +/** 更新采购退货的状态 */ +export function updatePurchaseReturnStatus(id: number, status: number) { + return requestClient.put('/erp/purchase-return/update-status', null, { + params: { id, status }, + }); +} + +/** 删除采购退货 */ +export function deletePurchaseReturn(ids: number[]) { + return requestClient.delete('/erp/purchase-return/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出采购退货 Excel */ +export function exportPurchaseReturn(params: any) { + return requestClient.download('/erp/purchase-return/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/purchase/supplier/index.ts b/apps/web-ele/src/api/erp/purchase/supplier/index.ts new file mode 100644 index 000000000..42c4196b0 --- /dev/null +++ b/apps/web-ele/src/api/erp/purchase/supplier/index.ts @@ -0,0 +1,66 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpSupplierApi { + /** 供应商信息 */ + export interface Supplier { + 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 getSupplierPage(params: PageParam) { + return requestClient.get>( + '/erp/supplier/page', + { params }, + ); +} + +/** 获得供应商精简列表 */ +export function getSupplierSimpleList() { + return requestClient.get( + '/erp/supplier/simple-list', + ); +} + +/** 查询供应商详情 */ +export function getSupplier(id: number) { + return requestClient.get( + `/erp/supplier/get?id=${id}`, + ); +} + +/** 新增供应商 */ +export function createSupplier(data: ErpSupplierApi.Supplier) { + return requestClient.post('/erp/supplier/create', data); +} + +/** 修改供应商 */ +export function updateSupplier(data: ErpSupplierApi.Supplier) { + return requestClient.put('/erp/supplier/update', data); +} + +/** 删除供应商 */ +export function deleteSupplier(id: number) { + return requestClient.delete(`/erp/supplier/delete?id=${id}`); +} + +/** 导出供应商 Excel */ +export function exportSupplier(params: any) { + return requestClient.download('/erp/supplier/export-excel', { params }); +} diff --git a/apps/web-ele/src/views/erp/finance/payment/data.ts b/apps/web-ele/src/views/erp/finance/payment/data.ts new file mode 100644 index 000000000..a396b2e26 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/data.ts @@ -0,0 +1,589 @@ +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 { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; +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: 'paymentTime', + label: '付款时间', + component: 'DatePicker', + componentProps: { + disabled: formType === 'detail', + placeholder: '选择付款时间', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + }, + rules: 'required', + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'ApiSelect', + componentProps: { + disabled: formType === 'detail', + placeholder: '请选择供应商', + clearable: true, + filterable: true, + api: getSupplierSimpleList, + labelField: 'name', + valueField: 'id', + }, + rules: 'required', + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + clearable: true, + filterable: 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: '请选择付款账户', + clearable: true, + filterable: 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: 'paymentPrice', + 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.paymentPrice = 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: 'paidPrice', + title: '已付金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'paymentPrice', + title: '本次付款', + minWidth: 115, + fixed: 'right', + slots: { default: 'paymentPrice' }, + }, + { + 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: '请输入付款单号', + clearable: true, + }, + }, + { + fieldName: 'paymentTime', + label: '付款时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + clearable: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择供应商', + clearable: true, + filterable: true, + api: getSupplierSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + clearable: true, + filterable: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + clearable: true, + filterable: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'accountId', + label: '付款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择付款账户', + clearable: true, + filterable: true, + api: getAccountSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + clearable: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + clearable: true, + }, + }, + { + fieldName: 'bizNo', + label: '采购单号', + component: 'Input', + componentProps: { + placeholder: '请输入采购单号', + clearable: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '付款单号', + width: 180, + fixed: 'left', + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'paymentTime', + 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: 'paymentPrice', + title: '实际付款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 90, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 220, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 采购入库单选择表单的配置项 */ +export function usePurchaseInGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '入库单号', + component: 'Input', + componentProps: { + placeholder: '请输入入库单号', + clearable: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择供应商', + }, + }, + { + fieldName: 'paymentStatus', + label: '付款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未付款', value: 0 }, + { label: '部分付款', value: 1 }, + { label: '全部付款', value: 2 }, + ], + placeholder: '请选择付款状态', + clearable: true, + }, + }, + ]; +} + +/** 采购入库单选择列表的字段 */ +export function usePurchaseInGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '入库单号', + width: 200, + fixed: 'left', + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'inTime', + title: '入库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应付金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'paymentPrice', + title: '已付金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unPaymentPrice', + title: '未付金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.paymentPrice || 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: '请输入退货单号', + clearable: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择供应商', + }, + }, + { + fieldName: 'refundStatus', + label: '退款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未退款', value: 0 }, + { label: '部分退款', value: 1 }, + { label: '全部退款', value: 2 }, + ], + placeholder: '请选择退款状态', + clearable: true, + }, + }, + ]; +} + +/** 采购退货单选择列表的字段 */ +export function useSaleReturnGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '退货单号', + width: 200, + fixed: 'left', + }, + { + field: 'supplierName', + 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/payment/index.vue b/apps/web-ele/src/views/erp/finance/payment/index.vue new file mode 100644 index 000000000..0eef9e0c9 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/index.vue @@ -0,0 +1,225 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/payment/modules/form.vue b/apps/web-ele/src/views/erp/finance/payment/modules/form.vue new file mode 100644 index 000000000..9611eebb1 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/modules/form.vue @@ -0,0 +1,194 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/payment/modules/item-form.vue b/apps/web-ele/src/views/erp/finance/payment/modules/item-form.vue new file mode 100644 index 000000000..67cfad968 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/modules/item-form.vue @@ -0,0 +1,302 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/payment/modules/purchase-in-select.vue b/apps/web-ele/src/views/erp/finance/payment/modules/purchase-in-select.vue new file mode 100644 index 000000000..76979c09d --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/modules/purchase-in-select.vue @@ -0,0 +1,112 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/payment/modules/sale-return-select.vue b/apps/web-ele/src/views/erp/finance/payment/modules/sale-return-select.vue new file mode 100644 index 000000000..c65c506d6 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/payment/modules/sale-return-select.vue @@ -0,0 +1,116 @@ + + +