Commit 4062eb45 authored by XieZhiXiong's avatar XieZhiXiong
parents 70bb79b1 fb3e7b16
......@@ -479,7 +479,14 @@ const Products: React.FC<{}> = () => {
title: `确定要执行批量${type==='3'?'上架':'下架'}操作?`,
icon: <ExclamationCircleOutlined />,
onOk() {
clickUp(type==='3'?1:0, null)
if(type === '3') {
clickUp(1, null)
} else {
PublicApi.postProductCommodityOffPublishCommodityBatch({idList: currentRef.current}).then(res => {
ref.current.reload()
setSelectedRowKeys([])
})
}
},
okType: type==='3'?'primary':'danger',
onCancel() {
......
......@@ -10,8 +10,8 @@ export const AddressPop = (props) => {
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<p>{pickInfo.receiver} / {pickInfo.phone}</p>
<p>{pickInfo.address}</p>
<p>{pickInfo.receiver || pickInfo.shipperName} / {pickInfo.phone}</p>
<p>{pickInfo.receiver ? pickInfo.address : `${pickInfo.provinceName}${pickInfo.cityName}${pickInfo.districtName}${pickInfo.address}`}</p>
</div>
</Row>
}>
......
......@@ -81,25 +81,19 @@ export const filterProductDataById = (data, targetData) => {
next.category = next.category || next.customerCategoryName
next.unit = next.unit || next.unitName
next.productName = next.productName || next.name
next.deliverType = next.logistics.sendAddress // 保证和详情编辑字段一致
// if (logistics.deliveryType === 2) {
// const { code, data } = await PublicApi.getLogisticsShipperAddressGet({
// id: logistics.sendAddress
// }, { ttl: 60 * 1000, useCache: true })
// logistics.render = code === 1000 ? <AddressPop pickInfo={data}>{DELIVERY_TYPE[logistics.deliveryType]}</AddressPop> : DELIVERY_TYPE[logistics.deliveryType]
// } else {
// logistics.render = DELIVERY_TYPE[logistics.deliveryType]
// }
if (logistics.deliveryType === 2 && logistics.sendAddress) {
const { code, data } = await PublicApi.getLogisticsShipperAddressGet({
id: logistics.sendAddress
}, { ttl: 60 * 1000, useCache: true })
logistics.render = data
logistics.render = {...data, deliverType: logistics.deliveryType}
} else {
logistics.render = DELIVERY_TYPE[logistics.deliveryType]
}
// 配送方式外置, 用于接口字段冗余
next.deliveryType = logistics.deliveryType
next.deliverType = logistics.deliveryType
// id 存在集合中, 采用target中的数据, 否则采用data中的数据
const findResult = data.find(v => v.id === next.id)
......
......@@ -351,15 +351,16 @@ export const productInfoColumns: any[] = [
// 接口调用
{
title: '配送方式',
dataIndex: 'logistics',
dataIndex: 'deliverType',
align: 'center',
key: 'logistics',
key: 'deliverType',
render: (t, r) => {
if(r.logistics === 1)
console.log(r, 'rr')
if(t === 1)
return "物流(默认)"
else if(r.logistics === 2)
return <AddressPop pickInfo={t}>{DELIVERY_TYPE[t]}</AddressPop>
else if(r.logistics === 3)
else if(t === 2)
return <AddressPop pickInfo={r.logistics.render}>自提</AddressPop>
else if(t === 3)
return "无需配送"
}
},
......
......@@ -87,7 +87,12 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
const shopId = ctx.getFieldValue('shopId')
const products = value.map(item => ({ productId: item.commodityId, skuId: item.productId }))
if(shopId && products?.length) {
console.log(value)
// 判断不存在物流 隐藏交付地址
if(!value.some(item => item.logistics.deliveryType === 1)) {
ctx.setFieldState('deliveryAddresId', state => state.visible = false )
} else {
ctx.setFieldState('deliveryAddresId', state => state.visible = true )
}
fetchOrderApi.getPayInfoList({
products: products,
memberId: productItem?.memberId,
......
......@@ -254,22 +254,24 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
// 交付地址数据字段转换拼接 查询省市区冗余
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId?.id || params.deliveryAddresId
})
params.consignee = {
deliverDate: params.deliverDate,
consigneeId: addressDetail.id,
consignee: addressDetail.receiverName,
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
phone: addressDetail.phone,
telephone: addressDetail.tel,
defaultConsignee: !!addressDetail.isDefault,
if(params?.deliveryAddresId) {
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId?.id || params.deliveryAddresId
})
params.consignee = {
deliverDate: params.deliverDate,
consigneeId: addressDetail.id,
consignee: addressDetail.receiverName,
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
phone: addressDetail.phone,
telephone: addressDetail.tel,
defaultConsignee: !!addressDetail.isDefault,
}
}
// 其他需求
......
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