[sync story #73341] Sync code to this branch from feature/deliverable.

This commit is contained in:
wangyidong
2025-05-12 13:21:17 +08:00
committed by 刘刚
parent 918abd43d4
commit 2a58ea8ede
+20 -27
View File
@@ -270,7 +270,6 @@ function validateResources(id)
let status = task.status;
let type = task.type;
let statusLang = ganttLang.taskStatusList['wait'];
flag = true;
/* Check status. */
if(status !== statusLang && type != 'point')
@@ -292,32 +291,26 @@ function validateResources(id)
if(type == 'point') itemID = task.id.split("-")[2];
/* Check data. */
let postData = {
'id' : itemID,
'startDate' : from.toLocaleDateString('en-CA'),
'endDate' : to.toLocaleDateString('en-CA'),
'type' : type
};
/* Sync Close. */
$.ajax({
url: $.createLink('programplan', 'ajaxResponseGanttDragEvent'),
dataType: "json",
data: postData,
type: "post",
success: function(response)
{
if(response.result == 'fail' && response.message)
{
zui.Messager.show({content: response.message, type: 'danger-outline', icon: 'exclamation-sign'});
flag = false;
}
else
{
gantt.updateTask(task.id, task);
if(task.parent) changeParentTask(task, task.parent);
}
}
});
const postData = 'id=' + itemID + '&startDate=' + from.toLocaleDateString('en-CA') + '&endDate=' + to.toLocaleDateString('en-CA') + '&type=' +type;
const xhr = new XMLHttpRequest();
xhr.open('POST', $.createLink('programplan', 'ajaxResponseGanttDragEvent'), false); // 同步模式
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(postData);
let flag = true;
const response = JSON.parse(xhr.responseText);
if(response.result == 'fail' && response.message)
{
zui.Messager.show({content: response.message, type: 'danger-outline', icon: 'exclamation-sign'});
flag = false;
}
else
{
gantt.updateTask(task.id, task);
if(task.parent) changeParentTask(task, task.parent);
}
return flag;
}