Commit 40ae291c authored by lixy's avatar lixy

车辆信息管理

parent 605672c3
...@@ -26,6 +26,7 @@ function loadFromServer(type) { ...@@ -26,6 +26,7 @@ function loadFromServer(type) {
} }
// url : baseURL+"",//路径 // url : baseURL+"",//路径
let rs = []; let rs = [];
if(type == 4){
$.ajax({ $.ajax({
type: 'get', type: 'get',
// url: process.env.BASE_API + '/vehicle/constant/type/' + type, // url: process.env.BASE_API + '/vehicle/constant/type/' + type,
...@@ -51,6 +52,34 @@ function loadFromServer(type) { ...@@ -51,6 +52,34 @@ function loadFromServer(type) {
console.log('请求常量信息出错。'); 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); console.log(rs);
return rs; return rs;
} }
......
...@@ -18,7 +18,7 @@ import Sticky from 'components/Sticky'; // 粘性header组件 ...@@ -18,7 +18,7 @@ import Sticky from 'components/Sticky'; // 粘性header组件
import IconSvg from 'components/Icon-svg';// svg 组件 import IconSvg from 'components/Icon-svg';// svg 组件
import vueWaves from './directive/waves';// 水波纹指令 import vueWaves from './directive/waves';// 水波纹指令
import errLog from 'store/errLog';// error log组件 import errLog from 'store/errLog';// error log组件
import './mock/index.js'; // 该项目所有请求使用mockjs模拟 // import './mock/index.js'; // 该项目所有请求使用mockjs模拟
import { getToken } from 'utils/auth'; import { getToken } from 'utils/auth';
import 'babel-polyfill';//支持IE执行原生script import 'babel-polyfill';//支持IE执行原生script
import XEUtils from 'xe-utils';//加入常用工具类 import XEUtils from 'xe-utils';//加入常用工具类
......
...@@ -1742,7 +1742,7 @@ ...@@ -1742,7 +1742,7 @@
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_BRAND_CODE_UNKOWN) { if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_BRAND_CODE_UNKOWN) {
return '未知'; return '未知';
} }
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val; return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val: '品牌不存在';
}, },
getAllBranch: () => { getAllBranch: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_BRAND); return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_BRAND);
...@@ -1751,7 +1751,7 @@ ...@@ -1751,7 +1751,7 @@
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_USE_TYPE_UNKOWN) { if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_USE_TYPE_UNKOWN) {
return '未知'; return '未知';
} }
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val; return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val: '用途未知';
}, },
getAllUseType: () => { getAllUseType: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_USE); 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