Commit 298ed036 by cwq0219

车品牌

1 parent c7824bae
import { http } from '@/main'
import { http, http_brand } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'
......@@ -26,7 +26,27 @@ const getExportApi = params => {
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http({
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
......@@ -34,10 +54,20 @@ const getCarBrandListApi = params => {
})
}
const getHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
url: 'rop-scrm-shopmall/router',
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
......@@ -78,4 +108,4 @@ const createCodeApi = params => {
})
}
export default { getListApi, getExportApi, getCarBrandListApi, updateHotlineApi, getPackageListApi, updateEquityApi, createCodeApi }
export default { getListApi, getExportApi, getCarBrandListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getPackageListApi, updateEquityApi, createCodeApi }
......@@ -18,3 +18,4 @@ Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_brand = params => Vue.prototype.$http_brand(params)
......@@ -16,7 +16,7 @@ import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {}
window.location.href.split('?').length > 1
? window.location.href
......@@ -28,6 +28,7 @@ export async function start() {
: ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$common = {
utils: utils
}
......
......@@ -4,15 +4,15 @@
<div class="container">
<p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="140px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="scope.scope.changeCarBrand(editForm.vehicle.vehicleBrandId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carBrandOptions" :key="item.carBrandId" :value="item.carBrandId" :label="item.carBrand"/>
<template slot="vehicleBrandId">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="getCarSeriesList(editForm.vehicle.vehicleBrandId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
<el-select v-model="editForm.vehicle.vehicleSeriesId" placeholder="请选择子品牌" @change="changeCarSmallBrand(editForm.vehicle.vehicleSeriesId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carSmallBrandOptions" :key="item.carChildsBrandId" :value="item.carChildsBrandId" :label="item.carChildsBrandName"/>
<el-select v-model="editForm.vehicle.vehicleSeriesId" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:220px; margin-right: 20px;">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.carChildsBrandId" :value="item.carChildsBrandId" :label="item.carChildsBrandName" />
</el-select>
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车系" @change="getCarType(editForm.vehicle.vehicleShapeId)" style="width:220px;">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.carSeriesId" :value="item.carSeriesId" :label="item.carSeriesName"/>
<el-select v-model="editForm.vehicle.vehicleShapeId" placeholder="请选择车型" style="width:220px;">
<el-option v-for="item in baseData.carTypeOptions" :key="item.carSeriesId" :value="item.carSeriesId" :label="item.carSeriesName" />
</el-select>
</template>
</glsx-combi-form>
......@@ -368,8 +368,8 @@ export default {
}
],
carBrandOptions: [],
carSmallBrandOptions: [],
carSeriesOptions: []
carSeriesOptions: [],
carTypeOptions: []
}
}
},
......@@ -389,7 +389,7 @@ export default {
console.log(this.routeInfo, '-------------')
// 获取套餐列表
this.getPackageList()
// this.getAllVehicleBrand()
this.getAllVehicleBrand()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
......@@ -524,13 +524,24 @@ export default {
const params = {}
this.$apis.beforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || []
// this.carInfoList = this.$common.util.deepClone(this.baseData.carBrandOptions)
// var hash = {}
// this.carBrandOptions = this.carBrandOptions.reduce((item, next) => {
// !hash[next.carBrandId] && (hash[next.carBrandId] = true) && item.push(next)
// return item
// }, [])
// fn()
})
},
// 获取车系
getCarSeriesList(brandId) {
const params = {
brandId: brandId
}
this.$apis.beforeSale.getCarSeriesListApi(params).then(res => {
this.baseData.carSeriesOptions = res || []
})
},
// 获取车型
getCarTypeList(value) {
const params = {
carSeriesId: value
}
this.$apis.beforeSale.getCarTypeListApi(params).then(res => {
this.baseData.carTypeOptions = res || []
})
},
getParams() {
......
......@@ -3,10 +3,10 @@
<div class="equity">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="其他权益订单" name="equityList">
<equity-list></equity-list>
<equity-list v-if="activeName == 'equityList'"></equity-list>
</el-tab-pane>
<el-tab-pane label="店面服务设置" name="serviceSet">
<service-set></service-set>
<service-set v-if="activeName == 'serviceSet'"></service-set>
</el-tab-pane>
</el-tabs>
</div>
......
......@@ -46,9 +46,16 @@ export default {
glsxCombiForm
},
mounted() {},
mounted() {
this.getHotline()
},
methods: {
getHotline() {
this.$apis.beforeSale.getHotlineApi({}).then(res => {
this.editForm.hotline = res
})
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!