Commit c09d1081 by fengzhaoyu

Merge branch 'dev' of http://gitlab.roboming.com/fengzhaoyu/schedule into dev

parents a141883e a47abc9e
......@@ -28,7 +28,6 @@ export default function xFetch({ url, method, data, type }) {
}
},
fail: function (err) {
console.log('err', JSON.stringify(err))
if (err && err.status == 401) {
login();
}
......
......@@ -336,7 +336,7 @@ create.Page({
}
},
addSchedule: throttle(function () {
addSchedule: throttle(async function () {
let data = {
title: this.data.title || `${getApp().globalData.name}创建的会议`,
location: {
......@@ -355,19 +355,12 @@ create.Page({
meetingRoomId: this.$store.data.roomId,
meetingWayModel: this.data.meetingWayModel
}
addSchedule(data).then(res => {
const res = await addSchedule(data);
if (res.data.code === 0) {
this.$store.data.tabBarIndex = '1'
if (this.data.repeatable === 0) {
// this.$store.data.onceMeetingContent = {
// startTime: new Date(this.$store.data.startTime),
// endTime: new Date(this.$store.data.endTime),
// confirmAttendance: res.data.data.confirmAttendance,
// title: res.data.data.title,
// id: res.data.data.id
// }
if (this.$store.addOnceMeeting) {
this.$store.addOnceMeeting({
await this.$store.addOnceMeeting({
startTime: new Date(this.$store.data.startTime),
endTime: new Date(this.$store.data.endTime),
confirmAttendance: res.data.data.confirmAttendance,
......@@ -378,17 +371,11 @@ create.Page({
} else {
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
await this.$store.modifyErpeatMeeting()
}
// this.$store.data.indexNeedUpdate = true
}
this.update()
dd.navigateBack({
delta: 1
})
dd.navigateBack()
}
})
}),
// 获取时间参数
......
......@@ -86,7 +86,7 @@
</view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" data-index="{{index}}" onTap="nextDetail">
<view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail">
<view class="scheduleTitle">
<text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text>
</view>
......
......@@ -97,20 +97,20 @@ create.Page({
//获取日程列表
this.getData();
this.$store.modifyOnceMeetingContent = (content) => {
this.modifyOnceMeetingContent(content);
this.$store.modifyOnceMeetingContent = async (content) => {
await this.modifyOnceMeetingContent(content);
}
this.$store.modifyErpeatMeeting = () => {
this.modifyErpeatMeeting()
this.$store.modifyErpeatMeeting = async () => {
await this.modifyErpeatMeeting()
}
this.$store.addOnceMeeting = (content) => {
this.addOnceMeeting(content)
this.$store.addOnceMeeting = async (content) => {
await this.addOnceMeeting(content)
}
this.update();
},
//添加单次会议
addOnceMeeting(content) {
this.getData(true);
async addOnceMeeting(content) {
await this.getData(true);
dd.setNavigationBar({
title: "日程"
});
......@@ -124,32 +124,34 @@ create.Page({
});
},
//修改重复会议
modifyErpeatMeeting() {
this.getData();
async modifyErpeatMeeting() {
await this.getData();
},
//修改会议,除单次会议修改成重复会议
modifyOnceMeetingContent(content) {
this.getData(true);
const scheduleListIndex = `scheduleList[${this.data.scheduleListIndex}].value`;
const item = this.data.scheduleList[this.data.scheduleListIndex].value
async modifyOnceMeetingContent(content) {
await this.getData(true);
//修改数据源
for (let i = 0; i < this.data.scheduleList.length; i++) {
if (typeof this.data.scheduleList[i].value !== 'string') {
if (this.data.scheduleList[i].value.id === content.id) {
this.setData({
[scheduleListIndex]: {
...item,
...content
[`scheduleList[${i}].value`]: { ...this.data.scheduleList[i].value, ...content }
})
break;
}
}
}
});
for (let i = 0; i < this.scheduleList.length; i++) {
if (typeof this.scheduleList[i].value !== 'string') {
if (this.scheduleList[i].value.id === item.id) {
if (this.scheduleList[i].value.id === content.id) {
this.scheduleList[i].value = { ...this.scheduleList[i].value, ...content };
break;
}
}
}
},
getData(onlyChangeSign) {
getHomeUserSchedule1({
async getData(onlyChangeSign) {
await getHomeUserSchedule1({
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
}).then(res => {
......@@ -213,6 +215,8 @@ create.Page({
this.timer = null;
},
refresh() {
this.isFirstLoad = true;
this.isLoaded = false;
this.onLoad();
},
//动态列表侧滑的时候禁止页面上下滑动
......@@ -792,12 +796,7 @@ create.Page({
dd.navigateTo({ url: "./../createMeeting/createMeeting" });
},
nextDetail: throttle(function (e) {
const { item, index } = e.target.dataset;
if (index) {
this.setData({
scheduleListIndex: index
})
}
const { item } = e.target.dataset;
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(item)
......
......@@ -651,8 +651,6 @@ create.Page({
return new Promise((resolve, rejects) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
// that.$store.data.indexNeedUpdate = true
// that.update()
if (data.modifyContent !== 'title') {
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
......@@ -754,15 +752,13 @@ create.Page({
}
isParticipate(data1).then(res => {
if (res.data.code === 0) {
// this.$store.data.indexNeedUpdate = true
// this.update()
this.setData({
confirmAttendance: 0
})
this.conflictPeople()
if (data1.type === 'only') {
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({ confirmAttendance: 0 })
this.$store.modifyOnceMeetingContent({ id: this.data.scheduleItem.id, confirmAttendance: 0 })
}
} else {
if (this.$store.modifyErpeatMeeting) {
......@@ -782,8 +778,6 @@ create.Page({
}
isParticipate(data).then(res => {
if (res.data.code === 0) {
// this.$store.data.indexNeedUpdate = true
// this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
......@@ -792,7 +786,7 @@ create.Page({
this.conflictPeople()
if (data.type === 'only') {
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({ confirmAttendance: 1 })
this.$store.modifyOnceMeetingContent({ id: this.data.scheduleItem.id, confirmAttendance: 1 })
}
} else {
if (this.$store.modifyErpeatMeeting) {
......@@ -810,6 +804,9 @@ create.Page({
cancelButtonText: '取消',
success: (success) => {
if (!!success.confirm) {
dd.showLoading({
content: '正在删除...',
});
let data = {
scheduleId: this.data.scheduleItem.id,
identify: this.data.organizer === getApp().globalData.userid ? 'major' : 'identify',
......@@ -817,11 +814,10 @@ create.Page({
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
deleteSchedule(data).then(res => {
deleteSchedule(data).then(async () => {
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
await this.$store.modifyErpeatMeeting()
}
// _that.$store.data.indexNeedUpdate = true;
_that.$store.data.isIndexAffairListNeedUpdate = true;
_that.update()
dd.navigateBack({
......@@ -936,6 +932,7 @@ create.Page({
if (this.data.repeatable == 0) {
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({
id: this.data.scheduleItem.id,
title: this.data.title
})
}
......@@ -1248,16 +1245,18 @@ create.Page({
cancelButtonText: '取消',
success: (success) => {
if (!!success.confirm) {
dd.showLoading({
content: '正在删除...',
});
let data = {
scheduleId: this.data.scheduleItem.id,
identify: this.data.organizer === getApp().globalData.userid ? 'major' : 'identify',
deleteModel: 'only'
}
deleteSchedule(data).then(res => {
deleteSchedule(data).then(async () => {
// _that.$store.data.indexNeedUpdate = true;
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
await this.$store.modifyErpeatMeeting()
}
_that.$store.data.isIndexAffairListNeedUpdate = true;
_that.update()
......@@ -1285,11 +1284,6 @@ create.Page({
} else {
isParticipate(data).then(res => {
if (res.data.code === 0) {
// this.$store.data.indexNeedUpdate = true
// this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
......@@ -1297,7 +1291,7 @@ create.Page({
})
this.conflictPeople()
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({ confirmAttendance: 1 })
this.$store.modifyOnceMeetingContent({ id: this.data.scheduleItem.id, confirmAttendance: 1 })
}
}
})
......@@ -1318,14 +1312,12 @@ create.Page({
} else {
isParticipate(data).then(res => {
if (res.data.code === 0) {
// this.$store.data.indexNeedUpdate = true
// this.update()
this.setData({
confirmAttendance: 0
})
this.conflictPeople()
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({ confirmAttendance: 0 })
this.$store.modifyOnceMeetingContent({ id: this.data.scheduleItem.id, confirmAttendance: 0 })
}
}
})
......@@ -1347,8 +1339,6 @@ create.Page({
}
isParticipate(data).then(res => {
if (res.data.code === 0) {
// this.$store.data.indexNeedUpdate = true
// this.update()
this.setData({
confirmAttendance: -9
})
......@@ -1359,7 +1349,7 @@ create.Page({
}
} else {
if (this.$store.modifyOnceMeetingContent) {
this.$store.modifyOnceMeetingContent({ confirmAttendance: -9 })
this.$store.modifyOnceMeetingContent({ id: this.data.scheduleItem.id, confirmAttendance: -9 })
}
}
......
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