Commit f41dfbb4 by 冒粤蓉

fix

1 parent fabe6e7d
......@@ -49,26 +49,21 @@ export default {
methods: {
...mapMutations(['updateBaseURL']),
getBreadcrumb() {
const { getters: {curBreadCrumb}} = this.$root.parentVuex;
let matched = this.$route.matched.filter(item => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const first = matched[0];
const { meta, path } = first;
const basePath = '/trialRun#';
const basePath = '/oEshield#';
let breadcrumb = [];
if(meta) {
const { title, parentTitle, parentPath } = meta;
if(parentTitle) {
breadcrumb.push({
name: parentTitle,
path: basePath + parentPath
})
}
if(title) {
const { title, pushState } = meta;
if(pushState && title) {
breadcrumb.push({
name: title,
path: basePath + path
})
this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb[0]]);
}
this.$root.parentVuex.dispatch('menu/setBreadCrumb', breadcrumb);
}
},
goToPage(path) {
......
......@@ -47,8 +47,7 @@ const routes = [
component: () => import('../views/vehicleSubmit/addVehicle/index.vue'),
meta: {
title: '上牌资料详情',
parentTitle: '上牌资料提交',
parentPath: '/vehicleSubmit',
pushState: true,
keepAlive: true
}
},
......@@ -85,8 +84,7 @@ const routes = [
component: () => import('../views/specialShop/addShop/index.vue'),
meta: {
title: '新增特约店',
parentTitle: '特约店列表',
parentPath: '/specialShop',
pushState: true,
keepAlive: false
}
},
......@@ -96,6 +94,7 @@ const routes = [
component: () => import('../views/testDrive/checkList.vue'),
meta: {
title: '试驶线路审核',
pushState: true,
keepAlive: true
}
},
......
......@@ -296,6 +296,7 @@ export default {
this.form.specialShopId = data.specialShopId;
this.form.specialShopName = data.shopName;
this.form.shopLevel = data.shopLevel;
this.form.analysisAddress = data.address;
if(form.shapeType === 1){
this.mapData = {
......@@ -396,23 +397,23 @@ export default {
}
},
getAddress(flag){
const lnglatXY = [this.form.lng, this.form.lat];
this.form.analysisAddress = ''
this.geocoder.getAddress(lnglatXY, (status, result)=>{
if(flag == this.transferFlag){
if (status === 'complete' && result.info === 'OK') {//获取地址成功
//console.log(result.regeocode.formattedAddress)
this.form.analysisAddress = result.regeocode.formattedAddress;
this.transferError = false;
this.$refs.shopForm.validateField('analysisAddress');
//this.$refs.fenceMap.updateMap(this.form)
}else{
this.transferError = true;
this.$refs.shopForm.validateField('analysisAddress');
}
}
});
},
const lnglatXY = [this.form.lng, this.form.lat];
this.form.analysisAddress = ''
this.geocoder.getAddress(lnglatXY, (status, result)=>{
if(flag == this.transferFlag){
if (status === 'complete' && result.info === 'OK') {//获取地址成功
//console.log(result.regeocode.formattedAddress)
this.form.analysisAddress = result.regeocode.formattedAddress;
this.transferError = false;
this.$refs.shopForm.validateField('analysisAddress');
//this.$refs.fenceMap.updateMap(this.form)
}else{
this.transferError = true;
this.$refs.shopForm.validateField('analysisAddress');
}
}
});
},
getParams(){
const form = this.form;
const params = {};
......@@ -488,7 +489,7 @@ export default {
});
}
this.submitting = false;
this.$router.push({path:"fenceManagement"})
history.go(-1)
});
}else{
saveFence(this.getParams()).then((res)=>{
......@@ -500,7 +501,7 @@ export default {
});
}
this.submitting = false;
this.$router.push('/specialShop')
history.go(-1)
});
}
......@@ -511,7 +512,7 @@ export default {
},
cancel(){
this.$router.push('/specialShop')
history.go(-1)
},
}
}
......
......@@ -193,6 +193,13 @@ import store from '@/store'
import { getList, getSpecialShopList, addVehicle, editVehicle, downloadtemplate, deleteVehicle, unbindVehicle, importVehicle, exportVehicle, infoVehicle } from 'services/vehicle'
export default {
data() {
let checkShopName = (rule, vaule, cb)=>{
if(this.vehicleForm.shopName==""){
cb(new Error('请选择特约店名称'))
}else{
cb();
}
}
return {
searchForm: {},
vehicleFormList: [
......@@ -324,7 +331,7 @@ export default {
{ label: '设备号:', prop: 'sn', type: 'input', maxlength: 15, clearable: true }
],
vehicleRules: {
shopName: [{ required: true, message: '请选择特约店名称', trigger: 'blur' }],
shopName: [{ required: true, validator: checkShopName, trigger: 'blur' }],
vin: [{ required: true, message: '请输入车架号', trigger: 'blur' },
{ validator: this.$Common.checkvin, trigger: 'blur' }],
modelId: [{ required: true, message: '请选择车型', trigger: 'blur' }],
......@@ -537,7 +544,14 @@ export default {
})
},
filterConfirm() {
const { label, id } = this.$refs.tree.getCurrentNode();
const { label, id, children } = this.$refs.tree.getCurrentNode();
if(children) {
this.$message({
message: '请选择下级特约店',
type: 'error'
})
return;
}
this.$set(this.vehicleForm, 'shopName', label);
this.vehicleForm.shopNameId = id
this.closeFilter();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!