Commit e09fa0e0 authored by XieZhiXiong's avatar XieZhiXiong

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

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