Commit 204a333f authored by 陈万宝's avatar 陈万宝

feat: 修复保存草稿数据问题

parent c11440e5
......@@ -451,7 +451,7 @@ const ServiceGoods = options => {
!info.infoMation ||
!info.infoMation.name ||
!info.infoMation.categoryId
// (info.infoMation.categoryId.length !== 3 && info.type !== 5)
// info.infoMation.categoryId.length !== 3 // 不能限制长度必须为3
) {
message.warning('请添加商品类目和名称');
return;
......@@ -463,20 +463,23 @@ const ServiceGoods = options => {
info.type = productType;
let arr = newCategoryList[info.type];
const first = arr.find(item => item.id === info.infoMation.categoryId[0]);
arr = first.children;
const second = arr.find(item => item.id === info.infoMation.categoryId[1]);
arr = second.children;
const third = arr.find(item => item.id === info.infoMation.categoryId[2]);
let second = '';
let third = '';
if (arr.length) {
arr = first?.children;
second = arr?.find(item => item.id === info.infoMation.categoryId[1]) || '';
arr = second?.children;
third = arr?.find(item => item.id === info.infoMation.categoryId[2]) || '';
}
const params = {
productName: info.infoMation.name,
productType: info.type,
firstCategoryId: info.infoMation.categoryId[0],
firstCategoryName: first.name,
secondCategoryId: info.infoMation.categoryId[1],
secondCategoryName: second.name,
secondCategoryName: second?.name || '',
thirdCategoryId: info.infoMation.categoryId[2],
thirdCategoryName: third?.name,
thirdCategoryName: third?.name || '',
content: JSON.stringify(info),
};
console.log('params :>> ', params);
......
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