Commit 4f14490b authored by XieZhiXiong's avatar XieZhiXiong

feat: 新增代客售后换货UI

parent c0c7374f
......@@ -342,6 +342,13 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 代客换货申请
{
path: '/memberCenter/afterService/exchangeManage/exchangeValetApply/index',
name: 'exchangeValetApply',
component: '@/pages/afterService/exchangeManage/exchangeValetApply/index',
noMargin: true,
},
]
};
......
......@@ -589,6 +589,7 @@ export default {
'menu.afterService.exchangeManage.verifyExchangePrDeliver': '换货发货',
'menu.afterService.exchangeManage.exchangePrConfirmBack': '待确认换货回单',
'menu.afterService.exchangeManage.verifyExchangePrConfirmBack': '确认换货回单',
'menu.afterService.exchangeManage.exchangeValetApply': '代客换货申请',
'menu.afterService.exchangeManage.orderPreview': '查看订单',
'menu.afterService.returnApplication': '退货申请',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-12-02 14:15:28
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-12-02 14:15:28
* @Description:
*/
import { useBusinessEffects } from './useBusinessEffects';
import { getLogisticsSelectListReceiverAddress, getLogisticsSelectListShipperAddress } from '@/services/LogisticsV2Api';
export const createEffects = (context, actions) => {
const { setFieldState } = actions;
useBusinessEffects(context, actions);
// 获取收件地址
getLogisticsSelectListReceiverAddress().then(res => {
if (res.code === 1000) {
setFieldState('deliveryAddress', state => {
state.props['x-component-props'].dataSource = res.data;
});
}
}).catch((err) => {
console.warn(err);
});
// 获取发货地址
getLogisticsSelectListShipperAddress().then(res => {
if (res.code === 1000) {
setFieldState('*(shippingAddress,pickupAddress)', state => {
state.props['x-component-props'].dataSource = res.data;
});
}
}).catch((err) => {
console.warn(err);
});
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-12-02 14:15:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-12-02 14:15:36
* @Description:
*/
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
} = actions;
const linkage = useLinkageUtils();
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
switch (value) {
// 物流
case 1: {
linkage.show('shippingAddress');
linkage.hide('pickupAddress');
break;
};
// 自提
case 2: {
linkage.hide('shippingAddress');
linkage.show('pickupAddress');
break;
};
// 无需物流
case 3: {
linkage.hide('*(shippingAddress,pickupAddress)');
break;
};
default:
break
};
});
// 校验换货数量
onFieldInputChange$('replaceGoodsList.*.replaceCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已换货数量
const replacedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `replaceGoodsList.${$1}.extraData`
}),
state => state.value.remaining,
);
});
// 供应会员联动 单据明细
onFieldInputChange$('*(supplierMember,orderType)').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('replaceGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('replaceGoodsList', []);
}
});
}
\ No newline at end of file
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