Commit 40ae291c authored by lixy's avatar lixy

车辆信息管理

parent 605672c3
......@@ -26,31 +26,60 @@ function loadFromServer(type) {
}
// url : baseURL+"",//路径
let rs = [];
$.ajax({
type: 'get',
// url: process.env.BASE_API + '/vehicle/constant/type/' + type,
url: process.env.BASE_API + '/vehicle/area/findAll',
async: false,
headers: {
Authorization: headerAuthorization
},
dataType: 'json',
data: {},
success: function (result) {
// 返回数据根据结果进行相应的处理
if (result.code === rsCode.RS_CODE_SUC) {
result.data.map(function(item){
rs.push(item);
})
} else {
if(type == 4){
$.ajax({
type: 'get',
// url: process.env.BASE_API + '/vehicle/constant/type/' + type,
url: process.env.BASE_API + '/vehicle/area/findAll',
async: false,
headers: {
Authorization: headerAuthorization
},
dataType: 'json',
data: {},
success: function (result) {
// 返回数据根据结果进行相应的处理
if (result.code === rsCode.RS_CODE_SUC) {
result.data.map(function(item){
rs.push(item);
})
} else {
console.log('请求常量信息出错。');
}
return rs;
},
error: function () {
console.log('请求常量信息出错。');
}
return rs;
},
error: function () {
console.log('请求常量信息出错。');
}
});
});
} else {
$.ajax({
type: 'get',
url: process.env.BASE_API + '/vehicle/constant/type/' + type,
// url: process.env.BASE_API + '/vehicle/area/findAll',
async: false,
headers: {
Authorization: headerAuthorization
},
dataType: 'json',
data: {},
success: function (result) {
// 返回数据根据结果进行相应的处理
if (result.code === rsCode.RS_CODE_SUC) {
result.data.map(function(item){
rs.push(item);
})
} else {
console.log('请求常量信息出错。');
}
return rs;
},
error: function () {
console.log('请求常量信息出错。');
}
});
}
console.log(rs);
return rs;
}
......
......@@ -18,7 +18,7 @@ import Sticky from 'components/Sticky'; // 粘性header组件
import IconSvg from 'components/Icon-svg';// svg 组件
import vueWaves from './directive/waves';// 水波纹指令
import errLog from 'store/errLog';// error log组件
import './mock/index.js'; // 该项目所有请求使用mockjs模拟
// import './mock/index.js'; // 该项目所有请求使用mockjs模拟
import { getToken } from 'utils/auth';
import 'babel-polyfill';//支持IE执行原生script
import XEUtils from 'xe-utils';//加入常用工具类
......
......@@ -1742,7 +1742,7 @@
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_BRAND_CODE_UNKOWN) {
return '未知';
}
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val;
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val: '品牌不存在';
},
getAllBranch: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_BRAND);
......@@ -1751,7 +1751,7 @@
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_USE_TYPE_UNKOWN) {
return '未知';
}
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val;
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val: '用途未知';
},
getAllUseType: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_USE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment