Commit 62a8a290 authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接完毕换货退货入库单相关

parent 47425c33
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-19 20:03:59
* @LastEditTime: 2021-08-20 14:35:58
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......
......@@ -81,7 +81,7 @@ const ExchangePrAddLogistics: React.FC = () => {
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.returnDeliveryId}`}
to={`/memberCenter/afterService/exchangeApplication/exchangePrAddDeliver/deliverDetail?id=${record.returnDeliveryId}`}
>
{text}
</Link>
......
......@@ -77,7 +77,7 @@ const ExchangePrConfirmBack: React.FC = () => {
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.returnDeliveryId}`}
to={`/memberCenter/afterService/exchangeApplication/exchangePrAddDeliver/deliverDetail?id=${record.returnDeliveryId}`}
>
{text}
</Link>
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 14:20:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 14:20:05
* @Description: 新增换货退货入库单
*/
import React, { useState } from 'react';
import { FormEffectHooks } from '@formily/antd';
import { history, Prompt } from 'umi';
import moment from 'moment';
import { DOC_TYPE_EXCHANGE_RETURN_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.getAsReplaceGoodsGetReturnGoodsStorageDetail({
returnDeliveryId: 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.postAsReplaceGoodsAddReturnGoodsStorage({
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_RETURN_RECEIPT}
fetchRelatedInfo={fetchRelatedInfo}
submitLoading={submitLoading}
onSubmit={handleSubmit}
customEffects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</>
);
};
export default ExchangeAddWarehouseBill;
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-18 10:38:29
* @LastEditTime: 2021-08-20 14:30:20
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -109,7 +109,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.returnStorageId}`}
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${record.returnDeliveryId}`}
>
{text}
</Link>
......@@ -140,7 +140,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.replaceId}&invoicesTypeId=${DOC_TYPE_EXCHANGE_RETURN_RECEIPT}&relevanceInvoices=${DEPENDENT_DOC_EXCHANGE}`)
history.push(`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/add?applyId=${record.replaceId}&deliveryId=${record.returnDeliveryId}`)
}
>
新增
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-20 14:20:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 14:31:43
* @Description: 换货退货入库单详情
*/
import React from 'react';
import { DOC_TYPE_EXCHANGE_RETURN_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_RETURN_RECEIPT}
fetchRelatedInfo={fetchRelatedInfo}
editable={false}
/>
</>
);
};
export default ExchangeWarehouseBillDetail;
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-07 11:05:27
* @LastEditTime: 2021-08-20 14:33:45
* @Description: 待退货收货
*/
import React, { useState, useRef } from 'react';
......@@ -79,7 +79,7 @@ const ExchangePrReceived: React.FC = () => {
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.returnStorageId}`}
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${record.returnDeliveryId}`}
>
{text}
</Link>
......
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