Commit 4fc73dc5 by fengzhaoyu

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

parents 0391326d e9f76179
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
"pages/participantsDetail/participantsDetail", "pages/participantsDetail/participantsDetail",
"pages/applicationDetails/applicationDetails", "pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList", "pages/attendeeList/attendeeList",
"pages/createTask/createTask" "pages/createTask/createTask",
"pages/files/files",
"pages/tasks/tasks"
], ],
"window": { "window": {
"allowsBounceVertical": "YES" "allowsBounceVertical": "YES"
......
page {
background: #Fff;
}
.file-container {
padding: 0 32rpx;
}
\ No newline at end of file
<view class="file-container" a:for="{{files}}">
<file-list fileView="{{item}}"/>
</view>
\ No newline at end of file
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
create.Page({
store: pageStore,
data: {
meetingId: '',
files: null //store
},
onLoad(query) {
this.setData({
meetingId: query.meetingId
})
},
});
{
"defaultTitle": "文件",
"usingComponents": {
"file-list": "../../components/fileList/fileList"
}
}
\ No newline at end of file
...@@ -765,7 +765,6 @@ create.Page({ ...@@ -765,7 +765,6 @@ create.Page({
dd.navigateTo({ url: "./../createMeeting/createMeeting" }); dd.navigateTo({ url: "./../createMeeting/createMeeting" });
}, },
nextDetail: throttle(function (e) { nextDetail: throttle(function (e) {
console.log(e.target.dataset)
const { item } = e.target.dataset; const { item } = e.target.dataset;
const scheduleItem = { scheduleId: item.meetingId || item.id, scheduleTemplateId: item.scheduleTemplateId, planDate: item.planDate } const scheduleItem = { scheduleId: item.meetingId || item.id, scheduleTemplateId: item.scheduleTemplateId, planDate: item.planDate }
dd.navigateTo({ dd.navigateTo({
......
...@@ -107,6 +107,8 @@ ...@@ -107,6 +107,8 @@
</view> </view>
</view> </view>
</view> </view>
<view onTap="goTasksPage">{{tasks.length}} 个任务</view>
<view onTap="goFilesPage">{{files.length}} 个附件</view>
<!-- 删除该会议 --> <!-- 删除该会议 -->
<template is="deleteBtn" onhandleDelete="" data="{{title: '删除该会议' }}"/> <template is="deleteBtn" onhandleDelete="" data="{{title: '删除该会议' }}"/>
</view> </view>
......
...@@ -1477,28 +1477,31 @@ create.Page({ ...@@ -1477,28 +1477,31 @@ create.Page({
//获取动态列表 //获取动态列表
loadAffairList(current = 1) { loadAffairList(current = 1) {
if (this.data.repeatable == 1) { // if (this.data.repeatable == 1) {
if (!this.data.scheduleItem.groupId) { // if (!this.data.scheduleItem.groupId) {
console.log(`groupId不存在`) // console.log(`groupId不存在`)
return // return
} // }
this.getRepeatAffairList(this.data.scheduleItem.groupId, current) // this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else { // } else {
if (!this.data.scheduleItem.id) { // if (!this.data.scheduleItem.id) {
console.log(`scheduleItem.id不存在`) // console.log(`scheduleItem.id不存在`)
return // return
} // }
// this.getAffairList(this.data.scheduleItem.id)
// }
// //重置
// this.store.data.isNeedReloadList = false;
// this.update();
this.getAffairList(this.data.scheduleItem.id) this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
}, },
//获取单次会议动态列表 //获取单次会议动态列表
getAffairList(id) { getAffairList(id) {
getMeetingRoomAffairs(id).then(res => { getMeetingRoomAffairs(id).then(res => {
this.getTaskAndFiles(res.data.data);
const newAffairList = this.dealAffairData(res.data.data || []); const newAffairList = this.dealAffairData(res.data.data || []);
this.store.data.affairList = newAffairList; this.store.data.affairList = newAffairList;
this.update(); this.update();
...@@ -1508,87 +1511,103 @@ create.Page({ ...@@ -1508,87 +1511,103 @@ create.Page({
}) })
}, },
//获取重复会议动态列表 //获取重复会议动态列表
getRepeatAffairList(groupId, current) { // getRepeatAffairList(groupId, current) {
getMeetingRoomRepeatAffairs(groupId, current).then(res => { // getMeetingRoomRepeatAffairs(groupId, current).then(res => {
const newAffairList = this.dealRepeatAffairs(res.data.data.records || []); // const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
//第一页数据会重新请求需要替换 // //第一页数据会重新请求需要替换
if (current === 1) { // if (current === 1) {
this.store.data.affairList = newAffairList; // this.store.data.affairList = newAffairList;
this.update(); // this.update();
} else { // } else {
const newDynamicList = this.store.data.affairList.concat(newAffairList); // const newDynamicList = this.store.data.affairList.concat(newAffairList);
this.store.data.affairList = newDynamicList; // this.store.data.affairList = newDynamicList;
this.update(); // this.update();
} // }
this.setData({ // this.setData({
affairLoading: false, // affairLoading: false,
current: res.data.data.current, // current: res.data.data.current,
pages: res.data.data.pages // pages: res.data.data.pages
}); // });
}) // })
}, // },
//加载之前的会议动态 //加载之前的会议动态
loadAffairMore() { // loadAffairMore() {
if (this.data.current < this.data.pages) { // if (this.data.current < this.data.pages) {
this.loadAffairList(this.data.current + 1); // this.loadAffairList(this.data.current + 1);
} // }
}, // },
//处理重复会议动态数据 //处理重复会议动态数据
dealRepeatAffairs(affairList, type) { // dealRepeatAffairs(affairList, type) {
// const newAffairData = {}; // // const newAffairData = {};
// const newAffairList = []; // // const newAffairList = [];
// affairList.forEach(it => { // // affairList.forEach(it => {
// if (it.meetingLogResource) { // // if (it.meetingLogResource) {
// newAffairData[it.resourceId] = [] // // 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,
// id: itemData.id,
// description: itemData.description
// };
// }
// 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
// }
// ]
// } // }
// })
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,
id: itemData.id,
description: itemData.description
};
}
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
}
]
}
// newAffairData[item.resourceId].push(item); // // 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 item
// return newAffairList.sort((a, b) => a.sort - b.sort); // });
// // 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);
// },
// 获取所有的任务和文件
getTaskAndFiles(affairList) {
const files = [];
const tasks = [];
affairList.forEach(it => {
if (it.commentType === 'task') {
tasks.push(it)
} else if (it.commentType === 'file') {
files.push(it)
}
})
this.store.data.files = files;
this.store.data.tasks = tasks;
this.update();
}, },
//处理会议动态数据 //处理会议动态数据
dealAffairData(affairList) { dealAffairData(affairList) {
...@@ -1611,65 +1630,65 @@ create.Page({ ...@@ -1611,65 +1630,65 @@ create.Page({
show: true show: true
}) })
}, },
closePop() { // closePop() {
this.setData({ // this.setData({
show: false // show: false
}); // });
if (this.data.pop.type == 'updateTask') { // if (this.data.pop.type == 'updateTask') {
const { currentTask } = this.store.data; // const { currentTask } = this.store.data;
const { oldTask } = this.data; // const { oldTask } = this.data;
//添加执行人 // //添加执行人
if (!oldTask.acceptorId && currentTask.acceptorId) { // if (!oldTask.acceptorId && currentTask.acceptorId) {
this.addTaskExcutor(); // this.addTaskExcutor();
} // }
///删除执行人 // ///删除执行人
else if (oldTask.acceptorId && !currentTask.acceptorId) { // else if (oldTask.acceptorId && !currentTask.acceptorId) {
this.deleteTaskExcutor(); // this.deleteTaskExcutor();
} // }
//修改执行人 // //修改执行人
else if ((oldTask.acceptorId && currentTask.acceptorId) && (oldTask.acceptorId !== currentTask.acceptorId)) { // else if ((oldTask.acceptorId && currentTask.acceptorId) && (oldTask.acceptorId !== currentTask.acceptorId)) {
this.updateTaskExcutor(); // this.updateTaskExcutor();
} // }
//修改任务标题 // //修改任务标题
if (currentTask.taskInfos.taskTitle && currentTask.taskInfos.taskTitle !== oldTask.taskInfos.taskTitle) { // if (currentTask.taskInfos.taskTitle && currentTask.taskInfos.taskTitle !== oldTask.taskInfos.taskTitle) {
this.editTaskTitle(); // this.editTaskTitle();
} // }
//修改任务状态 // //修改任务状态
if (currentTask.taskStatus !== oldTask.taskStatus) { // if (currentTask.taskStatus !== oldTask.taskStatus) {
this.changeTaskStatus(); // this.changeTaskStatus();
} // }
//刷新列表,这里为什么不在promie后执行 // //刷新列表,这里为什么不在promie后执行
setTimeout(() => { // setTimeout(() => {
if (this.store.data.isNeedReloadList) { // if (this.store.data.isNeedReloadList) {
this.loadAffairList(); // this.loadAffairList();
this.setData({ // this.setData({
'conToastData.showToast': true, // 'conToastData.showToast': true,
'conToastData.title': '编辑成功', // 'conToastData.title': '编辑成功',
}) // })
this.$store.data.isIndexAffairListNeedUpdate = true; // this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); // this.update();
} // }
}, 500) // }, 500)
} // }
}, // },
//出现任务弹窗 //出现任务弹窗
showCreateTask(e) { // showCreateTask(e) {
//重置 // //重置
this.store.data.currentTask = {}; // this.store.data.currentTask = {};
this.update(); // this.update();
this.showPop(e) // this.showPop(e)
}, // },
//设置修改任务弹框中当前任务 //设置修改任务弹框中当前任务
setCurrentTask(currentTask) { // setCurrentTask(currentTask) {
this.setData({ // this.setData({
oldTask: JSON.parse(JSON.stringify(currentTask)) // oldTask: JSON.parse(JSON.stringify(currentTask))
}) // })
this.store.data.currentTask = currentTask; // this.store.data.currentTask = currentTask;
this.update(); // this.update();
}, // },
// 上传文件 // 上传文件
async handleAddFile() { async handleAddFile() {
...@@ -1701,149 +1720,149 @@ create.Page({ ...@@ -1701,149 +1720,149 @@ create.Page({
}, },
//隐藏文件操作浮窗 //隐藏文件操作浮窗
hideFileOperate() { // hideFileOperate() {
this.store.data.logId = ''; // this.store.data.logId = '';
this.update(); // this.update();
}, // },
// 删除文件 // 删除文件
deleteMeetingFile(id) { // deleteMeetingFile(id) {
this.updateTask({ // this.updateTask({
"logType": "schedule_accessory_remove", // "logType": "schedule_accessory_remove",
"resourceType": "accessory", // "resourceType": "accessory",
"id": id // "id": id
}, () => { // }, () => {
this.loadAffairList(); // this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; // this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); // this.update();
}) // })
}, // },
// 删除执行人 // 删除执行人
deleteTaskExcutor() { // deleteTaskExcutor() {
this.updateTask({ // this.updateTask({
"logType": "task_remove_acceptor", // "logType": "task_remove_acceptor",
acceptorInfo: JSON.stringify(this.data.oldTask.acceptorInfo), // acceptorInfo: JSON.stringify(this.data.oldTask.acceptorInfo),
acceptorId: this.data.oldTask.acceptorId // acceptorId: this.data.oldTask.acceptorId
}) // })
}, // },
// 添加执行人 // 添加执行人
addTaskExcutor() { // addTaskExcutor() {
this.updateTask({ // this.updateTask({
"logType": "task_add_acceptor", // "logType": "task_add_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo), // acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId // acceptorId: this.store.data.currentTask.acceptorId
}) // })
}, // },
//修改执行人 //修改执行人
updateTaskExcutor() { // updateTaskExcutor() {
this.updateTask({ // this.updateTask({
"logType": "task_modify_acceptor", // "logType": "task_modify_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo), // acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId // acceptorId: this.store.data.currentTask.acceptorId
}) // })
}, // },
//修改任务标题 //修改任务标题
editTaskTitle(value) { // editTaskTitle(value) {
this.updateTask({ // this.updateTask({
"logType": "task_modify_title", // "logType": "task_modify_title",
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos) // "taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
}) // })
}, // },
//重复任务状态处理 //重复任务状态处理
dealRepeatStatus(task) { // dealRepeatStatus(task) {
let dataIndex = ""; // let dataIndex = "";
this.data.affairList.forEach((item, index) => { // this.data.affairList.forEach((item, index) => {
if (item.meetingLogResource.id == task.id) { // if (item.meetingLogResource.id == task.id) {
dataIndex = index; // dataIndex = index;
} // }
}); // });
const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`; // const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`; // const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
this.store.data[setData] = task.status; // this.store.data[setData] = task.status;
this.store.data[setData2] = task.status; // this.store.data[setData2] = task.status;
this.update(); // this.update();
}, // },
//弹窗修改任务状态 //弹窗修改任务状态
changeTaskStatus() { // changeTaskStatus() {
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) { // if (this.data.repeatable == 1) {
this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id }); // this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
} // }
this.store.data.isNeedReloadList = true; // this.store.data.isNeedReloadList = true;
this.update(); // this.update();
}) // })
}, // },
//删除任务 //删除任务
deleteTask(id) { // deleteTask(id) {
this.updateTask({ // this.updateTask({
"logType": "task_remove", // "logType": "task_remove",
}, () => { // }, () => {
this.closePop(); // this.closePop();
this.loadAffairList(); // this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; // this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); // this.update();
}) // })
}, // },
//修改任务 //修改任务
updateTask(taskData, callBack) { // updateTask(taskData, callBack) {
const postData = { // const postData = {
"groupId": this.data.scheduleItem.groupId, // "groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id, // "scheduleId": this.data.scheduleItem.id,
"resourceType": "task", // "resourceType": "task",
"creatorId": getApp().globalData.userid, // "creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo, // "creatorInfo": getApp().globalData.userInfo,
"id": this.store.data.currentTask.id, // "id": this.store.data.currentTask.id,
...taskData // ...taskData
} // }
updateMeetingTask(postData).then(res => { // updateMeetingTask(postData).then(res => {
if (res.data.code == 0) { // if (res.data.code == 0) {
if (callBack) { // if (callBack) {
callBack(); // callBack();
} else { // } else {
this.store.data.isNeedReloadList = true; // this.store.data.isNeedReloadList = true;
this.update(); // this.update();
} // }
} // }
}) // })
}, // },
//创建任务 //创建任务
complete: throttle(function () { // complete: throttle(function () {
const { currentTask } = this.store.data; // const { currentTask } = this.store.data;
const postData = { // const postData = {
"groupId": this.data.scheduleItem.groupId, // "groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id, // "scheduleId": this.data.scheduleItem.id,
"resourceType": "task", // "resourceType": "task",
"creatorId": getApp().globalData.userid, // "creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo, // "creatorInfo": getApp().globalData.userInfo,
"logType": "task_add", // "logType": "task_add",
"taskInfos": JSON.stringify(currentTask.taskInfos), // "taskInfos": JSON.stringify(currentTask.taskInfos),
"taskStatus": '0', // "taskStatus": '0',
"description": "" // "description": ""
} // }
if (currentTask.acceptorId) { // if (currentTask.acceptorId) {
postData.acceptorId = currentTask.acceptorId; // postData.acceptorId = currentTask.acceptorId;
postData.acceptorInfo = JSON.stringify(currentTask.acceptorInfo); // postData.acceptorInfo = JSON.stringify(currentTask.acceptorInfo);
} // }
createMeetingTask(postData).then(res => { // createMeetingTask(postData).then(res => {
if (res.data.code == 0) { // if (res.data.code == 0) {
this.loadAffairList(); // this.loadAffairList();
this.closePop(); // this.closePop();
this.setData({ // this.setData({
'conToastData.showToast': true, // 'conToastData.showToast': true,
'conToastData.title': '保存成功', // 'conToastData.title': '保存成功',
}) // })
//重置 // //重置
this.store.data.currentTask = {}; // this.store.data.currentTask = {};
this.update(); // this.update();
this.$store.data.isIndexAffairListNeedUpdate = true; // this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); // this.update();
} // }
}) // })
}), // }),
expand() { expand() {
this.setData({ this.setData({
isExpand: false isExpand: false
...@@ -2066,6 +2085,12 @@ create.Page({ ...@@ -2066,6 +2085,12 @@ create.Page({
} }
} }
return [index, childIndex]; return [index, childIndex];
},
goTasksPage() {
dd.navigateTo({ url: '/pages/tasks/tasks?meetingId=' + this.store.data.scheduleId })
},
goFilesPage() {
dd.navigateTo({ url: '/pages/files/files?meetingId=' + this.store.data.scheduleId })
} }
}); });
...@@ -5,6 +5,8 @@ class Store { ...@@ -5,6 +5,8 @@ class Store {
notes: null, //{meetingNotes: '', commentId: ''} notes: null, //{meetingNotes: '', commentId: ''}
parentCommentId: '', // 评论的动态Id parentCommentId: '', // 评论的动态Id
remark: null, //{remark: '', commentId: ''} remark: null, //{remark: '', commentId: ''}
files: [],
tasks: [],
fileInfos: null, fileInfos: null,
description: '', description: '',
oldFileInfos: '', oldFileInfos: '',
......
page {
background: #Fff;
}
\ No newline at end of file
<block a:for="{{tasks}}">
<task-list onChangeTaskStatusOnList="changeTaskStatus" taskView="{{item.meetingTaskSimpleViewModel}}" commentId="{{item.commentId}}" isCanEdit="{{false}}"/>
</block>
\ No newline at end of file
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
create.Page({
store: pageStore,
data: {
meetingId: '',
tasks: null //store
},
onLoad(query) {
this.setData({
meetingId: query.meetingId
})
},
});
{
"defaultTitle": "子任务",
"usingComponents": {
"task-list": "../../components/taskList/taskList"
}
}
\ No newline at end of file
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