Commit 700178c7 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加积分订单展示相关

parent 4e57c28a
......@@ -99,6 +99,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const [goodsValue, setGoodsValue] = useState([]);
const [submitLoading, setSubmitLoading] = useState(false);
const [visibleGoodsDrawer, setVisibleGoodsDrawer] = useState(false);
const [applyType, setApplyType] = useState(1);
const tableColumn: ColumnType<any>[] = [
{
......@@ -190,15 +191,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const setColumnsTitle = (orderType: number) => {
const isPointsOrder = orderType === ORDER_TYPE2_POINTS || orderType === ORDER_TYPE2_CHANNEL_POINTS;
// addSchemaAction.setFieldState('replaceGoodsList.*.purchasePrice', state => {
// state.title = !isPointsOrder ? '采购单价' : '所需积分';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseCount', state => {
// state.title = !isPointsOrder ? '采购数量' : '兑换数量';
// });
// addSchemaAction.setFieldState('replaceGoodsList.*.purchaseAmount', state => {
// state.title = !isPointsOrder ? '采购金额' : '所需积分小计';
// });
setApplyType(isPointsOrder ? 2 : 1);
};
// 根据供应会员获取订单列表
......@@ -644,7 +637,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={addBillSchema}
schema={addBillSchema(applyType)}
/>
</Card>
......
......@@ -68,7 +68,11 @@ const supplierSchema: ISchema = {
},
};
export const addBillSchema: ISchema = {
/**
*
* @param type 类型目前只有 1.普通的 跟 2.积分的
*/
export const addBillSchema = (applyType: number): ISchema => ({
type: 'object',
properties: {
REPOSIT_TABS: {
......@@ -264,17 +268,17 @@ export const addBillSchema: ISchema = {
},
purchaseCount: {
type: 'string',
title: '采购数量',
title: applyType !== 2 ? '采购数量' : '兑换数量',
'x-component': 'Text',
},
purchasePrice: {
type: 'string',
title: '采购单价',
title: applyType !== 2 ? '采购单价' : '所需积分',
'x-component': 'Text',
},
purchaseAmount: {
type: 'string',
title: '采购金额',
title: applyType !== 2 ? '采购金额' : '所需积分小计',
'x-component': 'Text',
},
replaceCount: {
......@@ -457,4 +461,4 @@ export const addBillSchema: ISchema = {
},
},
},
};
\ No newline at end of file
});
\ No newline at end of file
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