修复:总平台商品编辑时 无法编辑星级推荐、商品推荐的问题
This commit is contained in:
parent
ca198a4c11
commit
c810ab56ef
|
|
@ -929,18 +929,15 @@
|
|||
</el-row>
|
||||
<!-- 营销设置-->
|
||||
<el-row v-if="currentTab == '4'">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="星级推荐:">
|
||||
<el-rate class="rate_star" v-model="formValidate.star" :colors="colors" style="margin-top: 4px;"></el-rate>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品推荐:">
|
||||
<el-checkbox-group
|
||||
v-model="checkboxGroup"
|
||||
size="small"
|
||||
@change="onChangeGroup"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="(item, index) in recommend"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
>
|
||||
<el-checkbox-group v-model="checkboxGroup" size="small" @change="onChangeGroup">
|
||||
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
|
@ -969,7 +966,6 @@
|
|||
<span>为0或者空则使用商户默认设置(实际支付的金额 * 倍数)</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="是否开启礼包:">
|
||||
<el-radio-group v-model="formValidate.is_gift_bag" :disabled="$route.params.id ? true : false">
|
||||
|
|
@ -1179,7 +1175,7 @@
|
|||
<el-col v-bind="grid">
|
||||
<el-form-item label="排序:">
|
||||
<el-input-number
|
||||
v-model="formValidate.sort"
|
||||
v-model="formValidate.rank"
|
||||
controls-position="right"
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
|
|
@ -1439,9 +1435,13 @@ const defaultObj = {
|
|||
is_batch: 0, // 是否支持按批购买
|
||||
batch_num: 0, // 一批等于多少
|
||||
batch_unit: '', // 一批的单位
|
||||
sort: 0,
|
||||
rank: 0,
|
||||
once_max_count: 0,
|
||||
is_good: 0,
|
||||
is_benefit: 0,
|
||||
is_hot: 0,
|
||||
is_best: 0,
|
||||
is_new: 0,
|
||||
temp_id: '',
|
||||
video_link: '',
|
||||
guarantee_template_id: '',
|
||||
|
|
@ -1492,6 +1492,9 @@ const defaultObj = {
|
|||
// 积分抵扣
|
||||
integral_deduction_type: 0,
|
||||
integral_deduction_money: 0,
|
||||
// 其他营销内容设置
|
||||
star: 1,
|
||||
|
||||
}
|
||||
const objTitle = {
|
||||
price: {
|
||||
|
|
@ -1519,7 +1522,13 @@ const objTitle = {
|
|||
title: '体积(m³)'
|
||||
}
|
||||
}
|
||||
const proOptions = [{name: '店铺推荐', value: 'is_good'}]
|
||||
const proOptions = [
|
||||
{name: '店铺推荐', value: 'is_good'},
|
||||
{name: '热门榜单', value: 'is_hot'},
|
||||
{name: '促销单品', value: 'is_benefit'},
|
||||
{name: '精品推荐', value: 'is_best'},
|
||||
{name: '首发新品', value: 'is_new'}
|
||||
]
|
||||
export default {
|
||||
name: 'ProductProductAdd',
|
||||
components: {
|
||||
|
|
@ -1536,6 +1545,7 @@ export default {
|
|||
data() {
|
||||
const url = SettingMer.https + '/upload/image/0/file?ueditor=1&token=' + getToken()
|
||||
return {
|
||||
colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
|
||||
myConfig: {
|
||||
autoHeightEnabled: false, // 编辑器不自动被内容撑高
|
||||
initialFrameHeight: 500, // 初始容器高度
|
||||
|
|
@ -2133,9 +2143,11 @@ export default {
|
|||
this.$store.dispatch('tagsView/updateVisitedView', route)
|
||||
},
|
||||
onChangeGroup() {
|
||||
this.checkboxGroup.includes('is_good')
|
||||
? (this.formValidate.is_good = 1)
|
||||
: (this.formValidate.is_good = 0)
|
||||
this.checkboxGroup.includes('is_benefit') ? (this.formValidate.is_benefit = 1) : (this.formValidate.is_benefit = 0)
|
||||
this.checkboxGroup.includes('is_hot') ? (this.formValidate.is_hot = 1) : (this.formValidate.is_hot = 0)
|
||||
this.checkboxGroup.includes('is_best') ? (this.formValidate.is_best = 1) : (this.formValidate.is_best = 0)
|
||||
this.checkboxGroup.includes('is_new') ? (this.formValidate.is_new = 1) : (this.formValidate.is_new = 0)
|
||||
this.checkboxGroup.includes('is_good') ? (this.formValidate.is_good = 1) : (this.formValidate.is_good = 0)
|
||||
},
|
||||
watCh(val) {
|
||||
const tmp = {}
|
||||
|
|
@ -2699,10 +2711,15 @@ export default {
|
|||
cate_id: info.cate_id, // 平台分类id
|
||||
mer_cate_id: info.mer_cate_id || [], // 商户分类id
|
||||
unit_name: info.unit_name,
|
||||
sort: info.sort,
|
||||
rank: info.rank,
|
||||
once_max_count: info.once_max_count || 1,
|
||||
once_min_count: info.once_min_count || 0,
|
||||
is_good: info.is_good,
|
||||
is_good: info.is_good || 0,
|
||||
is_benefit: info.is_benefit || 0,
|
||||
is_hot: info.is_hot || 0,
|
||||
is_best: info.is_best || 0,
|
||||
is_new: info.is_new || 0,
|
||||
star: info.star || 1,
|
||||
temp_id: info.temp_id,
|
||||
guarantee_template_id: info.guarantee_template_id ? info.guarantee_template_id : "",
|
||||
attr: info.attr,
|
||||
|
|
@ -2764,9 +2781,13 @@ export default {
|
|||
this.ManyAttrValue = info.attrValue;
|
||||
this.generate();
|
||||
}
|
||||
if (this.formValidate.is_good === 1) {
|
||||
this.checkboxGroup.push("is_good");
|
||||
}
|
||||
|
||||
if (this.formValidate.is_benefit === 1) this.checkboxGroup.push("is_benefit");
|
||||
if (this.formValidate.is_hot === 1) this.checkboxGroup.push("is_hot");
|
||||
if (this.formValidate.is_best === 1) this.checkboxGroup.push("is_best");
|
||||
if (this.formValidate.is_new === 1) this.checkboxGroup.push("is_new");
|
||||
if (this.formValidate.is_good === 1) this.checkboxGroup.push("is_good");
|
||||
|
||||
this.getAttr();
|
||||
this.fullscreenLoading = false;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@
|
|||
<el-table-column prop="stock" label="商品状态" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="switch-content" v-if="scope.row.mer_id <= 0">
|
||||
<el-switch :value="Number(scope.row.us_status) == 1" active-text="上架" inactive-text="下架" @change="changeStatus(scope.row)" />
|
||||
<el-switch :value="Number(scope.row.is_show) == 1" active-text="上架" inactive-text="下架" @change="changeStatus(scope.row)" />
|
||||
</div>
|
||||
<span v-else>{{ scope.row.us_status | productStatusFilter }}</span>
|
||||
</template>
|
||||
|
|
@ -451,7 +451,7 @@ export default {
|
|||
// 修改商品状态
|
||||
changeStatus(row){
|
||||
// 状态取反
|
||||
let status = Number(row.us_status) == 1 ? 0 : 1;
|
||||
let status = Number(row.is_show) == 1 ? 0 : 1;
|
||||
// 发起请求
|
||||
changeProductStatus(row.product_id, status).then(({message}) => {
|
||||
this.$message.success(message)
|
||||
|
|
|
|||
Loading…
Reference in New Issue