Commit f9f7cc2c by 杨北旺

添加广汇售前权益代码

1 parent 72375963
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'
const getUserInfoApi = params => {
params.method = 'scrm.api.equity.common.merchant.current.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCountNoDataApi = params => {
params.method = `${defaultPath}count.unDataEffective`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = `${defaultPath}order.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取门店
const getMerchantApi = params => {
params.method = 'scrm.api.equity.common.under.merchant.list.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => {
params.method = `${defaultPath}order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 打印合同
const getPriteApi = params => {
params.method = `${defaultPath}order.prite`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
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({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
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`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `${defaultPath}list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getEquityApi = params => {
params.method = `${orderPath}detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquityApi = params => {
params.method = `${orderPath}insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取合同号
const createCodeApi = params => {
params.method = `${orderPath}code.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取套菜附件属性
const getOrderAttrApi = params => {
params.method = `${defaultPath}order.attachment.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取套菜附件属性
// 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',
data: params,
sign: true
})
}
// 校验
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`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const uploadImgApi = params => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
// 退保
const backOrderApi = params => {
params.method = `${orderPath}charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审核
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
<!-- 权益订单 -->
<template>
<div class="equity">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="其他权益订单" name="equityList">
<equity-list v-show="activeName == 'equityList'"></equity-list>
</el-tab-pane>
<el-tab-pane label="店面服务设置" name="serviceSet">
<service-set v-show="activeName == 'serviceSet'"></service-set>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import equityList from './equityList'
import serviceSet from './serviceSet'
export default {
name: 'index',
data() {
return {
activeName: 'equityList'
}
},
components: {
equityList,
serviceSet
},
mounted() {},
methods: {
handleClick() { }
}
}
</script>
<style>
.equity .el-tabs__nav-wrap:after {
opacity: 0;
}
.equity .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
}
</style>
<!-- 查看详情 -->
<template>
<div class="pdfDialog">
<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>
</template>
<script>
export default {
name: 'pdfDialog',
data() {
return {}
},
props: {
isVisible: {
type: Boolean,
default: false
},
title: String,
pdfUrl: String
},
mounted() {},
methods: {
handleClose() {
this.$emit('closeDialog')
}
}
}
</script>
<style lang="scss">
.pdfDialog {
.el-dialog__header {
padding: 10px 16px 4px;
background-color: #141516;
.el-dialog__title {
color: #fff;
font-size: 16px;
}
}
.el-dialog__body {
padding: 0;
background-color: #202223;
}
}
</style>
<!-- 店面服务设置 -->
<template>
<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>
</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>
</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: '',
vehicleBrandId: '',
vehicleSubBrandId: ''
},
editRule: {
// hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
},
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.getDefaultCarbrand()
},
methods: {
getHotline() {
this.$apis.beforeSale.getHotlineApi({}).then(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() {
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 scoped>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .edit-container {
margin-bottom: 84px;
}
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
/* left: 220px; */
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
}
.before-sale .flex-grow {
flex: 1;
}
.before-sale .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
border-bottom: 1px solid #E7EAEC;
margin: 0 0;
}
.before-sale .edit-sub-title {
position: relative;
font-size: 13px;
font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333;
margin-bottom: 20px;
padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.before-sale .message-Z-zinde {
z-index: 3000 !important;
}
.before-sale .txt-red {
color: red;
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!