Commit 49967daf authored by 黄奎's avatar 黄奎

页面修改

parent fba47e98
......@@ -7,9 +7,9 @@
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-md q-px-xs text-grey-6">基本资料</div>
<div class="row wrap">
<q-select filled v-if="isEditShow" stack-label option-value="SId" @input="queryDeptTree(objOption.School_Id)"
option-label="SName" v-model="objOption.School_Id" ref="School_Id" :options="schoolList" label="所属校区"
:dense="false" class="col-6 q-pb-lg q-pr-lg" emit-value map-options />
<q-select filled v-if="isEditShow" stack-label option-value="SId" option-label="SName"
v-model="objOption.School_Id" ref="School_Id" :options="schoolList" label="所属校区" :dense="false"
class="col-6 q-pb-lg q-pr-lg" emit-value map-options @input="schoolChagne" />
<selectTree :treeData='DeptList' v-if="isEditShow" :defaultArray="returnString" nodeKey="DeptId"
:multiple="false" labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild"
classStr="col-6 q-pr-lg q-pb-lg"></selectTree>
......@@ -187,18 +187,42 @@
this.initObj();
},
methods: {
//学校改变
schoolChagne() {
this.objOption.Dept_Id = 0;
this.returnString = [0];
this.objOption.Post_Id = 0;
this.PostList = [];
this.queryDeptTree();
},
//部门改变
deptChange() {
this.objOption.Post_Id = 0;
this.PostList = [];
},
getChild(deptArray) {
var tempStr = "";
if (deptArray && deptArray != '') {
tempStr = deptArray;
}
this.objOption.Dept_Id = tempStr;
this.queryPostList(this.objOption.Dept_Id);
if (this.saveObj) {
if (this.objOption.Dept_Id != this.saveObj.Dept_Id) {
this.deptChange();
this.queryPostList();
}
} else {
this.deptChange();
this.queryPostList();
}
},
//获取部门结构树
queryDeptTree(id) {
let msg = {
School_Id: id
queryDeptTree() {
var msg = {
School_Id: 0
};
if (this.objOption.School_Id && this.objOption.School_Id != '') {
msg.School_Id = this.objOption.School_Id;
}
getDeptTree(msg).then(res => {
if (res.Code == 1) {
......@@ -207,10 +231,9 @@
})
},
//获取岗位列表
queryPostList(deptId) {
this.PostList = [];
queryPostList() {
var postMsg = {
QDeptIds: deptId,
QDeptIds: "",
};
if (this.objOption.Dept_Id) {
postMsg.QDeptIds = this.objOption.Dept_Id;
......@@ -218,6 +241,7 @@
queryDeptPostList(postMsg).then(res => {
if (res.Code == 1) {
this.PostList = res.Data;
this.$forceUpdate();
}
})
},
......@@ -248,9 +272,12 @@
this.objOption.Account = res.Data.Account;
this.objOption.AccountType = res.Data.AccountType;
this.objOption.AccountId = res.Data.AccountId;
this.returnString.push(res.Data.Dept_Id.toString());
if (this.objOption.Dept_Id && this.objOption.Dept_Id > 0) {
if (this.objOption.School_Id) {
this.queryDeptTree();
}
if (this.objOption.Dept_Id) {
this.queryPostList();
this.returnString.push(this.objOption.Dept_Id.toString());
}
this.$forceUpdate();
})
......@@ -324,9 +351,7 @@
}
},
watch: {
"objOption.Dept_Id": function (val) {
this.queryPostList();
}
}
}
......
......@@ -49,7 +49,7 @@
</div>
<div class="col-6 q-pb-lg q-pt-lg">
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.BaseStuNum" ref="BaseStuNum"
class="col-6 q-pb-lg" label="带班基础人数" />
class="col-6 q-pb-lg" label="带班基础人数" />
</div>
<div class="col-12 q-pb-lg">
<q-field filled label="教师标签" bg-color="white" stack-label>
......@@ -126,7 +126,7 @@
TeachTag: "",
Dept_Id: 0, //部门编号
Post_Id: 0, //岗位编号
BaseStuNum:0,//带班基础人数
BaseStuNum: 0, //带班基础人数
},
optionTitle: "",
schoolList: [],
......@@ -228,13 +228,13 @@
this.objOption.TeachTag = this.saveObj.TeachTag;
this.objOption.Dept_Id = this.saveObj.Dept_Id;
this.objOption.Post_Id = this.saveObj.Post_Id;
this.objOption.BaseStuNum=this.saveObj.BaseStuNum;
this.objOption.BaseStuNum = this.saveObj.BaseStuNum;
if (this.objOption.School_Id) {
this.queryDeptTree();
}
if (this.saveObj.Dept_Id) {
if (this.objOption.Dept_Id) {
this.queryPostList();
this.returnString.push(this.saveObj.Dept_Id.toString());
this.returnString.push(this.objOption.Dept_Id.toString());
}
if (this.objOption.TeachTag && this.objOption.TeachTag.length > 0) {
this.tags = JSON.parse(this.objOption.TeachTag)
......@@ -282,9 +282,8 @@
},
saveTeacher() {
this.saveLoading = true;
if(this.objOption.Dept_Id&&this.objOption.Dept_Id=="")
{
this.objOption.Dept_Id=0;
if (this.objOption.Dept_Id && this.objOption.Dept_Id == "") {
this.objOption.Dept_Id = 0;
}
this.$refs.School_Id.validate()
this.$refs.TeacherName.validate()
......
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