Commit 3e251647 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理商品跳转过来的下单会员折扣显示异常

parent eea7495c
...@@ -59,12 +59,12 @@ const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsync ...@@ -59,12 +59,12 @@ const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsync
// return v // return v
// })) // }))
// } // }
// 配送方式请求 // 配送方式请求
// const asyncAddressRequests = productData.filter(v => v.distributeMode !== undefined) // const asyncAddressRequests = productData.filter(v => v.distributeMode !== undefined)
} }
export const createEffects = context => () => { export const createEffects = context => () => {
} }
export const useModelTypeChange = (callback) => { export const useModelTypeChange = (callback) => {
...@@ -96,7 +96,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor ...@@ -96,7 +96,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// // 已经存在数据 无需请求 // // 已经存在数据 无需请求
// if (payInfoData && payInfoData.length > 0) { // if (payInfoData && payInfoData.length > 0) {
// } else // } else
if (value && value.length > 0){ if (value && value.length > 0){
// 请求一次并复制给支付信息 // 请求一次并复制给支付信息
const productItem = value[0] const productItem = value[0]
...@@ -157,7 +157,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -157,7 +157,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// query中存在modelType参数, 则是从其他页面跳转而来,需禁用其余query选项 // query中存在modelType参数, 则是从其他页面跳转而来,需禁用其余query选项
// 商城跳转过来的数据 // 商城跳转过来的数据
const initValue = JSON.parse(window.sessionStorage.getItem(spam_id)) const initValue = JSON.parse(window.sessionStorage.getItem(spam_id))
// 从商城跳转, 需回显数据 // 从商城跳转, 需回显数据
if (initValue) { if (initValue) {
const fn = async (initValue) => { const fn = async (initValue) => {
...@@ -175,17 +175,17 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -175,17 +175,17 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
prev[next.range] = next.price prev[next.range] = next.price
return prev return prev
}, {}), }, {}),
isMemberPrice: !!v.memberDiscount, isMemberPrice: v.isMemberPrice,
purchaseCount: v.count, purchaseCount: v.count,
money: v.count * v.unitPrice, money: v.count * v.unitPrice,
productId: v.id, productId: v.id,
memberId: initValue.supplyMembersId, // 添加 memberId 字段 memberId: initValue.supplyMembersId, // 添加 memberId 字段
commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他) commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他)
memberPrice: v.memberDiscount !== 1 ? toPercent(v.memberDiscount) : 1, // 添加会员折扣 memberPrice: v.memberDiscount !== 1 ? v.memberDiscount : 1, // 添加会员折扣
} }
}))) })))
} }
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显 // 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
ctx.setFieldState('orderModel', state => { ctx.setFieldState('orderModel', state => {
state.remoteDataFn = fn state.remoteDataFn = fn
...@@ -196,7 +196,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -196,7 +196,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
fn(initValue) fn(initValue)
} }
// 写入收货地址数据 // 写入收货地址数据
useProductAddress(ctx) useProductAddress(ctx)
}) })
...@@ -209,7 +209,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -209,7 +209,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
} }
export const useProductAddress = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => { export const useProductAddress = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
fetchOrderApi.getProductAddressAll().then(data => { fetchOrderApi.getProductAddressAll().then(data => {
ctx.setFieldState('deliveryAddresId', state => { ctx.setFieldState('deliveryAddresId', state => {
if (data.length > 0 && !state.value) { if (data.length > 0 && !state.value) {
......
...@@ -12,7 +12,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -12,7 +12,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 待确认支付结果订单 // 待确认支付结果订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
...@@ -64,4 +63,4 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => { ...@@ -64,4 +63,4 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
FirstApprovedOrder.defaultProps = {} FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder export default FirstApprovedOrder
\ No newline at end of file
...@@ -64,7 +64,13 @@ export const useSelfTable = () => { ...@@ -64,7 +64,13 @@ export const useSelfTable = () => {
}, },
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' }, { title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转 // @todo 发货单号跳转
{ title: '发货单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> }, {
title: '发货单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.invoiceId}&preview=1`}>{text}</Link>
},
// { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text}, // { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text},
{ {
title: '订单类型', title: '订单类型',
...@@ -94,10 +100,10 @@ export const useSelfTable = () => { ...@@ -94,10 +100,10 @@ export const useSelfTable = () => {
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */} {/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button> <Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
} }
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button> <Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button>
} }
</> </>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment