人员管理新增只填必填项前端逻辑有误,新增时部门未展示
This commit is contained in:
parent
5807d557d8
commit
64df12c9f3
@ -169,11 +169,18 @@
|
||||
<el-input v-model="form.userName" placeholder="请输入姓名" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
:data="enabledDeptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
check-strictly
|
||||
placeholder="请选择归属部门"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@ -368,11 +375,13 @@ const data = reactive({
|
||||
nickName: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
|
||||
password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }],
|
||||
email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
|
||||
policeNo: [{ required: true, message: "警号不能为空", trigger: "blur" }],
|
||||
phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
|
||||
}
|
||||
},
|
||||
enabledDeptOptions: []
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules,enabledDeptOptions } = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
@ -387,6 +396,7 @@ watch(deptName, val => {
|
||||
function getDeptTree() {
|
||||
deptTreeSelect().then(response => {
|
||||
deptOptions.value = response.data;
|
||||
enabledDeptOptions.value = response.data;
|
||||
});
|
||||
};
|
||||
|
||||
@ -581,7 +591,9 @@ function submitForm() {
|
||||
|
||||
proxy.$refs["userRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.certificateType = form.value.certificateType.toString()
|
||||
if(form.value.certificateType){
|
||||
form.value.certificateType = form.value.certificateType.toString()
|
||||
}
|
||||
console.log("certificateType",form.value.certificateType)
|
||||
if (form.value.userId != undefined) {
|
||||
updateOperator(form.value).then(response => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user