|
@@ -10,6 +10,8 @@ import {WorkService} from "../../../../../service/work.service";
|
|
|
import {EventService} from "../../../../../service/event.service";
|
|
|
import {SHYKApi} from "../../../../../api/partylife/shyk";
|
|
|
import OperateEnum from "../../../../../enum/OperateEnum";
|
|
|
+import {DictionaryApi} from "../../../../../api/system/dictionary";
|
|
|
+import {AlertModal} from "../../../../../comm/modal/alert";
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-edit',
|
|
@@ -23,13 +25,10 @@ export class EditComponent implements OnInit {
|
|
|
loading: any = null;
|
|
|
userInfo: any = {};
|
|
|
selectUserUrl: string = "/appApi/home/getPartyUserList";
|
|
|
+ democracyReviewType: number = 7;
|
|
|
|
|
|
dataModel: any = {meetingid: ''};
|
|
|
- typeList: any = [{id: 1, name: '党员大会'}, {id: 2, name: '支委会'}, {id: 3, name: '党小组会'}, {
|
|
|
- id: 4,
|
|
|
- name: '党课'
|
|
|
- }];
|
|
|
- topicList: any = [{TOPICNAME: ''}, {}];
|
|
|
+ typeList: any = [];
|
|
|
userList: any = [];
|
|
|
historyAddressList: any = [];
|
|
|
|
|
@@ -39,7 +38,6 @@ export class EditComponent implements OnInit {
|
|
|
begintime: string = '';
|
|
|
endDate: string = '';
|
|
|
endtime: string = '';
|
|
|
- isUploadFile: boolean = false;
|
|
|
maxDate: any = moment(new Date()).add(1, 'M').format("YYYY-MM-DD");
|
|
|
imgOption1: any = {
|
|
|
fileRefid: '',
|
|
@@ -55,10 +53,15 @@ export class EditComponent implements OnInit {
|
|
|
isMulti: false,
|
|
|
readonly: false
|
|
|
};
|
|
|
+ boolList: any = [{dickey: true, dicvalue: '是'}, {dickey: false, dicvalue: '否'}];
|
|
|
+ democracyReviewList: any = [];
|
|
|
+ meetingTypeList: any = [];
|
|
|
+ democracyReviewResultTypeList: any = [];
|
|
|
+ selectShyktype: any = [];
|
|
|
|
|
|
constructor(private datePipe: DatePipe, private router: Router, private routeInfo: ActivatedRoute, private configService: ConfigService, private userService: UserService, public alertController: AlertController,
|
|
|
- public modalController: ModalController, public loadingController: LoadingController, public pickercontroller: PickerController, private workService: WorkService, private eventService: EventService
|
|
|
- , private shykApi: SHYKApi) {
|
|
|
+ public modalController: ModalController, public pickercontroller: PickerController, private workService: WorkService, private eventService: EventService
|
|
|
+ , private shykApi: SHYKApi, private dictionaryApi: DictionaryApi, private alertModal: AlertModal) {
|
|
|
}
|
|
|
|
|
|
ngOnInit() {
|
|
@@ -68,7 +71,7 @@ export class EditComponent implements OnInit {
|
|
|
this.op = parseInt(params['op']);
|
|
|
this.imgOption1.fileRefid = this.dataModel.meetingid;
|
|
|
this.imgOption2.fileRefid = this.dataModel.meetingid;
|
|
|
-
|
|
|
+ this.getDictionList();
|
|
|
this.loadData();
|
|
|
});
|
|
|
|
|
@@ -80,7 +83,7 @@ export class EditComponent implements OnInit {
|
|
|
}, {
|
|
|
text: '选择',
|
|
|
handler: (value) => {
|
|
|
- this.beginDate = value.year.text + '/' + value.month.text + '/' + value.day.text;
|
|
|
+ this.beginDate = value.year.text + '-' + value.month.text + '-' + value.day.text;
|
|
|
this.openTimePicker(1);
|
|
|
}
|
|
|
}]
|
|
@@ -93,48 +96,16 @@ export class EditComponent implements OnInit {
|
|
|
}, {
|
|
|
text: '选择',
|
|
|
handler: (value) => {
|
|
|
- this.endDate = value.year.text + '/' + value.month.text + '/' + value.day.text;
|
|
|
+ this.endDate = value.year.text + '-' + value.month.text + '-' + value.day.text;
|
|
|
this.openTimePicker(2);
|
|
|
}
|
|
|
}]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //加载会议信息
|
|
|
- loadData() {
|
|
|
- this.shykApi.getData(this.dataModel.meetingid).subscribe((data: RequsetData) => {
|
|
|
- if (data.success && data.item != null) {
|
|
|
- this.dataModel = data.item;
|
|
|
-
|
|
|
- if (this.op === OperateEnum.新增) {
|
|
|
- this.dataModel.shyktype = 1;
|
|
|
- this.dataModel.chairuser = this.userInfo.username;
|
|
|
- this.dataModel.partycode = this.userService.GetUser().dataDzzdm.length <= 9 ? this.userInfo.DZZDM : this.userService.GetUser().dataDzzdm;
|
|
|
- this.dataModel.partyname = this.userService.GetUser().dataDzzdm.length <= 9 ? this.userInfo.DZZMC : this.userService.GetUser().dataDzzmc;
|
|
|
-
|
|
|
- this.setMeetingname(this.dataModel.shyktype);
|
|
|
- }
|
|
|
-
|
|
|
- this.imgOption1.fileRefid = this.dataModel.meetingid;
|
|
|
- this.imgOption2.fileRefid = this.dataModel.meetingid;
|
|
|
-
|
|
|
- this.loadTopicList();
|
|
|
- this.loadUserList();
|
|
|
- this.loadHistoryAddressList();
|
|
|
- this.setUploadFile();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
//保存会议
|
|
|
- saveMeeting(shykstatus, isnotify) {
|
|
|
- var topics = this.topicList.filter(it => {
|
|
|
- return (it.checked == true || (it.ID == '' && it.MBMC != ''));
|
|
|
- }).map(function (val) {
|
|
|
- return {mbmc: val.MBMC, id: val.ID};
|
|
|
- });
|
|
|
-
|
|
|
- var users = this.userList.map(function (val) {
|
|
|
+ saveMeeting() {
|
|
|
+ const users = this.userList.map(function (val) {
|
|
|
return {
|
|
|
rybm: val.RYBM,
|
|
|
xm: val.XM,
|
|
@@ -145,115 +116,103 @@ export class EditComponent implements OnInit {
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- if (topics.length <= 0) {
|
|
|
- this.presentAlert(this.dataModel.shyktype == 4 ? "请填写会议主题" : "请选择议题");
|
|
|
- return false;
|
|
|
- }
|
|
|
+ const typeList = this.selectShyktype.map(function (val) {
|
|
|
+ return {
|
|
|
+ shyktype: val
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
if (users.length <= 0) {
|
|
|
- this.presentAlert("请选择参会人");
|
|
|
+ this.alertModal.alert("请选择参会人");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- this.dataModel.begintime = new Date(this.datePipe.transform(this.dataModel.begintime, "yyyy/MM/dd HH:mm:ss"));
|
|
|
- /*this.dataModel.endtime = new Date(this.datePipe.transform(this.dataModel.endtime, "yyyy/MM/dd HH:mm:ss"));
|
|
|
- if (this.dataModel.begintime >= this.dataModel.endtime) {
|
|
|
- this.presentAlert('开始时间必须小于结束时间');
|
|
|
- return false;
|
|
|
- }*/
|
|
|
-
|
|
|
- this.presentLoading("提交中...").then(val => {
|
|
|
- this.shykApi.save(this.dataModel, topics, users, this.userInfo.userid, this.userInfo.username, isnotify, shykstatus).subscribe((fdata: RequsetData) => {
|
|
|
- this.loading.dismiss();
|
|
|
+ this.alertModal.loading("提交中...").then((loading) => {
|
|
|
+ this.shykApi.save(this.dataModel, users, typeList, this.isEditDemocracyReview() ? this.democracyReviewList : []
|
|
|
+ , this.userInfo.userid, this.userInfo.username).subscribe((fdata: RequsetData) => {
|
|
|
+ loading.dismiss();
|
|
|
if (fdata.success) {
|
|
|
if (moment(this.dataModel.begintime) > moment(new Date())) {
|
|
|
- this.presentAlert("会议已经提交成功!本次提交的会议为计划会议,请在会议结束后上传会议照片、台账记录、以及考勤信息内容。");
|
|
|
+ this.alertModal.alert("提交成功!本次提交的会议为计划会议,请在会议结束后上传会议照片、台账记录、以及考勤信息内容。");
|
|
|
} else {
|
|
|
- this.presentAlert(fdata.msg);
|
|
|
+ this.alertModal.alert('提交成功!');
|
|
|
}
|
|
|
this.back();
|
|
|
/*this.eventService.eventEmit.emit('reloadShykList', '刷新页面');
|
|
|
this.workService.getWorkSettingList();*/
|
|
|
} else {
|
|
|
- this.presentAlert(fdata.msg);
|
|
|
+ this.alertModal.alert(fdata.msg);
|
|
|
}
|
|
|
+ }, () => {
|
|
|
+ loading.dismiss();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //会议类型变更
|
|
|
- changeType() {
|
|
|
- this.setMeetingname(this.dataModel.shyktype);
|
|
|
- //this.setUserUrl();
|
|
|
- this.loadTopicList();
|
|
|
- this.defaultUser();
|
|
|
- }
|
|
|
-
|
|
|
- //会议名称
|
|
|
- setMeetingname(typeId) {
|
|
|
- //会议名称默认值【类型】部门[日期]
|
|
|
+ isEditDemocracyReview = function () {
|
|
|
+ return this.selectShyktype.filter(e => e === this.democracyReviewType).length > 0;
|
|
|
+ };
|
|
|
|
|
|
- let meetingDate = this.dataModel.begintime || new Date();
|
|
|
+ //删除参会成员
|
|
|
+ deleteUser(idx) {
|
|
|
+ this.userList.splice(idx, 1);
|
|
|
+ }
|
|
|
|
|
|
- this.dataModel.meetingname = "【" + this.typeList.filter(it => it.id == typeId)[0].name + "】" +
|
|
|
- this.dataModel.partyname + "[" + this.datePipe.transform(meetingDate, 'yyyyMM') + "]";
|
|
|
+ //选择参会成员
|
|
|
+ selectUser() {
|
|
|
+ this.presentModal(1);
|
|
|
}
|
|
|
|
|
|
- setUploadFile() {
|
|
|
- this.isUploadFile = this.dataModel.begintime != null && moment(this.dataModel.begintime) <= moment(new Date());
|
|
|
- };
|
|
|
+ selectDemocracyReviewUser() {
|
|
|
+ this.presentModal(2);
|
|
|
+ }
|
|
|
|
|
|
- meetingDateChange() {
|
|
|
- this.setMeetingname(this.dataModel.shyktype);
|
|
|
- this.setUploadFile();
|
|
|
- };
|
|
|
+ //加载会议信息
|
|
|
+ loadData() {
|
|
|
+ this.shykApi.getData(this.dataModel.meetingid).subscribe((data: RequsetData) => {
|
|
|
+ if (data.success && data.item != null) {
|
|
|
+ this.dataModel = data.item;
|
|
|
|
|
|
- //加载题议
|
|
|
- loadTopicList() {
|
|
|
- this.shykApi.getTopicList(this.dataModel.meetingid, this.dataModel.shyktype).subscribe((data: RequsetData) => {
|
|
|
- if (data.success) {
|
|
|
- if (data.item != null) {
|
|
|
- this.topicList = data.item;
|
|
|
- this.topicList.forEach((it) => {
|
|
|
- if (it.MEETINGTOPICID != null && it.MEETINGTOPICID != "") {
|
|
|
- it.checked = true;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (this.op === OperateEnum.新增) {
|
|
|
+ this.dataModel.chairuser = this.userInfo.username;
|
|
|
+ this.dataModel.partycode = this.userInfo.DZZDM;
|
|
|
+ this.dataModel.partyname = this.userInfo.DZZMC;
|
|
|
}
|
|
|
+
|
|
|
+ this.imgOption1.fileRefid = this.dataModel.meetingid;
|
|
|
+ this.imgOption2.fileRefid = this.dataModel.meetingid;
|
|
|
+
|
|
|
+ this.getUserList();
|
|
|
+ this.getHistoryAddressList();
|
|
|
+ this.getMeetingTypeList();
|
|
|
+ this.getMeetingDemocracyReviewList();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//加载人员
|
|
|
- loadUserList() {
|
|
|
+ getUserList() {
|
|
|
this.shykApi.getMeetingUserList(this.dataModel.meetingid).subscribe((data: RequsetData) => {
|
|
|
if (data.success) {
|
|
|
if (data.item != null) {
|
|
|
this.userList = data.item.list;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (this.userList.length <= 0) {
|
|
|
this.defaultUser();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//初始化参会成员
|
|
|
defaultUser() {
|
|
|
this.userList = [];
|
|
|
var dzzdm = this.dataModel.partycode;
|
|
|
- var szdzbdm = '';
|
|
|
var getUserUrl = this.selectUserUrl;
|
|
|
- if (this.dataModel.shyktype == 2) {
|
|
|
- szdzbdm = this.dataModel.partycode;
|
|
|
- getUserUrl = "/appApi/home/getLeaderUserList";//支委领导成员
|
|
|
- }
|
|
|
|
|
|
this.configService.HttpGetRomote(getUserUrl, {
|
|
|
pageindex: 1,
|
|
|
pagesize: 10000,
|
|
|
- szdzbdm: szdzbdm,
|
|
|
dzzdm: dzzdm
|
|
|
}).subscribe((data: RequsetData) => {
|
|
|
if (data.success) {
|
|
@@ -267,17 +226,21 @@ export class EditComponent implements OnInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //删除参会成员
|
|
|
- deleteUser(idx) {
|
|
|
- this.userList.splice(idx, 1);
|
|
|
- }
|
|
|
+ getDictionList() {
|
|
|
+ this.dictionaryApi.getDictionaryList('shykType').subscribe((data: RequsetData) => {
|
|
|
+ if (data.success) {
|
|
|
+ this.typeList = data.item;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- //选择参会成员
|
|
|
- selectUser() {
|
|
|
- this.presentModal();
|
|
|
+ this.dictionaryApi.getDictionaryList('DemocracyReviewResultType').subscribe((data: RequsetData) => {
|
|
|
+ if (data.success) {
|
|
|
+ this.democracyReviewResultTypeList = data.item;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- loadHistoryAddressList() {
|
|
|
+ getHistoryAddressList() {
|
|
|
this.shykApi.getHistoryAddressList(this.userInfo.userid).subscribe((data: RequsetData) => {
|
|
|
if (data.success) {
|
|
|
if (data.item != null) {
|
|
@@ -290,34 +253,31 @@ export class EditComponent implements OnInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //取消
|
|
|
- back() {
|
|
|
- this.router.navigate(['../../shyk'], {relativeTo: this.routeInfo});
|
|
|
- }
|
|
|
-
|
|
|
- async presentLoading(msg: string) {
|
|
|
- this.loading = await this.loadingController.create({
|
|
|
- message: msg,
|
|
|
- spinner: 'circles'
|
|
|
+ getMeetingTypeList() {
|
|
|
+ this.shykApi.getMeetingTypeList(this.dataModel.meetingid).subscribe((data: RequsetData) => {
|
|
|
+ if (data.success) {
|
|
|
+ this.meetingTypeList = data.item;
|
|
|
+ }
|
|
|
});
|
|
|
- return this.loading.present();
|
|
|
}
|
|
|
|
|
|
- async presentAlert(msg: string) {
|
|
|
- const alert = await this.alertController.create({
|
|
|
- header: '提示',
|
|
|
- subHeader: '',
|
|
|
- message: msg,
|
|
|
- buttons: ['确定']
|
|
|
+ getMeetingDemocracyReviewList() {
|
|
|
+ this.shykApi.getMeetingDemocracyReviewList(this.dataModel.meetingid).subscribe((data: RequsetData) => {
|
|
|
+ if (data.success) {
|
|
|
+ this.democracyReviewList = data.item;
|
|
|
+ }
|
|
|
});
|
|
|
+ }
|
|
|
|
|
|
- await alert.present();
|
|
|
+ //取消
|
|
|
+ back() {
|
|
|
+ this.router.navigate(['../../shyk'], {relativeTo: this.routeInfo});
|
|
|
}
|
|
|
|
|
|
//人员选择控件
|
|
|
- async presentModal() {
|
|
|
- var removeUsers = this.userList.map(it => it.RYBM).join(',');
|
|
|
- var szdzbdm = this.dataModel.shyktype == 2 ? this.userInfo.DZZDM : '';
|
|
|
+ async presentModal(type) {
|
|
|
+ /*var removeUsers = this.userList.map(it => it.RYBM).join(',');*/
|
|
|
+ /*var szdzbdm = this.dataModel.shyktype == 2 ? this.userInfo.DZZDM : '';*/
|
|
|
|
|
|
const modal = await this.modalController.create({
|
|
|
component: UserselectPage,
|
|
@@ -325,10 +285,10 @@ export class EditComponent implements OnInit {
|
|
|
'pageindex': 1,
|
|
|
'pagesize': 30,
|
|
|
'dzzdm': this.dataModel.partycode,
|
|
|
- 'removeUsers': removeUsers,
|
|
|
+ /*'removeUsers': removeUsers,*/
|
|
|
'xm': '',
|
|
|
'getUserUrl': this.selectUserUrl,
|
|
|
- 'szdzbdm': szdzbdm
|
|
|
+ /*'szdzbdm': szdzbdm*/
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -338,16 +298,29 @@ export class EditComponent implements OnInit {
|
|
|
if (data.rtnData != null && data.rtnData.length > 0) {
|
|
|
var us = data.rtnData;
|
|
|
|
|
|
- for (var i = 0; i < us.length; i++) {
|
|
|
- if (this.userList.filter(it => {
|
|
|
- return it.RYBM == us[i].rybm
|
|
|
- }).length <= 0) {
|
|
|
- this.userList.push({
|
|
|
- RYJBXXBS: us[i].ryjbxxbs, RYBM: us[i].rybm, XM: us[i].xm,
|
|
|
- SZDZBDM: us[i].szdzbdm,
|
|
|
- DZZMC: us[i].szdzzmc,
|
|
|
- SIGNINSTATUS: 2
|
|
|
- });
|
|
|
+ if (type === 1) {
|
|
|
+ for (var i = 0; i < us.length; i++) {
|
|
|
+ if (this.userList.filter(it => {
|
|
|
+ return it.RYBM == us[i].rybm
|
|
|
+ }).length <= 0) {
|
|
|
+ this.userList.push({
|
|
|
+ RYJBXXBS: us[i].ryjbxxbs, RYBM: us[i].rybm, XM: us[i].xm,
|
|
|
+ SZDZBDM: us[i].szdzbdm,
|
|
|
+ DZZMC: us[i].szdzzmc,
|
|
|
+ SIGNINSTATUS: 2
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (var i = 0; i < us.length; i++) {
|
|
|
+ if (this.democracyReviewList.filter(it => {
|
|
|
+ return it.usercode == us[i].rybm
|
|
|
+ }).length <= 0) {
|
|
|
+ this.democracyReviewList.push({
|
|
|
+ usercode: us[i].rybm,
|
|
|
+ userName: us[i].xm,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -426,7 +399,7 @@ export class EditComponent implements OnInit {
|
|
|
text: '未参加',
|
|
|
handler: (result) => {
|
|
|
if (result.userremark == "" || result.userremark == null) {
|
|
|
- this.presentAlert("请填写未参加原因");
|
|
|
+ this.alertModal.alert("请填写未参加原因");
|
|
|
return false;
|
|
|
}
|
|
|
user.SIGNINSTATUS = 3;
|