Commit c58e1cf1 by 杨北旺

更新爱车保镖代码

1 parent 2ee99d7d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class="before-sale edit-equity"> <div class="before-sale edit-equity">
<div class="help-service"> <div class="help-service">
<img class="service-img" src="./image/code.png"/> <img class="service-img" src="./image/code.png" />
<p>提单及服务咨询</p> <p>提单及服务咨询</p>
<!-- <p>在线客服随时咨询</p> --> <!-- <p>在线客服随时咨询</p> -->
<p class="service-hotline">服务热线</p> <p class="service-hotline">服务热线</p>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<p class="edit-title">车辆信息</p> <p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="160px" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar"> <glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="160px" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar">
</glsx-combi-form> </glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="160px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar"> <glsx-combi-form ref="editFormRefBrand" labelWidth="160px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope"> <template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:160px;" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:160px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
...@@ -144,19 +144,23 @@ export default { ...@@ -144,19 +144,23 @@ export default {
// 车辆信息 // 车辆信息
editRuleCar: { editRuleCar: {
// licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }], // licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
licensePlate: [{ validator: (rule, value, callback) => { licensePlate: [{
return value ? ((/.{7,8}/).test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback() validator: (rule, value, callback) => {
}, trigger: 'change' }], return value ? ((/.{7,8}/).test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback()
}, trigger: 'change'
}],
vin: [{ required: true, message: '请输入车架号', trigger: 'change' }, vin: [{ required: true, message: '请输入车架号', trigger: 'change' },
{ validator: (rule, value, callback) => { {
return (/^[a-zA-Z0-9]{17}$/).test(value) ? callback() : callback(new Error('请输入17位数字和字母')) validator: (rule, value, callback) => {
}, trigger: 'change' return (/^[a-zA-Z0-9]{17}$/).test(value) ? callback() : callback(new Error('请输入17位数字和字母'))
}], }, trigger: 'change'
}],
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' }, engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' },
{ validator: (rule, value, callback) => { {
return (/^[a-zA-Z0-9]{6,16}$/).test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合')) validator: (rule, value, callback) => {
}, trigger: 'change' return (/^[a-zA-Z0-9]{6,16}$/).test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合'))
}], }, trigger: 'change'
}],
invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }], invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }],
// vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }], // vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }], vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }],
...@@ -248,21 +252,24 @@ export default { ...@@ -248,21 +252,24 @@ export default {
customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }], customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }], customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }], cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
cardNo: [{ required: true, cardNo: [{
validator: (rule, value, callback) => { required: true,
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码' ))) validator: (rule, value, callback) => {
}, trigger: 'change' return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码')))
}, }, trigger: 'change'
{ validator: (rule, value, callback) => { },
return (/[a-zA-Z0-9]{18}/).test(value) ? callback() : callback(new Error('请输入18位数字或字母')) {
}, trigger: 'change' validator: (rule, value, callback) => {
}], return (/[a-zA-Z0-9]{18}/).test(value) ? callback() : callback(new Error('请输入18位数字或字母'))
}, trigger: 'change'
}],
customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' }, customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' },
{ validator: (rule, value, callback) => { {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/; validator: (rule, value, callback) => {
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码')) let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/;
}, trigger: 'change' return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
}], }, trigger: 'change'
}],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }] customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
}, },
editFormDataUser: [ editFormDataUser: [
...@@ -314,7 +321,7 @@ export default { ...@@ -314,7 +321,7 @@ export default {
label: '联系地址', label: '联系地址',
name: 'customerAddress', name: 'customerAddress',
type: 'input', type: 'input',
maxlength: 30 maxlength: 100
} }
], ],
// 选择产品 // 选择产品
...@@ -467,13 +474,13 @@ export default { ...@@ -467,13 +474,13 @@ export default {
}, },
watch: { watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue){ 'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000) this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
}, },
'editForm.actualSalesPrice'(newValue, oldValue){ 'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2) this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
}, },
'editFormPro.additional_price'(newValue, oldValue){ 'editFormPro.additional_price'(newValue, oldValue) {
this.editFormPro.additional_price = limitPrice(newValue, oldValue, 6, 2) this.editFormPro.additional_price = limitPrice(newValue, oldValue, 6, 2)
} }
}, },
...@@ -493,7 +500,7 @@ export default { ...@@ -493,7 +500,7 @@ export default {
this.routeInfo = this.$route.params this.routeInfo = this.$route.params
this.disabled = this.routeInfo.addOrEdit == '5' this.disabled = this.routeInfo.addOrEdit == '5'
// 提单成功 - 修改 // 提单成功 - 修改
if(this.routeInfo.isSuper != 'true') { if (this.routeInfo.isSuper != 'true') {
this.successDisable = this.routeInfo.addOrEdit == '3' this.successDisable = this.routeInfo.addOrEdit == '3'
} }
this.getOptionsList('editFormDataCar', false) this.getOptionsList('editFormDataCar', false)
...@@ -524,21 +531,21 @@ export default { ...@@ -524,21 +531,21 @@ export default {
}) })
} }
}, },
handleCancelBubble(e) {}, handleCancelBubble(e) { },
getDefaultCarbrand() { getDefaultCarbrand() {
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => { this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
// 获取套餐列表 // 获取套餐列表
this.getPackageList() this.getPackageList()
if(res) { if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
if(this.routeInfo.addOrEdit == '1') { if (this.routeInfo.addOrEdit == '1') {
this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId this.editForm.vehicle.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId this.editForm.vehicle.vehicleSubBrandId = res.vehicleSubBrandId
if (this.editForm.vehicle.vehicleBrandId) { if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
} }
if(this.editForm.vehicle.vehicleSubBrandId) { if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true) this.getCarSeriesList(true)
} }
} }
...@@ -561,13 +568,13 @@ export default { ...@@ -561,13 +568,13 @@ export default {
if (this.editForm.actualSalesPrice) { if (this.editForm.actualSalesPrice) {
this.editForm.actualSalesPrice = (this.editForm.actualSalesPrice / 100).toFixed(2) this.editForm.actualSalesPrice = (this.editForm.actualSalesPrice / 100).toFixed(2)
} }
if(this.editForm.attributeList && this.editForm.attributeList.length) { if (this.editForm.attributeList && this.editForm.attributeList.length) {
var idxPrice = this.editForm.attributeList.findIndex(i => i.attributeName == 'additional_price') var idxPrice = this.editForm.attributeList.findIndex(i => i.attributeName == 'additional_price')
this.editForm.attributeList[idxPrice].attributeValue = this.editForm.attributeList[idxPrice].attributeValue ? (this.editForm.attributeList[idxPrice].attributeValue / 100).toFixed(2) : '' this.editForm.attributeList[idxPrice].attributeValue = this.editForm.attributeList[idxPrice].attributeValue ? (this.editForm.attributeList[idxPrice].attributeValue / 100).toFixed(2) : ''
} }
this.editForm.vehicle.billingDate = this.editForm.vehicle.billingDate ? new Date(this.editForm.vehicle.billingDate) : '' this.editForm.vehicle.billingDate = this.editForm.vehicle.billingDate ? new Date(this.editForm.vehicle.billingDate) : ''
this.editForm.effectiveDate = this.editForm.effectiveDate ? new Date(this.editForm.effectiveDate) : '' this.editForm.effectiveDate = this.editForm.effectiveDate ? new Date(this.editForm.effectiveDate) : ''
if(['2', '3', '4'].includes(this.routeInfo.addOrEdit)) { if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
this.editForm.vehicle.vehicleBrandId = this.editForm.vehicle.vehicleBrandId || this.defaultBrandForm.vehicleBrandId this.editForm.vehicle.vehicleBrandId = this.editForm.vehicle.vehicleBrandId || this.defaultBrandForm.vehicleBrandId
this.editForm.vehicle.vehicleSubBrandId = this.editForm.vehicle.vehicleSubBrandId || this.defaultBrandForm.vehicleSubBrandId this.editForm.vehicle.vehicleSubBrandId = this.editForm.vehicle.vehicleSubBrandId || this.defaultBrandForm.vehicleSubBrandId
} }
...@@ -597,7 +604,7 @@ export default { ...@@ -597,7 +604,7 @@ export default {
}) })
}, },
// 改建议价,实际销售价 // 改建议价,实际销售价
packageToPrice() { packageToPrice(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.editForm.suggestedSellingPrice = '' this.editForm.suggestedSellingPrice = ''
if (this.editForm.vehicle.invoicePrice) { if (this.editForm.vehicle.invoicePrice) {
...@@ -605,14 +612,14 @@ export default { ...@@ -605,14 +612,14 @@ export default {
targetItem && targetItem.servicePackagePrices.forEach(item => { targetItem && targetItem.servicePackagePrices.forEach(item => {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) { if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2) this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
this.editForm.actualSalesPrice = (item.retailPrice / 100).toFixed(2) this.editForm.actualSalesPrice = recovery ? (this.editForm.actualSalesPrice || (item.retailPrice / 100).toFixed(2)) : (item.retailPrice / 100).toFixed(2)
} }
}) })
} }
}, },
packageAttr(recovery = false) { packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.packageToPrice() this.packageToPrice(recovery)
var tempObj = this.$common.utils.deepClone(this.editFormPro) var tempObj = this.$common.utils.deepClone(this.editFormPro)
this.editRulePro = {} this.editRulePro = {}
this.editFormPro = {} this.editFormPro = {}
...@@ -631,7 +638,7 @@ export default { ...@@ -631,7 +638,7 @@ export default {
] ]
} }
} else { } else {
for(var i = 0; i < item.num; i++) { for (var i = 0; i < item.num; i++) {
item.attributeList.forEach(k => { item.attributeList.forEach(k => {
attrName = k.attributeName attrName = k.attributeName
this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '') this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
...@@ -669,7 +676,7 @@ export default { ...@@ -669,7 +676,7 @@ export default {
if (k.attributeList[0].attributeType == 'datePicker') { if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date' tempList[idx].dateType = 'date'
tempList[idx].valueFormat = 'yyyy-MM-dd', tempList[idx].valueFormat = 'yyyy-MM-dd',
tempList[idx].pickerOptions = 'beforeRangePickerOptions' tempList[idx].pickerOptions = 'beforeRangePickerOptions'
} }
} else { } else {
var tableList = [] var tableList = []
...@@ -736,7 +743,7 @@ export default { ...@@ -736,7 +743,7 @@ export default {
} }
}, },
// 获取品牌车型 // 获取品牌车型
getAllVehicleBrand(fn = () => {}) { getAllVehicleBrand(fn = () => { }) {
const params = {} const params = {}
this.$apis.beforeSale.getCarBrandListApi(params).then(res => { this.$apis.beforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || [] this.baseData.carBrandOptions = res || []
...@@ -856,7 +863,7 @@ export default { ...@@ -856,7 +863,7 @@ export default {
if (this.submit) { if (this.submit) {
return true return true
} }
if(!this.editForm.customerName) { if (!this.editForm.customerName) {
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('customerName') this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('customerName')
this.whereToGo('customerName') this.whereToGo('customerName')
return true return true
...@@ -898,7 +905,7 @@ export default { ...@@ -898,7 +905,7 @@ export default {
var flag = true var flag = true
var errorObjList = [] var errorObjList = []
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
if(this.$refs['editFormRef' + list[i]]) { if (this.$refs['editFormRef' + list[i]]) {
var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]] var pRef = list[i] == 'Pro' ? this.$refs['editFormRef' + list[i]][0] : this.$refs['editFormRef' + list[i]]
pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => { pRef.$refs['editChildRef' + list[i]].validate((valid, errorObj) => {
!valid && errorObjList.push(errorObj) !valid && errorObjList.push(errorObj)
...@@ -914,7 +921,7 @@ export default { ...@@ -914,7 +921,7 @@ export default {
var params = this.getParams() var params = this.getParams()
params.operationType = 1 params.operationType = 1
if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) { if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
if(this.routeInfo.addOrEdit == '4' && this.editForm.orderStatus != 3) { if (this.routeInfo.addOrEdit == '4' && this.editForm.orderStatus != 3) {
params.contractNo = '' params.contractNo = ''
} else { } else {
params.contractNo = this.routeInfo.contractNo params.contractNo = this.routeInfo.contractNo
...@@ -923,7 +930,7 @@ export default { ...@@ -923,7 +930,7 @@ export default {
params.contractNo = '' params.contractNo = ''
} }
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => { this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if(res.code == '0') { if (res.code == '0') {
this.updateEquity(params) this.updateEquity(params)
} else { } else {
this.submit = false this.submit = false
...@@ -962,7 +969,7 @@ export default { ...@@ -962,7 +969,7 @@ export default {
} }
} }
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => { this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
if(res) { if (res) {
this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId this.defaultBrandForm.vehicleBrandId = res.vehicleBrandId
this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId this.defaultBrandForm.vehicleSubBrandId = res.vehicleSubBrandId
// if(this.routeInfo.addOrEdit == '1') { // if(this.routeInfo.addOrEdit == '1') {
...@@ -971,7 +978,7 @@ export default { ...@@ -971,7 +978,7 @@ export default {
if (this.editForm.vehicle.vehicleBrandId) { if (this.editForm.vehicle.vehicleBrandId) {
this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs this.baseData.carChildOptions = this.allCarChildList.find(item => item.id == this.editForm.vehicle.vehicleBrandId).childs
} }
if(this.editForm.vehicle.vehicleSubBrandId) { if (this.editForm.vehicle.vehicleSubBrandId) {
this.getCarSeriesList(true) this.getCarSeriesList(true)
} }
} }
...@@ -1001,9 +1008,9 @@ export default { ...@@ -1001,9 +1008,9 @@ export default {
width: 144px; width: 144px;
height: 268px; height: 268px;
text-align: center; text-align: center;
background: #FFFFFF; background: #ffffff;
border: 1px solid rgb(220, 223, 230, 0.5); border: 1px solid rgb(220, 223, 230, 0.5);
box-shadow: 0px 3px 6px -4px rgba(0,0,0,0.12); box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
} }
.help-service .service-img { .help-service .service-img {
width: 124px; width: 124px;
...@@ -1019,7 +1026,7 @@ export default { ...@@ -1019,7 +1026,7 @@ export default {
font-weight: bold; font-weight: bold;
} }
.help-service .service-phone { .help-service .service-phone {
color: #5850FF; color: #5850ff;
} }
/* 客服 - end */ /* 客服 - end */
.before-sale .container { .before-sale .container {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <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 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"> <glsx-combi-form ref="editFormRefBrand" labelWidth="140px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm" :formData="editFormDataCar">
<template slot="vehicleBrandId"> <template slot="vehicleBrandId">
<el-select v-model="editForm.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicleBrandId)" style="width:160px;" clearable> <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-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
</el-select> </el-select>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
<div style="margin-left: 140px">
<p>针对包含“车主生活权益服务”的服务套餐,提供通过扫描小程序码进行领取“车主生活权益服务”。</p>
<img class="qrcodeImg" :src="qrcodeUrl" />
</div>
</div> </div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> --> <!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }"> <div class="footer" :style="{ width: '100%' }">
...@@ -36,6 +40,7 @@ export default { ...@@ -36,6 +40,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
qrcodeUrl: '',
editForm: { editForm: {
hotline: '', hotline: '',
vehicleBrandId: '', vehicleBrandId: '',
...@@ -91,13 +96,14 @@ export default { ...@@ -91,13 +96,14 @@ export default {
methods: { methods: {
getHotline() { getHotline() {
this.$apis.beforeSale.getHotlineApi({}).then(res => { this.$apis.beforeSale.getHotlineApi({}).then(res => {
this.editForm.hotline = res this.editForm.hotline = res.serviceHotline
this.qrcodeUrl = res.qrcodeUrl
}) })
}, },
getDefaultCarbrand() { getDefaultCarbrand() {
this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => { this.$apis.beforeSale.getDefaultCarbrandApi({}).then(res => {
// console.log(res) // console.log(res)
if(res) { if (res) {
this.editForm.id = res.id this.editForm.id = res.id
this.editForm.vehicleBrandId = res.vehicleBrandId this.editForm.vehicleBrandId = res.vehicleBrandId
this.editForm.vehicleSubBrandId = res.vehicleSubBrandId this.editForm.vehicleSubBrandId = res.vehicleSubBrandId
...@@ -133,8 +139,8 @@ export default { ...@@ -133,8 +139,8 @@ export default {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
Promise.all([this.$apis.beforeSale.updateHotlineApi(params), this.$apis.beforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => { Promise.all([this.$apis.beforeSale.updateHotlineApi(params), this.$apis.beforeSale.updateCarBrandApi(params)]).then(([hotlineRes, carBrandRes]) => {
this.$message({ this.$message({
message: (hotlineRes.code == '0' && carBrandRes.code == '0') ? '操作成功' : '操作失败', message: hotlineRes.code == '0' && carBrandRes.code == '0' ? '操作成功' : '操作失败',
type: (hotlineRes.code == '0' && carBrandRes.code == '0') ? 'success' : 'error' type: hotlineRes.code == '0' && carBrandRes.code == '0' ? 'success' : 'error'
}) })
this.getHotline() this.getHotline()
this.getDefaultCarbrand() this.getDefaultCarbrand()
...@@ -191,7 +197,7 @@ export default { ...@@ -191,7 +197,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;
} }
...@@ -222,4 +228,8 @@ export default { ...@@ -222,4 +228,8 @@ export default {
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.before-sale .qrcodeImg {
width: 160px;
height: 160px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!