Commit 5e8d6570 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 orderType以区分普通订单跟合同订单的展示

parent e705e159
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-19 19:49:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-15 10:01:18
* @LastEditTime: 2021-09-22 14:59:18
* @Description: 新增退货发货单
*/
import React, { useState } from 'react';
......@@ -46,6 +46,7 @@ const ExchangeAddDeliverBill = () => {
relatedCount: item.replaceCount,
count: item.replaceCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -42,6 +42,7 @@ const ExchangeDeliverBillDetail = () => {
count: item.replaceDeliveryCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -47,6 +47,7 @@ const ExchangeAddWarehouseBill = () => {
billCount: item.replaceDeliveryCount,
count: item.replaceDeliveryCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -43,6 +43,7 @@ const ExchangeWarehouseBillDetail = () => {
count: item.storageCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -46,6 +46,7 @@ const ExchangeAddDeliverBill = () => {
relatedCount: item.replaceCount,
count: item.receiveCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -42,6 +42,7 @@ const ExchangeDeliverBillDetail = () => {
count: item.replaceDeliveryCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -47,6 +47,7 @@ const ExchangeAddWarehouseBill = () => {
billCount: item.replaceDeliveryCount,
count: item.replaceDeliveryCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -43,6 +43,7 @@ const ExchangeWarehouseBillDetail = () => {
count: item.storageCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 15:53:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-15 10:00:55
* @LastEditTime: 2021-09-22 14:49:33
* @Description: 新增退货发货单
*/
import React, { useState } from 'react';
......@@ -46,6 +46,7 @@ const ReturnAddDeliverBill = () => {
relatedCount: item.returnCount,
count: item.returnCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -42,6 +42,7 @@ const ReturnDeliverBillDetail = () => {
count: item.returnDeliveryCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -47,6 +47,7 @@ const ReturnAddWarehouseBill = () => {
billCount: item.returnDeliveryCount,
count: item.returnDeliveryCount,
})),
orderType: res.data.orderType,
});
}
reject();
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-16 15:30:19
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-15 10:01:42
* @LastEditTime: 2021-09-22 15:06:12
* @Description: 退货入库单详情
*/
import React from 'react';
......@@ -43,6 +43,7 @@ const ReturnWarehouseBillDetail = () => {
count: item.storageCount,
})),
remark: res.data.remark,
orderType: res.data.orderType,
});
}
reject();
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 11:33:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-16 15:06:14
* @LastEditTime: 2021-09-22 14:56:42
* @Description: 单据表单组件,提供基础的表单内容,单据明细相关由外部传入控制
*/
import React, { useEffect, useState } from 'react';
......@@ -167,7 +167,7 @@ const BillsFormPage: React.FC<IProps> = (props: IProps) => {
customEffects?.($, actions);
}}
schema={createSchema(relatedType, billType)}
schema={createSchema(relatedType, billType, relatedInfo?.orderType)}
editable={!!editable}
/>
</AnchorPage>
......
......@@ -104,6 +104,10 @@ export type RelatedInfoDataType = {
* 备注
*/
remark?: string,
/**
* 订单类型
*/
orderType: number,
}
export type RelatedInfoType = Omit<RelatedInfoDataType, 'billDetails'> & {
......@@ -115,6 +119,10 @@ export type RelatedInfoType = Omit<RelatedInfoDataType, 'billDetails'> & {
* 单据明细数据
*/
billDetails: BillDetailsItemValueType[],
/**
* 订单类型
*/
orderType: number,
}
export type BillSubmitValuesType = RelatedInfoType & {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 13:59:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 17:09:13
* @LastEditTime: 2021-09-22 14:55:11
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -27,6 +27,11 @@ import {
DEPENDENT_DOC_PRODUCTION,
DEPENDENT_DOC_INTERNAL,
} from '@/constants/commodity';
import {
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
export type BillDetailSchemaType = {
[key: string]: ISchema,
......@@ -96,13 +101,20 @@ const BILL_DIRECTION_REVER_NAME_MAP: { [key: number]: '收货' | '入库' | '发
[DOC_TYPE_EXCHANGE_RECEIPT]: '发货',
};
const createSchema = (relatedType: RelatedType, billType: number): ISchema => {
const createSchema = (relatedType: RelatedType, billType: number, orderType: number): ISchema => {
// 是否是收件人
const isConsignee = (
billType === DOC_TYPE_PURCHASE_RECEIPT
|| billType === DOC_TYPE_RETURN_RECEIPT
|| billType === DOC_TYPE_EXCHANGE_RETURN_RECEIPT
|| billType === DOC_TYPE_EXCHANGE_RECEIPT
);
// 是否是合同订单
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
return {
type: 'object',
properties: {
......@@ -323,7 +335,7 @@ const createSchema = (relatedType: RelatedType, billType: number): ISchema => {
},
},
productId: {
title: '商品ID',
title: !isMateriel ? '商品ID' : '物料编号',
type: 'string',
'x-component': 'Text',
'x-component-props': {
......@@ -331,7 +343,7 @@ const createSchema = (relatedType: RelatedType, billType: number): ISchema => {
},
},
productName: {
title: `${BILL_NAME_MAP[billType]}商品名称`,
title: !isMateriel ? `${BILL_NAME_MAP[billType]}商品名称` : `${BILL_NAME_MAP[billType]}物料名称、规格`,
type: 'string',
'x-component': 'Text',
'x-component-props': {
......
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