Commit 6e2ec912 by xiexiaoqin

Merge branch 'release_beta/1.0.0' of…

Merge branch 'release_beta/1.0.0' of ssh://gitlab.roboming.com:2018/fengzhaoyu/schedule into release_beta/1.0.0
parents c273514c 6357191f
import { getInterTime } from '../../utils/utils'; import { getInterTime } from '../../utils/utils';
const currentDate = new Date(); const currentDate = new Date();
const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const durationList = [{ value: 30, label: '30分钟' }, { value: 60, label: '1小时' }, { value: 120, label: '2小时' }]; const durationList = [{ value: 30, label: '30分钟' }, { value: 60, label: '1小时' }, { value: 90, label: '1.5小时' }, { value: 120, label: '2小时' }];
const timeData = generateDate(365); const timeData = generateDate(365);
const timeHour = generateHour(24); const timeHour = generateHour(24);
const timeMin = generateMin(60); const timeMin = generateMin(60);
......
...@@ -17,24 +17,8 @@ create.Component({ ...@@ -17,24 +17,8 @@ create.Component({
this.getData(); this.getData();
}, },
didUpdate() { didUpdate() {
if (typeof this.$store.data.relatedAppNeedUpdate === "object") { if (this.$store.data.relatedAppNeedUpdate) {
let relatedAppList = this.data.relatedAppList; this.$store.data.relatedAppNeedUpdate = false;
let relatedAppPlatformList = this.data.relatedAppPlatformList;
relatedAppList.push({
thirdUserIdentify: this.$store.data.relatedAppNeedUpdate.name,
platform: this.$store.data.relatedAppNeedUpdate.platform
});
relatedAppPlatformList.push(
this.$store.data.relatedAppNeedUpdate.platform
);
this.setData({
relatedAppList: relatedAppList,
relatedAppPlatformList: relatedAppPlatformList
});
this.$store.data.relatedAppNeedUpdate = "";
this.update();
} else if (this.$store.data.relatedAppNeedUpdate === "1") {
this.$store.data.relatedAppNeedUpdate = "";
this.update(); this.update();
this.getData(); this.getData();
} }
...@@ -56,16 +40,9 @@ create.Component({ ...@@ -56,16 +40,9 @@ create.Component({
preventSort() { preventSort() {
return false; return false;
}, },
bindingApp(e) {
dd.navigateTo({
url: `./../bindingApp/bindingApp?platform=${e.target.dataset.platform}`
});
},
toAppDetails(e) { toAppDetails(e) {
dd.navigateTo({ dd.navigateTo({
url: `./../unbindApp/unbindApp?item=${JSON.stringify( url: `./../appDetails/appDetails?userName=${e.target.dataset.name}&platform=${e.target.dataset.platform}`
e.target.dataset.item
)}`
}); });
} }
} }
......
...@@ -47,7 +47,7 @@ create.Component({ ...@@ -47,7 +47,7 @@ create.Component({
complete: throttle( complete: throttle(
function () { function () {
const { currentTask } = this.store.data; const { currentTask } = this.store.data;
if (!currentTask.taskInfos.taskTitle) { if ((currentTask.taskInfos && !currentTask.taskInfos.taskTitle) || !currentTask.taskInfos) {
return return
} }
this.props.onComplete() this.props.onComplete()
......
...@@ -4,7 +4,7 @@ Component({ ...@@ -4,7 +4,7 @@ Component({
}, },
props: { props: {
showToast: false, showToast: false,
duration: 2000, duration: 1000,
title: '保存成功', title: '保存成功',
toastIcon: 'iconcanjia3' toastIcon: 'iconcanjia3'
......
<web-view id="web-view-1" src="{{url}}" onMessage="test">
</web-view>
\ No newline at end of file
import {
getOutlookUrl,
getZoomUrl,
authorizationCodeReplacementToken,
sendZoomCode
} from "../../api/request";
import "dingtalk-jsapi/entry/mobile";
import openLink from "dingtalk-jsapi/api/biz/util/openLink";
import create from "dd-store";
create.Page({
data: {
$data: null,
url: "",
platform: ""
},
onLoad(e) {
this.setData({
platform: e.platform
});
this.webViewContext = dd.createWebViewContext("web-view-1");
if (e.platform === "outlook") {
let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => {
openLink({
url: res.data.data
});
// this.setData({
// url: res.data.data
// });
});
} else if (e.platform === "zoom") {
getZoomUrl("").then(res => {
this.setData({
url: res.data.data
});
});
}
},
test(e) {
const code = e.detail.code;
const state = e.detail.state;
if (this.data.platform === "outlook") {
const data = {
code: code,
state: state
};
authorizationCodeReplacementToken(data).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
});
}
});
} else if (this.data.platform === "zoom") {
const data = {
code: code,
userId: getApp().globalData.userid,
orgId: dd.corpId
};
sendZoomCode(data).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
});
}
});
}
}
});
{}
\ No newline at end of file
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
padZero, padZero,
getCreateShowTime getCreateShowTime
} from "../../utils/utils"; } from "../../utils/utils";
import { checkFullScren } from "../../utils/checkFullScren";
const currentDate = new Date(); const currentDate = new Date();
const minYear = 2020; const minYear = 2020;
const maxYear = currentDate.getFullYear() + 1; const maxYear = currentDate.getFullYear() + 1;
...@@ -28,6 +29,7 @@ import create from "dd-store"; ...@@ -28,6 +29,7 @@ import create from "dd-store";
let maxClickCount = 5; let maxClickCount = 5;
create.Page({ create.Page({
data: { data: {
sign: '',
refresh: false, refresh: false,
$data: null, $data: null,
iconDay: currentDate.getDate(), iconDay: currentDate.getDate(),
...@@ -44,7 +46,7 @@ create.Page({ ...@@ -44,7 +46,7 @@ create.Page({
current: 1, current: 1,
pages: 1, pages: 1,
listLoading: true, listLoading: true,
isFullscreen: false isIPX: checkFullScren()
}, },
scrollTop: 0, scrollTop: 0,
pageSize: 10, pageSize: 10,
...@@ -60,6 +62,7 @@ create.Page({ ...@@ -60,6 +62,7 @@ create.Page({
maxYear: maxYear, maxYear: maxYear,
todayIndex: 0, todayIndex: 0,
onShow() { onShow() {
//如果是重复会议重新算 //如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) { if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({ dd.setNavigationBar({
...@@ -83,22 +86,31 @@ create.Page({ ...@@ -83,22 +86,31 @@ create.Page({
this.$store.data.isIndexAffairListNeedUpdate = false; this.$store.data.isIndexAffairListNeedUpdate = false;
this.update(); this.update();
} }
//开启一个定时器
this.timer = setInterval(() => {
this.getData()
}, 30000)
},
onHide() {
clearInterval(this.timer);
this.timer = null;
}, },
onLoad(event) { refresh() {
if (JSON.stringify(event) != "{}") { this.onLoad()
},
onLoad(query) {
console.log(query);
if (query && JSON.stringify(query) !== '{}') {
this.setData({ this.setData({
listLoading: false listLoading: false
}); });
let scheduleItem = JSON.parse(Object.keys(event)[0].split("=")[1]); const scheduleItem = JSON.parse(Object.keys(query)[0].split("=")[1]);
dd.navigateTo({ dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent( url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(scheduleItem) JSON.stringify(scheduleItem)
)}` )}`
}); });
} }
this.setData({
isFullscreen: getApp().globalData.isFullscreen
});
dd.setNavigationBar({ dd.setNavigationBar({
title: "动态" title: "动态"
}); });
...@@ -186,11 +198,11 @@ create.Page({ ...@@ -186,11 +198,11 @@ create.Page({
callBack(); callBack();
} }
}).catch(err => { }).catch(err => {
// if (err && err.refresh) { if (err && err.refresh) {
// this.setData({ this.setData({
// refresh: true refresh: true
// }) })
// } }
}); });
}, },
//动态置顶 //动态置顶
...@@ -291,7 +303,23 @@ create.Page({ ...@@ -291,7 +303,23 @@ create.Page({
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59" endTime: "2025-12-30 23:59:59"
}).then(res => { }).then(res => {
this.getScheduleList(res.data.data); //是否刷新页面
if (this.data.sign && res.data.data.sign !== this.data.sign) {
DateMap = getDateMap(this.minYear, this.maxYear);
}
if (res.data.data.sign !== this.data.sign) {
this.getScheduleList(res.data.data);
}
this.setData({
sign: res.data.data.sign
})
}).catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
})
}
}); });
}, },
//生成DateMap值 //生成DateMap值
...@@ -322,7 +350,7 @@ create.Page({ ...@@ -322,7 +350,7 @@ create.Page({
pushItem.duration = nextDateList.length; pushItem.duration = nextDateList.length;
for (let i = 1; i < nextDateList.length; i++) { for (let i = 1; i < nextDateList.length; i++) {
if (DateMap.has(nextDateList[i])) { if (DateMap.has(nextDateList[i])) {
DateMap.get(nextDateList[i]).unshift({ DateMap.get(nextDateList[i]).push({
...pushItem, ...pushItem,
isFewDays: i + 1, isFewDays: i + 1,
isfirstDayOrEndDay: nextDateList.length - 1 === i ? "2" : "1" // 0 第一天,1中间的天,2结束的天 isfirstDayOrEndDay: nextDateList.length - 1 === i ? "2" : "1" // 0 第一天,1中间的天,2结束的天
...@@ -782,7 +810,7 @@ create.Page({ ...@@ -782,7 +810,7 @@ create.Page({
maxClickCount--; maxClickCount--;
if (maxClickCount == 0) { if (maxClickCount == 0) {
dd.alert({ dd.alert({
content: "版本号222" content: "0.0.11"
}); });
maxClickCount = 5; maxClickCount = 5;
} }
......
...@@ -2,7 +2,7 @@ import create from 'dd-store'; ...@@ -2,7 +2,7 @@ import create from 'dd-store';
import { checkFullScren } from "../../utils/checkFullScren"; import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store'; import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request'; import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule } from '../../api/request.js' import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule, getMeetingRoomRepeatAffairs } from '../../api/request.js'
import { throttle, getCreateShowTime } from './../../utils/utils.js' import { throttle, getCreateShowTime } from './../../utils/utils.js'
import { observer } from '/utils/observer.js' import { observer } from '/utils/observer.js'
import { resolve } from 'path'; import { resolve } from 'path';
...@@ -10,6 +10,8 @@ create.Page({ ...@@ -10,6 +10,8 @@ create.Page({
store: pageStore, store: pageStore,
useAll: true, useAll: true,
data: { data: {
current: 1,
pages: 1,
isIPX: false, isIPX: false,
$data: null, $data: null,
affairLoading: true, affairLoading: true,
...@@ -106,7 +108,8 @@ create.Page({ ...@@ -106,7 +108,8 @@ create.Page({
editType: '', editType: '',
confirmAttendance: null, confirmAttendance: null,
isExpand: false, isExpand: false,
placeholder: '' placeholder: '',
mrReserveStatus: ''
}, },
onShow() { onShow() {
// this.conflictPeople() // this.conflictPeople()
...@@ -114,7 +117,7 @@ create.Page({ ...@@ -114,7 +117,7 @@ create.Page({
this.update() this.update()
}, 100) }, 100)
if (this.store.data.isNeedReloadList) { if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
'conToastData.title': '保存成功', 'conToastData.title': '保存成功',
...@@ -153,10 +156,14 @@ create.Page({ ...@@ -153,10 +156,14 @@ create.Page({
editType: this.$store.data.updateInfo.updateType editType: this.$store.data.updateInfo.updateType
}) })
} else { } else {
this.setData({ if (this.$store.data.participatorList.length < 2) {
editType: this.$store.data.updateInfo.updateType, this.isChange(this.$store.data.updateInfo.updateType, 'only')
'centerPopup.showCenterPopup': true } else {
}) this.setData({
editType: this.$store.data.updateInfo.updateType,
'centerPopup.showCenterPopup': true
})
}
// this.isChange(this.$store.data.updateInfo.updateType, 'only') // this.isChange(this.$store.data.updateInfo.updateType, 'only')
} }
} else { } else {
...@@ -213,12 +220,6 @@ create.Page({ ...@@ -213,12 +220,6 @@ create.Page({
participatorUserId.push(value.participator.userId) participatorUserId.push(value.participator.userId)
originUsersId.push(value.participator.userId) originUsersId.push(value.participator.userId)
originUsers.push(value.participator) originUsers.push(value.participator)
if (value.userId === getApp().globalData.userid) {
this.setData({
aheadTimes: !!value.aheadList ? value.aheadList : [],
'comListData.aheadTimesListId': !!value.aheadList ? value.aheadList : [-1]
})
}
} }
} }
for (let item of this.data.comListData.repeatList) { for (let item of this.data.comListData.repeatList) {
...@@ -227,6 +228,9 @@ create.Page({ ...@@ -227,6 +228,9 @@ create.Page({
} }
} }
this.setData({ this.setData({
aheadTimes: !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [],
'comListData.aheadTimesListId': !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [-1],
mrReserveStatus: res.data.data.mrReserveStatus,
confirmAttendance: res.data.data.confirmAttendance === null ? -9 : res.data.data.confirmAttendance, confirmAttendance: res.data.data.confirmAttendance === null ? -9 : res.data.data.confirmAttendance,
organizer: res.data.data.organizer, organizer: res.data.data.organizer,
'comListData.meetingWayModelId': res.data.data.meetingWayModel.model === null ? null : (res.data.data.meetingWayModel.model === 'dingtalk' ? 1 : 0), 'comListData.meetingWayModelId': res.data.data.meetingWayModel.model === null ? null : (res.data.data.meetingWayModel.model === 'dingtalk' ? 1 : 0),
...@@ -259,7 +263,7 @@ create.Page({ ...@@ -259,7 +263,7 @@ create.Page({
this.store.data.scheduleId = res.data.data.id; this.store.data.scheduleId = res.data.data.id;
this.store.data.groupId = res.data.data.groupId; this.store.data.groupId = res.data.data.groupId;
this.update(); this.update();
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.resetRepeatList() this.resetRepeatList()
} else { } else {
...@@ -320,6 +324,7 @@ create.Page({ ...@@ -320,6 +324,7 @@ create.Page({
reset() { reset() {
this.$store.resetEditData() this.$store.resetEditData()
this.resetRepeatList() this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime) this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
}, },
// 跳转下一页 // 跳转下一页
...@@ -351,10 +356,15 @@ create.Page({ ...@@ -351,10 +356,15 @@ create.Page({
editType: 'modify_location' editType: 'modify_location'
}) })
} else { } else {
this.setData({ if (this.$store.data.participatorList.length < 2) {
editType: 'modify_location', this.isChange('modify_location', 'only')
'centerPopup.showCenterPopup': true } else {
}) this.setData({
editType: 'modify_location',
'centerPopup.showCenterPopup': true
})
}
} }
break break
case 'meetingWayModel': case 'meetingWayModel':
...@@ -471,7 +481,15 @@ create.Page({ ...@@ -471,7 +481,15 @@ create.Page({
editType: 'repeat' editType: 'repeat'
}) })
} else { } else {
this.isChange('repeat', 'only') if (this.$store.data.participatorList.length < 2) {
this.isChange('repeat', 'only')
} else {
this.setData({
editType: 'repeat',
'centerPopup.showCenterPopup': true
})
}
} }
break; break;
} }
...@@ -594,10 +612,14 @@ create.Page({ ...@@ -594,10 +612,14 @@ create.Page({
editType: 'modify_time' editType: 'modify_time'
}) })
} else { } else {
this.setData({ if (this.$store.data.participatorList.length < 2) {
editType: 'modify_time', this.isChange('modify_time', 'only')
'centerPopup.showCenterPopup': true } else {
}) this.setData({
editType: 'modify_time',
'centerPopup.showCenterPopup': true
})
}
// this.isChange('modify_time', 'only') // this.isChange('modify_time', 'only')
} }
}, },
...@@ -704,10 +726,14 @@ create.Page({ ...@@ -704,10 +726,14 @@ create.Page({
const _that = this const _that = this
switch (this.data.conSelectPopupData.selectType) { switch (this.data.conSelectPopupData.selectType) {
case 'common': case 'common':
if (this.data.editType === 'modify_location' || this.data.editType === 'modify_time') { if (this.data.editType === 'modify_location' || this.data.editType === 'modify_time' || this.data.editType === 'repeat') {
this.setData({ if (this.$store.data.participatorList.length < 2) {
'centerPopup.showCenterPopup': true this.isChange(this.data.editType, event.currentTarget.dataset.item.id)
}) } else {
this.setData({
'centerPopup.showCenterPopup': true
})
}
} else { } else {
this.isChange(this.data.editType, event.currentTarget.dataset.item.id) this.isChange(this.data.editType, event.currentTarget.dataset.item.id)
} }
...@@ -744,6 +770,8 @@ create.Page({ ...@@ -744,6 +770,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true this.$store.data.indexNeedUpdate = true
this.update() this.update()
this.setData({ this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1 confirmAttendance: 1
}) })
this.conflictPeople() this.conflictPeople()
...@@ -874,13 +902,14 @@ create.Page({ ...@@ -874,13 +902,14 @@ create.Page({
modifyModel: modifyModel, modifyModel: modifyModel,
modifyContent: 'title' modifyContent: 'title'
} }
this.modifySchedule(dataTitle).catch(err => { this.modifySchedule(dataTitle).then(res => {
this.$store.data.isIndexAffairListNeedUpdate = true
this.$store.data.originalData.title = this.data.title
this.update()
}).catch(err => {
this.setData({ this.setData({
title: this.$store.data.originalData.title title: this.$store.data.originalData.title
}) })
}).then(res => {
this.$store.data.originalData.title = this.data.title
this.update()
}) })
} }
break break
...@@ -891,13 +920,13 @@ create.Page({ ...@@ -891,13 +920,13 @@ create.Page({
modifyModel: modifyModel, modifyModel: modifyModel,
modifyContent: 'remark' modifyContent: 'remark'
} }
this.modifySchedule(dataRemark).catch(err => { this.modifySchedule(dataRemark).then(res => {
this.$store.data.originalData.remark = this.data.remark
this.update()
}).catch(err => {
this.setData({ this.setData({
remark: this.$store.data.originalData.remark remark: this.$store.data.originalData.remark
}) })
}).then(res => {
this.$store.data.originalData.remark = this.data.remark
this.update()
}) })
} }
break break
...@@ -907,13 +936,13 @@ create.Page({ ...@@ -907,13 +936,13 @@ create.Page({
modifyModel: modifyModel, modifyModel: modifyModel,
modifyContent: 'meeting_way' modifyContent: 'meeting_way'
} }
this.modifySchedule(dataWay).catch(err => { this.modifySchedule(dataWay).then(res => {
this.$store.data.originalData.meetingWay = !!this.data.comListData.meetingWayModelId ? this.data.comListData.meetingWayList[this.data.comListData.meetingWayModelId] : null
this.update()
}).catch(err => {
this.setData({ this.setData({
'comListData.meetingWayModelId': this.$store.data.originalData.meetingWayModel === null ? null : (this.$store.data.originalData.meetingWayModel.model === 'dingtalk' ? 2 : (this.$store.data.originalData.meetingWayModel.model === 'zoom' ? 1 : 0)) 'comListData.meetingWayModelId': this.$store.data.originalData.meetingWayModel === null ? null : (this.$store.data.originalData.meetingWayModel.model === 'dingtalk' ? 2 : (this.$store.data.originalData.meetingWayModel.model === 'zoom' ? 1 : 0))
}) })
}).then(res => {
this.$store.data.originalData.meetingWay = !!this.data.comListData.meetingWayModelId ? this.data.comListData.meetingWayList[this.data.comListData.meetingWayModelId] : null
this.update()
}) })
break break
case 'operate_user': case 'operate_user':
...@@ -926,17 +955,17 @@ create.Page({ ...@@ -926,17 +955,17 @@ create.Page({
modifyModel: modifyModel, modifyModel: modifyModel,
modifyContent: 'operate_user' modifyContent: 'operate_user'
} }
this.modifySchedule(dataUser, needNotice).catch(err => { this.modifySchedule(dataUser, needNotice).then(res => {
this.$store.data.participatorList = this.$store.data.originUsers this.$store.data.originUsers = this.$store.data.participatorList
this.$store.data.participatorUserId = this.$store.data.originUsersId this.$store.data.originUsersId = this.$store.data.participatorUserId
this.$store.data.updateInfo = { this.$store.data.updateInfo = {
updateType: '', updateType: '',
isUpate: false isUpate: false
} }
this.update() this.update()
}).then(res => { }).catch(err => {
this.$store.data.originUsers = this.$store.data.participatorList this.$store.data.participatorList = this.$store.data.originUsers
this.$store.data.originUsersId = this.$store.data.participatorUserId this.$store.data.participatorUserId = this.$store.data.originUsersId
this.$store.data.updateInfo = { this.$store.data.updateInfo = {
updateType: '', updateType: '',
isUpate: false isUpate: false
...@@ -962,17 +991,17 @@ create.Page({ ...@@ -962,17 +991,17 @@ create.Page({
recurrenceModel: this.data.recurrenceModel, recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable repeatable: this.data.repeatable
} }
this.modifySchedule(dataRepeat1).catch(err => { this.modifySchedule(dataRepeat1).then(res => {
observer.notice(res.data.data)
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({ this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model), 'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable, repeatable: this.$store.data.originalData.repeatable,
recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.storer.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' } recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.storer.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' }
}) })
}).then(res => {
observer.notice(res.data.data)
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}) })
} }
else if (this.$store.data.originalData.repeatable === 1 && this.data.repeatable === 0) { else if (this.$store.data.originalData.repeatable === 1 && this.data.repeatable === 0) {
...@@ -984,16 +1013,16 @@ create.Page({ ...@@ -984,16 +1013,16 @@ create.Page({
recurrenceModel: this.data.recurrenceModel, recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable repeatable: this.data.repeatable
} }
this.modifySchedule(dataRepeat2).catch(err => { this.modifySchedule(dataRepeat2).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({ this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model), 'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable, repeatable: this.$store.data.originalData.repeatable,
recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.$store.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' } recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.$store.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' }
}) })
}).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}) })
} }
else { else {
...@@ -1005,15 +1034,15 @@ create.Page({ ...@@ -1005,15 +1034,15 @@ create.Page({
recurrenceModel: this.data.recurrenceModel, recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable repeatable: this.data.repeatable
} }
this.modifySchedule(dataRepeat3).catch(err => { this.modifySchedule(dataRepeat3).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({ this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model), 'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable repeatable: this.$store.data.originalData.repeatable
}) })
}).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}) })
} }
break break
...@@ -1028,11 +1057,7 @@ create.Page({ ...@@ -1028,11 +1057,7 @@ create.Page({
}, },
meetingRoomId: !!this.$store.data.roomId ? this.$store.data.roomId : -1 meetingRoomId: !!this.$store.data.roomId ? this.$store.data.roomId : -1
} }
this.modifySchedule(dataLocation, needNotice).catch(err => { this.modifySchedule(dataLocation, needNotice).then(res => {
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId
this.update()
}).then(res => {
this.$store.data.originalData.location = { this.$store.data.originalData.location = {
longitude: '-999', longitude: '-999',
latitude: '-999', latitude: '-999',
...@@ -1050,7 +1075,10 @@ create.Page({ ...@@ -1050,7 +1075,10 @@ create.Page({
this.isChange('modify_time', modifyModel, needNotice) this.isChange('modify_time', modifyModel, needNotice)
} }
}).catch(err => {
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId
this.update()
}) })
break break
case 'modify_time': case 'modify_time':
...@@ -1060,14 +1088,7 @@ create.Page({ ...@@ -1060,14 +1088,7 @@ create.Page({
endTime: this.$store.data.endTime.replace(/\//g, "-"), endTime: this.$store.data.endTime.replace(/\//g, "-"),
modifyContent: 'modify_time' modifyContent: 'modify_time'
} }
this.modifySchedule(data, needNotice).catch(err => { this.modifySchedule(data, needNotice).then(res => {
this.$store.data.startTime = this.$store.data.originalData.startTime.replace(/'-'/g, '/')
this.$store.data.endTime = this.$store.data.originalData.endTime.replace(/'-'/g, '/')
this.update()
this.setData({
week: this.data.weekList[new Date(this.$store.data.originalData.startTime.replace(/-/g, "/")).getDay()],
})
}).then(res => {
this.$store.data.originalData.startTime = this.$store.data.startTime.replace(/\//g, "-") this.$store.data.originalData.startTime = this.$store.data.startTime.replace(/\//g, "-")
this.$store.data.originalData.endTime = this.$store.data.endTime.replace(/\//g, "-") this.$store.data.originalData.endTime = this.$store.data.endTime.replace(/\//g, "-")
this.update() this.update()
...@@ -1103,6 +1124,13 @@ create.Page({ ...@@ -1103,6 +1124,13 @@ create.Page({
} }
// this.modifySchedule(data, needNotice) // this.modifySchedule(data, needNotice)
}).catch(err => {
this.$store.data.startTime = this.$store.data.originalData.startTime.replace(/-/g, '/')
this.$store.data.endTime = this.$store.data.originalData.endTime.replace(/-/g, '/')
this.update()
this.setData({
week: this.data.weekList[new Date(this.$store.data.originalData.startTime.replace(/-/g, "/")).getDay()],
})
}) })
break break
case 'aheadTimes': case 'aheadTimes':
...@@ -1111,13 +1139,13 @@ create.Page({ ...@@ -1111,13 +1139,13 @@ create.Page({
aheadTimes: this.data.aheadTimes, aheadTimes: this.data.aheadTimes,
modifyContent: 'aheadTimes' modifyContent: 'aheadTimes'
} }
this.modifySchedule(dataAheadTimes).catch(err => { this.modifySchedule(dataAheadTimes).then(res => {
this.$store.data.originalData.aheadTimes = (this.data.aheadTimes.length === 0 ? null : this.data.aheadTimes)
this.update()
}).catch(err => {
this.setData({ this.setData({
aheadTimes: this.$store.data.originalData.aheadTimes aheadTimes: this.$store.data.originalData.aheadTimes
}) })
}).then(res => {
this.$store.data.originalData.aheadTimes = (this.data.aheadTimes.length === 0 ? null : this.data.aheadTimes)
this.update()
}) })
break break
} }
...@@ -1216,6 +1244,8 @@ create.Page({ ...@@ -1216,6 +1244,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true this.$store.data.indexNeedUpdate = true
this.update() this.update()
this.setData({ this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1 confirmAttendance: 1
}) })
this.conflictPeople() this.conflictPeople()
...@@ -1278,48 +1308,142 @@ create.Page({ ...@@ -1278,48 +1308,142 @@ create.Page({
// 页面被关闭 // 页面被关闭
observer.unregister() observer.unregister()
}, },
//获取动态列表 //获取动态列表
reload(id) { loadAffairList(current = 1) {
if (this.data.repeatable == 1) {
this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else {
this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
},
//获取单次会议动态列表
getAffairList(id) {
getMeetingRoomAffairs(id).then(res => { getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data || []; const newAffairList = this.dealAffairData(res.data.data || []);
const newAffairList = affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
if (it.category == '2' && it.fileView) {
if (it.fileView.creatorInfo) {
it.fileView.creatorInfo = JSON.parse(it.fileView.creatorInfo);
}
if (it.fileView.fileInfos) {
it.fileView.fileInfos = JSON.parse(it.fileView.fileInfos)
}
return it
}
else if (it.category === '3' && it.taskViewList) {
it.taskViewList.map(o => {
if (o.acceptorInfo) {
o.acceptorInfo = JSON.parse(o.acceptorInfo)
}
if (o.creatorInfo) {
o.creatorInfo = JSON.parse(o.creatorInfo)
}
if (o.taskInfos) {
o.taskInfos = JSON.parse(o.taskInfos)
}
return o
})
return it
}
return it
})
this.store.data.affairList = newAffairList; this.store.data.affairList = newAffairList;
this.update();
this.setData({ this.setData({
affairLoading: false affairLoading: false
}); });
//重置 })
this.store.data.isNeedReloadList = false; },
//获取重复会议动态列表
getRepeatAffairList(groupId, current) {
getMeetingRoomRepeatAffairs(groupId, current).then(res => {
const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
//第一页数据会重新请求需要替换
if (current === 1) {
this.store.data.affairList = newAffairList;
this.update();
} else {
const newDynamicList = this.store.data.affairList.concat(newAffairList);
this.store.data.affairList = newDynamicList;
this.update();
}
this.setData({
affairLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
});
})
},
//加载之前的会议动态
loadAffairMore() {
if (this.data.current < this.data.pages) {
this.loadAffairList(this.data.current + 1);
}
},
//处理重复会议动态数据
dealRepeatAffairs(affairList, type) {
// const newAffairData = {};
// const newAffairList = [];
// affairList.forEach(it => {
// if (it.meetingLogResource) {
// newAffairData[it.resourceId] = []
// }
// })
return affairList.map(item => {
let itemData = item.meetingLogResource;
if (itemData) {
if (item.createTime) {
item.sort1 = item.createTime
item.sort = new Date(item.createTime.replace(/-/g, '/')).getTime();
item.createTime = getCreateShowTime(item.createTime);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
item.fileView = {
fileInfos: JSON.parse(itemData.fileInfos),
creatorInfo: itemData.creatorInfo
};
}
if (itemData.taskInfos) {
item.taskViewList = [
{
acceptorInfo: itemData.acceptorInfo,
acceptorId: itemData.acceptorId,
creatorInfo: itemData.creatorInfo,
creatorId: itemData.creatorId,
taskInfos: JSON.parse(itemData.taskInfos),
taskStatus: itemData.taskStatus,
id: itemData.id
}
]
}
this.update(); // newAffairData[item.resourceId].push(item);
}
return item
});
// console.log(newAffairData);
// for (let i in newAffairData) {
// newAffairData[i].sort((a, b) => a.sort - b.sort);
// newAffairList.push(newAffairData[i][0])
// }
// console.log(newAffairList)
// return newAffairList.sort((a, b) => a.sort - b.sort);
},
//处理会议动态数据
dealAffairData(affairList) {
return affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
if (it.category == '2' && it.fileView) {
if (it.fileView.creatorInfo) {
it.fileView.creatorInfo = JSON.parse(it.fileView.creatorInfo);
}
if (it.fileView.fileInfos) {
it.fileView.fileInfos = JSON.parse(it.fileView.fileInfos)
}
return it
}
else if (it.category === '3' && it.taskViewList) {
it.taskViewList.map(o => {
if (o.acceptorInfo) {
o.acceptorInfo = JSON.parse(o.acceptorInfo)
}
if (o.creatorInfo) {
o.creatorInfo = JSON.parse(o.creatorInfo)
}
if (o.taskInfos) {
o.taskInfos = JSON.parse(o.taskInfos)
}
return o
})
return it
}
return it
}) })
}, },
showPop(e) { showPop(e) {
...@@ -1361,7 +1485,7 @@ create.Page({ ...@@ -1361,7 +1485,7 @@ create.Page({
//刷新列表,这里为什么不在promie后执行 //刷新列表,这里为什么不在promie后执行
setTimeout(() => { setTimeout(() => {
if (this.store.data.isNeedReloadList) { if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
'conToastData.title': '编辑成功', 'conToastData.title': '编辑成功',
...@@ -1431,7 +1555,7 @@ create.Page({ ...@@ -1431,7 +1555,7 @@ create.Page({
"resourceType": "accessory", "resourceType": "accessory",
"id": id "id": id
}, () => { }, () => {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1467,6 +1591,21 @@ create.Page({ ...@@ -1467,6 +1591,21 @@ create.Page({
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos) "taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
}) })
}, },
//重复任务状态处理
dealRepeatStatus(task) {
let dataIndex = "";
this.data.affairList.forEach((item, index) => {
if (item.meetingLogResource.id == task.id) {
dataIndex = index;
}
});
const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
this.store.data[setData] = task.status;
this.store.data[setData2] = task.status;
this.update();
},
//列表修改任务状态 //列表修改任务状态
changeTaskStatusOnList(task) { changeTaskStatusOnList(task) {
this.updateTask({ this.updateTask({
...@@ -1474,7 +1613,11 @@ create.Page({ ...@@ -1474,7 +1613,11 @@ create.Page({
"taskStatus": task.status, "taskStatus": task.status,
'id': task.id 'id': task.id
}, () => { }, () => {
this.reload(this.data.scheduleItem.id); if (this.data.repeatable == 1) {
this.dealRepeatStatus(task);
} else {
this.loadAffairList();
}
this.$store.data.isIndexAffairListNeedUpdate = true; this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1484,6 +1627,12 @@ create.Page({ ...@@ -1484,6 +1627,12 @@ create.Page({
this.updateTask({ this.updateTask({
"logType": "task_status_modify", "logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus "taskStatus": this.store.data.currentTask.taskStatus
}, () => {
if (this.data.repeatable == 1) {
this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
}
this.store.data.isNeedReloadList = true;
this.update();
}) })
}, },
//删除任务 //删除任务
...@@ -1492,7 +1641,7 @@ create.Page({ ...@@ -1492,7 +1641,7 @@ create.Page({
"logType": "task_remove", "logType": "task_remove",
}, () => { }, () => {
this.closePop(); this.closePop();
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1539,7 +1688,7 @@ create.Page({ ...@@ -1539,7 +1688,7 @@ create.Page({
} }
createMeetingTask(postData).then(res => { createMeetingTask(postData).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.closePop(); this.closePop();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
...@@ -1553,14 +1702,7 @@ create.Page({ ...@@ -1553,14 +1702,7 @@ create.Page({
this.update(); this.update();
} }
}) })
}), }),
// throttle
// complete() {
// debugger
// },
//
expand() { expand() {
this.setData({ this.setData({
isExpand: false isExpand: false
......
...@@ -77,26 +77,23 @@ create.Page({ ...@@ -77,26 +77,23 @@ create.Page({
parentStr: "", parentStr: "",
onLoad(query) { onLoad(query) {
let date = new Date(this.$store.data.startTime.replace(/-/g, "/")); let date = new Date(this.$store.data.startTime.replace(/-/g, "/"));
// let date = new Date();
let year = date.getFullYear(); let year = date.getFullYear();
let month = padZero(date.getMonth() + 1); let month = padZero(date.getMonth() + 1);
let day = padZero(date.getDate()); let day = padZero(date.getDate());
let hour = padZero(date.getHours()); let toDayDate = new Date();
let minute = padZero(date.getMinutes()); let tomorrowTime = new Date(toDayDate);
let todayTime = `${year}/${padZero(date.getMonth() + 1)}/${padZero(
date.getDate()
)}`;
let tomorrowTime = new Date(date);
tomorrowTime.setDate(tomorrowTime.getDate() + 1); tomorrowTime.setDate(tomorrowTime.getDate() + 1);
let afterTomorrowTime = new Date(date); let afterTomorrowTime = new Date(toDayDate);
afterTomorrowTime.setDate(afterTomorrowTime.getDate() + 2); afterTomorrowTime.setDate(afterTomorrowTime.getDate() + 2);
this.setData({ this.setData({
"search.time": `${year}-${month}-${day}`, "search.time": `${year}-${month}-${day}`,
"TimeSlot.todayTime": todayTime, "TimeSlot.todayTime": `${toDayDate.getFullYear()}/${padZero(
"TimeSlot.tomorrowTime": `${year}/${padZero( toDayDate.getMonth() + 1
)}/${padZero(toDayDate.getDate())}`,
"TimeSlot.tomorrowTime": `${tomorrowTime.getFullYear()}/${padZero(
tomorrowTime.getMonth() + 1 tomorrowTime.getMonth() + 1
)}/${padZero(tomorrowTime.getDate())}`, )}/${padZero(tomorrowTime.getDate())}`,
"TimeSlot.afterTomorrowTime": `${year}/${padZero( "TimeSlot.afterTomorrowTime": `${afterTomorrowTime.getFullYear()}/${padZero(
afterTomorrowTime.getMonth() + 1 afterTomorrowTime.getMonth() + 1
)}/${padZero(afterTomorrowTime.getDate())}`, )}/${padZero(afterTomorrowTime.getDate())}`,
userId: getApp().globalData.userid userId: getApp().globalData.userid
...@@ -1266,6 +1263,10 @@ create.Page({ ...@@ -1266,6 +1263,10 @@ create.Page({
}; };
getReserveRoomList(data).then(res => { getReserveRoomList(data).then(res => {
if (res.data.data) { if (res.data.data) {
for (let value of res.data.data) {
value.name = `${this.getParentStr(value.locationId)}${value.name}`;
this.parentStr = "";
}
let reserveRoomList = res.data.data.map(item => { let reserveRoomList = res.data.data.map(item => {
let startTime = parseInt( let startTime = parseInt(
item.timeSlotWithMeetingVOS[0].reserveStartTime.substring(0, 2) item.timeSlotWithMeetingVOS[0].reserveStartTime.substring(0, 2)
......
...@@ -30,7 +30,7 @@ create.Page({ ...@@ -30,7 +30,7 @@ create.Page({
unbind() { unbind() {
unbindingApp(this.data.item.platform).then(res => { unbindingApp(this.data.item.platform).then(res => {
if (res.data.data) { if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = "1"; this.$store.data.relatedAppNeedUpdate = true;
this.update(); this.update();
dd.navigateBack({ dd.navigateBack({
delta: 1 delta: 1
......
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