Commit a265f520 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 7dc42c14 d2d60411
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-23 09:59:10
* @LastEditTime: 2021-10-26 10:32:48
* @Description: 维修商品抽屉组件
*/
import React from 'react';
......@@ -180,7 +180,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
const newData: { [key: string]: any }[] = data.map((item) => ({
...item,
id: item.orderId,
products: item.products.map(({ productId, ...rest }) => ({
products: item.products.map(({ productId, logo, ...rest }) => ({
id: productId,
...rest,
quantity: +rest.quantity,
......@@ -193,6 +193,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
orderType: item.orderType,
contractId: item.contractId,
contractNo: item.contractNo,
skuPic: logo,
shopId: item.shopId,
shopLogo: item.logo,
shopName: item.vendorMemberName,
})),
}));
newData.forEach((item) => {
......
......@@ -360,6 +360,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
replaceId,
manualReplaceGoodsAddress,
returnBatch,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -414,6 +417,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
orderId: item.orderId,
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
shopName,
shopId,
shopLogo,
})),
...rest,
});
......@@ -585,7 +591,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
unit,
extraData,
associated,
materielNameAndType,
shopId,
shopLogo,
shopName,
...rest
}) => ({
...rest,
......@@ -594,7 +602,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
orderRecordId: extraData.id,
replaceCount: +replaceCount,
})),
taskTypeKey: replaceGoodsList[0].extraData.taskTypeKey,
taskTypeKey: replaceGoodsList[0].extraData.taskTypeKey,
shopId: replaceGoodsList[0].shopId,
shopLogo: replaceGoodsList[0].shopLogo,
shopName: replaceGoodsList[0].shopName,
};
PublicApi.postAsReplaceGoodsSave(payload)
......@@ -681,6 +692,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -90,6 +90,21 @@ const OrderNo = (props: OrderNoProps) => {
};
OrderNo.isFieldComponent = true;
type ExtraType = {
/**
* 商城名称
*/
shopName: string,
/**
* 商城id
*/
shopId: number,
/**
* 商城logo
*/
shopLogo: string,
}
const RepairForm: React.FC<BillsFormProps> = ({
id,
isEdit = false,
......@@ -201,7 +216,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
];
// 获取维修明细列表
const getRepairGoods = () => {
const getRepairGoods = (extra: ExtraType) => {
if (!id) {
return;
}
......@@ -220,6 +235,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 已维修数量,这里取 采购数量判断即可
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
...extra,
})));
setGoodsValue(res.data && res.data.data ? res.data.data.map(item => item.orderRecordId) : []);
}
......@@ -254,6 +270,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
outerRecordList,
outerStatus,
outerTaskList,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -264,6 +283,12 @@ const RepairForm: React.FC<BillsFormProps> = ({
}
);
getRepairGoods({
shopName,
shopId,
shopLogo,
});
setOrderTypeValue(rest.orderType);
setDetailInfo({
...detailInfo,
......@@ -377,7 +402,6 @@ const RepairForm: React.FC<BillsFormProps> = ({
useEffect(() => {
getDetailInfo();
getOrderDetailInfo();
getRepairGoods();
}, []);
const handleAddGoods = () => {
......@@ -438,7 +462,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
unit,
extraData,
associated,
materielNameAndType,
shopId,
shopLogo,
shopName,
...rest
}) => ({
orderId: extraData.orderId,
......@@ -448,7 +474,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
unit: unit || '',
...rest,
})),
...rest,
...rest,
shopId: repairGoodsList[0].shopId,
shopLogo: repairGoodsList[0].shopLogo,
shopName: repairGoodsList[0].shopName,
};
PublicApi.postAsRepairGoodsSave(payload)
......@@ -528,6 +557,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -368,6 +368,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
returnId,
roleId,
refundList,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -417,6 +420,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 可退货数量,这里取 采购数量判断即可
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
shopId,
shopLogo,
shopName,
})),
...rest,
});
......@@ -587,6 +593,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
associated,
returnCount,
refundAmount,
shopId,
shopLogo,
shopName,
...rest
}) => ({
...rest,
......@@ -608,7 +617,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
};
}),
})),
taskTypeKey: returnGoodsList[0].extraData.taskTypeKey,
taskTypeKey: returnGoodsList[0].extraData.taskTypeKey,
shopId: returnGoodsList[0].shopId,
shopLogo: returnGoodsList[0].shopLogo,
shopName: returnGoodsList[0].shopName,
};
PublicApi.postAsReturnGoodsSave(payload)
......@@ -707,6 +719,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -143,8 +143,12 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
_fetch && _fetch(_params).then((res) => {
message.destroy()
if (res.code === 1000) {
setDataSource(res.data?.data || []);
setTotalCount(res.data?.totalCount ?? res.data.length);
if (Array.isArray(res.data)) {
setDataSource(res.data || []);
setTotalCount(res.data.length);
} else {
setDataSource(res.data?.data || []);
}
} else {
setDataSource([])
setTotalCount(0);
......
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