fix(workspace): 修复 ERP 明细草稿和收付款金额类型

pull/365/head
XuZhiqiang 2026-06-19 00:18:56 +08:00
parent 2e397a2c64
commit e1731f5394
36 changed files with 144 additions and 88 deletions

View File

@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi {
export interface PurchaseInItem {
count?: number;
id?: number;
seq?: number; // 前端行号
orderItemId?: number;
productBarCode?: string;
productId?: number;

View File

@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi {
/** 采购订单项信息 */
export interface PurchaseOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi {
/** 销售订单项 */
export interface SaleOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -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;

View File

@ -21,6 +21,7 @@ export namespace ErpStockCheckApi {
/** 库存盘点项 */
export interface StockCheckItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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; // 备注
}

View File

@ -26,6 +26,7 @@ export namespace ErpStockMoveApi {
count: number; // 数量
fromWarehouseId?: number; // 来源仓库ID
id?: number; // ID
seq?: number; // 前端行号
productBarCode: string; // 产品条形码
productId?: number; // 产品ID
productName?: string; // 产品名称

View File

@ -20,6 +20,7 @@ export namespace ErpStockOutApi {
/** 其它出库单产品信息 */
export interface StockOutItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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`);
}
}

View File

@ -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`);
}
}

View File

@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi {
export interface PurchaseInItem {
count?: number;
id?: number;
seq?: number; // 前端行号
orderItemId?: number;
productBarCode?: string;
productId?: number;

View File

@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi {
/** 采购订单项信息 */
export interface PurchaseOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi {
/** 销售订单项 */
export interface SaleOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -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;

View File

@ -21,6 +21,7 @@ export namespace ErpStockCheckApi {
/** 库存盘点项 */
export interface StockCheckItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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; // 备注
}

View File

@ -26,6 +26,7 @@ export namespace ErpStockMoveApi {
count: number; // 数量
fromWarehouseId?: number; // 来源仓库ID
id?: number; // ID
seq?: number; // 前端行号
productBarCode: string; // 产品条形码
productId?: number; // 产品ID
productName?: string; // 产品名称

View File

@ -20,6 +20,7 @@ export namespace ErpStockOutApi {
/** 其它出库单产品信息 */
export interface StockOutItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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`);
}
}

View File

@ -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`);
}
}

View File

@ -28,6 +28,7 @@ export namespace ErpPurchaseInApi {
export interface PurchaseInItem {
count?: number;
id?: number;
seq?: number; // 前端行号
orderItemId?: number;
productBarCode?: string;
productId?: number;

View File

@ -34,6 +34,7 @@ export namespace ErpPurchaseOrderApi {
/** 采购订单项信息 */
export interface PurchaseOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -28,6 +28,7 @@ export namespace ErpSaleOrderApi {
/** 销售订单项 */
export interface SaleOrderItem {
id?: number; // 订单项编号
seq?: number; // 前端行号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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;

View File

@ -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;

View File

@ -21,6 +21,7 @@ export namespace ErpStockCheckApi {
/** 库存盘点项 */
export interface StockCheckItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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; // 备注
}

View File

@ -26,6 +26,7 @@ export namespace ErpStockMoveApi {
count: number; // 数量
fromWarehouseId?: number; // 来源仓库ID
id?: number; // ID
seq?: number; // 前端行号
productBarCode: string; // 产品条形码
productId?: number; // 产品ID
productName?: string; // 产品名称

View File

@ -20,6 +20,7 @@ export namespace ErpStockOutApi {
/** 其它出库单产品信息 */
export interface StockOutItem {
id?: number; // 编号
seq?: number; // 前端行号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称

View File

@ -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`);
}
}

View File

@ -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`);
}
}