Commit 9cd9f806 authored by XieZhiXiong's avatar XieZhiXiong

feat: 开发中

parent cef0eb1b
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-20 16:03:42
* @LastEditTime: 2020-11-27 17:16:30
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -18,6 +18,12 @@ 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 {
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 { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
......@@ -111,18 +117,25 @@ const ExchangePrAddDeliver: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Button
type="link"
onClick={() => () => history.push(``)}
>
新增
</Button>
<Button
type="link"
onClick={() => handleVerify(record)}
>
审核
</Button>
{record.innerStatus === EXCHANGE_INNER_STATUS_NOT_ADDED_RETURN_DELIVERY && (
<Button
type="link"
onClick={
() =>
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.replaceId}&invoicesTypeId=${DOC_TYPE_RETURN_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_EXCHANGE}`)
}
>
新增
</Button>
)}
{record.innerStatus === EXCHANGE_INNER_STATUS_UNREVIEWED_RETURN_DELIVERY && (
<Button
type="link"
onClick={() => handleVerify(record)}
>
审核
</Button>
)}
</>
),
},
......
......@@ -47,15 +47,20 @@ const MemberUpgradeRule: React.FC<[]> = () => {
align: 'center',
},
{
title: '项目',
title: '升级规则',
dataIndex: 'ruleName',
align: 'center',
render: (text: any, record: any) => <span>{text}</span>,
},
{
title: '项目说明',
title: '升级规则说明',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
{
title: '适用会员等级类型',
dataIndex: 'levelTypeName',
align: 'center',
},
{
title: '可获取的分值',
......
......@@ -330,6 +330,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
] :
[]
,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -374,6 +376,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
] :
[]
,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -383,7 +387,59 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 退货发货单
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;
}
......@@ -443,6 +499,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const handleSubmit = value => {
const {
invoicesTypeId,
invoicesTypeCode,
orderNo,
transactionTime,
address,
......@@ -461,8 +518,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
}));
const newTransactionTime = transactionTime ? moment(transactionTime).valueOf() : null;
console.log('value', value);
setSubmitLoading(true);
switch (invoicesTypeId) {
// 采购入库单
......@@ -491,7 +546,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return {
...rest,
...extraRest,
itemNmae: itemName,
goodsName: itemName,
};
}),
supplyMembersName: memberName,
......@@ -533,7 +588,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return {
...rest,
...extraRest,
itemNmae: itemName,
goodsName: itemName,
};
}),
})
......@@ -578,7 +633,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return {
...rest,
...extraRest,
itemNmae: itemName,
goodsName: itemName,
};
}),
createMemberName: memberName,
......@@ -620,7 +675,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
return {
...rest,
...extraRest,
itemNmae: itemName,
goodsName: itemName,
};
}),
})
......@@ -709,7 +764,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...rest
} = item;
return {
...item,
...rest,
produceNoticeOrderDetailId: extraData.id,
orderNo: extraData.orderNo,
processNum: extraData.processNum,
......@@ -739,18 +794,72 @@ const BillsForm: React.FC<BillsFormProps> = ({
break;
}
// 退货发货单
case DOC_TYPE_RETURN_INVOICE: {
break;
}
// 退货入库单
// 退货发货单、退货入库单
case DOC_TYPE_RETURN_INVOICE:
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;
}
// 换货发货单
case DOC_TYPE_EXCHANGE_INVOICE: {
......
......@@ -232,6 +232,10 @@ export const addBillSchema: ISchema = {
},
required: true,
},
invoicesTypeCode: {
type: 'string',
display: false,
},
inventoryId: {
type: 'string',
title: '对应仓库',
......
......@@ -34,9 +34,9 @@ const Inventory: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
title: '货号',
align: 'center',
dataIndex: 'id',
dataIndex: 'itemNo',
},
{
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