|
|
@@ -270,12 +270,12 @@ $(document).ready(function() {
|
|
|
if (sel.rowCount > 1 && first) {
|
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
|
const rNode = tree.nodes[sel.row + r];
|
|
|
- childCanDel = this.checkDelete(rNode, childCanDel);
|
|
|
- // if (!hadContract) hadContract = this.checkContract(rNode);
|
|
|
if (!rNode) {
|
|
|
sameParent = false;
|
|
|
break;
|
|
|
}
|
|
|
+ childCanDel = this.checkDelete(rNode, childCanDel);
|
|
|
+ // if (!hadContract) hadContract = this.checkContract(rNode);
|
|
|
if (rNode.level > first.level) continue;
|
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
|
sameParent = false;
|
|
|
@@ -1137,6 +1137,7 @@ $(document).ready(function() {
|
|
|
return haveContract;
|
|
|
},
|
|
|
checkDelete: function (select, oldFlag = true) {
|
|
|
+ if (!select) return false;
|
|
|
let canDelete = oldFlag;
|
|
|
if (select.c_code) {
|
|
|
if (!(select.uid === user_id || is_admin)) {
|
|
|
@@ -1460,11 +1461,11 @@ $(document).ready(function() {
|
|
|
if (sel.rowCount > 1 && first) {
|
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
|
const rNode = tree.nodes[sel.row + r];
|
|
|
- childCanDel = contractTreeSpreadObj.checkDelete(rNode, childCanDel);
|
|
|
if (!rNode) {
|
|
|
sameParent = false;
|
|
|
break;
|
|
|
}
|
|
|
+ childCanDel = contractTreeSpreadObj.checkDelete(rNode, childCanDel);
|
|
|
if (rNode.level > first.level) continue;
|
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
|
sameParent = false;
|