Commit f41dfbb4 by 冒粤蓉

fix

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