|
|
|
@ -194,6 +194,7 @@ const DragTree = () => {
|
|
|
|
|
* @param {*} nodeData
|
|
|
|
|
*/
|
|
|
|
|
const onCancel = (nodeData) => {
|
|
|
|
|
setShowCanceled(0);
|
|
|
|
|
const extend = nodeData.type == '1' ? 'comp' : 'dept';
|
|
|
|
|
fetch(`/api/bs/hrmorganization/${extend}/updateForbiddenTagById`, {
|
|
|
|
|
method: 'POST',
|
|
|
|
@ -209,11 +210,18 @@ const DragTree = () => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
const data = [...gData];
|
|
|
|
|
loop(data, nodeData.key, (item, index, arr) => {
|
|
|
|
|
arr.splice(index, 1);
|
|
|
|
|
});
|
|
|
|
|
if (nodeData.canceled != '0') {
|
|
|
|
|
message.success('恢复成功', 2);
|
|
|
|
|
loop(data, nodeData.key, (item, index, arr) => {
|
|
|
|
|
arr[index].canceled = '0';
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
loop(data, nodeData.key, (item, index, arr) => {
|
|
|
|
|
arr.splice(index, 1);
|
|
|
|
|
});
|
|
|
|
|
message.success('封存成功', 2);
|
|
|
|
|
}
|
|
|
|
|
setGData(data);
|
|
|
|
|
message.success('封存成功', 2);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg, 2);
|
|
|
|
|
}
|
|
|
|
|