Commit 74828d08 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 单据来源字段相关

parent 6eb9e48b
...@@ -7,6 +7,7 @@ const AddBills: React.FC = () => { ...@@ -7,6 +7,7 @@ const AddBills: React.FC = () => {
invoicesTypeId, // 单据类型ID invoicesTypeId, // 单据类型ID
relevanceInvoices, // 对应单据 relevanceInvoices, // 对应单据
relevanceInvoicesId, // 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的 relevanceInvoicesId, // 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
source,
} = usePageStatus(); } = usePageStatus();
return ( return (
...@@ -14,6 +15,7 @@ const AddBills: React.FC = () => { ...@@ -14,6 +15,7 @@ const AddBills: React.FC = () => {
invoicesTypeId={invoicesTypeId} invoicesTypeId={invoicesTypeId}
relevanceInvoices={relevanceInvoices} relevanceInvoices={relevanceInvoices}
relevanceInvoicesId={relevanceInvoicesId} relevanceInvoicesId={relevanceInvoicesId}
source={+source as (1 | 2)}
/> />
); );
}; };
......
...@@ -74,6 +74,11 @@ interface BillsFormProps { ...@@ -74,6 +74,11 @@ interface BillsFormProps {
* 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的 * 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
*/ */
relevanceInvoicesId: string; relevanceInvoicesId: string;
/**
* 来源,跳转来源于 进销存新增 or 其他地方跳转过来的
* 1 进销存,2 单据
*/
source?: 1 | 2;
}; };
function transforDirection(type) { function transforDirection(type) {
...@@ -101,6 +106,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -101,6 +106,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
invoicesTypeId, invoicesTypeId,
relevanceInvoices, relevanceInvoices,
relevanceInvoicesId, relevanceInvoicesId,
source = 2,
}) => { }) => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [productRowSelection, productRowCtl] = useRowSelectionTable({ type: 'checkbox' }); const [productRowSelection, productRowCtl] = useRowSelectionTable({ type: 'checkbox' });
...@@ -834,6 +840,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -834,6 +840,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: memberName, supplyMembersName: memberName,
supplyMembersId: membersId, supplyMembersId: membersId,
supplyMembersRoleId: membersRoleId, supplyMembersRoleId: membersRoleId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -943,6 +950,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -943,6 +950,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: memberName, supplyMembersName: memberName,
supplyMembersId: membersId, supplyMembersId: membersId,
supplyMembersRoleId: membersRoleId, supplyMembersRoleId: membersRoleId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1041,6 +1049,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1041,6 +1049,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
storageCount: productCount, storageCount: productCount,
}; };
}), }),
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1139,6 +1148,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1139,6 +1148,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
shipmentQuantity: productCount, shipmentQuantity: productCount,
}; };
}), }),
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1254,6 +1264,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1254,6 +1264,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersId: orderNo[0].supplyMembersId, supplyMembersId: orderNo[0].supplyMembersId,
supplyMembersRoleId: orderNo[0].supplyMembersRoleId, supplyMembersRoleId: orderNo[0].supplyMembersRoleId,
invoicesTypeId, invoicesTypeId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1364,6 +1375,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1364,6 +1375,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersId: orderNo[0].supplyMembersId, supplyMembersId: orderNo[0].supplyMembersId,
supplyMembersRoleId: orderNo[0].supplyMembersRoleId, supplyMembersRoleId: orderNo[0].supplyMembersRoleId,
invoicesTypeId, invoicesTypeId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1472,6 +1484,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1472,6 +1484,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersId: orderNo[0].supplyMembersId, supplyMembersId: orderNo[0].supplyMembersId,
supplyMembersRoleId: orderNo[0].supplyMembersRoleId, supplyMembersRoleId: orderNo[0].supplyMembersRoleId,
invoicesTypeId, invoicesTypeId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1580,6 +1593,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1580,6 +1593,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersId: orderNo[0].supplyMembersId, supplyMembersId: orderNo[0].supplyMembersId,
supplyMembersRoleId: orderNo[0].supplyMembersRoleId, supplyMembersRoleId: orderNo[0].supplyMembersRoleId,
invoicesTypeId, invoicesTypeId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -1687,6 +1701,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1687,6 +1701,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersId: null, supplyMembersId: null,
supplyMembersRoleId: null, supplyMembersRoleId: null,
invoicesTypeId, invoicesTypeId,
source,
}) })
.then(res => { .then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
......
...@@ -238,7 +238,7 @@ const Bills: React.FC<{}> = () => { ...@@ -238,7 +238,7 @@ const Bills: React.FC<{}> = () => {
dataIndex: 'actions', dataIndex: 'actions',
align: 'center', align: 'center',
render: (_, record: any) => { render: (_, record: any) => {
return ( return record.source === 1 ? (
<> <>
{record.state === DOC_STATUS_UNREVIEWED && ( {record.state === DOC_STATUS_UNREVIEWED && (
<> <>
...@@ -263,7 +263,7 @@ const Bills: React.FC<{}> = () => { ...@@ -263,7 +263,7 @@ const Bills: React.FC<{}> = () => {
<Button type="link" onClick={() => handleCounterclaim(record.id)}>反审</Button> <Button type="link" onClick={() => handleCounterclaim(record.id)}>反审</Button>
)} )}
</> </>
); ) : null;
}, },
}, },
]; ];
...@@ -282,7 +282,7 @@ const Bills: React.FC<{}> = () => { ...@@ -282,7 +282,7 @@ const Bills: React.FC<{}> = () => {
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={() => onClick={() =>
history.push( history.push(
'/memberCenter/tranactionAbility/stockSellStorage/bills/add', '/memberCenter/tranactionAbility/stockSellStorage/bills/add?source=2',
) )
} }
> >
......
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