|
@@ -240,6 +240,7 @@
|
|
|
:houseData="houseData"
|
|
|
:peopleData="peopleData"
|
|
|
:houseDataNames="houseDataNames"
|
|
|
+ :userType="userType"
|
|
|
ref="filterHouse"
|
|
|
></previe-inform>
|
|
|
</div>
|
|
@@ -454,6 +455,7 @@ export default {
|
|
|
houseData: [],
|
|
|
houseDataNames: '',
|
|
|
peopleData: [],
|
|
|
+ userType: '',
|
|
|
// 选中的房间
|
|
|
selectDataHouseTreeData: {
|
|
|
checkData: [],
|
|
@@ -555,10 +557,10 @@ export default {
|
|
|
.then(({ status, data, msg }) => {
|
|
|
if (status === 0 && data) {
|
|
|
this.$refs.selectTreeHouse.filterhouse(val, data);
|
|
|
- this.ruleForm.issueRoom.checkAll = true;
|
|
|
- this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
- this.ruleForm.issueRoom.radioStaff = '';
|
|
|
- this.ruleForm.issueRoom.staff = false;
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
+ // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
+ // this.ruleForm.issueRoom.staff = false;
|
|
|
} else {
|
|
|
this.$message.error('获取房间失败');
|
|
|
}
|
|
@@ -578,16 +580,20 @@ export default {
|
|
|
// this.$message('获取房间失败');
|
|
|
}
|
|
|
});
|
|
|
- console.log('选中的房间val', val);
|
|
|
+ console.log('选中的房间inval', val);
|
|
|
},
|
|
|
// 选择的人员
|
|
|
selectPeople(val) {
|
|
|
+ if (val.userList.length < 1) {
|
|
|
+ this.ruleForm.issueRoom.radioStaff = '指定员工';
|
|
|
+ }
|
|
|
this.selectDataPeopleTreeData = val;
|
|
|
console.log('选择的人员inform', val);
|
|
|
},
|
|
|
/**监听指定房间单选框变化*/
|
|
|
changeRadioRoom(val) {
|
|
|
if (!this.ruleForm.popCommunityId) {
|
|
|
+ ruleForm.issueRoom.checkAll = false;
|
|
|
return this.$message.warning('请先选择所属社区');
|
|
|
}
|
|
|
if (val == '指定房间') {
|
|
@@ -601,22 +607,23 @@ export default {
|
|
|
},
|
|
|
//选择员工复选框变化
|
|
|
changeCheckboxStaffRoom(val) {
|
|
|
+ console.log('选择员工复选框变化', val);
|
|
|
if (!this.ruleForm.popCommunityId) {
|
|
|
this.ruleForm.issueRoom.staff = false;
|
|
|
return this.$message.warning('请先选择社区');
|
|
|
}
|
|
|
if (val) {
|
|
|
this.ruleForm.issueRoom.radioStaff = '全部员工';
|
|
|
- this.ruleForm.issueRoom.checkAll = false;
|
|
|
- this.ruleForm.issueRoom.radioRoom = '';
|
|
|
+ // this.ruleForm.issueRoom.checkAll = false;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '';
|
|
|
this.$refs.selectTreePeoples.selectAllPeople();
|
|
|
- this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
+ // this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
} else {
|
|
|
this.ruleForm.issueRoom.radioStaff = '';
|
|
|
- this.ruleForm.issueRoom.checkAll = true;
|
|
|
- this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
this.$refs.selectTreePeoples.selectPeopleOr();
|
|
|
- this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
+ // this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
}
|
|
|
},
|
|
|
// 选择房间复选框变化
|
|
@@ -626,10 +633,10 @@ export default {
|
|
|
return this.$message.warning('请先选择社区');
|
|
|
}
|
|
|
if (val) {
|
|
|
- this.ruleForm.issueRoom.staff = false;
|
|
|
- this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ // this.ruleForm.issueRoom.staff = false;
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
- this.ruleForm.issueRoom.radioStaff = '';
|
|
|
+ // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
} else {
|
|
|
this.ruleForm.issueRoom.radioRoom = '';
|
|
@@ -742,16 +749,43 @@ export default {
|
|
|
if (img.length > 3) {
|
|
|
return this.$message.warning('最多插入三张图片');
|
|
|
}
|
|
|
+ console.log('this.selectDataHouseTreeData.userList', this.selectDataHouseTreeData.userList);
|
|
|
if (
|
|
|
this.selectDataHouseTreeData.userList.length === 0 &&
|
|
|
this.selectDataPeopleTreeData &&
|
|
|
this.selectDataPeopleTreeData.userList.length === 0
|
|
|
) {
|
|
|
- return this.$message.warning('所选房间暂无住户,不可发布');
|
|
|
+ return this.$message.warning('所选暂无人员,不可发布');
|
|
|
}
|
|
|
// this.showDetail = false;
|
|
|
let startTime = this.$moment(this.ruleForm.activeTime[0]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
let endTime = this.$moment(this.ruleForm.activeTime[1]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
+ let userVos = [];
|
|
|
+ let obj = {};
|
|
|
+ let arr1 = this.selectDataHouseTreeData.userID;
|
|
|
+ let arr2 = this.selectDataPeopleTreeData.userList;
|
|
|
+ let treeData = [];
|
|
|
+ treeData[0] = JSON.stringify(arr1);
|
|
|
+ treeData[1] = JSON.stringify(arr2);
|
|
|
+ if (arr1.length > 0) {
|
|
|
+ for (let index = 0; index < arr1.length; index++) {
|
|
|
+ let element = arr1[index];
|
|
|
+ obj.noticeId = '';
|
|
|
+ obj.userId = element;
|
|
|
+ obj.userType = 0;
|
|
|
+ userVos.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (arr2.length > 0) {
|
|
|
+ for (let index = 0; index < arr2.length; index++) {
|
|
|
+ let element = arr2[index];
|
|
|
+ console.log('arr2', element);
|
|
|
+ obj.noticeId = '';
|
|
|
+ obj.userId = element;
|
|
|
+ obj.userType = 0;
|
|
|
+ userVos.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
let query = {
|
|
|
communityId: this.ruleForm.popCommunityId,
|
|
|
content: this.ruleForm.editorContents,
|
|
@@ -763,16 +797,22 @@ export default {
|
|
|
// pubPeople:ruleForm.informType,
|
|
|
// pubStatus: "",
|
|
|
themePictrue: JSON.stringify(this.successImageLists),
|
|
|
- userId: this.ruleForm.issueRoom.checkAll
|
|
|
- ? this.selectDataHouseTreeData.userList
|
|
|
- : this.selectDataPeopleTreeData.userList,
|
|
|
- treeData: this.ruleForm.issueRoom.checkAll
|
|
|
- ? JSON.stringify(this.selectDataHouseTreeData.userID)
|
|
|
- : JSON.stringify(this.selectDataPeopleTreeData.userList),
|
|
|
+ treeData: JSON.stringify(treeData),
|
|
|
+ // userId: this.ruleForm.issueRoom.checkAll
|
|
|
+ // ? this.selectDataHouseTreeData.userList
|
|
|
+ // : this.selectDataPeopleTreeData.userList,
|
|
|
+ // treeData: this.ruleForm.issueRoom.checkAll
|
|
|
+ // ? JSON.stringify(this.selectDataHouseTreeData.userID)
|
|
|
+ // : JSON.stringify(this.selectDataPeopleTreeData.userList),
|
|
|
title: this.ruleForm.title,
|
|
|
type: this.ruleForm.informType,
|
|
|
urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
|
|
|
- userType: this.ruleForm.issueRoom.checkAll ? 0 : 1
|
|
|
+ userVos: userVos
|
|
|
+ // userVos: [
|
|
|
+ // { noticeId: '', userId: this.selectDataHouseTreeData.userList, userType: 0 },
|
|
|
+ // { noticeId: '', userId: this.selectDataPeopleTreeData.userList, userType: 1 }
|
|
|
+ // ]
|
|
|
+ // userType: userType
|
|
|
};
|
|
|
this.$http.post('/sc-community-web/notice/add', query).then((res) => {
|
|
|
if (res.status === 0) {
|
|
@@ -845,7 +885,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
filterArrPeople(arr, item, index) {
|
|
|
- if (!this.rowDetail.treeData.includes(Number(item.id))) {
|
|
|
+ if (!this.rowDetail.treeDataPeople.includes(Number(item.id))) {
|
|
|
arr.splice(index, 1);
|
|
|
arr.map((item) => {
|
|
|
this.filterArrPeople(arr, item, index);
|
|
@@ -853,9 +893,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
filterPeopleName(array) {
|
|
|
- console.log('====================================');
|
|
|
- console.log(' filterPeopleName(array', array);
|
|
|
- console.log('====================================');
|
|
|
var that = this;
|
|
|
// array.map((item) => {
|
|
|
// if (item.children && item.children.length > 0) {
|
|
@@ -940,12 +977,32 @@ export default {
|
|
|
// this.rowDetail = [];
|
|
|
this.$http.get('/sc-community-web/notice/find/' + row.id).then((res) => {
|
|
|
if (res.status === 0) {
|
|
|
+ console.log('查看详情res.data.treeData', res.data.treeData);
|
|
|
this.rowDetail = res.data;
|
|
|
- this.rowDetail.treeData = JSON.parse(res.data.treeData);
|
|
|
+ let treeData = JSON.parse(res.data.treeData);
|
|
|
+ this.rowDetail.treeData = JSON.parse(treeData[0]);
|
|
|
+ this.rowDetail.treeDataPeople = JSON.parse(treeData[1]);
|
|
|
+ let userType = '';
|
|
|
+ let arr1 = this.rowDetail.treeData;
|
|
|
+ let arr2 = this.rowDetail.treeDataPeople;
|
|
|
+ if (arr1.length > 0 && arr2.length > 0) {
|
|
|
+ userType = 2;
|
|
|
+ } else if (arr1.length > 0) {
|
|
|
+ userType = 0;
|
|
|
+ } else {
|
|
|
+ userType = 1;
|
|
|
+ }
|
|
|
+ this.userType = userType;
|
|
|
+ console.log('查看详情this.userType', this.rowDetail.treeData);
|
|
|
+ console.log('查看详情this.rowDetail.treeData', this.rowDetail.treeData);
|
|
|
+ console.log('查看详情this.rowDetail.treeDataPeople', this.rowDetail.treeDataPeople);
|
|
|
// this.rowDetail.newName = this.houseNames.toString();
|
|
|
- if (res.data.userType == 0) {
|
|
|
+ if (userType == 0) {
|
|
|
this.getOrgTreeList();
|
|
|
+ } else if (userType == 1) {
|
|
|
+ this.getPeopleList();
|
|
|
} else {
|
|
|
+ this.getOrgTreeList();
|
|
|
this.getPeopleList();
|
|
|
}
|
|
|
// let fileArr = row.filePath.split(',');
|