Commit 75b1f865 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:

parent fda327e4
......@@ -303,7 +303,7 @@ const AddProducts: React.FC<{}> = (props) => {
throw new Error('请完善商品其他信息!')
}
} catch (e) {
return e
return { message: '请完善商品其他信息!' }
}
// 校验价格
try {
......
......@@ -50,6 +50,8 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
let newData = data.map((v: any) => {
v.memberId = item.offerMemberId
v.memberRoleId = item.offerMemberRoleId
v.orderMode = schemaAction.getFieldValue('orderMode')
v.shopId = schemaAction.getFieldValue('shopId')
return v
})
......
......@@ -70,6 +70,9 @@ export const procurementRenderField = (data) => {
memberRoleId: data.vendorRoleId,
// 冗余运费
freight: data.product.freight,
// 冗余shopId orderMode查询支付方式使用
shopId: data.shopId,
orderMode: data.orderMode,
}
})
}
......
......@@ -95,6 +95,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
} else {
ctx.setFieldState('deliveryAddresId', state => state.visible = true )
}
console.log('2')
fetchOrderApi.getPayInfoList({
products: products,
memberId: productItem?.memberId,
......
......@@ -83,18 +83,10 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
if (logsiticsDataMaps.length > 0) {
PublicApi.postLogisticsFreightTemplateCalFreightPrice({
orderProductList: pageStatus === PageStatus.ADD
?
logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId,
weight: v.logistics.weight,
orderProductList: logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId || v.logisticsTemplateId,
weight: v.logistics.weight || v.weight,
count: v?.purchaseCount || 0
}))
:
logsiticsDataMaps.map(v => ({
templateId: v.logisticTemplateId,
weight: v.weight,
count: v.purchaseCount
})),
receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId
}, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
......@@ -147,8 +139,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const [products, setProducts] = useState<any>([])
const [paymentColumns, paymentComponents, paymentSave] = usePaymentInfo(
addSchemaAction,
addSchemaAction.getFieldValue('vendorMemberId'),
addSchemaAction.getFieldValue('vendorRoleId'),
pageStatus === PageStatus.ADD ? addSchemaAction.getFieldValue('products') : products
)
// 订单商品
......@@ -332,7 +322,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
memberRef.current.setVisible(true)
}
const orderNoPrice = pageStatus !== PageStatus.PREVIEW && <div className='connectBtn' onClick={handleOrderNo}><LinkOutlined style={{marginRight: 4}}/>选择</div>
const orderNoPrice = pageStatus === PageStatus.ADD && <div className='connectBtn' onClick={handleOrderNo}><LinkOutlined style={{marginRight: 4}}/>选择</div>
const orderMember = pageStatus !== PageStatus.PREVIEW && <div className='connectBtn' onClick={handleOrderMember}><LinkOutlined style={{marginRight: 4}}/>选择</div>
// @todo 未实现金额合计
......@@ -431,6 +421,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
state.editable = false
})
}
if (id) {
ctx.setFieldState('shopId', state => {
state.editable = false
})
}
})
$('onFieldInputChange', 'orderMode').subscribe(state => {
const { value } = state
......@@ -486,6 +481,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
// 新增下 切换商城 清空受影响的字段
$('onFieldValueChange', 'shopId').subscribe(state => {
pageStatus === PageStatus.ADD && ctx.reset({
validate: false,
selector: '*(quoteNo,quoteId,vendorMemberName,vendorMemberId,vendorRoleId,products,payments)'
})
})
}}
expressionScope={{
orderNoPrice,
......
......@@ -4,7 +4,7 @@ import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { useEffect, useState, useRef } from 'react'
import { PublicApi } from '@/services/api'
export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, memberId: any, memberRoleId: any, products: any = []): any => {
export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, products: any = []): any => {
const paywayData = useRef<any>({})
const [columns, setColumns] = useState<any[]>(paymentInformationColumns)
const markRef = useRef<boolean>(true)
......@@ -40,11 +40,12 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const getPayLists = (memberId, memberRoleId) => {
console.log('1')
PublicApi.postOrderBuyerCreateB2bPaymentFind({
memberId,
roleId: memberRoleId,
shopId: ctx.getFieldValue('shopId'),
orderMode: ctx.getFieldValue('orderMode'),
shopId: products[0]['shopId'],
orderMode: products[0]['orderMode'],
products: products.map(item => ({ productId: item.commodityId, skuId: item.productId }))
}, { ctlType: 'none' }).then(res => {
const { code, data } = res
......
......@@ -253,7 +253,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
contractOrderRef.current.setVisible(true)
}
const orderContract = pageStatus !== PageStatus.PREVIEW && <div className='connectBtn' onClick={handleOrderContract}><LinkOutlined style={{marginRight: 4}}/>选择</div>
const orderContract = pageStatus === PageStatus.ADD && <div className='connectBtn' onClick={handleOrderContract}><LinkOutlined style={{marginRight: 4}}/>选择</div>
// 新增收货地址
const addNewAddress = <Button block icon={<PlusOutlined/>}>新增收货地址</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