Commit c7502836 authored by 周健威's avatar 周健威

修改用户相关

parent a3ec92dd
......@@ -5,6 +5,7 @@ import {
VEHICLE_CONSTANT_VEHICLE_USE,
VEHICLE_CONSTANT_BRAND_CODE_UNKOWN,
INSURANCE_COMPANY,
ZONE,
VEHICLE_CONSTANT_INSURANCE_COMPANY_UNKOWN,
VEHICLE_CONSTANT_USE_TYPE_UNKOWN,
VEHICLE_CONSTANT_STATUS_NORMAL
......@@ -107,7 +108,7 @@ export function getConstantListByType(type) {
return constantMap;
}
/** 保险公司 */
export function getInsuranceCompany(code) {
if (code == null || typeof (code) == "undefined" || code === VEHICLE_CONSTANT_INSURANCE_COMPANY_UNKOWN) {
return '未知';
......@@ -118,3 +119,15 @@ export function getInsuranceCompany(code) {
export function getAllInsuranceCompany() {
return getConstantListByType(INSURANCE_COMPANY);
}
/** 片区 */
export function getZone(code) {
if (code == null || typeof (code) == "undefined" ) {
return '未知';
}
return getConstantByTypeAndCode(ZONE, code).val;
}
export function getAllZone() {
return getConstantListByType(ZONE);
}
......@@ -2,6 +2,7 @@
export const VEHICLE_CONSTANT_VEHICLE_BRAND = 1; // "车辆品牌"
export const VEHICLE_CONSTANT_VEHICLE_USE = 2; // "车辆用途"
export const INSURANCE_COMPANY = 3; // "保险公司"
export const ZONE = 4; // "片区"
export const VEHICLE_CONSTANT_BRAND_CODE_UNKOWN = 0; // 车辆品牌-未知
......
......@@ -49,6 +49,16 @@
<el-form-item v-if="dialogStatus == 'create'" label="密码" placeholder="请输入密码" prop="password">
<el-input type="password" v-model="form.password"></el-input>
</el-form-item>
<el-form-item label="是否开启" prop="status">
<el-radio-group class="filter-item" v-model="form.status" >
<el-radio v-for="item in statusOptions" :key="item" :label="item" :value="item" ></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属片区">
<el-select class="filter-item" v-model="form.zone" placeholder="请选择">
<el-option v-for="(val, key, index) in getAllZone()" :key="val.code" :label="val.val" :value="val.code"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="性别">
<el-select class="filter-item" v-model="form.sex" placeholder="请选择">
<el-option v-for="item in sexOptions" :key="item" :label="item" :value="item"> </el-option>
......@@ -75,7 +85,14 @@ import {
delObj,
putObj
} from 'api/admin/user/index';
import { mapGetters } from 'vuex';
import {
getAllZone,
getZone
} from 'api/base_info/constant/';
export default {
name: 'user',
data() {
......@@ -84,6 +101,7 @@ export default {
username: undefined,
name: undefined,
sex: '男',
status: '开启',
password: undefined,
description: undefined
},
......@@ -126,6 +144,11 @@ export default {
message: '长度在 5 到 20 个字符',
trigger: 'blur'
}
],
status: [
{
required: true
}
]
},
list: null,
......@@ -137,6 +160,8 @@ export default {
name: undefined
},
sexOptions: ['男', '女'],
zoneOptions: ['男', '女'],
statusOptions: ['开启', '禁用'],
dialogFormVisible: false,
dialogStatus: '',
userManager_btn_edit: false,
......@@ -264,10 +289,14 @@ export default {
username: undefined,
name: undefined,
sex: '男',
status: '开启',
zone: undefined,
password: undefined,
description: undefined
};
}
},
getAllZone,
getZone
}
}
</script>
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