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 { export interface PurchaseInItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -11,6 +11,7 @@ export namespace ErpPurchaseReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice: number; // 合计金额,单位:元 totalPrice: number; // 合计金额,单位:元
refundPrice?: number; // 已退款金额,单位:元
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额 discountPrice?: number; // 折扣金额
status?: number; // 状态 status?: number; // 状态
@ -24,6 +25,7 @@ export namespace ErpPurchaseReturnApi {
export interface PurchaseReturnItem { export interface PurchaseReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -12,6 +12,7 @@ export namespace ErpSaleOutApi {
outTime?: Date; // 出库时间 outTime?: Date; // 出库时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
receiptPrice?: number; // 已收款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -28,6 +29,7 @@ export namespace ErpSaleOutApi {
export interface SaleOutItem { export interface SaleOutItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
refundPrice?: number; // 已退款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi {
export interface SaleReturnItem { export interface SaleReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -23,15 +23,16 @@ export namespace ErpStockInApi {
/** 其它入库单产品信息 */ /** 其它入库单产品信息 */
export interface StockInItem { export interface StockInItem {
id?: number; // 编号 id?: number; // 编号
warehouseId: number; // 仓库编号 seq?: number; // 前端行号
productId: number; // 产品编号 warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称 productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号 productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称 productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码 productBarCode?: string; // 产品条码
count: number; // 数量 count?: number; // 数量
productPrice: number; // 产品单价 productPrice?: number; // 产品单价
totalPrice: number; // 总价 totalPrice?: number; // 总价
stockCount?: number; // 库存数量 stockCount?: number; // 库存数量
remark?: string; // 备注 remark?: string; // 备注
} }

View File

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

View File

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

View File

@ -128,13 +128,15 @@ const handleOpenPurchaseIn = () => {
const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const paidPrice = row.paymentPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_IN, bizType: ErpBizType.PURCHASE_IN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: row.totalPrice, totalPrice,
paidPrice: row.paymentPrice, paidPrice,
paymentPrice: row.totalPrice - row.paymentPrice, paymentPrice: totalPrice - paidPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -154,13 +156,15 @@ const handleOpenSaleReturn = () => {
const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_RETURN, bizType: ErpBizType.PURCHASE_RETURN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
paidPrice: -row.refundPrice, paidPrice: -refundPrice,
paymentPrice: -row.totalPrice + row.refundPrice, paymentPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -202,7 +206,7 @@ const validate = () => {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (!item.paymentPrice || item.paymentPrice <= 0) { if (!item?.paymentPrice || item.paymentPrice <= 0) {
throw new Error(`${i + 1}本次付款必须大于0`); throw new Error(`${i + 1}本次付款必须大于0`);
} }
} }

View File

@ -128,14 +128,15 @@ function handleOpenSaleOut() {
function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) {
rows.forEach((row) => { rows.forEach((row) => {
// TODO const totalPrice = row.totalPrice ?? 0;
const receiptedPrice = row.receiptPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_OUT, bizType: ErpBizType.SALE_OUT,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: row.totalPrice, totalPrice,
receiptedPrice: row.receiptPrice, receiptedPrice,
receiptPrice: row.totalPrice - row.receiptPrice, receiptPrice: totalPrice - receiptedPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -154,15 +155,16 @@ function handleOpenSaleReturn() {
} }
function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) {
// TODO
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_RETURN, bizType: ErpBizType.SALE_RETURN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
receiptedPrice: -row.refundPrice, receiptedPrice: -refundPrice,
receiptPrice: -row.totalPrice + row.refundPrice, receiptPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -204,7 +206,7 @@ function validate() {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (!item.receiptPrice || item.receiptPrice <= 0) { if (!item?.receiptPrice || item.receiptPrice <= 0) {
throw new Error(`${i + 1}本次收款必须大于0`); throw new Error(`${i + 1}本次收款必须大于0`);
} }
} }

View File

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

View File

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

View File

@ -11,6 +11,7 @@ export namespace ErpPurchaseReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice: number; // 合计金额,单位:元 totalPrice: number; // 合计金额,单位:元
refundPrice?: number; // 已退款金额,单位:元
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额 discountPrice?: number; // 折扣金额
status?: number; // 状态 status?: number; // 状态
@ -24,6 +25,7 @@ export namespace ErpPurchaseReturnApi {
export interface PurchaseReturnItem { export interface PurchaseReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -12,6 +12,7 @@ export namespace ErpSaleOutApi {
outTime?: Date; // 出库时间 outTime?: Date; // 出库时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
receiptPrice?: number; // 已收款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -28,6 +29,7 @@ export namespace ErpSaleOutApi {
export interface SaleOutItem { export interface SaleOutItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
refundPrice?: number; // 已退款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi {
export interface SaleReturnItem { export interface SaleReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -23,15 +23,16 @@ export namespace ErpStockInApi {
/** 其它入库单产品信息 */ /** 其它入库单产品信息 */
export interface StockInItem { export interface StockInItem {
id?: number; // 编号 id?: number; // 编号
warehouseId: number; // 仓库编号 seq?: number; // 前端行号
productId: number; // 产品编号 warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称 productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号 productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称 productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码 productBarCode?: string; // 产品条码
count: number; // 数量 count?: number; // 数量
productPrice: number; // 产品单价 productPrice?: number; // 产品单价
totalPrice: number; // 总价 totalPrice?: number; // 总价
stockCount?: number; // 库存数量 stockCount?: number; // 库存数量
remark?: string; // 备注 remark?: string; // 备注
} }

View File

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

View File

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

View File

@ -128,13 +128,15 @@ const handleOpenPurchaseIn = () => {
const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const paidPrice = row.paymentPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_IN, bizType: ErpBizType.PURCHASE_IN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: row.totalPrice, totalPrice,
paidPrice: row.paymentPrice, paidPrice,
paymentPrice: row.totalPrice - row.paymentPrice, paymentPrice: totalPrice - paidPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -154,13 +156,15 @@ const handleOpenSaleReturn = () => {
const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_RETURN, bizType: ErpBizType.PURCHASE_RETURN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
paidPrice: -row.refundPrice, paidPrice: -refundPrice,
paymentPrice: -row.totalPrice + row.refundPrice, paymentPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -202,7 +206,7 @@ const validate = () => {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (!item.paymentPrice || item.paymentPrice <= 0) { if (!item?.paymentPrice || item.paymentPrice <= 0) {
throw new Error(`${i + 1}本次付款必须大于0`); throw new Error(`${i + 1}本次付款必须大于0`);
} }
} }

View File

@ -128,14 +128,15 @@ function handleOpenSaleOut() {
function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) {
rows.forEach((row) => { rows.forEach((row) => {
// TODO const totalPrice = row.totalPrice ?? 0;
const receiptedPrice = row.receiptPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_OUT, bizType: ErpBizType.SALE_OUT,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: row.totalPrice, totalPrice,
receiptedPrice: row.receiptPrice, receiptedPrice,
receiptPrice: row.totalPrice - row.receiptPrice, receiptPrice: totalPrice - receiptedPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -154,15 +155,16 @@ function handleOpenSaleReturn() {
} }
function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) {
// TODO
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_RETURN, bizType: ErpBizType.SALE_RETURN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
receiptedPrice: -row.refundPrice, receiptedPrice: -refundPrice,
receiptPrice: -row.totalPrice + row.refundPrice, receiptPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -204,7 +206,7 @@ function validate() {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (!item.receiptPrice || item.receiptPrice <= 0) { if (!item?.receiptPrice || item.receiptPrice <= 0) {
throw new Error(`${i + 1}本次收款必须大于0`); throw new Error(`${i + 1}本次收款必须大于0`);
} }
} }

View File

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

View File

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

View File

@ -11,7 +11,7 @@ export namespace ErpPurchaseReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice: number; // 合计金额,单位:元 totalPrice: number; // 合计金额,单位:元
refundPrice: number; refundPrice?: number; // 已退款金额,单位:元
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额 discountPrice?: number; // 折扣金额
status?: number; // 状态 status?: number; // 状态
@ -25,6 +25,7 @@ export namespace ErpPurchaseReturnApi {
export interface PurchaseReturnItem { export interface PurchaseReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -12,6 +12,7 @@ export namespace ErpSaleOutApi {
outTime?: Date; // 出库时间 outTime?: Date; // 出库时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
receiptPrice?: number; // 已收款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -28,6 +29,7 @@ export namespace ErpSaleOutApi {
export interface SaleOutItem { export interface SaleOutItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

@ -11,6 +11,7 @@ export namespace ErpSaleReturnApi {
returnTime?: Date; // 退货时间 returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量 totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元 totalPrice?: number; // 合计金额,单位:元
refundPrice?: number; // 已退款金额,单位:元
status?: number; // 状态 status?: number; // 状态
remark?: string; // 备注 remark?: string; // 备注
discountPercent?: number; // 折扣百分比 discountPercent?: number; // 折扣百分比
@ -27,6 +28,7 @@ export namespace ErpSaleReturnApi {
export interface SaleReturnItem { export interface SaleReturnItem {
count?: number; count?: number;
id?: number; id?: number;
seq?: number; // 前端行号
orderItemId?: number; orderItemId?: number;
productBarCode?: string; productBarCode?: string;
productId?: number; productId?: number;

View File

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

View File

@ -23,15 +23,16 @@ export namespace ErpStockInApi {
/** 其它入库单产品信息 */ /** 其它入库单产品信息 */
export interface StockInItem { export interface StockInItem {
id?: number; // 编号 id?: number; // 编号
warehouseId: number; // 仓库编号 seq?: number; // 前端行号
productId: number; // 产品编号 warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称 productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号 productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称 productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码 productBarCode?: string; // 产品条码
count: number; // 数量 count?: number; // 数量
productPrice: number; // 产品单价 productPrice?: number; // 产品单价
totalPrice: number; // 总价 totalPrice?: number; // 总价
stockCount?: number; // 库存数量 stockCount?: number; // 库存数量
remark?: string; // 备注 remark?: string; // 备注
} }

View File

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

View File

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

View File

@ -128,14 +128,15 @@ const handleOpenPurchaseIn = () => {
const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => { const handleAddPurchaseIn = (rows: ErpPurchaseInApi.PurchaseIn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
// TODO @ const totalPrice = row.totalPrice ?? 0;
const paidPrice = row.paymentPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id as any, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_IN, bizType: ErpBizType.PURCHASE_IN,
bizNo: row.no as any, bizNo: row.no ?? '',
totalPrice: row.totalPrice as any, totalPrice,
paidPrice: row.paymentPrice as any, paidPrice,
paymentPrice: (row.totalPrice as any) - (row.paymentPrice as any), paymentPrice: totalPrice - paidPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -155,13 +156,15 @@ const handleOpenSaleReturn = () => {
const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => { const handleAddSaleReturn = (rows: ErpPurchaseReturnApi.PurchaseReturn[]) => {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinancePaymentApi.FinancePaymentItem = { const newItem: ErpFinancePaymentApi.FinancePaymentItem = {
bizId: row.id as any, bizId: row.id ?? 0,
bizType: ErpBizType.PURCHASE_RETURN, bizType: ErpBizType.PURCHASE_RETURN,
bizNo: row.no as any, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
paidPrice: -row.refundPrice, paidPrice: -refundPrice,
paymentPrice: -row.totalPrice + row.refundPrice, paymentPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -203,7 +206,7 @@ const validate = () => {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (item!.paymentPrice || item!.paymentPrice <= 0) { if (!item?.paymentPrice || item.paymentPrice <= 0) {
throw new Error(`${i + 1}本次付款必须大于0`); throw new Error(`${i + 1}本次付款必须大于0`);
} }
} }

View File

@ -127,15 +127,16 @@ function handleOpenSaleOut() {
} }
function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) { function handleAddSaleOut(rows: ErpSaleOutApi.SaleOut[]) {
// TODO @
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const receiptedPrice = row.receiptPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_OUT, bizType: ErpBizType.SALE_OUT,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: row.totalPrice, totalPrice,
receiptedPrice: row.receiptPrice, receiptedPrice,
receiptPrice: row.totalPrice - row.receiptPrice, receiptPrice: totalPrice - receiptedPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -155,13 +156,15 @@ function handleOpenSaleReturn() {
function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) { function handleAddSaleReturn(rows: ErpSaleReturnApi.SaleReturn[]) {
rows.forEach((row) => { rows.forEach((row) => {
const totalPrice = row.totalPrice ?? 0;
const refundPrice = row.refundPrice ?? 0;
const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = { const newItem: ErpFinanceReceiptApi.FinanceReceiptItem = {
bizId: row.id, bizId: row.id ?? 0,
bizType: ErpBizType.SALE_RETURN, bizType: ErpBizType.SALE_RETURN,
bizNo: row.no, bizNo: row.no ?? '',
totalPrice: -row.totalPrice, totalPrice: -totalPrice,
receiptedPrice: -row.refundPrice, receiptedPrice: -refundPrice,
receiptPrice: -row.totalPrice + row.refundPrice, receiptPrice: -totalPrice + refundPrice,
remark: undefined, remark: undefined,
}; };
tableData.value.push(newItem); tableData.value.push(newItem);
@ -203,7 +206,7 @@ function validate() {
// //
for (let i = 0; i < tableData.value.length; i++) { for (let i = 0; i < tableData.value.length; i++) {
const item = tableData.value[i]; const item = tableData.value[i];
if (item!.receiptPrice || item!.receiptPrice <= 0) { if (!item?.receiptPrice || item.receiptPrice <= 0) {
throw new Error(`${i + 1}本次收款必须大于0`); throw new Error(`${i + 1}本次收款必须大于0`);
} }
} }