This commit is contained in:
zyk
2024-07-09 19:49:16 +08:00
parent c0c5df9fb0
commit b543e3943b
5 changed files with 209 additions and 202 deletions

View File

@@ -4,11 +4,11 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
# 线上
# VUE_APP_BASE_API = 'https://cms.diyouzhijia.com/car_admin_api'
VUE_APP_BASE_API = 'https://cms.diyouzhijia.com/car_admin_api'
# 花花
# VUE_APP_BASE_API = 'http://192.168.31.16:8080/car_admin_api'
# 薛磊
VUE_APP_BASE_API = 'http://192.168.31.226:8080/car_admin_api'
# VUE_APP_BASE_API = 'http://192.168.31.226:8080/car_admin_api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().

View File

@@ -114,13 +114,13 @@ export const problemDeleteAPI = (id) => request.post(`/admin/platform/car/commod
export const problemInfoAPI = (id) => request.get(`/admin/platform/car/commodity/common/problem/info/${id}`);
//租车商品列表 /admin/platform/car/information/product/list
export const productListAPI = (params) => request.get(`/admin/platform/car/information/product/list`,{params});
export const productListAPI = (params) => request.get(`/admin/platform/car/information/product/list`, { params });
//租车商品上下架 /api/admin/platform/car/information/product/switch/{id}
export const productSwitchAPI = (id) => request.post(`/admin/platform/car/information/product/switch/${id}`);
//买车购车方案列表 /api/admin/platform/car/buy/way/help/list
export const carBuyWayHelpListAPI = (params) => request.get(`/admin/platform/car/buy/way/help/list`,{params});
export const carBuyWayHelpListAPI = (params) => request.get(`/admin/platform/car/buy/way/help/list`, { params });
//添加购车方案 /api/admin/platform/car/buy/way/add
export const carBuyWayHelpAddAPI = (data) => request.post(`/admin/platform/car/buy/way/add`, data);
@@ -142,3 +142,15 @@ export const rentingandbuyinginfoAPI = () => request.get(`/admin/platform/agreem
// 租车用户协议 保存 /api/admin/platform/agreement/userrentalsave
export const rentingandbuyingsaveAPI = (data) => request.post(`/admin/platform/agreement/rentingandbuyingsave`, data);
//卖车商品上架
export const sellerProductSwitchAPI = (id) => request.post(`/admin/platform/car/seller/product/attr/up/${id}`);
//卖车商品下架
export const sellerProductSwitchDown = (id) => request.post(`/admin/platform/car/seller/product/attr/down/${id}`);
//卖车商品列表
export const sellerProductListAPI = (params) => request.get(`/admin/platform/car/seller/product/attr/list`, { params });
//卖车商品列表详情
export const sellerProductInfoAPI = (params) => request.get(`/front/car/attr/info/${id}`);

View File

@@ -10,10 +10,10 @@
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="话题" prop="topicId" >
<el-form-item label="话题" prop="topicId">
<el-select v-model="user.topicId" placeholder="请选择">
<el-option v-for="(item,index) in topicList" :key="index" :label="item.name" :value="item.id" />
</el-select>
<el-option v-for="(item, index) in topicList" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
@@ -64,7 +64,7 @@
</template>
<script>
import {communityTopicListApi} from "@/api/community"
import { communityTopicListApi } from "@/api/community"
import { addtopicAPI, updateTopicAPI } from '@/api/marketing';
import { Debounce } from '@/utils/validate';
import Tinymce from '@/components/Tinymce/index';
@@ -77,6 +77,7 @@ const obj = {
intro: '',
isHot: null,
content: '',
topicId: ''
};
export default {
name: 'CreatGrade',
@@ -109,7 +110,7 @@ export default {
levelNum: [],
levelNumDataNew: this.levelNumData,
//话题列表
topicList:[]
topicList: []
};
},
mounted() {
@@ -120,10 +121,10 @@ export default {
});
}
},
created(){
communityTopicListApi().then(res=>{
created() {
communityTopicListApi().then(res => {
console.log(res);
this.topicList=res.list
this.topicList = res.list
})
},
computed: {
@@ -174,6 +175,7 @@ export default {
intro: this.user.intro,
isHot: this.user.isHot,
content: this.user.content,
topicId: this.user.topicId
};
this.user.id
? updateTopicAPI(data)

View File

@@ -5,11 +5,29 @@
<div class="container">
<el-form :model="formData" inline size="small" label-width="110px">
<el-form-item label="标题:">
<el-input v-model.trim="formData.title" placeholder="请输入标题" class="selWidth"> </el-input>
<el-input v-model.trim="formData.title" placeholder="请输入标题"> </el-input>
</el-form-item>
<el-form-item label="品牌名称:">
<el-input v-model.trim="formData.brandName" placeholder="请输入品牌名称"> </el-input>
</el-form-item>
<el-form-item label="型号名称:">
<el-input v-model.trim="formData.modelName" placeholder="请输入型号名称"> </el-input>
</el-form-item>
<el-form-item label="发布车商:">
<el-select v-model="formData.carDealerId" placeholder="请选择">
<el-option v-for="item in merchantList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布租期:">
<el-input v-model.trim="formData.monthRent" placeholder="请输入发布租期"> </el-input>
</el-form-item>
<el-form-item label="发布状态:">
<el-select v-model="formData.isShow" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="车牌号:">
<el-input v-model.trim="formData.brandId" placeholder="请输入品牌号" class="selWidth"> </el-input>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -19,13 +37,8 @@
<!-- <el-button type="primary" class="mr10" @click="addBtn">新增汽车参数模板</el-button> -->
</div>
<el-table
v-loading="listLoading"
:data="posterList"
style="width: 100%"
highlight-current-row
class="switchTable"
>
<el-table v-loading="listLoading" :data="posterList" style="width: 100%" highlight-current-row
class="switchTable">
<el-table-column prop="id" label="ID" width="40px" />
<el-table-column prop="title" label="标题" show-overflow-tooltip></el-table-column>
<el-table-column prop="image" label="主图">
@@ -35,7 +48,7 @@
</el-table-column>
<el-table-column prop="brandName" label="品牌名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="modelName" label="型号名称" width="100px" show-overflow-tooltip></el-table-column>
<el-table-column prop="powerType" label="动力类型">
<template v-slot="{ row }">
{{ row.powerType == 0 ? '纯电' : row.powerType == 1 ? '油电' : '纯油' }}
@@ -48,21 +61,15 @@
<el-table-column prop="sales" label="发布数量">
<template slot-scope="scope">
<el-tag @click="publishBtn(scope.row)" v-if="scope.row.sales > 0" effect="dark">{{
scope.row.sales
}}</el-tag>
scope.row.sales
}}</el-tag>
<el-tag @click="publishBtn(scope.row)" v-else type="info">{{ scope.row.sales }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="isShow" label="发布状态">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
:active-value="true"
:inactive-value="false"
active-text="上架"
inactive-text="下架"
@change="updownBtn(scope.row)"
/>
<el-switch v-model="scope.row.isShow" :active-value="true" :inactive-value="false" active-text="上架"
inactive-text="下架" @change="updownBtn(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" min-width="120" fixed="right" align="center">
@@ -70,7 +77,7 @@
<!-- <el-button type="text" @click="editBtn(scope.row)">编辑</el-button> -->
<el-button type="text" @click="infoBtn(scope.row)">详情</el-button>
<!-- <el-button type="text" @click="onDelFn(scope.row)">删除</el-button> -->
<el-button type="text" @click="updownBtn(scope.row, 1)">
<el-button type="text" @click="updownBtn(scope.row, 1)">
{{ scope.row.isShow == true ? '下架' : '上架' }}
</el-button>
</template>
@@ -78,15 +85,9 @@
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 40, 60]"
:page-size="formData.limit"
:current-page="formData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
<el-pagination :page-sizes="[10, 20, 40, 60]" :page-size="formData.limit" :current-page="formData.page"
layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange"
@current-change="pageChange" />
</div>
</el-card>
<el-drawer :visible.sync="drawer" size="100%">
@@ -127,7 +128,7 @@
</el-descriptions>
</div>
</el-drawer>
<!-- 发布数量 -->
<el-dialog title="汽车商品-车商-发布列表" :visible.sync="dialogTableVisible" :close-on-click-modal="false">
<el-table :data="attrList">
@@ -152,27 +153,23 @@
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 40, 60]"
:page-size="attrData.limit"
:current-page="attrData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="attrTotal"
@size-change="handleSizeChange1"
@current-change="pageChange1"
/>
<el-pagination :page-sizes="[10, 20, 40, 60]" :page-size="attrData.limit" :current-page="attrData.page"
layout="total, sizes, prev, pager, next, jumper" :total="attrTotal" @size-change="handleSizeChange1"
@current-change="pageChange1" />
</div>
</el-dialog>
</div>
</template>
<script>
import {productListAPI,productSwitchAPI,carProductInfoAPI} from "@/api/rentsell.js"
import { productListAPI, productSwitchAPI, carProductInfoAPI } from "@/api/rentsell.js"
import { platformCardealer } from '@/api/vehicleShop/vehicleShop';
export default {
name: 'sellList',
components: { },
components: {},
data() {
return {
merchantList: [],//车商列表
drawer: false,
listLoading: true,
formData: {
@@ -203,6 +200,14 @@ export default {
},
attrTotal: 0,
attrList: [],
// 发布状态
options: [{
value: true,
label: '上架'
}, {
value: false,
label: '下架'
}],
};
},
created() {
@@ -231,6 +236,15 @@ export default {
this.tableData.total = res.total;
this.listLoading = false;
});
platformCardealer({
limit: 500,
isSwitch: undefined,
isSelf: '',
categoryId: '',
typeId: '',
}).then(res => {
this.merchantList = res.list
})
},
reset() {
this.userInfo = {};
@@ -267,16 +281,16 @@ export default {
// 上下加
updownBtn(row) {
if (row.isShow) {
productSwitchAPI(row.id).then(() => {
this.$message.success('下架成功');
this.getList();
});
} else {
productSwitchAPI(row.id).then(() => {
this.$message.success('上架成功');
this.getList();
});
}
productSwitchAPI(row.id).then(() => {
this.$message.success('下架成功');
this.getList();
});
} else {
productSwitchAPI(row.id).then(() => {
this.$message.success('上架成功');
this.getList();
});
}
},
// 删
onDelFn(row) {
@@ -319,17 +333,21 @@ export default {
.tableBox {
margin-top: 20px;
}
.pp {
font-size: 18px;
margin-bottom: 10px;
}
.descriBOX {
padding: 30px;
}
.dialogSpan {
font-size: 12px;
color: salmon;
}
.pic {
width: 60px;
height: 60px;

View File

@@ -4,12 +4,24 @@
<div slot="header" class="clearfix">
<div class="container">
<el-form :model="formData" inline size="small" label-width="110px">
<el-form-item label="标题">
<el-input v-model.trim="formData.title" placeholder="请输入标题" class="selWidth"> </el-input>
<el-form-item label="品牌名称">
<el-input v-model.trim="formData.keyWords" placeholder="请输入品牌名称"> </el-input>
</el-form-item>
<!-- <el-form-item label="车牌号:">
<el-input v-model.trim="formData.brandId" placeholder="请输入品牌号" class="selWidth"> </el-input>
</el-form-item> -->
<el-form-item label="类型:">
<el-select v-model="formData.type" placeholder="请选择">
<el-option v-for="item in optionsType" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布状态:">
<el-select v-model="formData.isShow" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -19,58 +31,58 @@
<!-- <el-button type="primary" class="mr10" @click="addBtn">新增汽车参数模板</el-button> -->
</div>
<el-table
v-loading="listLoading"
:data="posterList"
style="width: 100%"
highlight-current-row
class="switchTable"
>
<el-table v-loading="listLoading" :data="posterList" style="width: 100%" highlight-current-row
class="switchTable">
<el-table-column prop="id" label="ID" width="40px" />
<el-table-column prop="title" label="标题" show-overflow-tooltip></el-table-column>
<el-table-column prop="image" label="主图">
<template slot-scope="scope">
<imagePreview :src="scope.row.image" style="width: 40px; height: 40px" />
</template>
</el-table-column>
<el-table-column prop="brandName" label="品牌名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="modelName" label="型号名称" width="100px" show-overflow-tooltip></el-table-column>
<el-table-column prop="powerType" label="动力类型">
<el-table-column prop="carDealerName" label="车商名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="carBuyWarName" label="买车方案名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="depositPrice" label="定金" width="100px" show-overflow-tooltip></el-table-column>
<el-table-column prop="type" label="类型">
<template v-slot="{ row }">
{{ row.powerType == 0 ? '纯电' : row.powerType == 1 ? '油电' : '纯油' }}
{{ row.type == 0 ? '买车' : row.type == 1 ? '组买灵活' : '买车' }}
</template>
</el-table-column>
<el-table-column prop="carDealerName" label="发布车商" show-overflow-tooltip></el-table-column>
<el-table-column prop="depositMoney" label="定金" show-overflow-tooltip></el-table-column>
<el-table-column prop="rentalPrice" label="租金/月" show-overflow-tooltip></el-table-column>
<el-table-column prop="monthRent" label="租期" width="70px"></el-table-column>
<el-table-column prop="sales" label="发布数量">
<el-table-column label="品牌名称" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag @click="publishBtn(scope.row)" v-if="scope.row.sales > 0" effect="dark">{{
scope.row.sales
}}</el-tag>
<el-tag @click="publishBtn(scope.row)" v-else type="info">{{ scope.row.sales }}</el-tag>
<div>{{ scope.row.carSellerProduct && scope.row.carSellerProduct.brandName }}</div>
</template>
</el-table-column>
<el-table-column label="车辆型号名称" show-overflow-tooltip>
<template slot-scope="scope">
<div>{{ scope.row.carSellerProduct && scope.row.carSellerProduct.modelName }}</div>
</template>
</el-table-column>
<el-table-column prop="image" label="商品主图">
<template slot-scope="scope">
<imagePreview :src="scope.row.carSellerProduct && scope.row.carSellerProduct.image"
style="width: 40px; height: 40px" />
</template>
</el-table-column>
<el-table-column label="动力类型">
<template v-slot="{ row }">
{{ row.carSellerProduct && row.carSellerProduct.powerType == 0 ? '纯电' : row.carSellerProduct
&& row.carSellerProduct.powerType
== 1 ? '油电' : '纯电' }}
</template>
</el-table-column>
<el-table-column label="发布" width="60px">
<template v-slot="{ row }">
{{ row.carSellerProduct && row.carSellerProduct.isShow == true ? '' : '' }}
</template>
</el-table-column>
<el-table-column prop="isShow" label="发布状态">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
:active-value="true"
:inactive-value="false"
active-text="上架"
inactive-text="下架"
@change="updownBtn(scope.row)"
/>
<el-switch v-model="scope.row.isShow" :active-value="true" :inactive-value="false" active-text="上架"
inactive-text="下架" @change="updownFn(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<!-- <el-button type="text" @click="editBtn(scope.row)">编辑</el-button> -->
<el-button type="text" @click="infoBtn(scope.row)">详情</el-button>
<!-- <el-button type="text" @click="infoBtn(scope.row)">详情</el-button> -->
<!-- <el-button type="text" @click="onDelFn(scope.row)">删除</el-button> -->
<el-button type="text" @click="updownBtn(scope.row, 1)">
<el-button type="text" @click="updownBtn(scope.row, 1)">
{{ scope.row.isShow == true ? '下架' : '上架' }}
</el-button>
</template>
@@ -78,15 +90,9 @@
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 40, 60]"
:page-size="formData.limit"
:current-page="formData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
<el-pagination :page-sizes="[10, 20, 40, 60]" :page-size="formData.limit" :current-page="formData.page"
layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange"
@current-change="pageChange" />
</div>
</el-card>
<el-drawer :visible.sync="drawer" size="100%">
@@ -127,61 +133,37 @@
</el-descriptions>
</div>
</el-drawer>
<!-- 发布数量 -->
<el-dialog title="汽车商品-车商-发布列表" :visible.sync="dialogTableVisible" :close-on-click-modal="false">
<el-table :data="attrList">
<el-table-column prop="id" label="ID" />
<el-table-column prop="carDealerId" label="车商id" />
<el-table-column prop="cspId" label="卖车商品id"></el-table-column>
<el-table-column prop="saleNum" label="销量"></el-table-column>
<el-table-column prop="stock" label="库存"></el-table-column>
<el-table-column prop="isShow" label="发布">
<template v-slot="{ row }">
<el-tag v-if="row.isShow == true"></el-tag>
<el-tag v-if="row.isShow == false" type="info"></el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="180px"></el-table-column>
<el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" @click="updownBtn(scope.row, 2)">
{{ scope.row.isShow == true ? '下架' : '上架' }}
</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 40, 60]"
:page-size="attrData.limit"
:current-page="attrData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="attrTotal"
@size-change="handleSizeChange1"
@current-change="pageChange1"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import {productListAPI,productSwitchAPI,carProductInfoAPI} from "@/api/rentsell.js"
import { sellerProductListAPI, sellerProductSwitchAPI, sellerProductInfoAPI, sellerProductSwitchDown } from "@/api/rentsell.js"
export default {
name: 'sellList',
components: { },
components: {},
data() {
return {
// 发布状态
options: [{
value: true,
label: '上架'
}, {
value: false,
label: '下架'
}],
// 类型
optionsType: [{
value: '0',
label: '买车'
}, {
value: '1',
label: '租买灵活'
}],
drawer: false,
listLoading: true,
formData: {
page: 1,
limit: 20,
brandId: null,
modelId: null,
powerType: null,
title: '',
limit: 20
},
tableData: {
data: [],
@@ -209,32 +191,19 @@ export default {
this.getList();
},
methods: {
// 打开发布数量
publishBtn(row) {
this.dialogTableVisible = true;
this.attrData.cspId = row.id;
this.getAttrList();
},
getAttrList() {
attrListAPI(this.attrData).then((res) => {
console.log(res, '发布列表');
this.attrList = res.list;
this.attrTotal = res.total;
});
},
// 列表
getList() {
this.listLoading = true;
productListAPI(this.formData).then((res) => {
sellerProductListAPI(this.formData).then((res) => {
// console.log(res, '列表');
this.posterList = res.list;
this.tableData.total = res.total;
this.listLoading = false;
});
},
reset() {
this.userInfo = {};
},
// reset() {
// this.userInfo = {};
// },
addBtn() {
this.$refs.grades.dialogVisible = true;
this.userInfo = {};
@@ -254,7 +223,7 @@ export default {
},
infoBtn(row) {
this.drawer = true;
carProductInfoAPI(row.id).then((res) => {
sellerProductInfoAPI(row.id).then((res) => {
// console.log(res, '汽车详情');
this.detailObj = res;
this.imgArr = res.image.split(',');
@@ -267,26 +236,30 @@ export default {
// 上下加
updownBtn(row) {
if (row.isShow) {
productSwitchAPI(row.id).then(() => {
this.$message.success('下架成功');
this.getList();
});
} else {
productSwitchAPI(row.id).then(() => {
this.$message.success('上架成功');
this.getList();
});
}
},
// 删
onDelFn(row) {
this.$modalSure('删除该内容吗').then(() => {
delSellerAPI(row.id).then(() => {
this.$message.success('删除成功');
if (this.posterList.length === 1 && this.formData.page > 1) this.formData.page = this.formData.page - 1;
sellerProductSwitchDown(row.id).then(() => {
this.$message.success('下架成功');
this.getList();
});
});
} else {
sellerProductSwitchAPI(row.id).then(() => {
this.$message.success('上架成功');
this.getList();
});
}
},
// 上下加
updownFn(row) {
if (row.isShow) {
sellerProductSwitchAPI(row.id).then(() => {
this.$message.success('上架成功');
this.getList();
});
} else {
sellerProductSwitchDown(row.id).then(() => {
this.$message.success('下架成功');
this.getList();
});
}
},
pageChange(page) {
this.formData.page = page;
@@ -296,20 +269,18 @@ export default {
this.formData.limit = val;
this.getList();
},
pageChange1(page) {
this.attrData.page = page;
this.getAttrList();
},
handleSizeChange1(val) {
this.attrData.limit = val;
this.getAttrList();
},
handleQuery() {
this.formData;
this.getList();
},
resetQuery() {
(this.formData = { brandId: null, modelId: null, powerType: null, title: '' }), this.handleQuery();
(this.formData = {
page: 1,
limit: 20,
type: undefined,
isShow: null,
keyWords: null
}), this.handleQuery();
},
},
};
@@ -319,17 +290,21 @@ export default {
.tableBox {
margin-top: 20px;
}
.pp {
font-size: 18px;
margin-bottom: 10px;
}
.descriBOX {
padding: 30px;
}
.dialogSpan {
font-size: 12px;
color: salmon;
}
.pic {
width: 60px;
height: 60px;