|
|
@ -132,7 +132,8 @@ export default class MultiSpec { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 生成并获取多规格数据
|
|
|
|
// 生成并获取多规格数据
|
|
|
|
getData (specList = [], skuList = []) { |
|
|
|
getData(specList = [], skuList = []) { |
|
|
|
|
|
|
|
console.log(specList, skuList, 136) |
|
|
|
if (specList.length) { |
|
|
|
if (specList.length) { |
|
|
|
this.multiSpecData.specList = _.cloneDeep(specList) |
|
|
|
this.multiSpecData.specList = _.cloneDeep(specList) |
|
|
|
this.multiSpecData.skuList = _.cloneDeep(skuList) |
|
|
|
this.multiSpecData.skuList = _.cloneDeep(skuList) |
|
|
@ -219,13 +220,18 @@ export default class MultiSpec { |
|
|
|
if (!oldSkuList.length || !newSkuList.length) { |
|
|
|
if (!oldSkuList.length || !newSkuList.length) { |
|
|
|
return newSkuList |
|
|
|
return newSkuList |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(oldSkuList, newSkuList) |
|
|
|
for (const index in newSkuList) { |
|
|
|
for (const index in newSkuList) { |
|
|
|
// 查找符合的旧记录
|
|
|
|
// 查找符合的旧记录
|
|
|
|
let oldSkuItem = {} |
|
|
|
let oldSkuItem = {} |
|
|
|
// if (oldSkuList.length === newSkuList.length) {
|
|
|
|
// if (oldSkuList.length === newSkuList.length) {
|
|
|
|
// oldSkuItem = _.cloneDeep(oldSkuList[index])
|
|
|
|
// oldSkuItem = _.cloneDeep(oldSkuList[index])
|
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
oldSkuItem = oldSkuList.find(item => newSkuList[index].tempId === item.goods_props.map(v => v.value.name).join('_')) |
|
|
|
oldSkuItem = oldSkuList.find( |
|
|
|
|
|
|
|
(item) => |
|
|
|
|
|
|
|
newSkuList[index].tempId === |
|
|
|
|
|
|
|
(item.goods_props && item.goods_props.length > 0) ? item.goods_props.map((v) => v.value.name).join('_') : item.tempId |
|
|
|
|
|
|
|
) |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
const item = newSkuList[index] |
|
|
|
const item = newSkuList[index] |
|
|
|