Commit 12db0472 authored by 黄奎's avatar 黄奎

页面修改

parent 65fe8867
......@@ -22,8 +22,8 @@
</div>
<div class="text-caption q-my-md q-px-xs text-grey-6">选择角色</div>
<div class="q-pa-md">
<q-option-group type="checkbox" :options="roleList" label="RoleName" value="RoleId" v-model="tempRole" emit-value map-options>
</q-option-group>
<q-option-group type="checkbox" :options="roleList" v-model="tempRole" emit-value map-options />
</div>
</q-card-section>
<q-separator />
......@@ -38,7 +38,8 @@
<script>
import {
getSchoolDropdown,
saveManager
saveManager,
queryManagerInfo
} from '../../../api/school/index'
import {
queryRoleDropdown
......@@ -64,6 +65,7 @@
MName: "", //管理者姓名
MTel: '', //管理者电话
MHead: '', //头像
RoleAuth: "", //角色
},
optionTitle: "",
schoolList: [],
......@@ -82,18 +84,32 @@
methods: {
getrolelist() {
queryRoleDropdown({}).then(res => {
this.roleList = res.Data;
if (res.Code == 1) {
if (res.Data && res.Data.length > 0) {
res.Data.forEach(item => {
this.roleList.push({
label: item.RoleName,
value: item.RoleId
});
})
}
}
})
},
initObj() {
if (this.saveObj) {
this.optionTitle = "修改管理者信息"
this.objOption.MId = this.saveObj.MId;
this.objOption.School_Id = this.saveObj.School_Id;
this.objOption.MName = this.saveObj.MName;
this.objOption.MTel = this.saveObj.MTel;
this.objOption.MHead = this.saveObj.MHead;
this.$forceUpdate();
queryManagerInfo({
MId: this.saveObj.MId
}).then(res => {
this.objOption.MId = res.Data.MId;
this.objOption.School_Id = res.Data.School_Id;
this.objOption.MName = res.Data.MName;
this.objOption.MTel = res.Data.MTel;
this.objOption.MHead = res.Data.MHead;
this.tempRole = res.Data.RoleList;
this.$forceUpdate();
})
} else {
this.optionTitle = "新增管理者"
}
......@@ -123,6 +139,16 @@
this.persistent = false
},
setStudent() {
var authStr = "";
if (this.tempRole && this.tempRole.length > 0) {
this.tempRole.forEach(item => {
authStr += "," + item;
})
}
if (authStr != '') {
authStr = authStr.substring(1, authStr.length);
}
this.objOption.RoleAuth = authStr;
this.saveLoading = true
saveManager(this.objOption).then(res => {
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