From e1731f539472d214721b87bb4bea50e7be0e632c Mon Sep 17 00:00:00 2001 From: XuZhiqiang Date: Fri, 19 Jun 2026 00:18:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(workspace):=20=E4=BF=AE=E5=A4=8D=20ERP=20?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=8D=89=E7=A8=BF=E5=92=8C=E6=94=B6=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E9=87=91=E9=A2=9D=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/api/erp/purchase/in/index.ts | 1 + .../src/api/erp/purchase/order/index.ts | 1 + .../src/api/erp/purchase/return/index.ts | 2 ++ apps/web-antd/src/api/erp/sale/order/index.ts | 1 + apps/web-antd/src/api/erp/sale/out/index.ts | 2 ++ .../web-antd/src/api/erp/sale/return/index.ts | 2 ++ .../web-antd/src/api/erp/stock/check/index.ts | 1 + apps/web-antd/src/api/erp/stock/in/index.ts | 11 ++++---- apps/web-antd/src/api/erp/stock/move/index.ts | 1 + apps/web-antd/src/api/erp/stock/out/index.ts | 1 + .../erp/finance/payment/modules/item-form.vue | 26 +++++++++-------- .../erp/finance/receipt/modules/item-form.vue | 28 ++++++++++--------- .../src/api/erp/purchase/in/index.ts | 1 + .../src/api/erp/purchase/order/index.ts | 1 + .../src/api/erp/purchase/return/index.ts | 2 ++ .../src/api/erp/sale/order/index.ts | 1 + .../src/api/erp/sale/out/index.ts | 2 ++ .../src/api/erp/sale/return/index.ts | 2 ++ .../src/api/erp/stock/check/index.ts | 1 + .../src/api/erp/stock/in/index.ts | 11 ++++---- .../src/api/erp/stock/move/index.ts | 1 + .../src/api/erp/stock/out/index.ts | 1 + .../erp/finance/payment/modules/item-form.vue | 26 +++++++++-------- .../erp/finance/receipt/modules/item-form.vue | 28 ++++++++++--------- apps/web-ele/src/api/erp/purchase/in/index.ts | 1 + .../src/api/erp/purchase/order/index.ts | 1 + .../src/api/erp/purchase/return/index.ts | 3 +- apps/web-ele/src/api/erp/sale/order/index.ts | 1 + apps/web-ele/src/api/erp/sale/out/index.ts | 2 ++ apps/web-ele/src/api/erp/sale/return/index.ts | 2 ++ apps/web-ele/src/api/erp/stock/check/index.ts | 1 + apps/web-ele/src/api/erp/stock/in/index.ts | 11 ++++---- apps/web-ele/src/api/erp/stock/move/index.ts | 1 + apps/web-ele/src/api/erp/stock/out/index.ts | 1 + .../erp/finance/payment/modules/item-form.vue | 27 ++++++++++-------- .../erp/finance/receipt/modules/item-form.vue | 27 ++++++++++-------- 36 files changed, 144 insertions(+), 88 deletions(-) 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 060e1bcb8..df23762ad 100644 --- a/apps/web-antd/src/api/erp/purchase/in/index.ts +++ b/apps/web-antd/src/api/erp/purchase/in/index.ts @@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi { export interface PurchaseInItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; 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 e59dcf68e..66954dc08 100644 --- a/apps/web-antd/src/api/erp/purchase/order/index.ts +++ b/apps/web-antd/src/api/erp/purchase/order/index.ts @@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi { /** 采购订单项信息 */ export interface PurchaseOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 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 315ceeadb..3e1a26739 100644 --- a/apps/web-antd/src/api/erp/purchase/return/index.ts +++ b/apps/web-antd/src/api/erp/purchase/return/index.ts @@ -11,6 +11,7 @@ export namespace ErpPurchaseReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice: number; // 合计金额,单位:元 + refundPrice?: number; // 已退款金额,单位:元 discountPercent?: number; // 折扣百分比 discountPrice?: number; // 折扣金额 status?: number; // 状态 @@ -24,6 +25,7 @@ export namespace ErpPurchaseReturnApi { export interface PurchaseReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; 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 c190a3dc1..ec46d9fbf 100644 --- a/apps/web-antd/src/api/erp/sale/order/index.ts +++ b/apps/web-antd/src/api/erp/sale/order/index.ts @@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi { /** 销售订单项 */ export interface SaleOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 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 a3e335af6..85f5a6686 100644 --- a/apps/web-antd/src/api/erp/sale/out/index.ts +++ b/apps/web-antd/src/api/erp/sale/out/index.ts @@ -12,6 +12,7 @@ export namespace ErpSaleOutApi { outTime?: Date; // 出库时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + receiptPrice?: number; // 已收款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -28,6 +29,7 @@ export namespace ErpSaleOutApi { export interface SaleOutItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; 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 a0624cba2..18af37581 100644 --- a/apps/web-antd/src/api/erp/sale/return/index.ts +++ b/apps/web-antd/src/api/erp/sale/return/index.ts @@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + refundPrice?: number; // 已退款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi { export interface SaleReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-antd/src/api/erp/stock/check/index.ts b/apps/web-antd/src/api/erp/stock/check/index.ts index b6f9d0bea..c67ea62b1 100644 --- a/apps/web-antd/src/api/erp/stock/check/index.ts +++ b/apps/web-antd/src/api/erp/stock/check/index.ts @@ -21,6 +21,7 @@ export namespace ErpStockCheckApi { /** 库存盘点项 */ export interface StockCheckItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antd/src/api/erp/stock/in/index.ts b/apps/web-antd/src/api/erp/stock/in/index.ts index e68c05b36..b6e4a50ef 100644 --- a/apps/web-antd/src/api/erp/stock/in/index.ts +++ b/apps/web-antd/src/api/erp/stock/in/index.ts @@ -23,15 +23,16 @@ export namespace ErpStockInApi { /** 其它入库单产品信息 */ export interface StockInItem { id?: number; // 编号 - warehouseId: number; // 仓库编号 - productId: number; // 产品编号 + seq?: number; // 前端行号 + warehouseId?: number; // 仓库编号 + productId?: number; // 产品编号 productName?: string; // 产品名称 productUnitId?: number; // 产品单位编号 productUnitName?: string; // 产品单位名称 productBarCode?: string; // 产品条码 - count: number; // 数量 - productPrice: number; // 产品单价 - totalPrice: number; // 总价 + count?: number; // 数量 + productPrice?: number; // 产品单价 + totalPrice?: number; // 总价 stockCount?: number; // 库存数量 remark?: string; // 备注 } diff --git a/apps/web-antd/src/api/erp/stock/move/index.ts b/apps/web-antd/src/api/erp/stock/move/index.ts index 0120a9b45..aaf09b22f 100644 --- a/apps/web-antd/src/api/erp/stock/move/index.ts +++ b/apps/web-antd/src/api/erp/stock/move/index.ts @@ -26,6 +26,7 @@ export namespace ErpStockMoveApi { count: number; // 数量 fromWarehouseId?: number; // 来源仓库ID id?: number; // ID + seq?: number; // 前端行号 productBarCode: string; // 产品条形码 productId?: number; // 产品ID productName?: string; // 产品名称 diff --git a/apps/web-antd/src/api/erp/stock/out/index.ts b/apps/web-antd/src/api/erp/stock/out/index.ts index 1ecb89233..94588e1bb 100644 --- a/apps/web-antd/src/api/erp/stock/out/index.ts +++ b/apps/web-antd/src/api/erp/stock/out/index.ts @@ -20,6 +20,7 @@ export namespace ErpStockOutApi { /** 其它出库单产品信息 */ export interface StockOutItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue b/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue index 777d702db..3aadbe5fd 100644 --- a/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue +++ b/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue @@ -128,13 +128,15 @@ const handleOpenPurchaseIn = () => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const paidPrice = row.paymentPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_IN, - bizNo: row.no, - totalPrice: row.totalPrice, - paidPrice: row.paymentPrice, - paymentPrice: row.totalPrice - row.paymentPrice, + bizNo: row.no ?? '', + totalPrice, + paidPrice, + paymentPrice: totalPrice - paidPrice, remark: undefined, }; tableData.value.push(newItem); @@ -154,13 +156,15 @@ const handleOpenSaleReturn = () => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_RETURN, - bizNo: row.no, - totalPrice: -row.totalPrice, - paidPrice: -row.refundPrice, - paymentPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + paidPrice: -refundPrice, + paymentPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -202,7 +206,7 @@ const validate = () => { // 检查每行的付款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (!item.paymentPrice || item.paymentPrice <= 0) { + if (!item?.paymentPrice || item.paymentPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次付款必须大于0`); } } diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue index be48f695a..1ec800ab5 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue @@ -128,14 +128,15 @@ function handleOpenSaleOut() { function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { rows.forEach((row) => { - // TODO 芋艿 + const totalPrice = row.totalPrice ?? 0; + const receiptedPrice = row.receiptPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_OUT, - bizNo: row.no, - totalPrice: row.totalPrice, - receiptedPrice: row.receiptPrice, - receiptPrice: row.totalPrice - row.receiptPrice, + bizNo: row.no ?? '', + totalPrice, + receiptedPrice, + receiptPrice: totalPrice - receiptedPrice, remark: undefined, }; tableData.value.push(newItem); @@ -154,15 +155,16 @@ function handleOpenSaleReturn() { } function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { - // TODO 芋艿 rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_RETURN, - bizNo: row.no, - totalPrice: -row.totalPrice, - receiptedPrice: -row.refundPrice, - receiptPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + receiptedPrice: -refundPrice, + receiptPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -204,7 +206,7 @@ function validate() { // 检查每行的收款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (!item.receiptPrice || item.receiptPrice <= 0) { + if (!item?.receiptPrice || item.receiptPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次收款必须大于0`); } } diff --git a/apps/web-antdv-next/src/api/erp/purchase/in/index.ts b/apps/web-antdv-next/src/api/erp/purchase/in/index.ts index 060e1bcb8..df23762ad 100644 --- a/apps/web-antdv-next/src/api/erp/purchase/in/index.ts +++ b/apps/web-antdv-next/src/api/erp/purchase/in/index.ts @@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi { export interface PurchaseInItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-antdv-next/src/api/erp/purchase/order/index.ts b/apps/web-antdv-next/src/api/erp/purchase/order/index.ts index e59dcf68e..66954dc08 100644 --- a/apps/web-antdv-next/src/api/erp/purchase/order/index.ts +++ b/apps/web-antdv-next/src/api/erp/purchase/order/index.ts @@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi { /** 采购订单项信息 */ export interface PurchaseOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antdv-next/src/api/erp/purchase/return/index.ts b/apps/web-antdv-next/src/api/erp/purchase/return/index.ts index 315ceeadb..3e1a26739 100644 --- a/apps/web-antdv-next/src/api/erp/purchase/return/index.ts +++ b/apps/web-antdv-next/src/api/erp/purchase/return/index.ts @@ -11,6 +11,7 @@ export namespace ErpPurchaseReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice: number; // 合计金额,单位:元 + refundPrice?: number; // 已退款金额,单位:元 discountPercent?: number; // 折扣百分比 discountPrice?: number; // 折扣金额 status?: number; // 状态 @@ -24,6 +25,7 @@ export namespace ErpPurchaseReturnApi { export interface PurchaseReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-antdv-next/src/api/erp/sale/order/index.ts b/apps/web-antdv-next/src/api/erp/sale/order/index.ts index c190a3dc1..ec46d9fbf 100644 --- a/apps/web-antdv-next/src/api/erp/sale/order/index.ts +++ b/apps/web-antdv-next/src/api/erp/sale/order/index.ts @@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi { /** 销售订单项 */ export interface SaleOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antdv-next/src/api/erp/sale/out/index.ts b/apps/web-antdv-next/src/api/erp/sale/out/index.ts index a3e335af6..85f5a6686 100644 --- a/apps/web-antdv-next/src/api/erp/sale/out/index.ts +++ b/apps/web-antdv-next/src/api/erp/sale/out/index.ts @@ -12,6 +12,7 @@ export namespace ErpSaleOutApi { outTime?: Date; // 出库时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + receiptPrice?: number; // 已收款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -28,6 +29,7 @@ export namespace ErpSaleOutApi { export interface SaleOutItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-antdv-next/src/api/erp/sale/return/index.ts b/apps/web-antdv-next/src/api/erp/sale/return/index.ts index a0624cba2..18af37581 100644 --- a/apps/web-antdv-next/src/api/erp/sale/return/index.ts +++ b/apps/web-antdv-next/src/api/erp/sale/return/index.ts @@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + refundPrice?: number; // 已退款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi { export interface SaleReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-antdv-next/src/api/erp/stock/check/index.ts b/apps/web-antdv-next/src/api/erp/stock/check/index.ts index b6f9d0bea..c67ea62b1 100644 --- a/apps/web-antdv-next/src/api/erp/stock/check/index.ts +++ b/apps/web-antdv-next/src/api/erp/stock/check/index.ts @@ -21,6 +21,7 @@ export namespace ErpStockCheckApi { /** 库存盘点项 */ export interface StockCheckItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antdv-next/src/api/erp/stock/in/index.ts b/apps/web-antdv-next/src/api/erp/stock/in/index.ts index e68c05b36..b6e4a50ef 100644 --- a/apps/web-antdv-next/src/api/erp/stock/in/index.ts +++ b/apps/web-antdv-next/src/api/erp/stock/in/index.ts @@ -23,15 +23,16 @@ export namespace ErpStockInApi { /** 其它入库单产品信息 */ export interface StockInItem { id?: number; // 编号 - warehouseId: number; // 仓库编号 - productId: number; // 产品编号 + seq?: number; // 前端行号 + warehouseId?: number; // 仓库编号 + productId?: number; // 产品编号 productName?: string; // 产品名称 productUnitId?: number; // 产品单位编号 productUnitName?: string; // 产品单位名称 productBarCode?: string; // 产品条码 - count: number; // 数量 - productPrice: number; // 产品单价 - totalPrice: number; // 总价 + count?: number; // 数量 + productPrice?: number; // 产品单价 + totalPrice?: number; // 总价 stockCount?: number; // 库存数量 remark?: string; // 备注 } diff --git a/apps/web-antdv-next/src/api/erp/stock/move/index.ts b/apps/web-antdv-next/src/api/erp/stock/move/index.ts index 0120a9b45..aaf09b22f 100644 --- a/apps/web-antdv-next/src/api/erp/stock/move/index.ts +++ b/apps/web-antdv-next/src/api/erp/stock/move/index.ts @@ -26,6 +26,7 @@ export namespace ErpStockMoveApi { count: number; // 数量 fromWarehouseId?: number; // 来源仓库ID id?: number; // ID + seq?: number; // 前端行号 productBarCode: string; // 产品条形码 productId?: number; // 产品ID productName?: string; // 产品名称 diff --git a/apps/web-antdv-next/src/api/erp/stock/out/index.ts b/apps/web-antdv-next/src/api/erp/stock/out/index.ts index 1ecb89233..94588e1bb 100644 --- a/apps/web-antdv-next/src/api/erp/stock/out/index.ts +++ b/apps/web-antdv-next/src/api/erp/stock/out/index.ts @@ -20,6 +20,7 @@ export namespace ErpStockOutApi { /** 其它出库单产品信息 */ export interface StockOutItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-antdv-next/src/views/erp/finance/payment/modules/item-form.vue b/apps/web-antdv-next/src/views/erp/finance/payment/modules/item-form.vue index 47d356a7f..8650b3a77 100644 --- a/apps/web-antdv-next/src/views/erp/finance/payment/modules/item-form.vue +++ b/apps/web-antdv-next/src/views/erp/finance/payment/modules/item-form.vue @@ -128,13 +128,15 @@ const handleOpenPurchaseIn = () => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const paidPrice = row.paymentPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_IN, - bizNo: row.no, - totalPrice: row.totalPrice, - paidPrice: row.paymentPrice, - paymentPrice: row.totalPrice - row.paymentPrice, + bizNo: row.no ?? '', + totalPrice, + paidPrice, + paymentPrice: totalPrice - paidPrice, remark: undefined, }; tableData.value.push(newItem); @@ -154,13 +156,15 @@ const handleOpenSaleReturn = () => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_RETURN, - bizNo: row.no, - totalPrice: -row.totalPrice, - paidPrice: -row.refundPrice, - paymentPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + paidPrice: -refundPrice, + paymentPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -202,7 +206,7 @@ const validate = () => { // 检查每行的付款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (!item.paymentPrice || item.paymentPrice <= 0) { + if (!item?.paymentPrice || item.paymentPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次付款必须大于0`); } } diff --git a/apps/web-antdv-next/src/views/erp/finance/receipt/modules/item-form.vue b/apps/web-antdv-next/src/views/erp/finance/receipt/modules/item-form.vue index 4491b51e0..34c305b9d 100644 --- a/apps/web-antdv-next/src/views/erp/finance/receipt/modules/item-form.vue +++ b/apps/web-antdv-next/src/views/erp/finance/receipt/modules/item-form.vue @@ -128,14 +128,15 @@ function handleOpenSaleOut() { function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { rows.forEach((row) => { - // TODO 芋艿 + const totalPrice = row.totalPrice ?? 0; + const receiptedPrice = row.receiptPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_OUT, - bizNo: row.no, - totalPrice: row.totalPrice, - receiptedPrice: row.receiptPrice, - receiptPrice: row.totalPrice - row.receiptPrice, + bizNo: row.no ?? '', + totalPrice, + receiptedPrice, + receiptPrice: totalPrice - receiptedPrice, remark: undefined, }; tableData.value.push(newItem); @@ -154,15 +155,16 @@ function handleOpenSaleReturn() { } function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { - // TODO 芋艿 rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_RETURN, - bizNo: row.no, - totalPrice: -row.totalPrice, - receiptedPrice: -row.refundPrice, - receiptPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + receiptedPrice: -refundPrice, + receiptPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -204,7 +206,7 @@ function validate() { // 检查每行的收款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (!item.receiptPrice || item.receiptPrice <= 0) { + if (!item?.receiptPrice || item.receiptPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次收款必须大于0`); } } diff --git a/apps/web-ele/src/api/erp/purchase/in/index.ts b/apps/web-ele/src/api/erp/purchase/in/index.ts index 060e1bcb8..df23762ad 100644 --- a/apps/web-ele/src/api/erp/purchase/in/index.ts +++ b/apps/web-ele/src/api/erp/purchase/in/index.ts @@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi { export interface PurchaseInItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-ele/src/api/erp/purchase/order/index.ts b/apps/web-ele/src/api/erp/purchase/order/index.ts index e59dcf68e..66954dc08 100644 --- a/apps/web-ele/src/api/erp/purchase/order/index.ts +++ b/apps/web-ele/src/api/erp/purchase/order/index.ts @@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi { /** 采购订单项信息 */ export interface PurchaseOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-ele/src/api/erp/purchase/return/index.ts b/apps/web-ele/src/api/erp/purchase/return/index.ts index 84b2a8a77..3e1a26739 100644 --- a/apps/web-ele/src/api/erp/purchase/return/index.ts +++ b/apps/web-ele/src/api/erp/purchase/return/index.ts @@ -11,7 +11,7 @@ export namespace ErpPurchaseReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice: number; // 合计金额,单位:元 - refundPrice: number; + refundPrice?: number; // 已退款金额,单位:元 discountPercent?: number; // 折扣百分比 discountPrice?: number; // 折扣金额 status?: number; // 状态 @@ -25,6 +25,7 @@ export namespace ErpPurchaseReturnApi { export interface PurchaseReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-ele/src/api/erp/sale/order/index.ts b/apps/web-ele/src/api/erp/sale/order/index.ts index c190a3dc1..ec46d9fbf 100644 --- a/apps/web-ele/src/api/erp/sale/order/index.ts +++ b/apps/web-ele/src/api/erp/sale/order/index.ts @@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi { /** 销售订单项 */ export interface SaleOrderItem { id?: number; // 订单项编号 + seq?: number; // 前端行号 orderId?: number; // 采购订单编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-ele/src/api/erp/sale/out/index.ts b/apps/web-ele/src/api/erp/sale/out/index.ts index a3e335af6..85f5a6686 100644 --- a/apps/web-ele/src/api/erp/sale/out/index.ts +++ b/apps/web-ele/src/api/erp/sale/out/index.ts @@ -12,6 +12,7 @@ export namespace ErpSaleOutApi { outTime?: Date; // 出库时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + receiptPrice?: number; // 已收款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -28,6 +29,7 @@ export namespace ErpSaleOutApi { export interface SaleOutItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-ele/src/api/erp/sale/return/index.ts b/apps/web-ele/src/api/erp/sale/return/index.ts index a0624cba2..18af37581 100644 --- a/apps/web-ele/src/api/erp/sale/return/index.ts +++ b/apps/web-ele/src/api/erp/sale/return/index.ts @@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi { returnTime?: Date; // 退货时间 totalCount?: number; // 合计数量 totalPrice?: number; // 合计金额,单位:元 + refundPrice?: number; // 已退款金额,单位:元 status?: number; // 状态 remark?: string; // 备注 discountPercent?: number; // 折扣百分比 @@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi { export interface SaleReturnItem { count?: number; id?: number; + seq?: number; // 前端行号 orderItemId?: number; productBarCode?: string; productId?: number; diff --git a/apps/web-ele/src/api/erp/stock/check/index.ts b/apps/web-ele/src/api/erp/stock/check/index.ts index b6f9d0bea..c67ea62b1 100644 --- a/apps/web-ele/src/api/erp/stock/check/index.ts +++ b/apps/web-ele/src/api/erp/stock/check/index.ts @@ -21,6 +21,7 @@ export namespace ErpStockCheckApi { /** 库存盘点项 */ export interface StockCheckItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 diff --git a/apps/web-ele/src/api/erp/stock/in/index.ts b/apps/web-ele/src/api/erp/stock/in/index.ts index e68c05b36..b6e4a50ef 100644 --- a/apps/web-ele/src/api/erp/stock/in/index.ts +++ b/apps/web-ele/src/api/erp/stock/in/index.ts @@ -23,15 +23,16 @@ export namespace ErpStockInApi { /** 其它入库单产品信息 */ export interface StockInItem { id?: number; // 编号 - warehouseId: number; // 仓库编号 - productId: number; // 产品编号 + seq?: number; // 前端行号 + warehouseId?: number; // 仓库编号 + productId?: number; // 产品编号 productName?: string; // 产品名称 productUnitId?: number; // 产品单位编号 productUnitName?: string; // 产品单位名称 productBarCode?: string; // 产品条码 - count: number; // 数量 - productPrice: number; // 产品单价 - totalPrice: number; // 总价 + count?: number; // 数量 + productPrice?: number; // 产品单价 + totalPrice?: number; // 总价 stockCount?: number; // 库存数量 remark?: string; // 备注 } diff --git a/apps/web-ele/src/api/erp/stock/move/index.ts b/apps/web-ele/src/api/erp/stock/move/index.ts index 0120a9b45..aaf09b22f 100644 --- a/apps/web-ele/src/api/erp/stock/move/index.ts +++ b/apps/web-ele/src/api/erp/stock/move/index.ts @@ -26,6 +26,7 @@ export namespace ErpStockMoveApi { count: number; // 数量 fromWarehouseId?: number; // 来源仓库ID id?: number; // ID + seq?: number; // 前端行号 productBarCode: string; // 产品条形码 productId?: number; // 产品ID productName?: string; // 产品名称 diff --git a/apps/web-ele/src/api/erp/stock/out/index.ts b/apps/web-ele/src/api/erp/stock/out/index.ts index 1ecb89233..94588e1bb 100644 --- a/apps/web-ele/src/api/erp/stock/out/index.ts +++ b/apps/web-ele/src/api/erp/stock/out/index.ts @@ -20,6 +20,7 @@ export namespace ErpStockOutApi { /** 其它出库单产品信息 */ export interface StockOutItem { id?: number; // 编号 + seq?: number; // 前端行号 warehouseId?: number; // 仓库编号 productId?: number; // 产品编号 productName?: string; // 产品名称 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 index 8314d48e7..b281656f4 100644 --- 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 @@ -128,14 +128,15 @@ const handleOpenPurchaseIn = () => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { rows.forEach((row) => { - // TODO @芋艿 + const totalPrice = row.totalPrice ?? 0; + const paidPrice = row.paymentPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id as any, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_IN, - bizNo: row.no as any, - totalPrice: row.totalPrice as any, - paidPrice: row.paymentPrice as any, - paymentPrice: (row.totalPrice as any) - (row.paymentPrice as any), + bizNo: row.no ?? '', + totalPrice, + paidPrice, + paymentPrice: totalPrice - paidPrice, remark: undefined, }; tableData.value.push(newItem); @@ -155,13 +156,15 @@ const handleOpenSaleReturn = () => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinancePaymentApi.FinancePaymentItem = { - bizId: row.id as any, + bizId: row.id ?? 0, bizType: ErpBizType.PURCHASE_RETURN, - bizNo: row.no as any, - totalPrice: -row.totalPrice, - paidPrice: -row.refundPrice, - paymentPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + paidPrice: -refundPrice, + paymentPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -203,7 +206,7 @@ const validate = () => { // 检查每行的付款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (item!.paymentPrice || item!.paymentPrice <= 0) { + if (!item?.paymentPrice || item.paymentPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次付款必须大于0`); } } 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 index 09fe4b03e..dd34ac9f4 100644 --- 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 @@ -127,15 +127,16 @@ function handleOpenSaleOut() { } function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { - // TODO @芋艿 rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const receiptedPrice = row.receiptPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_OUT, - bizNo: row.no, - totalPrice: row.totalPrice, - receiptedPrice: row.receiptPrice, - receiptPrice: row.totalPrice - row.receiptPrice, + bizNo: row.no ?? '', + totalPrice, + receiptedPrice, + receiptPrice: totalPrice - receiptedPrice, remark: undefined, }; tableData.value.push(newItem); @@ -155,13 +156,15 @@ function handleOpenSaleReturn() { function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { rows.forEach((row) => { + const totalPrice = row.totalPrice ?? 0; + const refundPrice = row.refundPrice ?? 0; const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { - bizId: row.id, + bizId: row.id ?? 0, bizType: ErpBizType.SALE_RETURN, - bizNo: row.no, - totalPrice: -row.totalPrice, - receiptedPrice: -row.refundPrice, - receiptPrice: -row.totalPrice + row.refundPrice, + bizNo: row.no ?? '', + totalPrice: -totalPrice, + receiptedPrice: -refundPrice, + receiptPrice: -totalPrice + refundPrice, remark: undefined, }; tableData.value.push(newItem); @@ -203,7 +206,7 @@ function validate() { // 检查每行的收款金额 for (let i = 0; i < tableData.value.length; i++) { const item = tableData.value[i]; - if (item!.receiptPrice || item!.receiptPrice <= 0) { + if (!item?.receiptPrice || item.receiptPrice <= 0) { throw new Error(`第 ${i + 1} 行:本次收款必须大于0`); } }