Commit f8309c68 authored by XieZhiXiong's avatar XieZhiXiong

feat: 调整售后维修字段

parent 86655bf0
...@@ -384,8 +384,6 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -384,8 +384,6 @@ 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表示新增
...@@ -410,13 +408,13 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -410,13 +408,13 @@ const RepairForm: React.FC<BillsFormProps> = ({
repairCount: +repairCount, repairCount: +repairCount,
brand: brand || '', brand: brand || '',
unit: unit || '', unit: unit || '',
associatedGoods: extraData.productInfo ? extraData.productInfo.productName : '', materielId: extraData.materiel ? extraData.materiel.materielId : 0,
associatedDataId: extraData.productInfo ? extraData.productInfo.productId : '', materielNo: extraData.materiel ? extraData.materiel.materielNo : '',
associatedMaterielNo: '', materielName: extraData.materiel ? extraData.materiel.materielName : '',
associatedMaterielName: '', materielType: extraData.materiel ? extraData.materiel.materielType : '',
associatedType: '', materielCategory: extraData.materiel ? extraData.materiel.materielCategory : '',
associatedCategory: extraData.productInfo ? extraData.productInfo.category : '', materielBrand: extraData.materiel ? extraData.materiel.materielBrand : '',
associatedBrand: extraData.productInfo ? extraData.productInfo.brand : '', materielUnit: extraData.materiel ? extraData.materiel.materielUnit : '',
...rest, ...rest,
})), })),
...rest, ...rest,
...@@ -472,29 +470,30 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -472,29 +470,30 @@ const RepairForm: React.FC<BillsFormProps> = ({
values.forEach(item => { values.forEach(item => {
const atom = { const atom = {
orderNo: item.orderNo, orderNo: item.orderNo,
productId: !isMateriel ? item.productId : item.materialId, productId: item.productId,
productName: !isMateriel ? item.productName : item.materialName, productName: item.productName,
category: !isMateriel ? item.category : item.materialCategory, category: item.category,
brand: !isMateriel ? item.brand : item.materialBrand, brand: item.brand,
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, isHasTax: item.taxInclusive,
taxRate: item.taxRate, taxRate: item.taxRate,
contractId: item.contractId, contractId: item.contractId,
contractNo: item.contractNo, contractNo: item.contractNo,
repairReason: '', repairReason: '',
associated: !isMateriel ? '' : `${item.productId}/${item.productName}/${item.category}/${item.brand}`,
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 : { materiel: !isMateriel ? null : {
productName: item.productName, materielId: item.materialId,
productId: item.productId, materielNo: item.materialCode,
category: item.category, materielName: item.materialName,
brand: item.brand, materielType: item.materialType,
materielCategory: item.materialCategory,
materielBrand: item.materialBrand,
materielUnit: '',
}, },
}, },
}; };
......
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