feat(订单): 添加订单模式字段支持多种业务场景
在订单请求数据类型和结账组件中添加mode字段,用于支持支付、审批、借还等不同业务模式
This commit is contained in:
parent
e83f9750ea
commit
4599e5c6ad
|
@ -69,11 +69,15 @@ export interface SubmitOrderRequestData {
|
|||
/** 是否内部订单 0否 1汇邦云用户 2企业微信用户 */
|
||||
isInternal: number;
|
||||
applyRemark: string;
|
||||
/** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */
|
||||
mode: number;
|
||||
/** 订单商品明细列表 */
|
||||
goodsList: Array<{
|
||||
goodsId: number
|
||||
goodsId?: number
|
||||
quantity: number
|
||||
cellId: number
|
||||
/** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */
|
||||
mode: number;
|
||||
}>
|
||||
}
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@ async function handleSubmit() {
|
|||
let goodsListToSend;
|
||||
if (isRentingMode.value) {
|
||||
goodsListToSend = rentingCartItems.value.map(item => ({
|
||||
goodsId: item.cabinetCell.cellId, // 租用模式下,goodsId 可以是 cellId
|
||||
quantity: item.quantity,
|
||||
cellId: item.cabinetCell.cellId, // 租用模式下,cellId
|
||||
mode: productStore.selectedShop?.mode || 0, // 默认为 0
|
||||
// 注意:后端可能需要额外的字段来区分是商品订单还是租用订单,
|
||||
// 或者根据 goodsId/cellId 的性质来判断。
|
||||
// 如果后端接收的是 price,可能还需要加上:price: item.cabinetCell.cellPrice,
|
||||
|
@ -164,6 +164,7 @@ async function handleSubmit() {
|
|||
goodsId: item.product.id,
|
||||
quantity: item.quantity,
|
||||
cellId: item.product.cellId,
|
||||
mode: productStore.selectedShop?.mode || 0, // 默认为 0
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -178,6 +179,7 @@ async function handleSubmit() {
|
|||
name: isInternal === 2 ? qyName.value : name.value,
|
||||
applyRemark: applyRemark.value,
|
||||
qyUserid: wxStore.userid,
|
||||
mode: productStore.selectedShop?.mode || 0, // 默认为 0
|
||||
isInternal: isInternal
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue