|
|
|
@ -77,16 +77,34 @@ const DragTree = () => {
|
|
|
|
|
|
|
|
|
|
let pos = dropPosition == 0 ? '内部' : '下方';
|
|
|
|
|
let title = `确定将【${info.dragNode.title}】移到 【${info.node.title}】${pos}`;
|
|
|
|
|
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '转移操作(仅转移到内部时工作流提醒生效)',
|
|
|
|
|
content: title,
|
|
|
|
|
okText: '确认',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk() {
|
|
|
|
|
async onOk() {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
setTip('正在转移,请稍候...');
|
|
|
|
|
|
|
|
|
|
if (dropPosition == 0) {
|
|
|
|
|
let extend = 'dept';
|
|
|
|
|
let tranfeserType = 1;
|
|
|
|
|
if (dragKey.slice(0, 1).toLowerCase() === 's') {
|
|
|
|
|
extend = 'comp';
|
|
|
|
|
tranfeserType = 2;
|
|
|
|
|
}
|
|
|
|
|
if (dropKey.slice(0, 1).toLowerCase() === 's') {
|
|
|
|
|
tranfeserType = 2;
|
|
|
|
|
}
|
|
|
|
|
await messageRemind(
|
|
|
|
|
extend,
|
|
|
|
|
'MOVE',
|
|
|
|
|
dragKey.slice(1),
|
|
|
|
|
false,
|
|
|
|
|
dropKey.slice(1),
|
|
|
|
|
'',
|
|
|
|
|
tranfeserType,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
fetch('/api/bs/hrmorganization/dept/dragDepartment', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: {
|
|
|
|
@ -144,26 +162,6 @@ const DragTree = () => {
|
|
|
|
|
}
|
|
|
|
|
setGData(data);
|
|
|
|
|
message.success('转移成功', 2);
|
|
|
|
|
if (dropPosition == 0) {
|
|
|
|
|
let extend = 'dept';
|
|
|
|
|
let tranfeserType = 1;
|
|
|
|
|
if (dragKey.slice(0, 1).toLowerCase() === 's') {
|
|
|
|
|
extend = 'comp';
|
|
|
|
|
tranfeserType = 2;
|
|
|
|
|
}
|
|
|
|
|
if (dropKey.slice(0, 1).toLowerCase() === 's') {
|
|
|
|
|
tranfeserType = 2;
|
|
|
|
|
}
|
|
|
|
|
messageRemind(
|
|
|
|
|
extend,
|
|
|
|
|
'MOVE',
|
|
|
|
|
dragKey.slice(1),
|
|
|
|
|
false,
|
|
|
|
|
dropKey.slice(1),
|
|
|
|
|
'',
|
|
|
|
|
tranfeserType,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg, 2);
|
|
|
|
|
}
|
|
|
|
@ -184,6 +182,7 @@ const DragTree = () => {
|
|
|
|
|
const onDelete = (nodeData) => {
|
|
|
|
|
const extend = nodeData.type == '1' ? 'comp' : 'dept';
|
|
|
|
|
let id = nodeData.id.substring(1);
|
|
|
|
|
let title = nodeData.title;
|
|
|
|
|
fetch(`/api/bs/hrmorganization/${extend}/deleteByIds`, {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: {
|
|
|
|
@ -201,7 +200,7 @@ const DragTree = () => {
|
|
|
|
|
});
|
|
|
|
|
setGData(data);
|
|
|
|
|
message.success('删除成功', 2);
|
|
|
|
|
messageRemind(extend, 'DELETE', id);
|
|
|
|
|
messageRemind(extend, 'DELETE', title);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.data.message, 2);
|
|
|
|
|
}
|
|
|
|
@ -224,50 +223,55 @@ const DragTree = () => {
|
|
|
|
|
mergeName = '',
|
|
|
|
|
tranfeserType = null,
|
|
|
|
|
) => {
|
|
|
|
|
let params = {
|
|
|
|
|
workflowId: 1,
|
|
|
|
|
operateType: operateType,
|
|
|
|
|
mergeName: mergeName,
|
|
|
|
|
type: type,
|
|
|
|
|
canceled: canceled,
|
|
|
|
|
tranfeserType: tranfeserType,
|
|
|
|
|
};
|
|
|
|
|
if (type == 'dept') {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
departmentIdFrom: fromId,
|
|
|
|
|
debugger;
|
|
|
|
|
return new Promise((reslove, reject) => {
|
|
|
|
|
let params = {
|
|
|
|
|
workflowId: 1,
|
|
|
|
|
operateType: operateType,
|
|
|
|
|
mergeName: mergeName,
|
|
|
|
|
type: type,
|
|
|
|
|
canceled: canceled,
|
|
|
|
|
tranfeserType: tranfeserType,
|
|
|
|
|
};
|
|
|
|
|
if (tranfeserType == 2) {
|
|
|
|
|
if (type == 'dept') {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
subCompanyIdTo: toId,
|
|
|
|
|
departmentIdFrom: fromId,
|
|
|
|
|
};
|
|
|
|
|
if (tranfeserType == 2) {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
subCompanyIdTo: toId,
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
departmentIdTo: toId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
departmentIdTo: toId,
|
|
|
|
|
subCompanyIdFrom: fromId,
|
|
|
|
|
subCompanyIdTo: toId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
subCompanyIdFrom: fromId,
|
|
|
|
|
subCompanyIdTo: toId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetch('/api/bs/hrmorganization/remind/quickly/workflow/message', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify(params),
|
|
|
|
|
})
|
|
|
|
|
.then((response) => response.json())
|
|
|
|
|
.then((res) => {})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
message.error('系统默认工作流提醒失败');
|
|
|
|
|
});
|
|
|
|
|
fetch('/api/bs/hrmorganization/remind/quickly/workflow/message', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify(params),
|
|
|
|
|
})
|
|
|
|
|
.then((response) => response.json())
|
|
|
|
|
.then((res) => {
|
|
|
|
|
reslove();
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
message.error('系统默认工作流提醒失败');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -442,7 +446,7 @@ const DragTree = () => {
|
|
|
|
|
>
|
|
|
|
|
查看
|
|
|
|
|
</span>
|
|
|
|
|
<Popconfirm
|
|
|
|
|
{/**<Popconfirm
|
|
|
|
|
title={`确认要删除[${nodeData.title}] 吗?`}
|
|
|
|
|
onConfirm={() => onDelete(nodeData)}
|
|
|
|
|
okText="确认"
|
|
|
|
@ -450,6 +454,7 @@ const DragTree = () => {
|
|
|
|
|
>
|
|
|
|
|
<span className="drag-button">删除</span>
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
**/}
|
|
|
|
|
<Popconfirm
|
|
|
|
|
title={`确认要封存或恢复 [${nodeData.title}] 吗?`}
|
|
|
|
|
onConfirm={() => onCancel(nodeData)}
|
|
|
|
|