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

页面修改

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