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

页面修改

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