Commit a96f3fdf by 张立顺

fix 采购商城规格默认选中问题修复

1 parent bce1ea18
...@@ -785,31 +785,6 @@ export default { ...@@ -785,31 +785,6 @@ export default {
item.skuId = '' item.skuId = ''
item.skusTypes = item.specificationValues.map((el, elIndex) => { item.skusTypes = item.specificationValues.map((el, elIndex) => {
let skuItem = goodType[elIndex].propertyList.find((skuItem, skuItemIndex) => { let skuItem = goodType[elIndex].propertyList.find((skuItem, skuItemIndex) => {
// console.log(skuItem.name == el, skuItem.name, el)
// 取第一个默认选中
if (skuItem.name == el && index == 0) {
// if (skuItem.name == el && index == res.upgradeGoodsSpecificationValueDTOS.length - 1) {
// goodType[elIndex].propertyList[skuItemIndex].selected = true
// // // 记录选中的值
// this.selectItemList.push({
// grounpId: goodType[elIndex].id,
// id: skuItem.id,
// index: elIndex,
// i: skuItemIndex
// })
// setTimeout(() => {
// console.log(item.id, item)
// // this.handleClickSpecs1(el, skuItem.id, skuItem, index, skuItemIndex)
// // goodType[elIndex].propertyList[skuItemIndex].selected = true
// // // 记录选中的值
// // this.selectItemList.push({
// // grounpId: goodType[elIndex].id,
// // id: skuItem.id,
// // index: elIndex,
// // i: skuItemIndex
// // })
// }, 0)
}
return skuItem.name == el return skuItem.name == el
}) })
...@@ -842,13 +817,14 @@ export default { ...@@ -842,13 +817,14 @@ export default {
let sku = norSelectSkus.skusTypes[index] let sku = norSelectSkus.skusTypes[index]
this.handleClickSpecs1(item.id, sku.propertyId, sku, index, sku.index) this.handleClickSpecs1(item.id, sku.propertyId, sku, index, sku.index)
}) })
this.goodsInfo = res
} else { } else {
this.goodsInfo = res
// 默认选中第一个 // 默认选中第一个
let item = this.goodsInfo.upgradeGoodsList[0] let item = this.goodsInfo.upgradeGoodsList[0]
this.setHandleItemInfo(item) this.setHandleItemInfo(item)
} }
this.goodsInfo = res
this.tableInfo = res?.upgradeGoodsList?.merchantGoodsInfoList this.tableInfo = res?.upgradeGoodsList?.merchantGoodsInfoList
}) })
}, },
...@@ -882,7 +858,6 @@ export default { ...@@ -882,7 +858,6 @@ export default {
if (flag) { if (flag) {
return this.$message.error('请选择规格') return this.$message.error('请选择规格')
} }
// this.goodsInfo
orgdata.skus.find(item => { orgdata.skus.find(item => {
console.log(item, item.skuId, selectId) console.log(item, item.skuId, selectId)
if (item.skuId == selectId) { if (item.skuId == selectId) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!