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

页面修改

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