Commit f94a3eda authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加换货入库单相关

parent ea26962a
......@@ -236,7 +236,7 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-新增
// 待新增货发货单-新增
{
path: '/memberCenter/afterService/exchangeManage/exchangePrAddDeliver/add',
name: 'exchangeAddDeliverBill',
......@@ -244,7 +244,7 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-退货发货单详情
// 待新增换货发货单-退货换货单详情
{
path: '/memberCenter/afterService/exchangeManage/exchangePrAddDeliver/deliverDetail',
name: 'exchangeDeliverBillDetail',
......
......@@ -197,6 +197,22 @@ export default {
name: 'exchangePrAddWarehousing',
component: '@/pages/afterService/exchangeApplication/exchangePrAddWarehousing/index',
},
// 待新增换货入库单-新增
{
path: '/memberCenter/afterService/exchangeApplication/exchangePrAddWarehousing/add',
name: 'exchangeAddWarehousingBill',
component: '@/pages/afterService/exchangeApplication/exchangePrAddWarehousing/addWarehouseBill',
hideInMenu: true,
noMargin: true,
},
// 待新增换货入库单-换货入库单详情
{
path: '/memberCenter/afterService/exchangeApplication/exchangePrAddWarehousing/warehousingDetail',
name: 'exchangeWarehousingBillDetail',
component: '@/pages/afterService/exchangeApplication/exchangePrAddWarehousing/warehouseBillDetail',
hideInMenu: true,
noMargin: true,
},
// 待新增换货入库单-详情
{
path: '/memberCenter/afterService/exchangeApplication/exchangePrAddWarehousing/detail',
......
......@@ -557,6 +557,8 @@ export default {
'menu.afterService.exchangeApplication.exchangePrConfirmBack': '待确认退货回单',
'menu.afterService.exchangeApplication.verifyExchangePrConfirmBack': '确认退货回单',
'menu.afterService.exchangeApplication.exchangePrAddWarehousing': '待新增换货入库单',
'menu.afterService.exchangeApplication.exchangeAddWarehousingBill': '新增换货入库单',
'menu.afterService.exchangeApplication.exchangeWarehousingBillDetail': '查看换货入库单',
'menu.afterService.exchangeApplication.exchangePrReceived': '待换货收货',
'menu.afterService.exchangeApplication.verifyExchangePrReceived': '换货收货',
'menu.afterService.exchangeApplication.exchangePrFinished': '待确认售后完成',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 15:55:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 15:55:10
* @Description: 新增换货入库单
*/
import React, { useState } from 'react';
import { FormEffectHooks } from '@formily/antd';
import { history, Prompt } from 'umi';
import moment from 'moment';
import { DOC_TYPE_EXCHANGE_RECEIPT } from '@/constants/commodity';
import BillsFormPage, { RelatedInfoDataType, BillSubmitValuesType } from '@/pages/transaction/stockSellStorage/bills/components/BillsFormPage';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
const {
onFormInputChange$,
} = FormEffectHooks;
const ExchangeAddWarehouseBill = () => {
const { applyId, deliveryId } = usePageStatus();
const [unsaved, setUnsaved] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const fetchRelatedInfo = (): Promise<RelatedInfoDataType> => {
return new Promise((resolve, reject) => {
PublicApi.getAsReplaceGoodsGetReplaceGoodsStorageDetail({
replaceDeliveryId: deliveryId,
}).then((res) => {
if (res.code === 1000) {
resolve({
relatedNo: res.data.applyNo,
memberName: res.data.memberName,
address: `${res.data.userName || ''} / ${res.data.tel || ''} ${res.data.address || ''}`,
logisticsType: res.data.deliveryType,
billDetails: res.data.goodsDetailDeliveryList.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.category,
price: item.purchasePrice,
relatedCount: item.replaceCount,
billCount: item.replaceDeliveryCount,
count: item.replaceDeliveryCount,
})),
});
}
reject();
}).catch((err) => {
reject(err);
});
});
};
const handleSubmit = (values: BillSubmitValuesType) => {
PublicApi.postAsReplaceGoodsAddReplaceGoodsStorage({
replaceId: applyId,
storageTime: values.createTime ? moment(values.createTime).valueOf() : 0,
orderAbstract: values.digest,
remark: values.remark,
inventoryName: values.inventoryName,
inventoryRole: values.inventoryRole,
detailList: values.billDetails.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
count: item.count,
})),
}).then((res) => {
if (res.code === 1000) {
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
} else {
setSubmitLoading(false);
}
});
};
return (
<>
<BillsFormPage
billType={DOC_TYPE_EXCHANGE_RECEIPT}
fetchRelatedInfo={fetchRelatedInfo}
submitLoading={submitLoading}
onSubmit={handleSubmit}
customEffects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</>
);
};
export default ExchangeAddWarehouseBill;
......@@ -2,13 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-19 18:18:34
* @Description: 待新增换货发货
* @LastEditTime: 2021-08-20 16:08:41
* @Description: 待新增换货入库
*/
import React, { useState, useRef } from 'react';
import { Card, Badge, Progress, Button, Modal } from 'antd';
import { Card, Badge, Button, Modal } from 'antd';
import {
ClockCircleOutlined,
ExclamationCircleOutlined,
} from '@ant-design/icons';
import { history, Link } from 'umi';
......@@ -22,10 +21,6 @@ import {
EXCHANGE_INNER_STATUS_NOT_ADDED_REPLACE_STORAGE,
EXCHANGE_INNER_STATUS_UNREVIEWED_REPLACE_STORAGE
} from '@/constants/afterService';
import {
DOC_TYPE_EXCHANGE_RECEIPT,
DEPENDENT_DOC_EXCHANGE,
} from '@/constants/commodity';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
......@@ -37,7 +32,6 @@ import {
EXCHANGE_INNER_STATUS_BADGE_MAP,
} from '../../constants';
import styles from './index.less';
import { reject } from 'lodash';
const { confirm } = Modal;
......@@ -50,7 +44,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
confirm({
title: '确认审核操作',
icon: <ExclamationCircleOutlined />,
content: `是否确认审核换货入库单号为${record.replaceDeliveryNo}的换货入库单?`,
content: `是否确认审核换货收货单号为${record.replaceDeliveryNo}的换货收货单?`,
onOk() {
return new Promise((resolve, reject) => {
PublicApi.postAsReplaceGoodsVerifyReplaceGoodsStorage({
......@@ -88,12 +82,12 @@ const ExchangePrAddWarehousing: React.FC = () => {
dataIndex: 'applyAbstract',
align: 'center',
ellipsis: true,
},
},
{
title: '供应会员',
dataIndex: 'supplierName',
align: 'center',
},
},
{
title: '单据时间',
dataIndex: 'applyTime',
......@@ -105,12 +99,12 @@ const ExchangePrAddWarehousing: React.FC = () => {
align: 'center',
},
{
title: '换货货单号',
dataIndex: 'replaceDeliveryNo',
title: '换货货单号',
dataIndex: 'replaceStorageNo',
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.replaceDeliveryId}`}
to={`/memberCenter/afterService/exchangeApplication/exchangePrAddWarehousing/warehousingDetail?id=${record.replaceDeliveryId}`}
>
{text}
</Link>
......@@ -129,7 +123,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => <Badge color={EXCHANGE_INNER_STATUS_BADGE_MAP[record.innerStatus] || '#606266'} text={text} />,
},
},
{
title: '操作',
dataIndex: 'option',
......@@ -141,7 +135,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.replaceId}&invoicesTypeId=${DOC_TYPE_EXCHANGE_RECEIPT}&relevanceInvoices=${DEPENDENT_DOC_EXCHANGE}`)
history.push(`/memberCenter/afterService/exchangeApplication/exchangePrAddWarehousing/add?applyId=${record.replaceId}&deliveryId=${record.replaceDeliveryId}`)
}
>
新增
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 15:55:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 15:55:18
* @Description: 换货入库单详情
*/
import React from 'react';
import { DOC_TYPE_EXCHANGE_RECEIPT } from '@/constants/commodity';
import BillsFormPage, { RelatedInfoDataType } from '@/pages/transaction/stockSellStorage/bills/components/BillsFormPage';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import moment from 'moment';
const ExchangeWarehouseBillDetail = () => {
const { id } = usePageStatus();
const fetchRelatedInfo = (): Promise<RelatedInfoDataType> => {
return new Promise((resolve, reject) => {
PublicApi.getAsReplaceGoodsGetReturnGoodsStorageDetail({
returnDeliveryId: id,
}).then((res) => {
if (res.code === 1000) {
resolve({
relatedNo: res.data.applyNo,
memberName: res.data.memberName,
address: `${res.data.userName || ''} / ${res.data.tel || ''} ${res.data.address || ''}`,
logisticsType: res.data.deliveryType,
inventoryId: res.data.inventoryName,
inventoryRole: res.data.inventoryRole,
digest: res.data.orderAbstract,
createTime: res.data.orderTime ? moment(res.data.orderTime).format('YYYY-MM-DD HH:mm:ss') : '',
billDetails: res.data.goodsDetailDeliveryList.map((item) => ({
orderNo: item.orderNo,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.category,
price: item.purchasePrice,
relatedCount: item.replaceCount,
billCount: item.replaceDeliveryCount,
count: item.storageCount,
})),
remark: res.data.remark,
});
}
reject();
}).catch((err) => {
reject(err);
});
});
};
return (
<>
<BillsFormPage
billType={DOC_TYPE_EXCHANGE_RECEIPT}
fetchRelatedInfo={fetchRelatedInfo}
editable={false}
/>
</>
);
};
export default ExchangeWarehouseBillDetail;
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