|
@@ -764,7 +764,7 @@ export default {
|
|
|
},
|
|
|
async save({ state, commit, dispatch }, payload) {
|
|
|
if (state.hotData) {
|
|
|
- if (state.hotData.type == 'waterfall' && !state.hotData.brandId) {
|
|
|
+ if (state.hotData.type == 'waterfall' && !state.hotData.brand) {
|
|
|
return Promise.reject({ type: 'toast', tips: 'warn', msg: 'tag.toolbox.chooseBrand' })
|
|
|
}
|
|
|
if (state.hotData.title.trim() == '') {
|
|
@@ -946,11 +946,18 @@ export default {
|
|
|
|
|
|
let addparams = {}
|
|
|
addparams['hotType'] = customized[type].hotType
|
|
|
-
|
|
|
+ let newBrand = null
|
|
|
//处理商品关联id
|
|
|
if (type != 'waterfall') {
|
|
|
delete hotData.brandId
|
|
|
delete hotData.brand
|
|
|
+ } else {
|
|
|
+ if (hotData.brandId && hotData.brand) {
|
|
|
+ addparams['brandId'] = hotData.brandId
|
|
|
+ newBrand = hotData.brand
|
|
|
+ delete hotData.brandId
|
|
|
+ delete hotData.brand
|
|
|
+ }
|
|
|
}
|
|
|
if (type === 'commodity' || type === 'waterfall' || type === 'exhibits') {
|
|
|
addparams['relationIds'] = hotData.products.map(item => item.id)
|
|
@@ -988,18 +995,18 @@ export default {
|
|
|
delete hotData.visiblePanos
|
|
|
}
|
|
|
let data = null
|
|
|
- if (hotData.brandId) {
|
|
|
- data = {
|
|
|
- sid: hotData.sid,
|
|
|
- brandId: hotData.brandId,
|
|
|
- hotData: JSON.stringify(hotData),
|
|
|
- }
|
|
|
- } else {
|
|
|
- data = {
|
|
|
- sid: hotData.sid,
|
|
|
- hotData: JSON.stringify(hotData),
|
|
|
- }
|
|
|
+ // if (hotData.brandId) {
|
|
|
+ // data = {
|
|
|
+ // sid: hotData.sid,
|
|
|
+ // brandId: hotData.brandId,
|
|
|
+ // hotData: JSON.stringify(hotData),
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ data = {
|
|
|
+ sid: hotData.sid,
|
|
|
+ hotData: JSON.stringify(hotData),
|
|
|
}
|
|
|
+ // }
|
|
|
tagList.push(data)
|
|
|
}
|
|
|
}
|
|
@@ -1007,26 +1014,26 @@ export default {
|
|
|
|
|
|
// state.changeTagsList = []
|
|
|
} else {
|
|
|
- if (hotData.brandId) {
|
|
|
- tagList.push({
|
|
|
- sid: hotData.sid,
|
|
|
- brandId: hotData.brandId,
|
|
|
- hotData: JSON.stringify({
|
|
|
- ...hotData,
|
|
|
- products: [],
|
|
|
- }),
|
|
|
- ...addparams,
|
|
|
- })
|
|
|
- } else {
|
|
|
- tagList.push({
|
|
|
- sid: hotData.sid,
|
|
|
- hotData: JSON.stringify({
|
|
|
- ...hotData,
|
|
|
- products: [],
|
|
|
- }),
|
|
|
- ...addparams,
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (hotData.brandId) {
|
|
|
+ // tagList.push({
|
|
|
+ // sid: hotData.sid,
|
|
|
+ // brandId: hotData.brandId,
|
|
|
+ // hotData: JSON.stringify({
|
|
|
+ // ...hotData,
|
|
|
+ // products: [],
|
|
|
+ // }),
|
|
|
+ // ...addparams,
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ tagList.push({
|
|
|
+ sid: hotData.sid,
|
|
|
+ hotData: JSON.stringify({
|
|
|
+ ...hotData,
|
|
|
+ products: [],
|
|
|
+ }),
|
|
|
+ ...addparams,
|
|
|
+ })
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
console.error(hotData)
|
|
@@ -1046,6 +1053,9 @@ export default {
|
|
|
}
|
|
|
let data = await dispatch('svaeTag', params)
|
|
|
if (data.success) {
|
|
|
+ if (newBrand) {
|
|
|
+ hotData.brand = newBrand
|
|
|
+ }
|
|
|
commit('save', hotData)
|
|
|
}
|
|
|
return data
|