Commit 4e778044 authored by 黄奎's avatar 黄奎

页面修改

parent ee2f9cc1
...@@ -56,3 +56,14 @@ export function setPostStatusInfo(data) { ...@@ -56,3 +56,14 @@ export function setPostStatusInfo(data) {
data data
}); });
} }
/**
* 获取部门岗位列表
*/
export function queryDeptPostList(data) {
return request({
url: '/User/GetDeptPostList',
method: 'post',
data
});
}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
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-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id" <q-select filled 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" emit-value ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pb-lg" emit-value
map-options :rules="[val => !!val || '请选择所属校区']" @input="queryDeptTree(objOption.School_Id)" /> map-options :rules="[val => !!val || '请选择所属校区']" @input="schoolChagne" />
<q-input type="tel" filled stack-label maxlength="100" :dense="false" v-model="objOption.AssistTel" <q-input type="tel" filled stack-label maxlength="100" :dense="false" v-model="objOption.AssistTel"
ref="AssistTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" :rules="[val => !!val || '请填写助教联系电话']" /> ref="AssistTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" :rules="[val => !!val || '请填写助教联系电话']" />
<selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString" <selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
} from '../../../api/system/dept' } from '../../../api/system/dept'
//岗位 //岗位
import { import {
getPostList queryDeptPostList
} from '../../../api/system/post' } from '../../../api/system/post'
import extEditor from '../../common/ext-editor' import extEditor from '../../common/ext-editor'
import selectTree from '../../common/select-tree' import selectTree from '../../common/select-tree'
...@@ -92,30 +92,50 @@ ...@@ -92,30 +92,50 @@
} }
}, },
created() { created() {
this.queryDeptTree(0);
this.queryPostList();
this.getSchool(); this.getSchool();
}, },
mounted() { mounted() {
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;
if (this.saveObj) {
if (this.objOption.Dept_Id != this.saveObj.Dept_Id) {
this.deptChange();
this.queryPostList();
}
} else {
this.deptChange();
this.queryPostList();
}
}, },
//获取部门结构树 //获取部门结构树
queryDeptTree(schoolId) { queryDeptTree() {
var qMsg = { var msg = {
School_Id: 0 School_Id: 0
}; };
if (schoolId) { if (this.objOption.School_Id && this.objOption.School_Id != '') {
qMsg.School_Id = schoolId; msg.School_Id = this.objOption.School_Id;
} }
getDeptTree(qMsg).then(res => { getDeptTree(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.DeptList = res.Data; this.DeptList = res.Data;
} }
...@@ -123,16 +143,16 @@ ...@@ -123,16 +143,16 @@
}, },
//获取岗位列表 //获取岗位列表
queryPostList() { queryPostList() {
this.PostList = [];
var postMsg = { var postMsg = {
RB_Dept_Id: 0, QDeptIds: "",
}; };
if (this.objOption.Dept_Id) { if (this.objOption.Dept_Id) {
postMsg.RB_Dept_Id = this.objOption.Dept_Id; postMsg.QDeptIds = this.objOption.Dept_Id;
} }
getPostList(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();
} }
}) })
}, },
...@@ -151,7 +171,11 @@ ...@@ -151,7 +171,11 @@
this.objOption.AssistIntro = this.saveObj.AssistIntro; this.objOption.AssistIntro = this.saveObj.AssistIntro;
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;
if (this.objOption.School_Id) {
this.queryDeptTree();
}
if (this.saveObj.Dept_Id) { if (this.saveObj.Dept_Id) {
this.queryPostList();
this.returnString.push(this.saveObj.Dept_Id.toString()); this.returnString.push(this.saveObj.Dept_Id.toString());
} }
} else { } else {
...@@ -187,7 +211,6 @@ ...@@ -187,7 +211,6 @@
this.$refs.School_Id.validate() this.$refs.School_Id.validate()
this.$refs.AssistName.validate() this.$refs.AssistName.validate()
this.$refs.AssistTel.validate() this.$refs.AssistTel.validate()
let tempSchool = null
if ( if (
!this.$refs.School_Id.hasError && !this.$refs.School_Id.hasError &&
!this.$refs.AssistName.hasError && !this.$refs.AssistName.hasError &&
...@@ -225,11 +248,7 @@ ...@@ -225,11 +248,7 @@
} }
}, },
}, },
watch: { watch: {},
"objOption.Dept_Id": function (val) {
this.queryPostList();
}
},
} }
</script> </script>
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
} from '../../../api/system/dept' } from '../../../api/system/dept'
//岗位 //岗位
import { import {
getPostList queryDeptPostList
} from '../../../api/system/post' } from '../../../api/system/post'
import { import {
UploadSelfFile, UploadSelfFile,
...@@ -210,12 +210,12 @@ ...@@ -210,12 +210,12 @@
queryPostList(deptId) { queryPostList(deptId) {
this.PostList = []; this.PostList = [];
var postMsg = { var postMsg = {
RB_Dept_Id: deptId, QDeptIds: deptId,
}; };
if (this.objOption.Dept_Id) { if (this.objOption.Dept_Id) {
postMsg.RB_Dept_Id = this.objOption.Dept_Id; postMsg.QDeptIds = this.objOption.Dept_Id;
} }
getPostList(postMsg).then(res => { queryDeptPostList(postMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.PostList = res.Data; this.PostList = res.Data;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
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-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id" <q-select filled 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" emit-value ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pb-lg" emit-value
map-options :rules="[val => !!val || '请选择所属校区']" /> map-options :rules="[val => !!val || '请选择所属校区']" @input="schoolChagne" />
<q-input type="tel" filled stack-label maxlength="100" :dense="false" v-model="objOption.TeacherTel" <q-input type="tel" filled stack-label maxlength="100" :dense="false" v-model="objOption.TeacherTel"
ref="TeacherTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" :rules="[val => !!val || '请填写教师联系电话']" /> ref="TeacherTel" 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.TeacherSay" ref="TeacherSay" <q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.TeacherSay" ref="TeacherSay"
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
} from '../../../api/system/dept' } from '../../../api/system/dept'
//岗位 //岗位
import { import {
getPostList queryDeptPostList
} from '../../../api/system/post' } from '../../../api/system/post'
import extEditor from '../../common/ext-editor' import extEditor from '../../common/ext-editor'
import selectTree from '../../common/select-tree' import selectTree from '../../common/select-tree'
...@@ -135,24 +135,50 @@ ...@@ -135,24 +135,50 @@
} }
}, },
created() { created() {
this.queryDeptTree();
this.queryPostList();
this.getSchool() this.getSchool()
}, },
mounted() { mounted() {
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;
if (this.saveObj) {
if (this.objOption.Dept_Id != this.saveObj.Dept_Id) {
this.deptChange();
this.queryPostList();
}
} else {
this.deptChange();
this.queryPostList();
}
}, },
//获取部门结构树 //获取部门结构树
queryDeptTree() { queryDeptTree() {
getDeptTree({}).then(res => { 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) { if (res.Code == 1) {
this.DeptList = res.Data; this.DeptList = res.Data;
} }
...@@ -160,16 +186,16 @@ ...@@ -160,16 +186,16 @@
}, },
//获取岗位列表 //获取岗位列表
queryPostList() { queryPostList() {
this.PostList = [];
var postMsg = { var postMsg = {
RB_Dept_Id: 0, QDeptIds: "",
}; };
if (this.objOption.Dept_Id) { if (this.objOption.Dept_Id) {
postMsg.RB_Dept_Id = this.objOption.Dept_Id; postMsg.QDeptIds = this.objOption.Dept_Id;
} }
getPostList(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();
} }
}) })
}, },
...@@ -197,9 +223,12 @@ ...@@ -197,9 +223,12 @@
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;
if(this.saveObj.Dept_Id) if (this.objOption.School_Id) {
{ this.queryDeptTree();
this.returnString.push(this.saveObj.Dept_Id.toString()); }
if (this.saveObj.Dept_Id) {
this.queryPostList();
this.returnString.push(this.saveObj.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)
...@@ -276,7 +305,6 @@ ...@@ -276,7 +305,6 @@
this.closeSaveForm() this.closeSaveForm()
}).catch(() => { }).catch(() => {
this.saveLoading = false this.saveLoading = false
}) })
} else { } else {
this.$q.notify({ this.$q.notify({
...@@ -291,11 +319,7 @@ ...@@ -291,11 +319,7 @@
} }
}, },
}, },
watch: { watch: {},
"objOption.Dept_Id": function (val) {
this.queryPostList();
}
},
} }
</script> </script>
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-col-gutter-md"> <div class="col row wrap q-col-gutter-md">
<div class="col"> <div class="col">
<selectSearch :Data='schoolList' optionValue="SId" optionLabel="SName" <selectSearch :Data='schoolList' optionValue="SId" optionLabel="SName" :densetype="false"
:densetype="false" :vModel="msg.School_Id" label="校区" @returnData="returnData" :useInput="true" :vModel="msg.School_Id" label="校区" @returnData="returnData" :useInput="true" :reactiveRules="false">
:reactiveRules="false">
</selectSearch> </selectSearch>
</div> </div>
<div class="col"> <div class="col">
...@@ -14,8 +13,8 @@ ...@@ -14,8 +13,8 @@
</div> </div>
<div class="col"> <div class="col">
<q-select @input="resetSearch" filled stack-label option-value="value" option-label="label" <q-select @input="resetSearch" filled stack-label option-value="value" option-label="label"
v-model="msg.DeptTier" ref="DeptTier" :options="DeptTierList" label="部门层级" :dense="false" v-model="msg.DeptTier" ref="DeptTier" :options="DeptTierList" label="部门层级" :dense="false" emit-value
emit-value map-options clearable @clear="resetSearch" /> map-options clearable @clear="resetSearch" />
</div> </div>
<div class="col"> <div class="col">
<selectTree v-if="DeptTreeList&&DeptTreeList.length>0" :treeData='DeptTreeList' :defaultArray="returnString" <selectTree v-if="DeptTreeList&&DeptTreeList.length>0" :treeData='DeptTreeList' :defaultArray="returnString"
...@@ -36,7 +35,8 @@ ...@@ -36,7 +35,8 @@
<q-space /> <q-space />
<div class="page-option"> <div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增部门" @click="EditDept(null)" /> <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增部门" @click="EditDept(null)" />
<q-btn color="secondary" flat size="sm" icon="iconfont icon-zuzhijiagou" label="组织机构图" @click="gotoRelation()" /> <q-btn color="secondary" flat size="sm" icon="iconfont icon-zuzhijiagou" label="组织机构图"
@click="gotoRelation()" />
</div> </div>
</template> </template>
<template v-slot:body-cell-Status="props"> <template v-slot:body-cell-Status="props">
...@@ -50,6 +50,14 @@ ...@@ -50,6 +50,14 @@
{{props.row.School_Id>0? props.row.SchoolName:'总部'}} {{props.row.School_Id>0? props.row.SchoolName:'总部'}}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-DeptPostList="props">
<q-td :props="props">
<template v-if="props.row.DeptPostList&&props.row.DeptPostList.length>0"
v-for="(item,index) in props.row.DeptPostList">
<q-badge :key="index" color="red" :label="item.PostName" class="q-mr-xs" />
</template>
</q-td>
</template>
<template v-slot:bottom> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
...@@ -123,6 +131,12 @@ ...@@ -123,6 +131,12 @@
field: 'DeptTel', field: 'DeptTel',
align: 'left' align: 'left'
}, },
{
name: 'DeptPostList',
label: '绑定岗位',
field: 'DeptPostList',
align: 'left'
},
{ {
name: 'DeptSort', name: 'DeptSort',
label: '排序', label: '排序',
...@@ -251,7 +265,7 @@ ...@@ -251,7 +265,7 @@
this.loading = false; this.loading = false;
this.data = res.Data.PageData; this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount; this.pageCount = res.Data.PageCount;
if (this.msg.DeptTier == "0") { if (this.msg.DeptTier == "0") {
this.msg.DeptTier = "" this.msg.DeptTier = ""
} }
...@@ -323,8 +337,8 @@ ...@@ -323,8 +337,8 @@
}); });
}, },
returnData(data) { returnData(data) {
this.msg.School_Id = data; this.msg.School_Id = data;
this.resetSearch() this.resetSearch()
} }
} }
} }
......
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