Commit e635b0f0 by xiexiaoqin

fix:删除动态包含文件或任务时,修改详情数据

parent 557c89ba
...@@ -1192,8 +1192,14 @@ create.Page({ ...@@ -1192,8 +1192,14 @@ create.Page({
this.update(); this.update();
} else { } else {
if (index !== -1) { if (index !== -1) {
this.store.data.affairList.splice(index, 1); const deleteData = this.store.data.affairList.splice(index, 1);
this.update(); this.update();
// 如果删除的动态包含文件和任务,需要修改
console.log(deleteData)
if (deleteData[0].fileDetailList || deleteData[0].meetingTaskSimpleViewModel) {
this.getTaskAndFiles(this.store.data.affairList);
}
} }
} }
} }
......
import { getCreateShowTime } from '../../utils/utils'; import { getCreateShowTime, dealRepeatModal } from '../../utils/utils';
import { updateMeetingTask } from '../../api/request'; import { updateMeetingTask } from '../../api/request';
class Store { class Store {
data = { data = {
...@@ -20,16 +20,15 @@ class Store { ...@@ -20,16 +20,15 @@ class Store {
relatedAppPlatform: null relatedAppPlatform: null
} }
changeStatus(meetingId, taskModifyModel, callBack) { changeStatus(meetingId, taskModifyModel, callBack) {
const data = { const data = {
meetingId: meetingId, meetingId: meetingId,
platform: 'dingTalk', platform: 'dingTalk',
taskModifyModel taskModifyModel
}; };
// 提前改 // 修改详情列表
const index = this.data.affairList.findIndex(it => it.commentId === taskModifyModel.commentId); const index = this.data.affairList.findIndex(it => it.commentId === taskModifyModel.commentId);
if (index !== -1) { if (index !== -1) {
// 修改详情列表数据
const changeData = this.data.affairList[index]; const changeData = this.data.affairList[index];
changeData.meetingTaskSimpleViewModel.processState = taskModifyModel.processState; changeData.meetingTaskSimpleViewModel.processState = taskModifyModel.processState;
changeData.updateTime = getCreateShowTime(new Date()); changeData.updateTime = getCreateShowTime(new Date());
...@@ -37,39 +36,23 @@ class Store { ...@@ -37,39 +36,23 @@ class Store {
this.data.affairList.splice(index, 1); this.data.affairList.splice(index, 1);
this.data.affairList.unshift(changeData); this.data.affairList.unshift(changeData);
// 修改任务列表页面数据
this.data.tasks[index].processState = taskModifyModel.processState;
this.data.tasks[index].updateTime = getCreateShowTime(new Date());
this.update(); this.update();
// 页面定位到最上面
if (callBack) { if (callBack) {
callBack() callBack()
} }
} }
updateMeetingTask(data).then(res => {
if (res.data.code === 0) {
// const index = this.data.affairList.findIndex(it => it.commentId === taskModifyModel.commentId);
// if (index !== -1) {
// // 修改详情列表数据
// const changeData = this.data.affairList[index];
// changeData.meetingTaskSimpleViewModel.processState = taskModifyModel.processState;
// changeData.updateTime = getCreateShowTime(new Date());
// this.data.affairList.splice(index, 1); // 修改任务列表页面
// this.data.affairList.unshift(changeData); const tasksIndex = this.data.tasks.findIndex(it => it.commentId === taskModifyModel.commentId);
if (tasksIndex !== -1) {
// // 修改任务列表页面数据 this.data.tasks[tasksIndex].processState = taskModifyModel.processState;
// this.data.tasks[index].processState = taskModifyModel.processState; this.data.tasks[tasksIndex].updateTime = getCreateShowTime(new Date());
// this.data.tasks[index].updateTime = getCreateShowTime(new Date()); }
updateMeetingTask(data).then(res => {
// this.update(); if (res.data.code !== 0) {
dd.alert('操作失败,请重试')
// if (callBack) {
// callBack()
// }
// }
} }
}); });
} }
......
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