Commit b93a8ed3 authored by XieZhiXiong's avatar XieZhiXiong

静态开发中...

parent a850461f
......@@ -36,17 +36,26 @@ const route: RouterChild = {
{
path: '/memberCenter/afterService/repairApplication/repairPrSubmit/detail',
name: 'repairPrSubmitDetail',
component: '@/pages/afterService/repairApplication/repairPrSubmit/detail',
hideInMenu: true,
noMargin: true,
},
// 待提交维修申请单-新增
{
path: '/memberCenter/afterService/repairApplication/repairPrSubmit/addRepair',
path: '/memberCenter/afterService/repairApplication/repairPrSubmit/add',
name: 'addRepair',
component: '@/pages/afterService/repairApplication/repairPrSubmit/addRepair',
hideInMenu: true,
noMargin: true,
},
// 待提交维修申请单-编辑
{
path: '/memberCenter/afterService/repairApplication/repairPrSubmit/edit',
name: 'editRepair',
component: '@/pages/afterService/repairApplication/repairPrSubmit/editRepair',
hideInMenu: true,
noMargin: true,
},
// 待确认售后完成
{
path: '/memberCenter/afterService/repairApplication/repairPrFinished',
......
......@@ -28,13 +28,39 @@ const route: RouterChild = {
},
// 待提交退货申请单
{
path: '/memberCenter/afterService/return/waitSubmitOrder',
name: 'waitSubmitOrder',
path: '/memberCenter/afterService/returnApplication/returnPrSubmit',
name: 'returnPrSubmit',
component: '@/pages/afterService/returnApplication/returnPrSubmit/index',
},
// 待退货发货
// 待提交退货申请单-详情
{
path: '/memberCenter/afterService/return/waitReturnAndSendOut',
name: 'waitReturnAndSendOut',
path: '/memberCenter/afterService/returnApplication/returnPrSubmit/detail',
name: 'returnPrSubmitDetail',
component: '@/pages/afterService/returnApplication/returnPrSubmit/detail',
hideInMenu: true,
noMargin: true,
},
// 待提交退货申请单-新增
{
path: '/memberCenter/afterService/returnApplication/returnPrSubmit/add',
name: 'addReturnPrSubmit',
component: '@/pages/afterService/returnApplication/returnPrSubmit/addReturn',
hideInMenu: true,
noMargin: true,
},
// 待提交退货申请单-编辑
{
path: '/memberCenter/afterService/returnApplication/returnPrSubmit/edit',
name: 'editReturnPrSubmit',
component: '@/pages/afterService/returnApplication/returnPrSubmit/editReturn',
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单
{
path: '/memberCenter/afterService/returnApplication/returnPrAddDeliver',
name: 'returnPrAddDeliver',
component: '@/pages/afterService/returnApplication/returnPrAddDeliver/index',
},
// 待确认退货回单
{
......
......@@ -512,8 +512,11 @@ export default {
'menu.afterService.returnApplication': '退货申请',
'menu.afterService.returnApplication.returnQuery': '退申请单查询',
'menu.afterService.returnApplication.returnQueryDetail': '查看退申请单',
'menu.afterService.returnApplication.waitSubmitOrder': '待提交退货申请单',
'menu.afterService.returnApplication.waitReturnAndSendOut': '待退货发货',
'menu.afterService.returnApplication.returnPrSubmit': '待提交退货申请单',
'menu.afterService.returnApplication.returnPrSubmitDetail': '查看退申请单',
'menu.afterService.returnApplication.addReturnPrSubmit': '新建退申请单',
'menu.afterService.returnApplication.editReturnPrSubmit': '编辑退申请单',
'menu.afterService.returnApplication.returnPrAddDeliver': '待新增退货发货单',
'menu.afterService.returnApplication.waitConfirmOrder': '待确认退货回单',
'menu.afterService.returnApplication.waitConfirmRefundResult': '待确认退款结果',
'menu.afterService.returnApplication.waitConfirmFinsh': '待确认售后完成',
......@@ -533,6 +536,7 @@ export default {
'menu.afterService.repairApplication.repairPrSubmit': '待提交维修申请单',
'menu.afterService.repairApplication.repairPrSubmitDetail': '查看维修申请单',
'menu.afterService.repairApplication.addRepair': '新建维修申请单',
'menu.afterService.repairApplication.editRepair': '编辑维修申请单',
'menu.afterService.repairApplication.repairPrFinished': '待确认售后完成',
'menu.afterService.repairApplication.repairPrFinishedDetail': '查看维修申请单',
'menu.afterService.repairApplication.verifyRepairPrFinished': '确认售后完成',
......
......@@ -29,14 +29,12 @@ interface AddressFormItemProps {
onChange: (id: string) => {};
};
const AddressFormItem = (props: AddressFormItemProps) => {
const {
value,
showCount = 3,
dataSource = [],
onChange,
} = props;
const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: boolean } = ({
value,
showCount = 3,
dataSource = [],
onChange,
}) => {
const [showMore, setShowMore] = useState(false);
useEffect(() => {
......@@ -96,6 +94,6 @@ const AddressFormItem = (props: AddressFormItemProps) => {
AddressFormItem.defaultProps = {};
// AddressFormItem.isFieldComponent = true;
AddressFormItem.isFieldComponent = true;
export default AddressFormItem;
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 11:49:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 14:11:09
* @LastEditTime: 2020-11-06 10:02:30
* @Description: 附件列表
*/
import React from 'react';
......
import React, { Suspense } from 'react';
import { Row, Col } from 'antd';
const FileList = React.lazy(() => import('../FileList'));
const AddressInfo = React.lazy(() => import('../AddressInfo'));
const Score = React.lazy(() => import('../Score'));
const IntroduceRow: React.FC = () => {
return (
<Row
gutter={24}
>
<Col span={6}>
<Suspense fallback={null}>
<FileList />
</Suspense>
</Col>
<Col span={12}>
<Suspense fallback={null}>
<AddressInfo />
</Suspense>
</Col>
<Col span={6}>
<Suspense fallback={null}>
<Score />
</Suspense>
</Col>
</Row>
);
};
export default IntroduceRow;
\ No newline at end of file
......@@ -3,14 +3,14 @@
* @Date: 2020-11-03 13:53:58
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 14:11:57
* @Description: 地址信息
* @Description: 维修地址
*/
import React from 'react';
import { Descriptions } from 'antd';
import MellowCard from '@/components/MellowCard';
import styles from './index.less';
const AddressInfo: React.FC = () => {
const RepairAddressInfo: React.FC = () => {
return (
<MellowCard
title="维修地址"
......@@ -26,4 +26,4 @@ const AddressInfo: React.FC = () => {
);
};
export default AddressInfo;
\ No newline at end of file
export default RepairAddressInfo;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 09:54:16
* @Description: 退货地址信息
*/
import React from 'react';
import { Descriptions } from 'antd';
import MellowCard from '@/components/MellowCard';
import styles from './index.less';
const ReturnAddressInfo: React.FC = () => {
return (
<MellowCard
title="收货地址"
fullHeight
>
<Descriptions column={1} className={styles.desc}>
<Descriptions.Item label="配送方式">
物流
</Descriptions.Item>
<Descriptions.Item label="退货收货地址">
<p>张三 / 185 2929 6475</p>
<p>广东省广州市海珠区新港东路1068号中洲中心北塔6楼</p>
</Descriptions.Item>
<Descriptions.Item label="退货发货地址">
<p>张三 / 185 2929 6475</p>
<p>广东省广州市海珠区新港东路1068号中洲中心北塔6楼</p>
</Descriptions.Item>
</Descriptions>
</MellowCard>
);
};
export default ReturnAddressInfo;
......@@ -2,25 +2,32 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-05 18:02:00
* @LastEditTime: 2020-11-06 15:45:19
* @Description: 查看退货数量与退款金额 抽屉
*/
import React from 'react';
import { Drawer, Tabs } from 'antd';
import DescribeLine from '../DescribeLine';
import { Drawer, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import schema from './schema';
import Stamp from '../Stamp';
import styles from './index.less';
const { TabPane } = Tabs;
const schemaAction = createFormActions();
interface ReturnInfoDrawerProps {
visible: boolean;
onClose: () => void;
onSubmit?: (values: { [key: string]: any }) => void;
// 是否是编辑的
isEdit?: boolean;
};
const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
visible = false,
onClose,
onSubmit,
isEdit = false,
}) => {
const handleClose = () => {
......@@ -28,71 +35,56 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
onClose();
}
};
const handleSubmit = values => {
console.log('values', values)
if (onSubmit) {
onSubmit(values);
}
};
return (
<Drawer
title="查看退货数量与退款金额"
placement="right"
width={1120}
onClose={() => handleClose()}
onClose={handleClose}
visible={visible}
closable={false}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button
onClick={handleClose}
style={{ marginRight: 8 }}
>
取消
</Button>
<Button
onClick={() => schemaAction.submit()}
type="primary"
>
确定
</Button>
</div>
}
>
<Tabs defaultActiveKey="1" tabPosition="left">
<TabPane tab="订单信息" key="1">
<h2 className={styles.paneTitle}>订单信息</h2>
<DescribeLine column={2}>
<DescribeLine.Item title="订单号" titleWidth="102px">SPTY12</DescribeLine.Item>
<DescribeLine.Item title="商品名称" titleWidth="102px">进口头层牛皮荔枝纹/红色/XL</DescribeLine.Item>
<DescribeLine.Item title="品类" titleWidth="102px">牛皮</DescribeLine.Item>
<DescribeLine.Item title="品牌" titleWidth="102px">PELLE</DescribeLine.Item>
<DescribeLine.Item title="单位" titleWidth="102px"></DescribeLine.Item>
<DescribeLine.Item title="采购数量" titleWidth="102px">2,000</DescribeLine.Item>
<DescribeLine.Item title="采购单价" titleWidth="102px">¥ 20.00</DescribeLine.Item>
<DescribeLine.Item title="采购金额" titleWidth="102px">¥ 40,000.00</DescribeLine.Item>
<DescribeLine.Item title="退货数量" titleWidth="102px">1,000</DescribeLine.Item>
</DescribeLine>
</TabPane>
<TabPane tab="支付信息" key="2">
<h2 className={styles.paneTitle}>支付信息</h2>
<div className={styles.payInfo}>
<div className={styles['payInfo-item']}>
<Stamp imprinted>
<DescribeLine column={2}>
<DescribeLine.Item title="支付次数">1</DescribeLine.Item>
<DescribeLine.Item title="支付环节">订单确认后支付</DescribeLine.Item>
<DescribeLine.Item title="支付方式">授信额度支付方式</DescribeLine.Item>
<DescribeLine.Item title="支付金额(元)">12,000</DescribeLine.Item>
<DescribeLine.Item title="支付渠道">授信额度支付</DescribeLine.Item>
<DescribeLine.Item title="支付时间">2020-05-20 10:00</DescribeLine.Item>
</DescribeLine>
</Stamp>
</div>
<div className={styles['payInfo-item']}>
<Stamp imprinted>
<DescribeLine column={2}>
<DescribeLine.Item title="支付次数">1</DescribeLine.Item>
<DescribeLine.Item title="支付环节">订单确认后支付</DescribeLine.Item>
<DescribeLine.Item title="支付方式">授信额度支付方式</DescribeLine.Item>
<DescribeLine.Item title="支付金额(元)">12,000</DescribeLine.Item>
<DescribeLine.Item title="支付渠道">授信额度支付</DescribeLine.Item>
<DescribeLine.Item title="支付时间">2020-05-20 10:00</DescribeLine.Item>
</DescribeLine>
</Stamp>
</div>
</div>
<NiceForm
initialValues={{}}
components={{
Stamp,
}}
editable={isEdit}
effects={($, actions) => {
</TabPane>
<TabPane tab="退款信息" key="3">
<h2 className={styles.paneTitle}>退款信息</h2>
<DescribeLine column={1}>
<DescribeLine.Item title="退款金额(元)" titleWidth="102px">20,000.00</DescribeLine.Item>
<DescribeLine.Item title="退货原因" titleWidth="102px">质量缺陷L</DescribeLine.Item>
</DescribeLine>
</TabPane>
</Tabs>
}}
onSubmit={handleSubmit}
actions={schemaAction}
schema={schema}
/>
</Drawer>
);
};
......
/*
* @Author: XieZhiXiong
* @Date: 2020-11-06 14:20:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 15:40:09
* @Description:
*/
import { ISchema } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
const schema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
tabPosition: 'left',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '订单信息',
},
properties: {
MEGA_LAYOUT_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 20,
},
properties: {
orderNo: {
type: 'string',
title: '订单号',
default: 'SPTY12',
'x-component': 'Text',
},
productName: {
type: 'string',
title: '商品名称',
default: '进口头层牛皮荔枝纹/红色/XL',
'x-component': 'Text',
},
category: {
type: 'string',
title: '品类',
default: '牛皮',
'x-component': 'Text',
},
brand: {
type: 'string',
title: '品牌',
default: '阿比巴斯',
'x-component': 'Text',
},
unit: {
type: 'string',
title: '单位',
default: '尺',
'x-component': 'Text',
},
quantity: {
type: 'string',
title: '采购数量',
default: '2,000',
'x-component': 'Text',
},
price: {
type: 'string',
title: '采购单价',
default: '¥ 20.00',
'x-component': 'Text',
},
amount: {
type: 'string',
title: '采购金额',
default: '¥ 40,000.00',
'x-component': 'Text',
},
returnNum: {
type: 'string',
title: '退货数量',
'x-rules': [
{
required: true,
message: '请填写退货数量',
},
{
pattern: PATTERN_MAPS.quantity,
message: '请填写大于等于1的正整数',
},
],
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '支付信息',
},
properties: {
STAMP_1: {
type: 'object',
'x-component': 'Stamp',
'x-component-props': {
imprinted: true,
},
properties: {
MEGA_LAYOUT_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 6,
wrapperCol: 18,
grid: true,
columns: 2,
autoRow: true,
},
properties: {
payCount: {
type: 'string',
title: '支付次数',
default: '1',
'x-component': 'Text',
},
payLink: {
type: 'string',
title: '支付环节',
default: '1',
'x-component': 'Text',
},
payProportion: {
type: 'string',
title: '支付比例',
default: '1',
'x-component': 'Text',
},
payWay: {
type: 'string',
title: '支付方式',
default: '1',
'x-component': 'Text',
},
payReturnAmount: {
type: 'string',
title: '退款金额(元)',
},
payChannel: {
type: 'string',
title: '支付渠道',
default: '授信额度支付',
'x-component': 'Text',
},
payTime: {
type: 'string',
title: '支付时间',
default: '2020-05-20 10:00',
'x-component': 'Text',
},
},
}
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '退款信息',
},
properties: {
MEGA_LAYOUT_3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
},
properties: {
returnAmount: {
type: 'string',
title: '退款金额(元)',
default: '20,000.00',
'x-component': 'Text',
},
reason: {
type: 'string',
title: '退货原因',
'x-component': 'textarea',
'x-component-props': {
rows: 4,
},
'x-rules': [
{
required: true,
message: '请填写退货原因',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
},
},
},
},
},
},
},
};
export default schema;
\ No newline at end of file
......@@ -12,7 +12,8 @@ import { Gauge } from '@/components/Charts';
const Score: React.FC = () => {
return (
<MellowCard
title="售后评价"
title="售后评价"
fullHeight
>
<Gauge
title="5分"
......
.stamp {
padding: 16px;
margin: 10px;
background: #FFFFFF;
box-shadow: 0px 4px 6px 0px rgba(23, 43, 77, 0.08), 0px 0px 1px 0px rgba(23, 43, 77, 0.12);
border-radius: 4px;
......
......@@ -13,7 +13,7 @@ interface StampProps {
imprinted?: boolean;
};
const Stamp: React.FC<StampProps> = ({
const Stamp: React.FC<StampProps> & { isVirtualFieldComponent: boolean } = ({
imprinted = false,
children,
}) => {
......@@ -28,4 +28,6 @@ const Stamp: React.FC<StampProps> = ({
);
};
Stamp.isVirtualFieldComponent = true;
export default Stamp;
......@@ -25,7 +25,9 @@ import { } from '../../../constants';
const OuterCirculation = React.lazy(() => import('../../../components/OuterCirculation'));
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const IntroduceRow = React.lazy(() => import('../../../components/IntroduceRow'));
const FileList = React.lazy(() => import('../../../components/FileList'));
const RepairAddressInfo = React.lazy(() => import('../../../components/RepairAddressInfo'));
const Score = React.lazy(() => import('../../../components/Score'));
const OuterCirculationRecord = React.lazy(() => import('../../../components/OuterCirculationRecord'));
interface DetailInfoProps {
......@@ -210,7 +212,27 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Col span={24}>
<Suspense fallback={null}>
<IntroduceRow />
<Row
gutter={24}
>
<Col span={6}>
<Suspense fallback={null}>
<FileList />
</Suspense>
</Col>
<Col span={12}>
<Suspense fallback={null}>
<RepairAddressInfo />
</Suspense>
</Col>
<Col span={6}>
<Suspense fallback={null}>
<Score />
</Suspense>
</Col>
</Row>
</Suspense>
</Col>
......
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import RepairForm from './components/RepairForm';
const RepairDetail: React.FC = () => {
const { id, creditId } = usePageStatus();
return (
<RepairForm id={id} />
);
};
export default RepairDetail;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import RepairForm from './components/RepairForm';
const EditRepair: React.FC = () => {
const { id, creditId } = usePageStatus();
return (
<RepairForm id={id} isEdit />
);
};
export default EditRepair;
\ No newline at end of file
......@@ -112,7 +112,7 @@ const RepairPrSubmit: React.FC = () => {
</Popconfirm>
<Button
type="link"
onClick={() => {}}
onClick={() => history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/edit?id=${record.id}`)}
>
编辑
</Button>
......@@ -195,14 +195,14 @@ const RepairPrSubmit: React.FC = () => {
<Button
type="primary"
onClick={() =>
history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/addRepair`)
history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/add`)
}
>
<PlusOutlined />
新建
</Button>
</Space>
</>
</>
);
return (
......
......@@ -25,7 +25,9 @@ import { EditableColumns } from '@/components/PolymericTable/interface';
import { } from '../../../constants';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const IntroduceRow = React.lazy(() => import('../../../components/IntroduceRow'));
const FileList = React.lazy(() => import('../../../components/FileList'));
const RepairAddressInfo = React.lazy(() => import('../../../components/RepairAddressInfo'));
const Score = React.lazy(() => import('../../../components/Score'));
const FlowRecords = React.lazy(() => import('../FlowRecords'));
interface DetailInfoProps {
......@@ -226,7 +228,27 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Col span={24}>
<Suspense fallback={null}>
<IntroduceRow />
<Row
gutter={24}
>
<Col span={6}>
<Suspense fallback={null}>
<FileList />
</Suspense>
</Col>
<Col span={12}>
<Suspense fallback={null}>
<RepairAddressInfo />
</Suspense>
</Col>
<Col span={6}>
<Suspense fallback={null}>
<Score />
</Suspense>
</Col>
</Row>
</Suspense>
</Col>
......
......@@ -28,7 +28,9 @@ const OuterCirculation = React.lazy(() => import('../../../components/OuterCircu
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const ReturnInfo = React.lazy(() => import('../../../components/ReturnInfo'));
const ReturnDetailInfo = React.lazy(() => import('../../../components/ReturnDetailInfo'));
const IntroduceRow = React.lazy(() => import('../../../components/IntroduceRow'));
const FileList = React.lazy(() => import('../../../components/FileList'));
const ReturnAddressInfo = React.lazy(() => import('../../../components/ReturnAddressInfo'));
const Score = React.lazy(() => import('../../../components/Score'));
const OuterCirculationRecord = React.lazy(() => import('../../../components/OuterCirculationRecord'));
interface DetailInfoProps {
......@@ -286,9 +288,27 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</Col>
<Col span={24}>
<Suspense fallback={null}>
<IntroduceRow />
</Suspense>
<Row
gutter={24}
>
<Col span={6}>
<Suspense fallback={null}>
<FileList />
</Suspense>
</Col>
<Col span={12}>
<Suspense fallback={null}>
<ReturnAddressInfo />
</Suspense>
</Col>
<Col span={6}>
<Suspense fallback={null}>
<Score />
</Suspense>
</Col>
</Row>
</Col>
<Col span={24}>
......
/*
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 16:49:12
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
import { Card, Badge, Progress, Button } from 'antd';
import {
ClockCircleOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { coverColFiltersItem } from '@/utils';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema';
import {
CREDIT_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP,
} from '../../contants';
import styles from './index.less';
const formActions = createFormActions();
const ReturnPrAddDeliver: React.FC = () => {
const ref = useRef<any>({});
const defaultColumns: ColumnType<any>[] = [
{
title: '申请单号',
dataIndex: 'applyNo',
align: 'center',
render: (text, record) => (
<>
<EyePreview
url={`/memberCenter/afterService/returnApplication/returnQuery/detail?id=${record.id}`}
>
{text}
</EyePreview>
</>
),
},
{
title: '申请单摘要',
dataIndex: 'parentMemberName',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplier',
align: 'center',
},
{
title: '退款金额',
dataIndex: 'returnAmount',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'created',
align: 'center',
},
{
title: '退货批次',
dataIndex: 'batch',
align: 'center',
},
{
title: '退货发货单号',
dataIndex: 'deliverNo',
align: 'center',
render: text => <a>{text}</a>,
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type="success" title="售后完成" />
),
},
{
title: '内部状态',
dataIndex: 'innerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />,
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => {}}
>
查看物流单
</Button>
</>
),
},
];
const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest,
// })
// .then(res => {
// if (res.code === 1000) {
// resolve(res.data);
// }
// reject();
// })
// .catch(() => {
// reject();
// });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
});
};
// 初始化高级筛选选项
const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer();
// if (res.code === 1000) {
// const { data } = res;
// const {
// outerStatusList = [],
// innerStatusList = [],
// } = data;
// const newColumns = columns.slice();
// // filter 0 过滤掉全部选项
// coverColFiltersItem(
// newColumns,
// 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// coverColFiltersItem(
// newColumns,
// 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// setColumns(newColumns);
// return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// };
// }
return {};
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSearchItems,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
);
};
export default ReturnPrDeliver;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-05 14:28:08
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
abstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
supplier: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '供应会员(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 16:41:12
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
import { Card, Badge, Progress, Button } from 'antd';
import {
ClockCircleOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { coverColFiltersItem } from '@/utils';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema';
import {
CREDIT_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP,
} from '../../contants';
import styles from './index.less';
const formActions = createFormActions();
const ReturnPrLogistics: React.FC = () => {
const ref = useRef<any>({});
const defaultColumns: ColumnType<any>[] = [
{
title: '申请单号',
dataIndex: 'applyNo',
align: 'center',
render: (text, record) => (
<>
<EyePreview
url={`/memberCenter/afterService/returnApplication/returnQuery/detail?id=${record.id}`}
>
{text}
</EyePreview>
</>
),
},
{
title: '申请单摘要',
dataIndex: 'parentMemberName',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplier',
align: 'center',
},
{
title: '退款金额',
dataIndex: 'returnAmount',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'created',
align: 'center',
},
{
title: '退货批次',
dataIndex: 'batch',
align: 'center',
},
{
title: '退货发货单号',
dataIndex: 'deliverNo',
align: 'center',
render: text => <a>{text}</a>,
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type="success" title="售后完成" />
),
},
{
title: '内部状态',
dataIndex: 'innerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />,
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => {}}
>
审核
</Button>
</>
),
},
];
const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest,
// })
// .then(res => {
// if (res.code === 1000) {
// resolve(res.data);
// }
// reject();
// })
// .catch(() => {
// reject();
// });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
});
};
// 初始化高级筛选选项
const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer();
// if (res.code === 1000) {
// const { data } = res;
// const {
// outerStatusList = [],
// innerStatusList = [],
// } = data;
// const newColumns = columns.slice();
// // filter 0 过滤掉全部选项
// coverColFiltersItem(
// newColumns,
// 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// coverColFiltersItem(
// newColumns,
// 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// setColumns(newColumns);
// return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// };
// }
return {};
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSearchItems,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
);
};
export default ReturnPrLogistics;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-05 14:28:08
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
abstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
supplier: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '供应会员(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import React from 'react';
import ReturnForm from './components/ReturnForm';
const AddReturn: React.FC = () => {
return (
<ReturnForm isEdit />
);
};
export default AddReturn;
\ No newline at end of file
.goods {
&-head {
}
&-body {
}
&-foot {
}
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 11:49:59
* @Description: 维修商品抽屉组件
*/
import React, { useState } from 'react';
import { Drawer, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { createFormActions } from '@formily/antd';
import { ColumnType } from 'antd/lib/table/interface';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import NiceForm from '@/components/NiceForm';
import NestTable from '@/components/NestTable';
import { listSearchSchema } from './schema';
import styles from './index.less';
const formActions = createFormActions();
const mockData = [
{
id: 1,
orderNo: 'SPTY12',
applyAbstract: '进口头层黄牛皮荔枝纹',
supplierName: '广州白马皮具交易中心',
createTime: '2020-05-12 08:08',
orderStatus: '已完成',
orderType: '询价采购',
childData: [
{
id: 11,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
},
{
id: 12,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
}
]
},
{
id: 2,
orderNo: 'SPTY12',
applyAbstract: '进口头层黄牛皮荔枝纹',
supplierName: '广州白马皮具交易中心',
createTime: '2020-05-12 08:08',
orderStatus: '已完成',
orderType: '询价采购',
childData: [
{
id: 23,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
},
{
id: 24,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
}
]
},
{
id: 3,
orderNo: 'SPTY12',
applyAbstract: '进口头层黄牛皮荔枝纹',
supplierName: '广州白马皮具交易中心',
createTime: '2020-05-12 08:08',
orderStatus: '已完成',
orderType: '询价采购',
childData: [
{
id: 35,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
},
{
id: 36,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
}
]
},
{
id: 4,
orderNo: 'SPTY12',
applyAbstract: '进口头层黄牛皮荔枝纹',
supplierName: '广州白马皮具交易中心',
createTime: '2020-05-12 08:08',
orderStatus: '已完成',
orderType: '询价采购',
childData: [
{
id: 47,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
},
{
id: 48,
productId: 1110,
productName: '进口头层黄牛皮荔枝纹/红色',
category: '牛皮',
brand: 'PELLE',
unit: '尺',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 4000,
replaceCount: 1000,
}
]
},
]
interface GoodsDrawer {
// 是否可见的
visible: boolean;
// 关闭事件
onClose: () => void;
};
const GoodsDrawer: React.FC<GoodsDrawer> = ({
visible = false,
onClose,
}) => {
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const [childSelectedRowKeys, setChildSelectedRowKeys] = useState<any>([])
const tableColumn: ColumnType<any>[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
},
{
title: '订单摘要',
dataIndex: 'applyAbstract',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplierName',
align: 'center',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
},
{
title: '订单状态',
dataIndex: 'orderStatus',
align: 'center',
},
{
title: '订单类型',
dataIndex: 'orderType',
align: 'center',
},
]
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: 'price',
align: 'center',
},
{
title: '金额',
dataIndex: 'amount',
align: 'center',
},
{
title: '已退货数量',
dataIndex: 'returnNum',
align: 'center',
},
{
title: '已退款金额',
dataIndex: 'returnAmount',
align: 'center',
},
]
const handleClose = () => {
if (onClose) {
onClose();
}
};
// 子表格选中行
const handleChildSelectChange = () => {
};
// 子表格选中所有行
const handleChildSelectAll = () => {
};
// 表格选中行
const handleParentSelectChange = () => {
};
// 表格选中所有行
const hanldeParentSelectAll = () => {
};
return (
<Drawer
title="选择维修商品"
width={1200}
onClose={handleClose}
visible={visible}
bodyStyle={{ paddingBottom: 80 }}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={onClose} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={handleClose} type="primary">
确定
</Button>
</div>
}
>
<div className={styles.goods}>
<div className={styles['goods-head']}>
<NiceForm
actions={formActions}
onSubmit={values => {}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
);
}}
schema={listSearchSchema}
/>
</div>
<div>
<NestTable
NestColumns={[tableColumn, childTableColumn]}
className="common_tb"
rowClassName={(_, index) => (index % 2) === 0 && 'tb_bg'}
rowKey="id"
childrenDataKey="childData"
dataSource={mockData}
childRowSelection={{
selectedRowKeys: childSelectedRowKeys,
onSelect: handleChildSelectChange,
onSelectAll: handleChildSelectAll,
}}
rowSelection={{
selectedRowKeys: selectedRowKeys,
onSelect: handleParentSelectChange,
onSelectAll: hanldeParentSelectAll,
}}
/>
</div>
</div>
</Drawer>
);
};
export default GoodsDrawer;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 11:48:45
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
abstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '订单类型(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:19:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 18:32:29
* @Description:
*/
import { useBusinessEffects } from './useBusinessEffects';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api';
// 获取单据类型
const fetchInvoicesType = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
PublicApi.getWarehouseInvoicesTypeAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
}).catch(() => {
reject();
});
});
};
export const createEffects = (context, actions) => {
useBusinessEffects(context, actions);
// useAsyncSelect('invoicesTypeId', fetchInvoicesType, ['name', 'id']);
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 18:50:28
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {
} from '@/constants';
import { PublicApi } from '@/services/api';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
// 获取采购入库单相关数据
const fetchOrderPurchaseReceiptAddList = async (params: any) => {
const res = await PublicApi.getOrderPurchaseReceiptAddList({
...params,
})
if (res.code === 1000) {
return res.data;
}
return [];
};
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
const linkage = useLinkageUtils();
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react';
import { Button, Card, Spin, message } from 'antd';
import { DeleteOutlined } from '@ant-design/icons';
import { Radio, ArrayTable } from '@formily/antd-components';
import { history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined, PlusOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import GoodsDrawer from '../GoodsDrawer';
import AddressFormItem from '../../../../components/AddressFormItem';
import ReturnInfoDrawer from '../../../../components/ReturnInfoDrawer';
import { addBillSchema } from './schema';
import { createEffects } from './effects';
const addSchemaAction = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
interface BillsFormProps {
id?: string;
// 是否是编辑的
isEdit?: boolean;
};
const RepairForm: React.FC<BillsFormProps> = ({
id,
isEdit = false,
}) => {
const [visible, setVisible] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [visibleGoodsDrawer, setVisibleGoodsDrawer] = useState(false);
const [visibleReturnInfoDrawer, setVisibleReturnInfoDrawer] = useState(false);
useEffect(() => {
}, []);
// 弹出单据明细
const handleAdd = () => {
// do something
};
const TableAddButton = isEdit || !id ? (
<Button
style={{ marginBottom: 16 }}
block
icon={<PlusOutlined />}
onClick={() => setVisibleGoodsDrawer(true)}
type="dashed"
>
选择退货商品
</Button>
) : null;
const handleSubmit = value => {
const {
} = value;
console.log('value', value)
};
const handleRemoveItem = (index: number) => {
// do something
// const newSelectRow = [...productRowCtl.selectRow];
// const newSelectedRowKeys = [...productRowCtl.selectedRowKeys];
// const newValue = [...addSchemaAction.getFieldValue('invoicesDetailsRequests')];
// newSelectRow.splice(index, 1);
// newSelectedRowKeys.splice(index, 1);
// productRowCtl.setSelectRow(newSelectRow);
// productRowCtl.setSelectedRowKeys(newSelectedRowKeys);
// newValue.splice(index, 1);
// addSchemaAction.setFieldValue('invoicesDetailsRequests', newValue);
};
// ArrayTable自定义渲染
const renderListTableRemove = (index: number) => (
<>
<a
onClick={() => setVisibleReturnInfoDrawer(true)}
style={{
marginRight: 20,
}}
>
编辑
</a>
<a
onClick={() => handleRemoveItem(index)}
style={{
color: '#ff4d4f',
}}
>
删除
</a>
</>
);
const beforeUpload = file => {
if (file.size / 1024 < 20) {
message.warning('图片大小超过20M');
return Promise.reject();
}
};
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
style={{
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
!id ?
'新建单据' :
isEdit ?
'编辑单据' :
'查看单据'
}
extra={
(isEdit || !id)
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => addSchemaAction.submit()}
>
保存
</Button>,
]
: []
}
>
<Card>
<NiceForm
initialValues={{}}
expressionScope={{
TableAddButton,
renderListTableRemove,
beforeUpload,
}}
components={{
ArrayTable,
AddressFormItem,
}}
editable={isEdit || !id}
effects={($, actions) => {
createEffects($, actions)
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={addBillSchema}
/>
</Card>
<GoodsDrawer
visible={visibleGoodsDrawer}
onClose={() => setVisibleGoodsDrawer(false)}
/>
<ReturnInfoDrawer
visible={visibleReturnInfoDrawer}
onClose={() => setVisibleReturnInfoDrawer(false)}
isEdit
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</PageHeaderWrapper>
</Spin>
);
};
export default RepairForm;
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import ReturnForm from './components/ReturnForm';
const EditReturn: React.FC = () => {
const { id } = usePageStatus();
return (
<ReturnForm id={id} />
);
};
export default EditReturn;
\ No newline at end of file
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import ReturnForm from './components/ReturnForm';
const EditReturn: React.FC = () => {
const { id, creditId } = usePageStatus();
return (
<ReturnForm id={id} isEdit />
);
};
export default EditReturn;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-06 10:13:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 16:41:29
* @Description: 待提交退货申请单
*/
import React, { useState, useRef } from 'react';
import {
Card,
Badge,
Progress,
Button,
Popconfirm,
Space,
} from 'antd';
import { history } from 'umi';
import {
ClockCircleOutlined,
PlusOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { coverColFiltersItem } from '@/utils';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema';
import {
CREDIT_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP,
} from '../../contants';
import styles from './index.less';
const formActions = createFormActions();
const ReturnPrSubmit: React.FC = () => {
const ref = useRef<any>({});
const handleDelete = () => {
};
const defaultColumns: ColumnType<any>[] = [
{
title: '申请单号',
dataIndex: 'applyNo',
align: 'center',
render: (text, record) => (
<>
<EyePreview
url={`/memberCenter/afterService/returnApplication/returnPrSubmit/detail?id=${record.id}`}
>
{text}
</EyePreview>
</>
),
},
{
title: '申请单摘要',
dataIndex: 'parentMemberName',
align: 'center',
},
{
title: '供应会员',
dataIndex: 'supplier',
align: 'center',
},
{
title: '退款金额',
dataIndex: 'returnAmount',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'created',
align: 'center',
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type="success" title="售后完成" />
),
},
{
title: '内部状态',
dataIndex: 'innerStatusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />,
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => {}}
>
提交
</Button>
<Button
type="link"
onClick={() => history.push(`/memberCenter/afterService/returnApplication/returnPrSubmit/edit`)}
>
编辑
</Button>
<Button
type="link"
onClick={() => handleDelete()}
danger
>
删除
</Button>
</>
),
},
];
const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest,
// })
// .then(res => {
// if (res.code === 1000) {
// resolve(res.data);
// }
// reject();
// })
// .catch(() => {
// reject();
// });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
});
};
// 初始化高级筛选选项
const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer();
// if (res.code === 1000) {
// const { data } = res;
// const {
// outerStatusList = [],
// innerStatusList = [],
// } = data;
// const newColumns = columns.slice();
// // filter 0 过滤掉全部选项
// coverColFiltersItem(
// newColumns,
// 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// coverColFiltersItem(
// newColumns,
// 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// );
// setColumns(newColumns);
// return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// };
// }
return {};
};
const controllerBtns = (
<>
<Space>
<Button
type="primary"
onClick={() =>
history.push(`/memberCenter/afterService/returnApplication/returnPrSubmit/add`)
}
>
<PlusOutlined />
新建
</Button>
</Space>
</>
);
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'cond',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSearchItems,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
);
};
export default ReturnPrSubmit;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-05 14:34:48
* @Description:
*/
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
cond: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
abstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
},
},
supplier: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '供应会员(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-05 14:25:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-06 16:41:39
* @Description: 退货申请单查询
*/
import React, { useState, useRef } from 'react';
import { Card, Badge, Progress, Button } from 'antd';
import {
......@@ -54,6 +61,11 @@ const ReturnQuery: React.FC = () => {
align: 'center',
},
{
title: '退款金额',
dataIndex: 'returnAmount',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'created',
align: 'center',
......
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