Commit 1a23251a authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接 v2售后维修相关

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