修改管理后台产品列表
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="车辆级别:">
|
||||
<el-form-item label="能源类型:">
|
||||
<el-select v-model="where.carProductLabel" multiple>
|
||||
<el-option
|
||||
v-for="item in carProductLabel"
|
||||
@@ -82,7 +82,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="能源类型:">
|
||||
<el-form-item label="车辆级别:">
|
||||
<el-select v-model="where.productLevel" multiple>
|
||||
<el-option
|
||||
v-for="item in productLevel"
|
||||
|
||||
@@ -71,3 +71,17 @@ export async function getProduct(id) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getCouponBizList(params) {
|
||||
const res = await request.get('/car/product/couponBizList', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<!-- 用户编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
width="800px"
|
||||
:visible="visible"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="true"
|
||||
custom-class="ele-dialog-form"
|
||||
title="适用门店"
|
||||
@update:visible="updateVisible"
|
||||
>
|
||||
<el-card shadow="never">
|
||||
<!-- 数据表格 -->
|
||||
<ele-pro-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:datasource="allBiz"
|
||||
cache-key="pingProductCouponBizList"
|
||||
:need-page="false"
|
||||
:loading="loading"
|
||||
>
|
||||
<!-- 表头工具栏 -->
|
||||
<template v-slot:toolbar> </template>
|
||||
</ele-pro-table>
|
||||
</el-card>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCouponBizList } from '@/api/car/product';
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
// 弹窗是否打开
|
||||
visible: Boolean,
|
||||
couponId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
where: {
|
||||
couponId: ''
|
||||
},
|
||||
editVersion: false,
|
||||
loading: false,
|
||||
// 是否是修改
|
||||
isUpdate: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'biz_name',
|
||||
label: '门店',
|
||||
align: 'center',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'province_name',
|
||||
label: '省份',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'city_name',
|
||||
label: '市',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '详细地址',
|
||||
align: 'center'
|
||||
}
|
||||
],
|
||||
allBiz: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 是否开启响应式布局
|
||||
styleResponsive() {
|
||||
return this.$store.state.theme.styleResponsive;
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
loadBiz() {
|
||||
getCouponBizList({ couponId: this.couponId })
|
||||
.then((data) => {
|
||||
this.allBiz = data.list;
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 更新visible */
|
||||
updateVisible(value) {
|
||||
this.$emit('update:visible', value);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(visible) {
|
||||
if (visible) {
|
||||
this.loadBiz();
|
||||
} else {
|
||||
this.allBiz = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.ele-image-upload-list .ele-image-upload-item {
|
||||
margin-top: 2px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -26,7 +26,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="车辆级别:">
|
||||
<el-form-item label="能源类型:">
|
||||
<el-select v-model="where.carProductLabel" multiple>
|
||||
<el-option
|
||||
v-for="item in carProductLabel"
|
||||
@@ -38,7 +38,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="能源类型:">
|
||||
<el-form-item label="车辆级别:">
|
||||
<el-select v-model="where.productLevel" multiple>
|
||||
<el-option
|
||||
v-for="item in productLevel"
|
||||
@@ -158,13 +158,21 @@
|
||||
<template v-slot:couponBiz="{ row }">
|
||||
<template v-if="row.coupon.userType === 1">所有门店</template>
|
||||
<template v-else>
|
||||
{{ objFirstValue(row.coupon.bizList) }}
|
||||
<div>{{ row.coupon.bizList['list'][0]['biz_name'] }}</div>
|
||||
<div>
|
||||
{{ row.coupon.bizList['list'][0]['province_name'] }}-{{
|
||||
row.coupon.bizList['list'][0]['city_name']
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ row.coupon.bizList['list'][0]['address'] }}
|
||||
</div>
|
||||
<el-link
|
||||
size="mini"
|
||||
v-if="Object.keys(row.coupon.bizList).length > 1"
|
||||
v-if="row.coupon.bizList['count'] > 1"
|
||||
type="primary"
|
||||
class="ele-btn-icon"
|
||||
@click="showAllBizName(row)"
|
||||
@click="showAllBizName(row.coupon.couponId)"
|
||||
>
|
||||
查看所有>>
|
||||
</el-link>
|
||||
@@ -318,7 +326,7 @@
|
||||
</template>
|
||||
</el-row>
|
||||
</ele-modal>
|
||||
|
||||
<!--
|
||||
<ele-modal
|
||||
width="800px"
|
||||
:visible.sync="showBizList"
|
||||
@@ -335,6 +343,11 @@
|
||||
</template>
|
||||
</el-row>
|
||||
</ele-modal>
|
||||
-->
|
||||
<coupon-bizs
|
||||
:visible.sync="showBizList"
|
||||
:coupon-id="couponId"
|
||||
></coupon-bizs>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -345,10 +358,16 @@
|
||||
import CarModelSelector from '@/components/CarSelector/index.vue';
|
||||
import ElDialogWrapper from '@/components/IframePre/index.vue';
|
||||
import RegionsSelect from '@/components/RegionsSelect/index.vue';
|
||||
import CouponBizs from './components/couponBizs.vue';
|
||||
|
||||
export default {
|
||||
name: 'carProduct',
|
||||
components: { RegionsSelect, CarModelSelector, ElDialogWrapper },
|
||||
components: {
|
||||
RegionsSelect,
|
||||
CarModelSelector,
|
||||
ElDialogWrapper,
|
||||
CouponBizs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
where: {
|
||||
@@ -396,13 +415,13 @@
|
||||
align: 'center',
|
||||
minWidth: 50
|
||||
},
|
||||
{
|
||||
prop: 'coupon',
|
||||
label: '补贴信息',
|
||||
align: 'center',
|
||||
slot: 'coupon',
|
||||
minWidth: 100
|
||||
},
|
||||
// {
|
||||
// prop: 'coupon',
|
||||
// label: '补贴信息',
|
||||
// align: 'center',
|
||||
// slot: 'coupon',
|
||||
// minWidth: 100
|
||||
// },
|
||||
// {
|
||||
// prop: 'cityName',
|
||||
// label: '范围',
|
||||
@@ -469,7 +488,8 @@
|
||||
crowdProfiling: [],
|
||||
couponSelling: [],
|
||||
showBizList: false,
|
||||
bizList: []
|
||||
bizList: [],
|
||||
couponId: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -547,9 +567,9 @@
|
||||
const keys = Object.keys(myObject);
|
||||
return keys.length > 0 ? myObject[keys[0]] : null;
|
||||
},
|
||||
showAllBizName(row) {
|
||||
showAllBizName(couponId) {
|
||||
this.couponId = couponId;
|
||||
this.showBizList = true;
|
||||
this.bizList = row.coupon.bizList;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user