Commit 529686b6 authored by zhengke's avatar zhengke

修改

parent 23be16ad
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SName" ref="SName" <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SName" ref="SName"
class="col-6 q-pr-lg q-pb-lg" label="校区名称" :rules="[val => !!val || '请填写校区名称']" /> class="col-6 q-pr-lg q-pb-lg" label="校区名称" :rules="[val => !!val || '请填写校区名称']" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.SAddress" ref="SAddress" <q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.SAddress" ref="SAddress"
class="col-6 q-pb-lg" label="校区地址" /> class="col-6 q-pb-lg" label="校区地址" :rules="[val => !!val || '请填写校区地址']" />
<q-select class="col-6 q-pb-lg q-pr-lg" clearable filled stack-label use-input option-value="Id" <q-select class="col-6 q-pb-lg q-pr-lg" clearable filled stack-label use-input option-value="Id"
option-label="EmployeeName" v-model="objOption.ManagerId" ref="ManagerId" :options="EmployeeList" option-label="EmployeeName" v-model="objOption.ManagerId" ref="ManagerId" :options="EmployeeList"
label="校区联系人" :dense="false" emit-value map-options @filter="filterFn"> label="校区联系人" :dense="false" emit-value map-options @filter="filterFn">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</template> </template>
</q-select> </q-select>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SLinkTel" ref="SLinkTel" <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SLinkTel" ref="SLinkTel"
class="col-6 q-pb-lg" label="校区联系电话" /> class="col-6 q-pb-lg" label="校区联系电话" :rules="[val => !!val || '请填写校区联系电话']" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.Remark" <q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.Remark"
class="col-6 q-pb-lg q-pr-lg" label="校区备注" /> class="col-6 q-pb-lg q-pr-lg" label="校区备注" />
<selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString" <selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString"
...@@ -182,15 +182,6 @@ ...@@ -182,15 +182,6 @@
}, },
//保存校区 //保存校区
saveSchool() { saveSchool() {
if(this.objOption.SName==''){
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写校区名称`
})
return;
}
this.saveLoading = true;
this.$refs.SName.validate() this.$refs.SName.validate()
this.$refs.SAddress.validate() this.$refs.SAddress.validate()
this.$refs.SLinkTel.validate() this.$refs.SLinkTel.validate()
...@@ -202,6 +193,7 @@ ...@@ -202,6 +193,7 @@
if (this.tempManager && this.tempManager.Id) { if (this.tempManager && this.tempManager.Id) {
this.objOption.ManagerId = this.tempManager.Id; this.objOption.ManagerId = this.tempManager.Id;
} }
this.saveLoading = true;
saveSchool(this.objOption).then(res => { saveSchool(this.objOption).then(res => {
this.saveLoading = false this.saveLoading = false
this.$q.notify({ this.$q.notify({
......
...@@ -34,21 +34,21 @@ ...@@ -34,21 +34,21 @@
} }
.role-form .role_TreeList::-webkit-scrollbar { .role-form .role_TreeList::-webkit-scrollbar {
width: 3px; width: 3px;
height: 3px; height: 3px;
background-color: #F5F5F5; background-color: #F5F5F5;
} }
.role-form .role_TreeList::-webkit-scrollbar-track { .role-form .role_TreeList::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px; border-radius: 10px;
background-color: #F5F5F5; background-color: #F5F5F5;
} }
.role-form .role_TreeList::-webkit-scrollbar-thumb { .role-form .role_TreeList::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent)); -webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae; background-color: #0ae;
} }
...@@ -79,9 +79,11 @@ ...@@ -79,9 +79,11 @@
border-radius: 4px; border-radius: 4px;
overflow: auto; overflow: auto;
} }
.role-form .role_ItemList:last-child{
margin-right:0; .role-form .role_ItemList:last-child {
margin-right: 0;
} }
.role-form .role_ItemList::-webkit-scrollbar { .role-form .role_ItemList::-webkit-scrollbar {
width: 3px; width: 3px;
height: 6px; height: 6px;
...@@ -475,104 +477,99 @@ ...@@ -475,104 +477,99 @@
}, },
//保存菜单 //保存菜单
saveRole() { saveRole() {
if (this.objOption.RoleName == "") { this.$refs.RoleName.validate()
this.$q.notify({ if (!this.$refs.RoleName.hasError) {
type: 'negative', this.saveLoading = true;
position: "top", //角色菜单权限
message: `请填写角色名称!` var rolePermissionList = [];
}) //角色功能权限
return; var roleFunctionList = [];
} if (this.AuthMenuList && this.AuthMenuList.length > 0) {
this.saveLoading = true; this.AuthMenuList.forEach(item => {
//角色菜单权限 //一级菜单权限
var rolePermissionList = []; if (item.IsChecked) {
//角色功能权限 rolePermissionList.push({
var roleFunctionList = []; ID: 0,
if (this.AuthMenuList && this.AuthMenuList.length > 0) { Role_Id: this.objOption.RoleId,
this.AuthMenuList.forEach(item => { Menu_Id: item.MenuId
//一级菜单权限 });
if (item.IsChecked) { }
rolePermissionList.push({ //二级菜单权限
ID: 0, if (item.SubList && item.SubList.length > 0) {
Role_Id: this.objOption.RoleId, item.SubList.forEach(secondItem => {
Menu_Id: item.MenuId if (secondItem.IsChecked) {
}); //系统菜单
} if (secondItem.MenuType == 1) {
//二级菜单权限 rolePermissionList.push({
if (item.SubList && item.SubList.length > 0) { ID: 0,
item.SubList.forEach(secondItem => { Role_Id: this.objOption.RoleId,
if (secondItem.IsChecked) { Menu_Id: secondItem.MenuId
//系统菜单 });
if (secondItem.MenuType == 1) { } //功能菜单
rolePermissionList.push({ else if (secondItem.MenuType == 2) {
ID: 0, roleFunctionList.push({
Role_Id: this.objOption.RoleId, ID: 0,
Menu_Id: secondItem.MenuId Role_Id: this.objOption.RoleId,
}); Action_Id: secondItem.MenuId
} //功能菜单 });
else if (secondItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: secondItem.MenuId
});
}
}
//三级菜单权限
if (secondItem.SubList && secondItem.SubList.length > 0) {
secondItem.SubList.forEach(thirdItem => {
if (thirdItem.IsChecked) {
//系统菜单
if (thirdItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: thirdItem.MenuId
});
}
//功能菜单
else if (thirdItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: thirdItem.MenuId
});
}
} }
//四级--功能权限 }
if (thirdItem.SubList && thirdItem.SubList.length > 0) { //三级菜单权限
thirdItem.SubList.forEach(fourthItem => { if (secondItem.SubList && secondItem.SubList.length > 0) {
if (fourthItem.IsChecked) { secondItem.SubList.forEach(thirdItem => {
if (thirdItem.IsChecked) {
//系统菜单
if (thirdItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: thirdItem.MenuId
});
}
//功能菜单
else if (thirdItem.MenuType == 2) {
roleFunctionList.push({ roleFunctionList.push({
ID: 0, ID: 0,
Role_Id: this.objOption.RoleId, Role_Id: this.objOption.RoleId,
Action_Id: fourthItem.MenuId Action_Id: thirdItem.MenuId
}); });
} }
}) }
} //四级--功能权限
}); if (thirdItem.SubList && thirdItem.SubList.length > 0) {
} thirdItem.SubList.forEach(fourthItem => {
}) if (fourthItem.IsChecked) {
} roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: fourthItem.MenuId
});
}
})
}
});
}
})
}
})
}
this.objOption.RolePermissionList = rolePermissionList;
this.objOption.RoleFunctionList = roleFunctionList;
saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
}) })
} }
this.objOption.RolePermissionList = rolePermissionList;
this.objOption.RoleFunctionList = roleFunctionList;
saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
} }
}, },
} }
......
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