Commit 88ab4be7 authored by XieZhiXiong's avatar XieZhiXiong

feat: 完成 售后相关v2静态UI

parent f33301c2
/*
* @Author: XieZhiXiong
* @Date: 2021-04-21 18:13:25
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-04-21 18:34:25
* @Description: 订单相关常量
*/
/* --------------------------------- 订单类型 -------------------------------- */
/**
* 询价采购
*/
export const ORDER_TYPE_INQUIRYT_PURCHASE = 1;
/**
* 需求采购
*/
export const ORDER_TYPE_DEMAND_PURCHASE = 2;
/**
* 现货采购
*/
export const ORDER_TYPE_STORE_PURCHASE = 3;
/**
* 集采
*/
export const ORDER_TYPE_CENTRAL_PURCHASE = 4;
/**
* 渠道直采
*/
export const ORDER_TYPE_CHANNEL_DIRECT_MINING = 5;
/**
* 渠道现货
*/
export const ORDER_TYPE_CHANNEL_STORE = 6;
/**
* 积分兑换
*/
export const ORDER_TYPE_POINTS = 7;
/**
* 渠道积分兑换
*/
export const ORDER_TYPE_CHANNEL_POINTS = 8;
/**
* 采购询价合同
*/
export const ORDER_TYPE_INQUIRY_CONTRACT = 9;
/**
* 采购竞价合同
*/
export const ORDER_TYPE_BIDDING_CONTRACT = 10;
/**
* 采购招标合同
*/
export const ORDER_TYPE_TENDER_CONTRACT = 11;
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-20 17:54:10
* @LastEditTime: 2021-04-22 14:54:25
* @Description: 维修商品抽屉组件
*/
import React, { useState, useEffect } from 'react';
......@@ -73,7 +73,7 @@ interface GoodsDrawerProps {
/**
* 流程类型:1.订单交易流程 2.售后换货流程 3.售后退货流程 4.售后维修流程
*/
afterType: 1 | 2 | 3 | 4,
afterType: 1 | 2 | 3 | 4;
};
interface GoodsDrawerState {
......@@ -157,80 +157,6 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
flattened = [];
tableColumn: ColumnType<any>[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplyMembersName',
align: 'center',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '订单状态',
dataIndex: 'externalState',
align: 'center',
render: text => PurchaseOrderOutWorkStateTexts[text],
},
{
title: '订单类型',
dataIndex: 'type',
align: 'center',
render: text => ORDER_TYPE2[text],
},
];
childTableColumn: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'productId',
align: 'center',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
},
{
title: '订单数量',
dataIndex: 'purchaseCount',
align: 'center',
},
{
title: '已维修数量',
dataIndex: 'repairCount',
align: 'center',
},
];
// 获取订单列表
getOrderList = async () => {
const { page, size, searchVal } = this.state;
......@@ -638,7 +564,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
<div className={styles['order-body']}>
<NestTable
NestColumns={[this.tableColumn, this.childTableColumn]}
NestColumns={[]}
className="common_tb"
rowClassName={(_, index) => (index % 2) === 0 && 'tb_bg'}
rowKey="id"
......
......@@ -112,7 +112,7 @@ export interface goodItem {
*/
ruleConfigurationId?: number
}[]
};
}
export interface OrderListParams {
orderNo: string;
......@@ -120,9 +120,9 @@ export interface OrderListParams {
startCreateTime: string;
endCreateTime: string;
type: number;
};
}
export interface OrderListRes {
data: { [key: string]: any }[];
totalCount: number;
};
\ No newline at end of file
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react';
import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { DeleteOutlined } from '@ant-design/icons';
import { Radio, ArrayTable } from '@formily/antd-components';
import { ArrayTable } from '@formily/antd-components';
import { history, Link, Prompt } from 'umi';
import moment from 'moment';
import { findLastIndex } from 'lodash';
......@@ -11,20 +10,25 @@ import { SaveOutlined, PlusOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { GetAsReplaceGoodsPageReturnedGoodsResponseDetail } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import { normalizeFiledata, FileData } from '@/utils';
import {
PurchaseOrderOutWorkStateTexts,
ORDER_TYPE2,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import { addBillSchema } from './schema';
import { addSchema } from './schema';
import { createEffects } from './effects';
import {
EXCHANGE_OUTER_STATUS_TAG_MAP,
......@@ -36,6 +40,7 @@ const {
onFormInputChange$,
onFormInit$,
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
interface BillsFormProps {
......@@ -99,7 +104,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const [goodsValue, setGoodsValue] = useState([]);
const [submitLoading, setSubmitLoading] = useState(false);
const [visibleGoodsDrawer, setVisibleGoodsDrawer] = useState(false);
const [applyType, setApplyType] = useState(1);
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const tableColumn: ColumnType<any>[] = [
{
......@@ -135,7 +146,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
align: 'center',
render: text => ORDER_TYPE2[text],
},
];
isMateriel ? {
title: '合同编号',
dataIndex: 'type2',
align: 'center',
render: () => 'H-13-00002',
} : null,
].filter(Boolean) as ColumnType<any>[];
const childTableColumn = (record): ColumnType<any>[] => {
const isPointsOrder = record.type === ORDER_TYPE2_POINTS || record.type === ORDER_TYPE2_CHANNEL_POINTS;
......@@ -189,11 +206,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
];
};
const setColumnsTitle = (orderType: number) => {
const isPointsOrder = orderType === ORDER_TYPE2_POINTS || orderType === ORDER_TYPE2_CHANNEL_POINTS;
setApplyType(isPointsOrder ? 2 : 1);
};
// 根据供应会员获取订单列表
const getOrderList = (params): Promise<OrderListRes> => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
......@@ -203,7 +215,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
orderNo: detailInfo.orderNo,
...params,
supplyMembersId: supplierMemberValue[0].memberId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
type: orderTypeValue,
}).then(res => {
if (res.code === 1000) {
resolve(res.data);
......@@ -244,7 +257,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
outerTaskList,
replaceBatch,
replaceId,
orderType,
...rest
} = res.data;
......@@ -295,13 +307,12 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 已换货数量,这里取 采购数量判断即可
id: item.orderRecordId,
taskType,
orderType,
orderType: rest.orderType,
},
})),
...rest,
});
setGoodsValue(goodsDetailList.map(item => item.orderRecordId));
setColumnsTitle(orderType);
}
}).finally(() => {
setInfoLoading(false);
......@@ -362,12 +373,17 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
}, []);
const handleAddGoods = () => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
const supplierMemberVal = addSchemaAction.getFieldValue('supplierMember');
const orderTypeVal = addSchemaAction.getFieldValue('orderType');
if (!supplierMemberValue || !supplierMemberValue.length) {
if (!supplierMemberVal || !supplierMemberVal.length) {
message.error('请先选择供应会员');
return;
}
if (!orderTypeVal) {
message.error('请先选择售后订单类型');
return;
}
setVisibleGoodsDrawer(true);
};
......@@ -379,7 +395,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
onClick={handleAddGoods}
type="dashed"
>
选择换货商品
{!isMateriel ? '选择换货商品' : '选择换货物料'}
</Button>
) : null;
......@@ -521,7 +537,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const handleGoodsConfirm = values => {
const preValues = addSchemaAction.getFieldValue('replaceGoodsList');
const value = [];
const first = values.length ? values[0] : {};
values.forEach(item => {
const atom = {
......@@ -550,7 +565,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
if (preValues.length) {
newData.reverse();
}
setColumnsTitle(first.orderType);
addSchemaAction.setFieldValue('replaceGoodsList', newData);
};
......@@ -566,6 +580,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
<Badge color={EXCHANGE_INNER_STATUS_BADGE_MAP[detailInfo?.innerStatus]} text={detailInfo?.innerStatusName} />
);
const schemaValue = useMemo(() => addSchema(orderTypeValue), [orderTypeValue]);
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
......@@ -635,15 +651,19 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
onFieldInputChange$('supplierMember').subscribe(() => {
setGoodsValue([]);
});
onFieldValueChange$('orderType').subscribe(fieldState => {
setOrderTypeValue(fieldState.value);
});
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={addBillSchema(applyType)}
schema={schemaValue}
/>
</Card>
<GoodsDrawer
title="选择换货商品"
title={!isMateriel ? '选择换货商品' : '选择换货物料'}
afterType={2}
visible={visibleGoodsDrawer}
fetchOrderList={getOrderList}
......
......@@ -2,16 +2,16 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-21 16:26:00
* @LastEditTime: 2021-04-22 15:09:55
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
} from '@/constants';
import { PublicApi } from '@/services/api';
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
......@@ -25,7 +25,7 @@ export const useBusinessEffects = (context, actions) => {
getFieldState,
setFieldState,
} = actions;
// const linkage = useLinkageUtils();
const linkage = useLinkageUtils();
// 校验维修数量
onFieldInputChange$('repairGoodsList.*.repairCount').subscribe(fieldState => {
......@@ -53,8 +53,8 @@ export const useBusinessEffects = (context, actions) => {
// );
});
// 供应会员联动 单据明细
onFieldInputChange$('supplierMember').subscribe(fieldState => {
// 供应会员、订单类型 联动 单据明细
onFieldInputChange$('*(supplierMember,orderType)').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('repairGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('repairGoodsList', []);
......
import React, { useState, useEffect, useRef } from 'react';
import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { DeleteOutlined } from '@ant-design/icons';
import { Radio, ArrayTable } from '@formily/antd-components';
import { ArrayTable } from '@formily/antd-components';
import { history, Prompt, Link } from 'umi';
import moment from 'moment';
import { findLastIndex } from 'lodash';
......@@ -11,13 +12,22 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { GetAsRepairGoodsPageRepairGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import {
PurchaseOrderOutWorkStateTexts,
ORDER_TYPE2,
} from '@/constants';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import { addBillSchema } from './schema';
import { addSchema } from './schema';
import { createEffects } from './effects';
import {
REPAIR_OUTER_STATUS_TAG_MAP,
......@@ -27,6 +37,7 @@ import {
const addSchemaAction = createFormActions();
const {
onFormInputChange$,
onFieldValueChange$,
onFormInit$,
} = FormEffectHooks;
......@@ -84,6 +95,93 @@ const RepairForm: React.FC<BillsFormProps> = ({
const [goodsValue, setGoodsValue] = useState([]);
const [submitLoading, setSubmitLoading] = useState(false);
const [visibleDrawer, setVisibleDrawer] = useState(false);
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const tableColumn: ColumnType<any>[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplyMembersName',
align: 'center',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '订单状态',
dataIndex: 'externalState',
align: 'center',
render: text => PurchaseOrderOutWorkStateTexts[text],
},
{
title: '订单类型',
dataIndex: 'type',
align: 'center',
render: text => ORDER_TYPE2[text],
},
isMateriel ? {
title: '合同编号',
dataIndex: 'type2',
align: 'center',
render: () => 'H-13-00002',
} : null,
].filter(Boolean) as ColumnType<any>[];
const childTableColumn: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'productId',
align: 'center',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
},
{
title: '订单数量',
dataIndex: 'purchaseCount',
align: 'center',
},
{
title: '已维修数量',
dataIndex: 'repairCount',
align: 'center',
},
];
// 获取维修申请详情
const getDetailInfo = () => {
......@@ -142,6 +240,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
setInfoLoading(true);
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
})
.then(res => {
if (res.code === 1000) {
......@@ -221,7 +320,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
orderNo: detailInfo.orderNo,
...params,
supplyMembersId: supplierMemberValue[0].memberId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
type: orderTypeValue,
}).then(res => {
if (res.code === 1000) {
resolve(res.data);
......@@ -240,24 +340,28 @@ const RepairForm: React.FC<BillsFormProps> = ({
}, []);
const handleAddGoods = () => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
const supplierMemberVal = addSchemaAction.getFieldValue('supplierMember');
const orderTypeVal = addSchemaAction.getFieldValue('orderType');
if (!supplierMemberValue || !supplierMemberValue.length) {
if (!supplierMemberVal || !supplierMemberVal.length) {
message.error('请先选择供应会员');
return;
}
if (!orderTypeVal) {
message.error('请先选择售后订单类型');
return;
}
setVisibleDrawer(true);
};
const TableAddButton = isEdit || !id ? (
<Button
style={{ marginBottom: 16 }}
block
icon={<PlusOutlined />}
onClick={handleAddGoods}
type="dashed"
block
>
选择维修商品
{!isMateriel ? '选择维修商品' : '选择维修物料'}
</Button>
) : null;
......@@ -385,6 +489,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
<Badge color={REPAIR_INNER_STATUS_BADGE_MAP[detailInfo?.innerStatus]} text={detailInfo?.innerStatusName} />
);
const schemaValue = useMemo(() => addSchema(orderTypeValue), [orderTypeValue]);
return (
<Spin spinning={infoLoading || repairGoodsLoading}>
<PageHeaderWrapper
......@@ -453,14 +559,19 @@ const RepairForm: React.FC<BillsFormProps> = ({
});
}
});
onFieldValueChange$('orderType').subscribe(fieldState => {
setOrderTypeValue(fieldState.value);
});
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={addBillSchema}
schema={schemaValue}
/>
</Card>
<GoodsDrawer
title={!isMateriel ? '选择维修商品' : '选择维修物料'}
afterType={4}
visible={visibleDrawer}
fetchOrderList={getOrderList}
......@@ -468,6 +579,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
onConfirm={handleGoodsConfirm}
checked={goodsValue}
onChange={handleGoodsChange}
nestProps={{
NestColumns: [tableColumn, childTableColumn],
}}
searchable={!orderId}
/>
......
import React, { useState, useEffect, useRef } from 'react';
import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { DeleteOutlined } from '@ant-design/icons';
import { Radio, ArrayTable } from '@formily/antd-components';
import { ArrayTable } from '@formily/antd-components';
import { history, Prompt, Link } from 'umi';
import moment from 'moment';
import { findLastIndex } from 'lodash';
......@@ -13,6 +12,11 @@ import { PublicApi } from '@/services/api';
import { GetAsReturnGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import { PurchaseOrderOutWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm';
......@@ -20,7 +24,7 @@ import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import ReturnInfoDrawer, { OrderInfo } from '../../../../components/ReturnInfoDrawer';
import { addBillSchema } from './schema';
import { addSchema } from './schema';
import { createEffects } from './effects';
import {
RETURN_OUTER_STATUS_TAG_MAP,
......@@ -30,6 +34,7 @@ import {
const addSchemaAction = createFormActions();
const {
onFormInputChange$,
onFieldValueChange$,
onFormInit$,
} = FormEffectHooks;
......@@ -91,6 +96,13 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const [visibleGoodsDrawer, setVisibleGoodsDrawer] = useState(false);
const [visibleReturnInfoDrawer, setVisibleReturnInfoDrawer] = useState(false);
const [goodsValue, setGoodsValue] = useState([]);
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const tableColumn: ColumnType<any>[] = [
{
......@@ -126,7 +138,13 @@ const ReturnForm: React.FC<BillsFormProps> = ({
align: 'center',
render: text => ORDER_TYPE2[text],
},
];
isMateriel ? {
title: '合同编号',
dataIndex: 'type2',
align: 'center',
render: () => 'H-13-00002',
} : null,
].filter(Boolean) as ColumnType<any>[];
const childTableColumn: ColumnType<any>[] = [
{
......@@ -191,7 +209,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
orderNo: detailInfo.orderNo,
...params,
supplyMembersId: supplierMemberValue[0].memberId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
supplyMembersRoleId: supplierMemberValue[0].roleId,
type: orderTypeValue,
}).then(res => {
if (res.code === 1000) {
resolve(res.data);
......@@ -348,12 +367,17 @@ const ReturnForm: React.FC<BillsFormProps> = ({
}, []);
const handleAddGoods = () => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
const supplierMemberVal = addSchemaAction.getFieldValue('supplierMember');
const orderTypeVal = addSchemaAction.getFieldValue('orderType');
if (!supplierMemberValue || !supplierMemberValue.length) {
if (!supplierMemberVal || !supplierMemberVal.length) {
message.error('请先选择供应会员');
return;
}
if (!orderTypeVal) {
message.error('请先选择售后订单类型');
return;
}
setVisibleGoodsDrawer(true);
};
......@@ -365,7 +389,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
onClick={handleAddGoods}
type="dashed"
>
选择退货商品
{!isMateriel ? '选择退货商品' : '选择退货物料'}
</Button>
) : null;
......@@ -606,6 +630,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
<Badge color={RETURN_INNER_STATUS_BADGE_MAP[detailInfo?.innerStatus]} text={detailInfo?.innerStatusName} />
);
const schemaValue = useMemo(() => addSchema(orderTypeValue), [orderTypeValue]);
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
......@@ -674,15 +700,19 @@ const ReturnForm: React.FC<BillsFormProps> = ({
});
}
});
onFieldValueChange$('orderType').subscribe(fieldState => {
setOrderTypeValue(fieldState.value);
});
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={addBillSchema}
schema={schemaValue}
/>
</Card>
<GoodsDrawer
title="选择退货商品"
title={!isMateriel ? '选择退货商品' : '选择退货物料'}
afterType={3}
visible={visibleGoodsDrawer}
fetchOrderList={getOrderList}
......
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