Commit 4a86a61a authored by GuanHua's avatar GuanHua
parents c5b6a081 046daf12
......@@ -329,7 +329,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
return (
<MellowCard title="退款明细" {...rest}>
<PolymericTable
rowKey={record => `${record.orderNo}+${record.productId}`}
rowKey={(record: any) => `${record.orderNo}+${record.productId}`}
dataSource={dataSource}
columns={columns}
loading={false}
......@@ -341,7 +341,7 @@ const ReturnDetailInfo: React.FC<ReturnDetailInfoProps> = ({
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender: record => (
expandedRowRender: (record: any) => (
<Row
gutter={16}
className={styles.deliver}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-24 16:52:30
* @LastEditTime: 2021-09-01 18:12:44
* @Description:
*/
import React from 'react';
......@@ -29,7 +29,7 @@ const ReturnPrConfirmResultVerify: React.FC = () => {
content: `是否本单所有退款确认到账?`,
onOk() {
return PublicApi.postAsReturnGoodsConfirmAllRefund({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -174,7 +174,7 @@ const Products: React.FC<{}> = () => {
];
const previewUpper = (upId) => {
history.push(`/memberCenter/commodityAbility/commodity/products/detail?id=${upId}`)
}
/** 参照后台数据生成 */
......@@ -464,10 +464,12 @@ const Products: React.FC<{}> = () => {
const handleBatch = (type: string) => {
// 判断 批量操作的商品类型相同、并且满足可上(审核通过,下架)下架()的状态
const rows = [...currentRefRow.current]
const canUp = currentRefRow.current.every(item => item.status === 4 || item.status === 6)
const canDown = !currentRefRow.current.some(item => item.status !== 5)
const isSamilar = currentRefRow.current.every(item => item.priceType === rows[0]['priceType'])
console.log(type, currentRefRow.current, canUp, canDown, isSamilar)
const canUp = rows.every(item => item.status === 4 || item.status === 6)
const canDown = !rows.some(item => item.status !== 5)
const isSamilar = rows.every(item => item.priceType === rows[0]['priceType'])
if(!rows.length) {
return message.error('请选择需要批量操作的商品')
}
if(!isSamilar) {
return message.error('批量操作仅限产品定价类型相同的商品')
}
......@@ -477,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() {
......
......@@ -95,6 +95,12 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({editable}) => {
}
}
// 数据去重处理(主要针对没有专家评,但评标模板评标分类有重复)
dataSource = Object.values([...dataSource].map(item => ({ ...item, mockId: `${item.memberId}_${item.expertExtractRecordId}_${item.sort}` })).reduce((item, next)=>{
item[next.mockId] = next
return item
},{}))
// 计算总分 计算平均分
const computedData = groupBy(dataSource, 'memberName')
const computedScore = Object.keys(computedData).map((item) => {
......
......@@ -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>
}>
......
......@@ -133,7 +133,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setCurrent(1)
setPayStep(1)
// 获取对公账户信息
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.vendorMemberId, memberRoleId: data.vendorRoleId}).then(res => {
PublicApi.getSettleAccountsCommonCorporateAccountDetail({memberId: data.vendorMemberId, roleId: data.vendorRoleId, type: checked.fundMode}).then(res => {
if(res.code === 1000) {
setBlankAccountInfo(res.data)
setSettleAccountsError(true)
......@@ -276,6 +276,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
paymentInformationId: payInfoObj.id,
payType: checked.payType,
payChannel: checked.id,
fundMode: checked.fundMode,
}
if(payStep === 2) {
if(code.length != number.length){
......@@ -387,10 +388,14 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
(item['payChannels'] as any[]).map(v => <div
key={v.payChannel}
className={cx(style.payRadio, (checked && v.payChannel === checked.id) ? style.active : '')}
onClick={() => setChecked({ id: v.payChannel, channel: v.payChannelName, payType: item.payType, payTypeName: item.payTypeName })}>
{
v.payChannelName
}
onClick={() => setChecked({
id: v.payChannel,
channel: v.payChannelName,
payType: item.payType,
payTypeName: item.payTypeName,
fundMode: item.fundMode
})}>
{v.payChannelName}
</div>)
}
</div>
......
......@@ -28,7 +28,6 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
// 过滤支付信息 取第一个待支付或者未到账的id
if(data?.payments?.length) {
let payments = data.payments.sort((a, b) => a.batchNo - b.batchNo).filter(item => item.showPayment)
console.log(data.payments.sort((a, b) => a.batchNo - b.batchNo), payments, 'lo')
if(payments.length) {
ctl.setPayId(payments[0].paymentId)
}
......
......@@ -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,
}
}
// 其他需求
......
......@@ -522,7 +522,7 @@ export interface FileData {
export function normalizeFiledata(url: string): FileData
export function normalizeFiledata(url: any): any {
if (!url) {
return url;
return {};
}
const splited = url.split('/');
const fileName = splited && splited.length ? splited[splited.length - 1] : '';
......
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