Commit f25d7db8 by 杨北旺

更新售前权益的代码

1 parent a2942358
import { http, http_brand } from '@/main' import { http } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.' const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.' const orderPath = 'scrm.api.equity.service.order.'
...@@ -67,7 +67,7 @@ const getPriteApi = params => { ...@@ -67,7 +67,7 @@ const getPriteApi = params => {
const getCarBrandListApi = params => { const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list' // params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList' params.method = 'scrm.api.carlife.common.getCarBrandList'
return http_brand({ return http({
url: 'rop-scrm-carlife/router', url: 'rop-scrm-carlife/router',
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -78,7 +78,7 @@ const getCarBrandListApi = params => { ...@@ -78,7 +78,7 @@ const getCarBrandListApi = params => {
const getCarChildListApi = params => { const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list' // params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList' params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http_brand({ return http({
url: 'rop-scrm-carlife/router', url: 'rop-scrm-carlife/router',
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -88,7 +88,7 @@ const getCarChildListApi = params => { ...@@ -88,7 +88,7 @@ const getCarChildListApi = params => {
const getCarSeriesListApi = params => { const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList' params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({ return http({
url: 'rop-scrm-carlife/router', url: 'rop-scrm-carlife/router',
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -98,7 +98,7 @@ const getCarSeriesListApi = params => { ...@@ -98,7 +98,7 @@ const getCarSeriesListApi = params => {
const getCarTypeListApi = params => { const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList' params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({ return http({
url: 'rop-scrm-carlife/router', url: 'rop-scrm-carlife/router',
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -116,6 +116,16 @@ const getHotlineApi = params => { ...@@ -116,6 +116,16 @@ const getHotlineApi = params => {
}) })
} }
const getDefaultCarbrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.detail'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateHotlineApi = params => { const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update` params.method = `${defaultPath}merchant.hotline.update`
return http({ return http({
...@@ -127,6 +137,17 @@ const updateHotlineApi = params => { ...@@ -127,6 +137,17 @@ const updateHotlineApi = params => {
}) })
} }
const updateCarBrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.insert.or.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称) // 获取产品名称(套餐名称)
const getProListApi = params => { const getProListApi = params => {
params.method = `${defaultPath}select.get` params.method = `${defaultPath}select.get`
...@@ -193,8 +214,17 @@ const getOrderAttrApi = params => { ...@@ -193,8 +214,17 @@ const getOrderAttrApi = params => {
} }
// 获取套菜附件属性 // 获取套菜附件属性
const getOrderValueApi = params => { // const getOrderValueApi = params => {
params.method = `${defaultPath}order.attachment.value.get` // params.method = `${defaultPath}order.attachment.value.get`
// return http({
// url: 'rop-scrm-equity/router',
// method: 'GET',
// data: params,
// sign: true
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get`
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'GET', method: 'GET',
...@@ -203,6 +233,30 @@ const getOrderValueApi = params => { ...@@ -203,6 +233,30 @@ const getOrderValueApi = params => {
}) })
} }
// 校验
const verifyOrderApi = params => {
params.method = 'scrm.api.equity.service.order.verify'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 车架号
const checkOrderApi = params => {
params.method = 'scrm.api.equity.service.order.check'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新套菜附件属性 // 更新套菜附件属性
const updateOrderApi = params => { const updateOrderApi = params => {
params.method = `${orderPath}attachment.update` params.method = `${orderPath}attachment.update`
...@@ -238,4 +292,16 @@ const backOrderApi = params => { ...@@ -238,4 +292,16 @@ const backOrderApi = params => {
}) })
} }
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getOrderValueApi, updateOrderApi, uploadImgApi, backOrderApi }
\ No newline at end of file \ No newline at end of file
// 审核
const aduitOrderApi = params => {
params.method = `${orderPath}aduit`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi }
\ No newline at end of file \ No newline at end of file
...@@ -48,7 +48,7 @@ const staticRoutes = Object.freeze([{ ...@@ -48,7 +48,7 @@ const staticRoutes = Object.freeze([{
}, },
{ {
name: 'editEquity', name: 'editEquity',
path: '/beforeSale/editEquity', path: '/beforeSale/editEquity/:id',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve), component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {} meta: {}
}, },
......
...@@ -18,14 +18,14 @@ export async function start() { ...@@ -18,14 +18,14 @@ export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, request_brand, sign, secret } = await fetchConfig() const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {} var urlParams = {}
window.location.href.split('?').length > 1 window.location.href.split('?').length > 1 ?
? window.location.href window.location.href
.split('?')[1] .split('?')[1]
.split('&') .split('&')
.forEach(item => { .forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1] urlParams[item.split('=')[0]] = item.split('=')[1]
}) }) :
: '' ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444' 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 = 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.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<template> <template>
<div class="equity"></div> <div class="equity"></div>
</template> </template>
<script> <script>
export default { export default {
name: 'index', name: 'index',
...@@ -15,7 +14,6 @@ export default { ...@@ -15,7 +14,6 @@ export default {
this.$router.push('/beforeSale/equityList') this.$router.push('/beforeSale/equityList')
}, },
mounted() {}, mounted() {},
methods: {} methods: {}
} }
</script> </script>
......
<!-- 查看详情 --> <!-- 查看详情 -->
<template> <template>
<div class="pdfDialog"> <div class="pdfDialog">
<el-dialog <el-dialog :visible.sync="isVisible" :title="title" :before-close="handleClose" :close-on-click-modal="false" width="860px">
:visible.sync="isVisible"
:title="title"
:before-close="handleClose"
:close-on-click-modal="false"
width="860px"
>
<iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe> <iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
</el-dialog> </el-dialog>
</div> </div>
...@@ -17,8 +11,7 @@ ...@@ -17,8 +11,7 @@
export default { export default {
name: 'pdfDialog', name: 'pdfDialog',
data() { data() {
return { return {}
}
}, },
props: { props: {
...@@ -38,21 +31,20 @@ export default { ...@@ -38,21 +31,20 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.pdfDialog{ .pdfDialog {
.el-dialog__header { .el-dialog__header {
padding: 10px 16px 4px; padding: 10px 16px 4px;
background-color: #141516; background-color: #141516;
.el-dialog__title{ .el-dialog__title {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
} }
} }
.el-dialog__body { .el-dialog__body {
padding: 0; padding: 0;
background-color: #202223 background-color: #202223;
} }
} }
</style> </style>
<!-- 店面服务设置 --> <!-- 店面服务设置 -->
<template> <template>
<div class="before-sale"> <div class="before-sale edit-equity">
<el-form ref="form" :rules="editRule" label-width="100px" :model="editForm"> <div class="container edit-container">
<el-form-item label="服务热线" prop="hotline"> <p class="edit-title">{{ title }}</p>
<el-input class="find_width" size="small" maxlength="20" clearable placeholder="请输入服务热线" v-model="editForm.hotline"></el-input> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</el-form-item> <glsx-combi-form ref="editFormRefBrand" labelWidth="140px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm" :formData="editFormDataCar">
<el-form-item label="品牌"> <template slot="vehicleBrandId">
<el-col :span="5"> <el-select v-model="editForm.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicleBrandId)" style="width:160px;" clearable>
<el-select class="find_width_mini" size="small" clearable v-model="editForm.brand" placeholder="请选择品牌"> <el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
<el-option v-for="item in brandList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-col> </template>
<el-col :span="5"> <template slot="vehicleSubBrandId">
<el-select class="find_width_mini" size="small" clearable v-model="editForm.childBrand" placeholder="请选择子品牌"> <el-select v-model="editForm.vehicleSubBrandId" placeholder="请选择子品牌" filterable style="width:160px;" clearable>
<el-option v-for="item in childBrandList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</el-col> </template>
</el-form-item> </glsx-combi-form>
<el-form-item size="small"> </div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
</el-form-item> </div>
</el-form>
<!-- <div class="container edit-container">
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div> -->
</div> </div>
</template> </template>
<script> <script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default { export default {
name: 'serviceSet', name: 'serviceSet',
data() { data() {
return { return {
size: 'small', size: 'small',
isBlock: true,
title: '店面服务设置',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
editForm: { editForm: {
hotline: '', hotline: '',
brand: '', vehicleBrandId: '',
childBrand: '' vehicleSubBrandId: ''
}, },
editRule: { editRule: {
hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }] // hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
}, },
brandList: [], editFormData: [
childBrandList: [] {
label: '服务热线',
name: 'hotline',
width: '320px',
type: 'input',
maxlength: 20
} }
],
editFormDataCar: [
{
label: '主营品牌',
name: 'vehicleBrandId',
addHtml: 'vehicleBrandId'
}, },
{
label: '',
// label: '子品牌',
name: 'vehicleSubBrandId',
addHtml: 'vehicleSubBrandId'
}
],
// 公共数据
baseData: {
carBrandOptions: [],
carChildOptions: []
}
}
},
components: {
glsxCombiForm
},
created() {
this.getAllVehicleBrand()
this.getCarChildList()
},
mounted() { mounted() {
// this.getHotline() this.getHotline()
// this.getDefaultCarbrand()
}, },
methods: { methods: {
...@@ -56,37 +94,71 @@ export default { ...@@ -56,37 +94,71 @@ export default {
this.editForm.hotline = res this.editForm.hotline = res
}) })
}, },
getDefaultCarbrand() {
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
// console.log(res)
if(res) {
this.editForm.id = res.id
this.editForm.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicleSubBrandId = res.vehicleSubBrandId
this.handleChangeBrand(this.editForm.vehicleBrandId, true)
}
})
},
// 获取品牌车型
getAllVehicleBrand(fn = () => {}) {
const params = {}
this.$apis.beforeSale.getCarBrandListApi(params).then(res => {
// console.log(res)
this.baseData.carBrandOptions = res || []
})
},
handleChangeBrand(brandId, isRecovery = false) {
!isRecovery && (this.editForm.vehicleSubBrandId = '')
this.baseData.carChildOptions = brandId ? this.allCarChildList.find(item => item.id == brandId).childs : []
},
// 获取子品牌
getCarChildList(isRecovery = false) {
this.$apis.beforeSale.getCarChildListApi({}).then(res => {
this.allCarChildList = res || []
if (isRecovery) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicleBrandId).childs
}
this.getDefaultCarbrand()
})
},
handleConfirm() { handleConfirm() {
// this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
// if (valid) { if (valid) {
// var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
// this.$apis.beforeSale.updateHotlineApi(params).then(res => { Promise.all([this.$apis.beforeSale.updateHotlineApi(params), this.$apis.beforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => {
// this.$message({ this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败', message: (hotlineRes.code == '0' && carBrandRes.code == '0') ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error' type: (hotlineRes.code == '0' && carBrandRes.code == '0') ? 'success' : 'error'
// }) })
// }) this.getHotline()
// } this.getDefaultCarbrand()
// }) })
}
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style scoped>
.before-sale { .before-sale .container {
margin-top: 17px; padding: 0px 20px 20px 40px;
height: calc(100% - 17px);
background: #ffffff; background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
box-sizing: border-box; padding: 20px;
padding: 20px 0;
} }
.find_width { .before-sale .edit-container {
width: 320px; margin-bottom: 84px;
} }
.find_width_mini {
width: 215px; .before-sale .edit-form-container {
margin-top: 20px;
} }
.before-sale .txt-center { .before-sale .txt-center {
...@@ -119,7 +191,7 @@ export default { ...@@ -119,7 +191,7 @@ export default {
font-weight: bold; font-weight: bold;
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #E7EAEC;
margin: 0 0; margin: 0 0;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!