最新
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function pageIndex(params) {
|
||||
const res = await request.get('/home/data', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -115,7 +115,7 @@
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="能源类型:">
|
||||
<el-form-item label="级别:">
|
||||
<el-checkbox-group v-model="form.carProductLabel">
|
||||
<el-checkbox
|
||||
v-for="value in productLevel"
|
||||
@@ -125,7 +125,7 @@
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别:">
|
||||
<el-form-item label="能源类型:">
|
||||
<el-checkbox-group v-model="form.carProductLabel">
|
||||
<el-checkbox
|
||||
v-for="value in carProductLabel"
|
||||
|
||||
@@ -40,13 +40,10 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用规则:">
|
||||
<el-input
|
||||
clearable
|
||||
type="textarea"
|
||||
:maxlength="60"
|
||||
placeholder=""
|
||||
:rows="4"
|
||||
<tinymce-editor
|
||||
:init="editoption"
|
||||
v-model="form.rule"
|
||||
placeholder="请输入使用规则"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="可用门店:">
|
||||
@@ -92,11 +89,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TinymceEditor from '@/components/TinymceEditor/index.vue';
|
||||
import SelectBiz from '@/components/SelectBiz/index.vue';
|
||||
import { addProductCoupon, updateProductCoupon } from '@/api/car/coupon';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TinymceEditor,
|
||||
SelectBiz
|
||||
},
|
||||
props: {
|
||||
@@ -155,7 +154,14 @@
|
||||
//用户画像
|
||||
crowdProfiling: [],
|
||||
//产品标签
|
||||
carProductLabel: ''
|
||||
carProductLabel: '',
|
||||
editoption: {
|
||||
height: 300,
|
||||
toolbar: [
|
||||
'code | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | fontsizeselect | bullist numlist | \
|
||||
table emoticons hr preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs| image emoticons hr '
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -64,6 +64,14 @@
|
||||
}}</div
|
||||
>
|
||||
</template>
|
||||
<template v-slot:status="{ row }">
|
||||
<el-switch
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="row.status"
|
||||
@change="editStatus(row)"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:action="{ row }">
|
||||
<el-link
|
||||
type="primary"
|
||||
@@ -98,7 +106,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { pageProductCoupon, removeProductCoupon } from '@/api/car/coupon';
|
||||
import {
|
||||
pageProductCoupon,
|
||||
removeProductCoupon,
|
||||
updateProductCouponStatus
|
||||
} from '@/api/car/coupon';
|
||||
import editCoupon from './components/editCoupon.vue';
|
||||
import { setPageTabTitle } from '@/utils/page-tab-util';
|
||||
|
||||
@@ -160,6 +172,14 @@
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
resizable: false,
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '上架状态',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
resizable: false,
|
||||
slot: 'status',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
@@ -246,6 +266,20 @@
|
||||
},
|
||||
handleCarChange(carInfo) {
|
||||
this.where.selectedCar = carInfo;
|
||||
},
|
||||
/* 更改状态 */
|
||||
editStatus(row) {
|
||||
const loading = this.$loading({ lock: true });
|
||||
updateProductCouponStatus(row.id, row.status)
|
||||
.then((msg) => {
|
||||
loading.close();
|
||||
this.$message.success(msg);
|
||||
this.reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -13,6 +13,28 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="上架状态:">
|
||||
<el-select v-model="where.status" clearable>
|
||||
<el-option value="1" label="上架" />
|
||||
<el-option value="0" label="未上架" />
|
||||
</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="12" :sm="24">
|
||||
<car-model-selector
|
||||
type="brandSeries"
|
||||
@@ -20,6 +42,35 @@
|
||||
:key="componentKey"
|
||||
/>
|
||||
</el-col>
|
||||
<!--
|
||||
<el-col :md="12" :sm="12">
|
||||
<el-form-item label="补贴金额:">
|
||||
<el-input
|
||||
v-model="where.minPrice"
|
||||
placeholder="最小金额"
|
||||
style="width: 45%"
|
||||
>
|
||||
<template #append>~</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
v-model="where.maxPrice"
|
||||
placeholder="最大金额"
|
||||
style="width: 45%"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</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
|
||||
@@ -131,10 +182,11 @@
|
||||
import edit from './components/edit.vue';
|
||||
import editBrokerage from './components/editBrokerage.vue';
|
||||
import CarModelSelector from '@/components/CarSelector/index.vue';
|
||||
import RegionsSelect from '@/components/RegionsSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: 'carProduct',
|
||||
components: { CarModelSelector, edit, editBrokerage },
|
||||
components: { RegionsSelect, CarModelSelector, edit, editBrokerage },
|
||||
data() {
|
||||
return {
|
||||
where: {
|
||||
@@ -143,7 +195,11 @@
|
||||
brandId: '',
|
||||
seriesId: '',
|
||||
modelId: ''
|
||||
}
|
||||
},
|
||||
status: '',
|
||||
dateRange: '',
|
||||
minPrice: '',
|
||||
maxPrice: ''
|
||||
},
|
||||
// 表格列配置
|
||||
columns: [
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
<div
|
||||
class="analysis-chart-card-num ele-text-heading"
|
||||
style="margin-bottom: 10px"
|
||||
>101条</div
|
||||
>{{ data.today_clues }}条</div
|
||||
>
|
||||
<el-divider />
|
||||
<div class="analysis-chart-card-text">累计线索:100000条</div>
|
||||
<div class="analysis-chart-card-text"
|
||||
>累计线索:{{ data.total_clues }}条</div
|
||||
>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||
@@ -28,10 +30,12 @@
|
||||
<div
|
||||
class="analysis-chart-card-num ele-text-heading"
|
||||
style="margin-bottom: 10px"
|
||||
>2323人</div
|
||||
>{{ data.member }}人</div
|
||||
>
|
||||
<el-divider />
|
||||
<div class="analysis-chart-card-text">历史成交:100000单</div>
|
||||
<div class="analysis-chart-card-text"
|
||||
>历史成交:{{ data.orders }}单</div
|
||||
>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -42,8 +46,8 @@
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
import { LineChart, BarChart } from 'echarts/charts';
|
||||
import { GridComponent, TooltipComponent } from 'echarts/components';
|
||||
import { getPayNumList } from '@/api/dashboard/analysis';
|
||||
import { echartsMixin } from '@/utils/echarts-mixin';
|
||||
import { pageIndex } from '@/api/home';
|
||||
|
||||
use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]);
|
||||
|
||||
@@ -55,7 +59,13 @@
|
||||
// 访问量折线图配置
|
||||
visitChartOption: {},
|
||||
// 支付笔数柱状图配置
|
||||
payNumChartOption: {}
|
||||
payNumChartOption: {},
|
||||
data: {
|
||||
total_clues: 0,
|
||||
today_clues: 0,
|
||||
member: 0,
|
||||
orders: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -65,91 +75,15 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getPayNumData();
|
||||
this.fetchData();
|
||||
},
|
||||
methods: {
|
||||
/* 获取数据 */
|
||||
getPayNumData() {
|
||||
getPayNumList()
|
||||
.then((data) => {
|
||||
this.visitChartOption = {
|
||||
color: '#975fe5',
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter:
|
||||
'<i class="ele-chart-dot" style="background: #975fe5;"></i>{b0}: {c0}'
|
||||
},
|
||||
grid: {
|
||||
top: 10,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
show: false,
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: data.map((d) => d.date)
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
show: false,
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
areaStyle: {
|
||||
opacity: 0.5
|
||||
},
|
||||
data: data.map((d) => d.value)
|
||||
}
|
||||
]
|
||||
};
|
||||
//
|
||||
this.payNumChartOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter:
|
||||
'<i class="ele-chart-dot" style="background: #5b8ff9;"></i>{b0}: {c0}'
|
||||
},
|
||||
grid: {
|
||||
top: 10,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
show: false,
|
||||
type: 'category',
|
||||
data: data.map((d) => d.date)
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
show: false,
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: 'bar',
|
||||
data: data.map((d) => d.value)
|
||||
}
|
||||
]
|
||||
};
|
||||
fetchData() {
|
||||
pageIndex()
|
||||
.then((res) => {
|
||||
this.$util.assignObject(this.data, {
|
||||
...res
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
|
||||
Reference in New Issue
Block a user