修改管理后台产品管理

This commit is contained in:
lcc
2025-07-13 20:32:56 +08:00
parent 8c14bc7fa0
commit a4e0ab2574
3 changed files with 334 additions and 31 deletions
@@ -146,6 +146,16 @@
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="核销卖点:">
<el-checkbox-group v-model="form.carProductLabel">
<el-checkbox
v-for="value in couponSelling"
:label="value.dictDataId"
:key="value.dictDataId"
>{{ value.dictDataName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="推广文案:">
<div
style="margin: 8px 0"
@@ -274,7 +284,8 @@
//能源类型
productLevel: '',
//产品标签
carProductLabel: ''
carProductLabel: '',
couponSelling: []
};
},
computed: {
@@ -296,6 +307,9 @@
listDictionaryData({ dictCode: 'carProductLabel' }).then((data) => {
this.carProductLabel = data;
});
listDictionaryData({ dictCode: 'couponSelling' }).then((data) => {
this.couponSelling = data;
});
},
methods: {
/* 保存编辑 */
+84 -17
View File
@@ -28,20 +28,6 @@
:key="componentKey"
/>
</el-col>
<el-col :md="12" :sm="12">
<el-form-item label="上架时间:">
<el-date-picker
unlink-panels
v-model="where.dateRange"
range-separator="-"
type="daterange"
end-placeholder="结束日期"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
class="ele-fluid"
/>
</el-form-item>
</el-col>
<!--
<el-col :md="12" :sm="12">
<el-form-item label="补贴金额:">
@@ -71,6 +57,56 @@
/>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="价格区间:">
<el-select v-model="where.priceRange" multiple>
<el-option
v-for="item in priceRange"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="车辆级别:">
<el-select v-model="where.carProductLabel" multiple>
<el-option
v-for="item in carProductLabel"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="能源类型:">
<el-select v-model="where.productLevel" multiple>
<el-option
v-for="item in productLevel"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12">
<el-form-item label="上架时间:">
<el-date-picker
unlink-panels
v-model="where.dateRange"
range-separator="-"
type="daterange"
end-placeholder="结束日期"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
class="ele-fluid"
/>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<div class="ele-form-actions">
<el-button
@@ -202,6 +238,7 @@
</template>
<script>
import { listDictionaryData } from '@/api/system/dictionary-data';
import {
pageProduct,
removeProduct,
@@ -227,7 +264,10 @@
status: '',
dateRange: '',
minPrice: '',
maxPrice: ''
maxPrice: '',
priceRange: [],
carProductLabel: [],
productLevel: []
},
// 表格列配置
columns: [
@@ -295,10 +335,37 @@
// 佣金编辑框
showEditBrokerage: false,
showCityName: false,
cityNames: []
cityNames: [],
//价格区间
priceRange: [],
//能源类型
productLevel: [],
//产品标签
carProductLabel: [],
//用户画像
crowdProfiling: [],
couponSelling: [],
showBizList: false,
bizList: []
};
},
created() {},
created() {
listDictionaryData({ dictCode: 'priceRange' }).then((data) => {
this.priceRange = data;
});
listDictionaryData({ dictCode: 'productLevel' }).then((data) => {
this.productLevel = data;
});
listDictionaryData({ dictCode: 'carProductLabel' }).then((data) => {
this.carProductLabel = data;
});
listDictionaryData({ dictCode: 'crowdProfiling' }).then((data) => {
this.crowdProfiling = data;
});
listDictionaryData({ dictCode: 'couponSelling' }).then((data) => {
this.couponSelling = data;
});
},
methods: {
/* 下拉按钮点击 */
dropClick(command, row) {
+235 -13
View File
@@ -13,6 +13,42 @@
/>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="价格区间:">
<el-select v-model="where.priceRange" multiple>
<el-option
v-for="item in priceRange"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="车辆级别:">
<el-select v-model="where.carProductLabel" multiple>
<el-option
v-for="item in carProductLabel"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="能源类型:">
<el-select v-model="where.productLevel" multiple>
<el-option
v-for="item in productLevel"
:key="item.dictDataId"
:value="item.dictDataId"
:label="item.dictDataName"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<car-model-selector
type="brandSeries"
@@ -20,6 +56,17 @@
:key="componentKey"
/>
</el-col>
<el-col :md="6" :sm="12">
<el-form-item label="推广范围:">
<regions-select
v-model="where.citys"
type="provinceCity"
placeholder="请选择省市"
:props="{ multiple: true }"
class="ele-fluid"
/>
</el-form-item>
</el-col>
<el-col :md="6" :sm="12">
<div class="ele-form-actions">
<el-button
@@ -59,8 +106,36 @@
:underline="false"
class="table-text"
@click="goDetail(row)"
style="width: 100%"
>
{{ row.title }}
<div>{{ row.title }}</div>
<div>{{ row.guide_price }}</div>
<div>
<template v-for="item in priceRange">
<el-tag
:key="item.dictDataId"
v-if="row.labels.includes(item.dictDataId)"
size="mini"
>{{ item.dictDataName }}</el-tag
>
</template>
<template v-for="item in productLevel">
<el-tag
:key="item.dictDataId"
v-if="row.labels.includes(item.dictDataId)"
size="mini"
>{{ item.dictDataName }}</el-tag
>
</template>
<template v-for="item in carProductLabel">
<el-tag
:key="item.dictDataId"
v-if="row.labels.includes(item.dictDataId)"
size="mini"
>{{ item.dictDataName }}</el-tag
>
</template>
</div>
</el-link>
</div>
</template>
@@ -80,11 +155,70 @@
查看所有>>
</el-link>
</template>
<template v-slot:couponBiz="{ row }">
<template v-if="row.coupon.userType === 1">所有门店</template>
<template v-else>
{{ objFirstValue(row.coupon.bizList) }}
<el-link
size="mini"
v-if="Object.keys(row.coupon.bizList).length > 1"
type="primary"
class="ele-btn-icon"
@click="showAllBizName(row)"
>
查看所有>>
</el-link>
</template>
<!--
{{ row.cityName[0] }}
<el-link
size="mini"
v-if="row.cityName.length > 1"
type="primary"
class="ele-btn-icon"
@click="showAllCityName(row)"
>
查看所有>>
</el-link>
-->
</template>
<template v-slot:timeBetween="{ row }">
<!--
<div
>{{ row.timeStart.split(' ')[0] }} ~
{{ row.timeEnd.split(' ')[0] }}</div
>
-->
<div> 开始时间:{{ row.timeStart.split(' ')[0] }}</div>
<div> 结束时间:{{ row.timeEnd.split(' ')[0] }}</div>
</template>
<template v-slot:coupon="{ row }">
<div> {{ row.coupon.price }} </div>
<div> 开始时间:{{ row.coupon.timeStart }}</div>
<div> 结束时间:{{ row.coupon.timeEnd }}</div>
</template>
<template v-slot:crowdProfiling="{ row }">
<template v-for="(item, index) in crowdProfiling">
<el-tag
:key="index"
v-if="row.crowdProfiling.includes(item.dictDataId)"
size="small"
>{{ item.dictDataName }}</el-tag
>
</template>
</template>
<template v-slot:couponSelling="{ row }">
<template v-for="(item, index) in couponSelling">
<el-tag
style="margin-top: 5px"
:key="index"
v-if="row.labels.includes(item.dictDataId)"
size="small"
>{{ item.dictDataName }}</el-tag
>
</template>
</template>
<!-- 操作列 -->
<template v-slot:action="{ row }">
@@ -103,9 +237,11 @@
>
推广海报
</el-link>
<!--
<el-link type="primary" :underline="false" @click="showCoupon(row)">
购车券
</el-link>
-->
</template>
</ele-pro-table>
<!-- 推广文案 -->
@@ -182,18 +318,37 @@
</template>
</el-row>
</ele-modal>
<ele-modal
width="800px"
:visible.sync="showBizList"
:append-to-body="true"
:close-on-click-modal="true"
custom-class="ele-dialog-form"
title="适用门店"
>
<el-row style="padding-bottom: 20px">
<template v-for="(item, index) in bizList">
<el-tag :key="index" type="info" style="margin-bottom: 10px">{{
item
}}</el-tag>
</template>
</el-row>
</ele-modal>
</el-card>
</div>
</template>
<script>
import { listDictionaryData } from '@/api/system/dictionary-data';
import { pageProduct } from '@/api/car/product';
import CarModelSelector from '@/components/CarSelector/index.vue';
import ElDialogWrapper from '@/components/IframePre/index.vue';
import RegionsSelect from '@/components/RegionsSelect/index.vue';
export default {
name: 'carProduct',
components: { CarModelSelector, ElDialogWrapper },
components: { RegionsSelect, CarModelSelector, ElDialogWrapper },
data() {
return {
where: {
@@ -202,7 +357,11 @@
brandId: '',
seriesId: '',
modelId: ''
}
},
priceRange: [],
carProductLabel: [],
productLevel: [],
citys: []
},
// 表格列配置
columns: [
@@ -210,30 +369,58 @@
prop: 'title',
label: '车型',
slot: 'title',
showOverflowTooltip: true,
align: 'center',
minWidth: 100
},
{
prop: 'couponSelling',
label: '核销卖点',
align: 'center',
slot: 'couponSelling'
},
{
prop: 'crowdProfiling',
label: '人群画像',
align: 'center',
slot: 'crowdProfiling'
},
{
prop: 'discounts',
label: '补贴详情',
align: 'center'
},
{
prop: 'commission',
label: '佣金',
slot: 'commission',
showOverflowTooltip: true,
align: 'center',
minWidth: 50
},
{
prop: 'cityName',
label: '范围',
showOverflowTooltip: true,
prop: 'coupon',
label: '补贴信息',
align: 'center',
slot: 'coupon',
minWidth: 100
},
// {
// prop: 'cityName',
// label: '范围',
// showOverflowTooltip: true,
// align: 'center',
// minWidth: 100,
// slot: 'cityName'
// },
{
prop: 'couponBiz',
label: '适用门店',
align: 'center',
minWidth: 100,
slot: 'cityName'
slot: 'couponBiz'
},
{
prop: 'timeBetween',
label: '周期',
showOverflowTooltip: true,
align: 'center',
slot: 'timeBetween',
minWidth: 100
@@ -241,7 +428,7 @@
{
columnKey: 'action',
label: '推广',
width: 300,
width: 150,
align: 'center',
resizable: false,
slot: 'action'
@@ -271,10 +458,37 @@
dialogVisible: false,
showPoster: false,
showCityName: false,
cityNames: []
cityNames: [],
//价格区间
priceRange: [],
//能源类型
productLevel: [],
//产品标签
carProductLabel: [],
//用户画像
crowdProfiling: [],
couponSelling: [],
showBizList: false,
bizList: []
};
},
created() {},
created() {
listDictionaryData({ dictCode: 'priceRange' }).then((data) => {
this.priceRange = data;
});
listDictionaryData({ dictCode: 'productLevel' }).then((data) => {
this.productLevel = data;
});
listDictionaryData({ dictCode: 'carProductLabel' }).then((data) => {
this.carProductLabel = data;
});
listDictionaryData({ dictCode: 'crowdProfiling' }).then((data) => {
this.crowdProfiling = data;
});
listDictionaryData({ dictCode: 'couponSelling' }).then((data) => {
this.couponSelling = data;
});
},
methods: {
/* 表格数据源 */
datasource({ page, limit, where, order }) {
@@ -328,6 +542,14 @@
showAllCityName(row) {
this.showCityName = true;
this.cityNames = row.cityName;
},
objFirstValue(myObject) {
const keys = Object.keys(myObject);
return keys.length > 0 ? myObject[keys[0]] : null;
},
showAllBizName(row) {
this.showBizList = true;
this.bizList = row.coupon.bizList;
}
}
};