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

fix:…

fix: 处理渠道商品商品规格重复添加/数据为空一直loading问题,处理渠道商城跳转过来下单重复打折/下单模式异常/查询库存/查询交易规则报错问题,处理下单支付对未配置对公账户不给予提交问题,处理仓位提交返回问题
parent ca2a3b81
...@@ -52,7 +52,7 @@ const AddDirectChannel:React.FC<{}> = (props) => { ...@@ -52,7 +52,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
let params: any = {} let params: any = {}
console.log(values, 'vvv') console.log(values, 'vvv')
values.map((item, index) => { values.map((item, index) => {
if(!item?.carriageType) if(!item.deliveryType)
params = { ...params, ...item } params = { ...params, ...item }
else else
params.logistics = { ...item } params.logistics = { ...item }
......
...@@ -123,14 +123,22 @@ const ModifyDirectChannel:React.FC<{}> = () => { ...@@ -123,14 +123,22 @@ const ModifyDirectChannel:React.FC<{}> = () => {
// 获取商品规格列表 // 获取商品规格列表
const fetchSpecData = () => { const fetchSpecData = () => {
setLoading(true) setLoading(true)
PublicApi.getProductChannelCommodityGetCommodityUnitPriceByChannel({id: history.location.query.id}).then(res => { console.log(priceTableData, 'priceTableData')
PublicApi.postProductChannelCommodityGetCommodityUnitPriceByChannel({
id: history.location.query.id,
idList: priceTableData.map(item => item.id)
}, { ctlType: "none" }).then(res => {
const { data } = res const { data } = res
// let hasIds = priceTableData.map(item => item.id) // let hasIds = priceTableData.map(item => item.id)
// setOriginHasIds(hasIds) // setOriginHasIds(hasIds)
let _data = data.filter(item => !originHasIds.includes(item.id)) // let _data = data.filter(item => !originHasIds.includes(item.id))
setOriginTableData(_data) setOriginTableData(data)
if(_data.length > 0) if(data.length > 0) {
structureTable(_data) structureTable(data)
} else {
setLoading(false)
structureTable([])
}
}) })
} }
......
...@@ -46,10 +46,12 @@ const AddRepository:React.FC<{}> = (props) => { ...@@ -46,10 +46,12 @@ const AddRepository:React.FC<{}> = (props) => {
params['warehouseName'] = prevState.props.enum.filter((item: any) => item.value === prevState.value)[0]['label'] params['warehouseName'] = prevState.props.enum.filter((item: any) => item.value === prevState.value)[0]['label']
} }
}) })
await PublicApi.postWarehouseFreightSpaceAdd(params) let res = await PublicApi.postWarehouseFreightSpaceAdd(params)
setTimeout(() => { if(res.code === 1000) {
history.goBack(-1) setTimeout(() => {
}, 1000) history.goBack(-1)
}, 1000)
}
} }
} }
......
...@@ -91,6 +91,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -91,6 +91,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const [payOnReceived, setPayOnReceived] = useState<boolean>(false) // 是否要禁用到付方式 const [payOnReceived, setPayOnReceived] = useState<boolean>(false) // 是否要禁用到付方式
const [blankAccountInfo, setBlankAccountInfo] = useState<any>() const [blankAccountInfo, setBlankAccountInfo] = useState<any>()
const { run, loading } = useHttpRequest(PublicApi.postOrderPendingOrderPay) const { run, loading } = useHttpRequest(PublicApi.postOrderPendingOrderPay)
const [settleAccountsError, setSettleAccountsError] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
if (currentRef) { if (currentRef) {
...@@ -178,6 +179,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -178,6 +179,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => { PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setBlankAccountInfo(res.data) setBlankAccountInfo(res.data)
setSettleAccountsError(true)
} else {
setSettleAccountsError(false)
} }
}) })
} else if (checked.id === 6) { // 授信额度支付 } else if (checked.id === 6) { // 授信额度支付
...@@ -310,6 +314,10 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -310,6 +314,10 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
params.payOrderUrls = payOrderUrls.join(',') params.payOrderUrls = payOrderUrls.join(',')
} }
if(!settleAccountsError) {
return message.error('请先完成对公账户配置')
}
const res = await run(params, mobilePayFlag.current === 4 ? { ctlType: "none" } : null) const res = await run(params, mobilePayFlag.current === 4 ? { ctlType: "none" } : null)
if (res.code === 1000) { if (res.code === 1000) {
if(mobilePayFlag.current !== 4) { // 非微信 if(mobilePayFlag.current !== 4) { // 非微信
......
...@@ -206,7 +206,8 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -206,7 +206,8 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
}, {}), }, {}),
isMemberPrice: v.isMemberPrice, isMemberPrice: v.isMemberPrice,
purchaseCount: v.count, purchaseCount: v.count,
money: v.memberDiscount ? (v.count*1000 * v.unitPrice*100 * v.memberDiscount*100)/10000000 : (v.count*1000 * v.unitPrice*100)/100000, // money: v.memberDiscount ? (v.count*1000 * v.unitPrice*100 * v.memberDiscount*100)/10000000 : (v.count*1000 * v.unitPrice*100)/100000,
money: (v.count*1000 * v.unitPrice*100)/100000,
productId: v.id, productId: v.id,
channelProductId: v.channelProductId, channelProductId: v.channelProductId,
memberId: initValue.supplyMembersId, // 添加 memberId, memberRoleId 字段 memberId: initValue.supplyMembersId, // 添加 memberId, memberRoleId 字段
...@@ -226,7 +227,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -226,7 +227,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// ctx.setFormState(state => { // ctx.setFormState(state => {
// state.remoteDataFn = fn // state.remoteDataFn = fn
// }) // })
console.log(initValue, 'initValue')
fn(initValue) fn(initValue)
} }
......
...@@ -321,7 +321,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -321,7 +321,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
params.orderProductRequests = params.orderProductRequests.map(item => { params.orderProductRequests = params.orderProductRequests.map(item => {
let logistics: any = { let logistics: any = {
...item.logistics, ...item.logistics,
render: JSON.stringify(typeof item.logistics.render === "object" ? item.logistics.render : item.logistics.render.replace(/\"/g, '')) render: JSON.stringify(typeof item.logistics.render === "object" ? item.logistics.render : (item.logistics?.render ? item.logistics.render.replace(/\"/g, '') : {}))
}; };
return { return {
...item, ...item,
......
...@@ -85,6 +85,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -85,6 +85,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
// 商品行数变动 清空之前的支付信息 // 商品行数变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) { if (pageStatus === PageStatus.ADD) {
console.log('Add')
let paymentInfo = ctx.getFieldValue('paymentInformationResponses').map(item => { let paymentInfo = ctx.getFieldValue('paymentInformationResponses').map(item => {
let _item = {...item} let _item = {...item}
delete _item.channel delete _item.channel
......
...@@ -141,7 +141,7 @@ export const useSelfTable = () => { ...@@ -141,7 +141,7 @@ export const useSelfTable = () => {
} }
</Col> */} </Col> */}
</Row> </Row>
<Progress percent={Math.ceil(record.currentPayments / record.sum)} showInfo={false} /> <Progress percent={Number(record.currentPayments / record.sum).toFixed(2) * 100} showInfo={false} />
</> </>
}, },
{ {
......
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