Commit f8309c68 authored by XieZhiXiong's avatar XieZhiXiong

feat: 调整售后维修字段

parent 86655bf0
......@@ -384,8 +384,6 @@ const RepairForm: React.FC<BillsFormProps> = ({
...rest
} = values;
console.log('values', values)
setSubmitLoading(true);
const payload = {
repairId: id || 0, // 有 id 表示编辑,0表示新增
......@@ -410,13 +408,13 @@ const RepairForm: React.FC<BillsFormProps> = ({
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 : '',
materielId: extraData.materiel ? extraData.materiel.materielId : 0,
materielNo: extraData.materiel ? extraData.materiel.materielNo : '',
materielName: extraData.materiel ? extraData.materiel.materielName : '',
materielType: extraData.materiel ? extraData.materiel.materielType : '',
materielCategory: extraData.materiel ? extraData.materiel.materielCategory : '',
materielBrand: extraData.materiel ? extraData.materiel.materielBrand : '',
materielUnit: extraData.materiel ? extraData.materiel.materielUnit : '',
...rest,
})),
...rest,
......@@ -472,29 +470,30 @@ const RepairForm: React.FC<BillsFormProps> = ({
values.forEach(item => {
const atom = {
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,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
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: '',
associated: !isMateriel ? '' : `${item.productId}/${item.productName}/${item.category}/${item.brand}`,
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,
materiel: !isMateriel ? null : {
materielId: item.materialId,
materielNo: item.materialCode,
materielName: item.materialName,
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