Commit 9cd9f806 authored by XieZhiXiong's avatar XieZhiXiong

feat: 开发中

parent cef0eb1b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44 * @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-20 16:03:42 * @LastEditTime: 2020-11-27 17:16:30
* @Description: 待新增退货发货单 * @Description: 待新增退货发货单
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
...@@ -18,6 +18,12 @@ import { ColumnType } from 'antd/lib/table/interface'; ...@@ -18,6 +18,12 @@ import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import {
DOC_TYPE_RETURN_INVOICE,
DEPENDENT_DOC_EXCHANGE,
EXCHANGE_INNER_STATUS_NOT_ADDED_RETURN_DELIVERY,
EXCHANGE_INNER_STATUS_UNREVIEWED_RETURN_DELIVERY,
} from '@/constants';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'; import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
...@@ -111,18 +117,25 @@ const ExchangePrAddDeliver: React.FC = () => { ...@@ -111,18 +117,25 @@ const ExchangePrAddDeliver: React.FC = () => {
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<> <>
{record.innerStatus === EXCHANGE_INNER_STATUS_NOT_ADDED_RETURN_DELIVERY && (
<Button <Button
type="link" type="link"
onClick={() => () => history.push(``)} onClick={
() =>
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.replaceId}&invoicesTypeId=${DOC_TYPE_RETURN_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_EXCHANGE}`)
}
> >
新增 新增
</Button> </Button>
)}
{record.innerStatus === EXCHANGE_INNER_STATUS_UNREVIEWED_RETURN_DELIVERY && (
<Button <Button
type="link" type="link"
onClick={() => handleVerify(record)} onClick={() => handleVerify(record)}
> >
审核 审核
</Button> </Button>
)}
</> </>
), ),
}, },
......
...@@ -47,15 +47,20 @@ const MemberUpgradeRule: React.FC<[]> = () => { ...@@ -47,15 +47,20 @@ const MemberUpgradeRule: React.FC<[]> = () => {
align: 'center', align: 'center',
}, },
{ {
title: '项目', title: '升级规则',
dataIndex: 'ruleName', dataIndex: 'ruleName',
align: 'center', align: 'center',
render: (text: any, record: any) => <span>{text}</span>,
}, },
{ {
title: '项目说明', title: '升级规则说明',
dataIndex: 'remark', dataIndex: 'remark',
align: 'center', align: 'center',
ellipsis: true,
},
{
title: '适用会员等级类型',
dataIndex: 'levelTypeName',
align: 'center',
}, },
{ {
title: '可获取的分值', title: '可获取的分值',
......
...@@ -330,6 +330,8 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -330,6 +330,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
] : ] :
[] []
, ,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
}); });
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
...@@ -374,6 +376,8 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -374,6 +376,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
] : ] :
[] []
, ,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
}); });
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
...@@ -383,9 +387,61 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -383,9 +387,61 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 退货发货单 // 退货发货单
case DOC_TYPE_RETURN_INVOICE: { case DOC_TYPE_RETURN_INVOICE: {
switch (+relevanceInvoices) {
// 换货申请单
case DEPENDENT_DOC_EXCHANGE: {
setInfoLoading(true);
PublicApi.getAsReplaceGoodsGetDetailByConsumer({
replaceId: relevanceInvoicesId,
}).then(res => {
if (res.code !== 1000) {
return;
}
const {
supplierName,
returnGoodsAddress,
applyNo,
parentMemberId,
parentMemberRoleId,
} = res.data;
setBillInfo({
invoicesTypeId: intInvoicesTypeId,
relevanceInvoices: +relevanceInvoices,
orderNo:
relevanceInvoicesId ?
[
{
orderNo: applyNo,
id: +relevanceInvoicesId,
deliveryAddresId: returnGoodsAddress.receiveId,
memberName: supplierName,
fullAddress: returnGoodsAddress.receiveAddress || '',
receiverName: returnGoodsAddress.receiveUserName || '',
phone: returnGoodsAddress.receiveUserTel || '',
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
});
}).finally(() => {
setInfoLoading(false);
});
break;
}
// 退货申请单
case DEPENDENT_DOC_RETURN: {
break; break;
} }
}
break;
}
// 退货入库单 // 退货入库单
case DOC_TYPE_RETURN_RECEIPT: { case DOC_TYPE_RETURN_RECEIPT: {
...@@ -443,6 +499,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -443,6 +499,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const handleSubmit = value => { const handleSubmit = value => {
const { const {
invoicesTypeId, invoicesTypeId,
invoicesTypeCode,
orderNo, orderNo,
transactionTime, transactionTime,
address, address,
...@@ -461,8 +518,6 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -461,8 +518,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
})); }));
const newTransactionTime = transactionTime ? moment(transactionTime).valueOf() : null; const newTransactionTime = transactionTime ? moment(transactionTime).valueOf() : null;
console.log('value', value);
setSubmitLoading(true); setSubmitLoading(true);
switch (invoicesTypeId) { switch (invoicesTypeId) {
// 采购入库单 // 采购入库单
...@@ -491,7 +546,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -491,7 +546,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return { return {
...rest, ...rest,
...extraRest, ...extraRest,
itemNmae: itemName, goodsName: itemName,
}; };
}), }),
supplyMembersName: memberName, supplyMembersName: memberName,
...@@ -533,7 +588,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -533,7 +588,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return { return {
...rest, ...rest,
...extraRest, ...extraRest,
itemNmae: itemName, goodsName: itemName,
}; };
}), }),
}) })
...@@ -578,7 +633,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -578,7 +633,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return { return {
...rest, ...rest,
...extraRest, ...extraRest,
itemNmae: itemName, goodsName: itemName,
}; };
}), }),
createMemberName: memberName, createMemberName: memberName,
...@@ -620,7 +675,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -620,7 +675,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return { return {
...rest, ...rest,
...extraRest, ...extraRest,
itemNmae: itemName, goodsName: itemName,
}; };
}), }),
}) })
...@@ -709,7 +764,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -709,7 +764,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...rest ...rest
} = item; } = item;
return { return {
...item, ...rest,
produceNoticeOrderDetailId: extraData.id, produceNoticeOrderDetailId: extraData.id,
orderNo: extraData.orderNo, orderNo: extraData.orderNo,
processNum: extraData.processNum, processNum: extraData.processNum,
...@@ -739,15 +794,69 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -739,15 +794,69 @@ const BillsForm: React.FC<BillsFormProps> = ({
break; break;
} }
// 退货发货单 // 退货发货单、退货入库单
case DOC_TYPE_RETURN_INVOICE: { case DOC_TYPE_RETURN_INVOICE:
break;
}
// 退货入库单
case DOC_TYPE_RETURN_RECEIPT: { case DOC_TYPE_RETURN_RECEIPT: {
if (!id) {
if (isEdit) {
return;
}
PublicApi.postWarehouseInvoicesAdd({
invoicesTypeCode: invoicesTypeCode,
invoicesAbstract: rest.invoicesAbstract,
memberName: memberName,
inventoryId: rest.inventoryId,
inventoryRole: rest.inventoryRole,
transactionTime: newTransactionTime,
orderNo: orderNo[0].orderNo,
deliveryAddresId: orderNo[0].deliveryAddresId,
receiverName: rest.receiverName,
fullAddress: rest.fullAddress,
phone: rest.phone,
deliveryType: rest.deliveryType,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => {
const {
extraData = {},
amount,
productCount,
itemName,
...rest
} = item;
return {
...rest,
goodsName: itemName,
productModel: rest.specifications,
productName: extraData.productName,
storageCount: 0,
shipmentQuantity: productCount,
productCount: extraData.goodsCount,
};
}),
relevanceInvoicesId: orderNo[0].id,
relevanceInvoices: rest.relevanceInvoices,
supplyMembersName: billInfo.supplyMembersName,
supplyMembersId: billInfo.supplyMembersId,
supplyMembersRoleId: billInfo.supplyMembersRoleId,
invoicesTypeId,
})
.then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
} else {
// update action
if (!isEdit) {
return;
}
}
break; break;
} }
......
...@@ -232,6 +232,10 @@ export const addBillSchema: ISchema = { ...@@ -232,6 +232,10 @@ export const addBillSchema: ISchema = {
}, },
required: true, required: true,
}, },
invoicesTypeCode: {
type: 'string',
display: false,
},
inventoryId: { inventoryId: {
type: 'string', type: 'string',
title: '对应仓库', title: '对应仓库',
......
...@@ -34,9 +34,9 @@ const Inventory: React.FC<{}> = () => { ...@@ -34,9 +34,9 @@ const Inventory: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: 'ID', title: '货号',
align: 'center', align: 'center',
dataIndex: 'id', dataIndex: 'itemNo',
}, },
{ {
title: '货品名称', title: '货品名称',
......
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