Commit 1a23251a authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接 v2售后维修相关

parent e1ae334e
...@@ -234,6 +234,8 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -234,6 +234,8 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
orderNo: item.orderNo, orderNo: item.orderNo,
payInfoList: item.payInfoList, payInfoList: item.payInfoList,
orderType: item.type, orderType: item.type,
contractId: item.contractId,
contractNo: item.contractNo,
}); });
} }
}); });
......
...@@ -146,15 +146,24 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -146,15 +146,24 @@ const RepairForm: React.FC<BillsFormProps> = ({
].filter(Boolean) as ColumnType<any>[]; ].filter(Boolean) as ColumnType<any>[];
const childTableColumn: ColumnType<any>[] = [ const childTableColumn: ColumnType<any>[] = [
{ !isMateriel ?{
title: 'ID', title: 'ID',
dataIndex: 'productId', dataIndex: 'productId',
align: 'center', align: 'center',
} : {
title: '物料编号',
dataIndex: 'materialCode',
align: 'center',
}, },
{ !isMateriel ? {
title: '商品名称', title: '商品名称',
dataIndex: 'productName', dataIndex: 'productName',
align: 'center', align: 'center',
} : {
title: '物料名称、规格',
dataIndex: 'materialName',
align: 'center',
render: (text, record) => `${text}${record.materialType}`,
}, },
{ {
title: '品类', title: '品类',
...@@ -375,6 +384,8 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -375,6 +384,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
...rest ...rest
} = values; } = values;
console.log('values', values)
setSubmitLoading(true); setSubmitLoading(true);
const payload = { const payload = {
repairId: id || 0, // 有 id 表示编辑,0表示新增 repairId: id || 0, // 有 id 表示编辑,0表示新增
...@@ -387,18 +398,26 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -387,18 +398,26 @@ const RepairForm: React.FC<BillsFormProps> = ({
filePath: item.url, filePath: item.url,
})), })),
repairGoodsList: repairGoodsList.map(({ repairGoodsList: repairGoodsList.map(({
repairCount, repairCount,
brand, brand,
unit, unit,
extraData, extraData,
associated,
...rest ...rest
}) => ({ }) => ({
orderId: extraData.orderId, orderId: extraData.orderId,
orderRecordId: extraData.id, orderRecordId: extraData.id,
repairCount: +repairCount, repairCount: +repairCount,
brand: brand || '', brand: brand || '',
unit: unit || '', unit: unit || '',
...rest, associatedGoods: extraData.productInfo ? extraData.productInfo.productName : '',
associatedDataId: extraData.productInfo ? extraData.productInfo.productId : '',
associatedMaterielNo: '',
associatedMaterielName: '',
associatedType: '',
associatedCategory: extraData.productInfo ? extraData.productInfo.category : '',
associatedBrand: extraData.productInfo ? extraData.productInfo.brand : '',
...rest,
})), })),
...rest, ...rest,
}; };
...@@ -452,18 +471,31 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -452,18 +471,31 @@ const RepairForm: React.FC<BillsFormProps> = ({
values.forEach(item => { values.forEach(item => {
const atom = { const atom = {
orderNo: item.orderNo, orderNo: item.orderNo,
productId: item.productId, productId: !isMateriel ? item.productId : item.materialId,
productName: item.productName, productName: !isMateriel ? item.productName : item.materialName,
category: item.category, category: !isMateriel ? item.category : item.materialCategory,
brand: item.brand, brand: !isMateriel ? item.brand : item.materialBrand,
unit: item.unit, unit: item.unit,
materielNo: !isMateriel ? '' : item.materialCode,
type: !isMateriel ? '' : item.materialType,
associated: !isMateriel ? '' : `${item.productId}/${item.productName}/${item.category}/${item.brand}`,
purchaseCount: item.purchaseCount, purchaseCount: item.purchaseCount,
isHasTax: item.taxInclusive,
taxRate: item.taxRate,
contractId: item.contractId,
contractNo: item.contractNo,
repairReason: '', repairReason: '',
extraData: { extraData: {
id: item.id, id: item.id,
orderId: item.orderId, orderId: item.orderId,
remaining: item.purchaseCount - (item.repairCount || 0), // 可维修数量 remaining: item.purchaseCount - (item.repairCount || 0), // 可维修数量
productInfo: !isMateriel ? null : {
productName: item.productName,
productId: item.productId,
category: item.category,
brand: item.brand,
},
}, },
}; };
value.push(atom); value.push(atom);
......
...@@ -296,14 +296,19 @@ export const addSchema = (orderType: number): ISchema => { ...@@ -296,14 +296,19 @@ export const addSchema = (orderType: number): ISchema => {
title: '订单号', title: '订单号',
'x-component': 'OrderNo', 'x-component': 'OrderNo',
}, },
productId: { materielNo: {
type: 'string', type: 'string',
title: '物料编号', title: '物料编号',
'x-component': 'Text', 'x-component': 'Text',
}, },
productName: { productName: {
type: 'string', type: 'string',
title: '物料名称、规格', title: '物料名称',
'x-component': 'Text',
},
type: {
type: 'string',
title: '规格',
'x-component': 'Text', 'x-component': 'Text',
}, },
category: { category: {
...@@ -321,7 +326,7 @@ export const addSchema = (orderType: number): ISchema => { ...@@ -321,7 +326,7 @@ export const addSchema = (orderType: number): ISchema => {
title: '单位', title: '单位',
'x-component': 'Text', 'x-component': 'Text',
}, },
aaa: { associated: {
type: 'string', type: 'string',
title: orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌', title: orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
'x-component': 'Text', 'x-component': 'Text',
......
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