Commit f25d7db8 by 杨北旺

更新售前权益的代码

1 parent a2942358
import { http, http_brand } from '@/main'
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'
......@@ -67,7 +67,7 @@ const getPriteApi = params => {
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http_brand({
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
......@@ -78,7 +78,7 @@ const getCarBrandListApi = params => {
const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http_brand({
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
......@@ -88,7 +88,7 @@ const getCarChildListApi = params => {
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
......@@ -98,7 +98,7 @@ const getCarSeriesListApi = params => {
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: 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 => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
......@@ -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 => {
params.method = `${defaultPath}select.get`
......@@ -193,8 +214,17 @@ const getOrderAttrApi = params => {
}
// 获取套菜附件属性
const getOrderValueApi = params => {
params.method = `${defaultPath}order.attachment.value.get`
// const getOrderValueApi = params => {
// 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({
url: 'rop-scrm-equity/router',
method: 'GET',
......@@ -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 => {
params.method = `${orderPath}attachment.update`
......@@ -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
// 审核
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
......@@ -48,7 +48,7 @@ const staticRoutes = Object.freeze([{
},
{
name: 'editEquity',
path: '/beforeSale/editEquity',
path: '/beforeSale/editEquity/:id',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
},
......
......@@ -18,14 +18,14 @@ export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {}
window.location.href.split('?').length > 1
? window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
})
: ''
window.location.href.split('?').length > 1 ?
window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
}) :
''
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 } })
......@@ -34,4 +34,4 @@ export async function start() {
}
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
}
\ No newline at end of file
......@@ -2,7 +2,6 @@
<template>
<div class="equity"></div>
</template>
<script>
export default {
name: 'index',
......@@ -15,9 +14,8 @@ export default {
this.$router.push('/beforeSale/equityList')
},
mounted() {},
methods: {}
}
</script>
<style>
</style>
</style>
\ No newline at end of file
<!-- 查看详情 -->
<template>
<div class="pdfDialog">
<el-dialog
:visible.sync="isVisible"
:title="title"
:before-close="handleClose"
:close-on-click-modal="false"
width="860px"
>
<el-dialog :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>
</el-dialog>
</div>
......@@ -17,8 +11,7 @@
export default {
name: 'pdfDialog',
data() {
return {
}
return {}
},
props: {
......@@ -38,21 +31,20 @@ export default {
}
}
}
</script>
<style lang="scss">
.pdfDialog{
.pdfDialog {
.el-dialog__header {
padding: 10px 16px 4px;
background-color: #141516;
.el-dialog__title{
.el-dialog__title {
color: #fff;
font-size: 16px;
}
}
.el-dialog__body {
padding: 0;
background-color: #202223
background-color: #202223;
}
}
</style>
<!-- 店面服务设置 -->
<template>
<div class="before-sale">
<el-form ref="form" :rules="editRule" label-width="100px" :model="editForm">
<el-form-item label="服务热线" prop="hotline">
<el-input class="find_width" size="small" maxlength="20" clearable placeholder="请输入服务热线" v-model="editForm.hotline"></el-input>
</el-form-item>
<el-form-item label="品牌">
<el-col :span="5">
<el-select class="find_width_mini" size="small" clearable v-model="editForm.brand" placeholder="请选择品牌">
<el-option v-for="item in brandList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<div class="before-sale edit-equity">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="140px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm" :formData="editFormDataCar">
<template slot="vehicleBrandId">
<el-select v-model="editForm.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicleBrandId)" style="width:160px;" clearable>
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</el-col>
<el-col :span="5">
<el-select class="find_width_mini" size="small" clearable v-model="editForm.childBrand" placeholder="请选择子品牌">
<el-option v-for="item in childBrandList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</template>
<template slot="vehicleSubBrandId">
<el-select v-model="editForm.vehicleSubBrandId" placeholder="请选择子品牌" filterable style="width:160px;" clearable>
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</el-col>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleConfirm">确定</el-button>
</el-form-item>
</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> -->
</template>
</glsx-combi-form>
</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>
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'serviceSet',
data() {
return {
size: 'small',
isBlock: true,
title: '店面服务设置',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
editForm: {
hotline: '',
brand: '',
childBrand: ''
vehicleBrandId: '',
vehicleSubBrandId: ''
},
editRule: {
hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
// hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
},
brandList: [],
childBrandList: []
editFormData: [
{
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() {
// this.getHotline()
this.getHotline()
// this.getDefaultCarbrand()
},
methods: {
......@@ -56,37 +94,71 @@ export default {
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() {
// this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
// if (valid) {
// var params = this.$common.utils.deepClone(this.editForm)
// this.$apis.beforeSale.updateHotlineApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// })
// }
// })
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
Promise.all([this.$apis.beforeSale.updateHotlineApi(params), this.$apis.beforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => {
this.$message({
message: (hotlineRes.code == '0' && carBrandRes.code == '0') ? '操作成功' : '操作失败',
type: (hotlineRes.code == '0' && carBrandRes.code == '0') ? 'success' : 'error'
})
this.getHotline()
this.getDefaultCarbrand()
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.before-sale {
margin-top: 17px;
height: calc(100% - 17px);
<style scoped>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 20px 0;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.find_width {
width: 320px;
.before-sale .edit-container {
margin-bottom: 84px;
}
.find_width_mini {
width: 215px;
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
......@@ -119,7 +191,7 @@ export default {
font-weight: bold;
height: 48px;
line-height: 48px;
border-bottom: 1px solid #e7eaec;
border-bottom: 1px solid #E7EAEC;
margin: 0 0;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!