|
@@ -22,7 +22,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="接收人" prop="sendType" v-if="addForm.noticeType == 1">
|
|
|
- <el-select v-model="addForm.sendType" placeholder="请选择接收人" style="width:500px;">
|
|
|
+ <el-select v-model="addForm.sendType" @change="sendTypeChange" placeholder="请选择接收人" style="width:500px;">
|
|
|
<el-option
|
|
|
v-for="dict in userTypeList"
|
|
|
:key="dict.code"
|
|
@@ -50,6 +50,35 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="适用学院" prop="deptIds" v-if="addForm.noticeType == 1 && addForm.sendType == 6">
|
|
|
+ <el-cascader
|
|
|
+ style="width:500px;"
|
|
|
+ ref="cascader"
|
|
|
+ v-model="addForm.deptIds"
|
|
|
+ :options="deptOptions"
|
|
|
+ :props="{value: 'deptId', label: 'deptName',children:'child',multiple: true,emitPath:false}"
|
|
|
+ placeholder="请选择适用学院"
|
|
|
+ collapse-tags
|
|
|
+ ></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实验室:" prop="subIds" v-if="addForm.noticeType == 1 && addForm.sendType == 7">
|
|
|
+ <el-select
|
|
|
+ style="width:500px;"
|
|
|
+ v-model="addForm.subIds"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ @change="subChange"
|
|
|
+ placeholder="请搜索选择实验室"
|
|
|
+ :remote-method="subSelectList">
|
|
|
+ <el-option
|
|
|
+ v-for="item in subOptions"
|
|
|
+ :key="item.subId"
|
|
|
+ :label="item.subName"
|
|
|
+ :value="item.subId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="发布单位" prop="company" v-if="addForm.noticeType == 2 || addForm.noticeType == 3">
|
|
|
<el-input v-model="addForm.company" placeholder="请输入发布单位"
|
|
|
maxLength="20" style="width:500px;"></el-input>
|
|
@@ -73,7 +102,8 @@
|
|
|
import { systemNoticeGetSendType,systemNoticeAdd,systemNotifyAdd,
|
|
|
systemNoticeDetail,systemNoticeUpdate,
|
|
|
systemNoticeSendUserIds } from "@/api/systemManagement/index";
|
|
|
- import { systemNoticeGetNoticeType,systemUserSelect } from "@/api/commonality/permission";
|
|
|
+ import { systemNoticeGetNoticeType,systemUserSelect,systemDeptOrganizeStructure } from "@/api/commonality/permission";
|
|
|
+ import { systemSubjectGetList } from '@/api/commonality/noPermission'
|
|
|
export default {
|
|
|
name: 'addPage',
|
|
|
props:{
|
|
@@ -86,11 +116,16 @@
|
|
|
//接收人
|
|
|
userTypeList:[],
|
|
|
optionsUser:[],
|
|
|
+ subOptions:[],
|
|
|
+ //学院
|
|
|
+ deptOptions:[],
|
|
|
addForm:{
|
|
|
title:'',
|
|
|
noticeType:'',
|
|
|
sendType:'',
|
|
|
userIds:'',
|
|
|
+ deptIds:'',
|
|
|
+ subIds:'',
|
|
|
sendState:1,
|
|
|
content:'',
|
|
|
},
|
|
@@ -109,6 +144,12 @@
|
|
|
userIds: [
|
|
|
{ required: true, message: "请选择指定用户", trigger: "change" }
|
|
|
],
|
|
|
+ deptIds: [
|
|
|
+ { required: true, message: "请选择指定部门", trigger: "change" }
|
|
|
+ ],
|
|
|
+ subIds: [
|
|
|
+ { required: true, message: "请选择指定实验室", trigger: "change" }
|
|
|
+ ],
|
|
|
sendState: [
|
|
|
{ required: true, message: "请选择发送状态", trigger: "change" }
|
|
|
],
|
|
@@ -126,6 +167,7 @@
|
|
|
created(){
|
|
|
},
|
|
|
mounted(){
|
|
|
+ this.getTreeselect();
|
|
|
this.systemNoticeGetNoticeType();
|
|
|
this.systemNoticeGetSendType();
|
|
|
if(this.propsData.noticeId){
|
|
@@ -133,6 +175,22 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ systemDeptOrganizeStructure({}).then(response => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //搜索实验室
|
|
|
+ subSelectList(query){
|
|
|
+ if (query !== '' && query.length>1) {
|
|
|
+ systemSubjectGetList({"subName":query,}).then(response => {
|
|
|
+ this.$set(this,'subOptions',response.data);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$set(this,'subOptions',[]);
|
|
|
+ }
|
|
|
+ },
|
|
|
//消息详情
|
|
|
systemNoticeDetail(){
|
|
|
systemNoticeDetail({noticeId:this.propsData.noticeId}).then(response => {
|
|
@@ -142,11 +200,17 @@
|
|
|
noticeType:response.data.noticeType,
|
|
|
sendType:response.data.sendType,
|
|
|
userIds:[],
|
|
|
+ deptIds:[],
|
|
|
+ subIds:[],
|
|
|
sendState:response.data.sendState,
|
|
|
content:response.data.content,
|
|
|
});
|
|
|
if(response.data.sendType == 5){
|
|
|
this.systemNoticeSendUserIds();
|
|
|
+ }else if(response.data.sendType == 6){
|
|
|
+
|
|
|
+ }else if(response.data.sendType == 7){
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -176,6 +240,8 @@
|
|
|
obj.noticeType = this.addForm.noticeType;
|
|
|
obj.sendType = this.addForm.sendType;
|
|
|
obj.userIds = this.addForm.sendType == 5 ? this.addForm.userIds : [];
|
|
|
+ obj.deptIds = this.addForm.sendType == 6 ? this.addForm.deptIds : [];
|
|
|
+ obj.subIds = this.addForm.sendType == 7 ? this.addForm.subIds : [];
|
|
|
obj.sendState = this.addForm.sendState;
|
|
|
}else{
|
|
|
obj.notifyType = this.addForm.noticeType
|
|
@@ -230,10 +296,29 @@
|
|
|
if(e == 1){
|
|
|
this.$set(this.addForm,'sendType','');
|
|
|
this.$set(this.addForm,'userIds','');
|
|
|
+ this.$set(this.addForm,'deptIds','');
|
|
|
+ this.$set(this.addForm,'subIds','');
|
|
|
}else if(e == 2){
|
|
|
this.$set(this.addForm,'company','');
|
|
|
}
|
|
|
},
|
|
|
+ //接收人切换
|
|
|
+ sendTypeChange(e){
|
|
|
+ if(e == 5){
|
|
|
+ this.$set(this.addForm,'deptIds','');
|
|
|
+ this.$set(this.addForm,'subIds','');
|
|
|
+ }else if(e == 6){
|
|
|
+ this.$set(this.addForm,'userIds','');
|
|
|
+ this.$set(this.addForm,'subIds','');
|
|
|
+ }else if(e == 7){
|
|
|
+ this.$set(this.addForm,'userIds','');
|
|
|
+ this.$set(this.addForm,'deptIds','');
|
|
|
+ }else{
|
|
|
+ this.$set(this.addForm,'userIds','');
|
|
|
+ this.$set(this.addForm,'deptIds','');
|
|
|
+ this.$set(this.addForm,'subIds','');
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|