Commit e09fa0e0 authored by XieZhiXiong's avatar XieZhiXiong

chore: 自提不展示物流公司、单号

parent be561d21
...@@ -22,14 +22,15 @@ import { ...@@ -22,14 +22,15 @@ import {
} from '@/services/AfterServiceV2Api'; } from '@/services/AfterServiceV2Api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'; import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { AddressValueType } from '@/components/AddressSelect/components/AddressRadioGroup'; import { AddressValueType } from '@/components/AddressSelect/components/AddressRadioGroup';
import { schema } from './schema'; import { schema } from './schema';
const formActions = createAsyncFormActions(); const formActions = createAsyncFormActions();
const { const {
onFieldValueChange$, onFieldInputChange$,
onFieldInputChange$, onFormInit$,
} = FormEffectHooks; } = FormEffectHooks;
export type ValuesType = { export type ValuesType = {
...@@ -40,15 +41,15 @@ export type ValuesType = { ...@@ -40,15 +41,15 @@ export type ValuesType = {
/** /**
* 物流公司 * 物流公司
*/ */
logisticsName: number, logisticsName?: number,
/** /**
* 物流公司名称 * 物流公司名称
*/ */
logisticsNameTxt: string, logisticsNameTxt?: string,
/** /**
* 物流单号 * 物流单号
*/ */
logisticsOrderNo: string, logisticsOrderNo?: string,
/** /**
* 产品列表 * 产品列表
*/ */
...@@ -91,6 +92,10 @@ interface IProps { ...@@ -91,6 +92,10 @@ interface IProps {
productList: GetAsReturnGoodsPageReturnedGoodsResponseDetail[], productList: GetAsReturnGoodsPageReturnedGoodsResponseDetail[],
}, },
/** /**
* 配送方式
*/
deliveryType: number,
/**
* Form 确认事件 * Form 确认事件
*/ */
onSubmit: (values: ValuesType) => void, onSubmit: (values: ValuesType) => void,
...@@ -108,6 +113,7 @@ const ReturnDeliverDrawer: React.FC<IProps> = (props) => { ...@@ -108,6 +113,7 @@ const ReturnDeliverDrawer: React.FC<IProps> = (props) => {
const { const {
visible, visible,
value, value,
deliveryType,
onSubmit, onSubmit,
onClose, onClose,
submitLoading, submitLoading,
...@@ -184,8 +190,17 @@ const ReturnDeliverDrawer: React.FC<IProps> = (props) => { ...@@ -184,8 +190,17 @@ const ReturnDeliverDrawer: React.FC<IProps> = (props) => {
ArrayTable, ArrayTable,
}} }}
effects={($, { setFieldValue, getFieldValue, setFieldState }) => { effects={($, { setFieldValue, getFieldValue, setFieldState }) => {
const linkage = useLinkageUtils();
useAsyncSelect('logisticsName', fetchLogisticsCompany, ['label', 'value']); useAsyncSelect('logisticsName', fetchLogisticsCompany, ['label', 'value']);
onFormInit$().subscribe(() => {
// 自提隐藏物流编号、物流公司
if (deliveryType === 2) {
linkage.hide('*(logisticsOrderNo,logisticsName,logisticsNameTxt)');
}
});
onFieldInputChange$('logisticsName').subscribe((state) => { onFieldInputChange$('logisticsName').subscribe((state) => {
const { originAsyncData, value } = state; const { originAsyncData, value } = state;
const current = originAsyncData.find((item) => item.value === value); const current = originAsyncData.find((item) => item.value === value);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34 * @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-09 13:43:24 * @LastEditTime: 2021-08-10 18:18:45
* @Description: 退货发货 * @Description: 退货发货
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -77,8 +77,9 @@ const ReturnPrDeliverVerify: React.FC = () => { ...@@ -77,8 +77,9 @@ const ReturnPrDeliverVerify: React.FC = () => {
<ReturnDeliverDrawer <ReturnDeliverDrawer
value={{ value={{
productList: info?.goodsDetailList.filter((item) => item.noDeliveryCount > 0), productList: info?.goodsDetailList.filter((item) => item.isNeedReturn && item.noDeliveryCount > 0),
}} }}
deliveryType={info?.returnGoodsAddress.deliveryType}
visible={visible} visible={visible}
onClose={() => handleVisibleDrawer(false)} onClose={() => handleVisibleDrawer(false)}
onSubmit={handleSubmit} onSubmit={handleSubmit}
......
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