Commit 942fda90 authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善代码逻辑

parent 43d435bf
......@@ -37,7 +37,7 @@ import {
const addSchemaAction = createFormActions();
const {
onFormInputChange$,
onFieldValueChange$,
onFieldInputChange$,
onFormInit$,
} = FormEffectHooks;
......@@ -146,7 +146,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
const childTableColumn: ColumnType<any>[] = [
!isMateriel ?{
title: 'ID',
title: '商品ID',
dataIndex: 'productId',
align: 'center',
} : {
......@@ -162,21 +162,21 @@ const RepairForm: React.FC<BillsFormProps> = ({
title: '物料名称、规格',
dataIndex: 'materialName',
align: 'center',
render: (text, record) => `${text}${record.materialType}`,
render: (text, record) => `${text}/${record.materialType}`,
},
{
title: '品类',
dataIndex: 'category',
dataIndex: !isMateriel ? 'category' : 'materialCategory',
align: 'center',
},
{
title: '品牌',
dataIndex: 'brand',
dataIndex: !isMateriel ? 'brand' : 'materialBrand',
align: 'center',
},
{
title: '单位',
dataIndex: 'unit',
dataIndex: !isMateriel ? 'unit' : 'materialUnit',
align: 'center',
},
{
......@@ -271,7 +271,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
,
...rest,
});
getRepairGoods();
setOrderTypeValue(rest.orderType);
}
}).finally(() => {
setInfoLoading(false);
......@@ -351,6 +351,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
useEffect(() => {
getDetailInfo();
getOrderDetailInfo();
getRepairGoods();
}, []);
const handleAddGoods = () => {
......@@ -396,7 +397,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
setSubmitLoading(true);
const payload = {
repairId: id || 0, // 有 id 表示编辑,0表示新增
repairId: +id || 0, // 有 id 表示编辑,0表示新增
supplierMemberId: supplierMember[0].memberId,
supplierRoleId: supplierMember[0].roleId,
supplierName: supplierMember[0].name,
......@@ -589,7 +590,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
}
});
onFieldValueChange$('orderType').subscribe(fieldState => {
onFieldInputChange$('orderType').subscribe(fieldState => {
setOrderTypeValue(fieldState.value);
});
}}
......
......@@ -306,16 +306,6 @@ export const addSchema = (orderType: number): ISchema => {
title: '物料名称、规格',
'x-component': 'Text',
},
materielName: {
type: 'string',
title: '物料名称',
'x-component': 'Text',
},
materielType: {
type: 'string',
title: '规格',
'x-component': 'Text',
},
materielCategory: {
type: 'string',
title: '品类',
......
......@@ -34,7 +34,7 @@ import {
const addSchemaAction = createFormActions();
const {
onFormInputChange$,
onFieldValueChange$,
onFieldInputChange$,
onFormInit$,
} = FormEffectHooks;
......@@ -146,29 +146,38 @@ const ReturnForm: React.FC<BillsFormProps> = ({
].filter(Boolean) as ColumnType<any>[];
const childTableColumn: ColumnType<any>[] = [
{
!isMateriel ?{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
} : {
title: '物料编号',
dataIndex: 'materialCode',
align: 'center',
},
{
!isMateriel ? {
title: '商品名称',
dataIndex: 'productName',
align: 'center',
} : {
title: '物料名称、规格',
dataIndex: 'materialName',
align: 'center',
render: (text, record) => `${text}/${record.materialType}`,
},
{
title: '品类',
dataIndex: 'category',
dataIndex: !isMateriel ? 'category' : 'materialCategory',
align: 'center',
},
{
title: '品牌',
dataIndex: 'brand',
dataIndex: !isMateriel ? 'brand' : 'materialBrand',
align: 'center',
},
{
title: '单位',
dataIndex: 'unit',
dataIndex: !isMateriel ? 'unit' : 'materialUnit',
align: 'center',
},
{
......@@ -304,6 +313,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
associated: !item.materielId ? '' : `${item.productId}/${item.productName}/${item.category}/${item.brand}`,
materielNameAndType: `${item.materielName || ''}${item.materielType ? '/' + item.materielType : ''}`,
})));
setOrderTypeValue(rest.orderType);
setGoodsValue(goodsDetailList.map(item => item.orderRecordId));
}
}).finally(() => {
......@@ -414,7 +424,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const payload = {
...rest,
returnId: id || 0,
returnId: +id || 0,
supplierMemberId: supplierMember[0].memberId,
supplierRoleId: supplierMember[0].roleId,
supplierMemberName: supplierMember[0].name,
......@@ -714,7 +724,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
}
});
onFieldValueChange$('orderType').subscribe(fieldState => {
onFieldInputChange$('orderType').subscribe(fieldState => {
setOrderTypeValue(fieldState.value);
});
}}
......
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