|
@@ -943,16 +943,16 @@ module.exports = app => {
|
|
updateData[this.setting.level] = s[this.setting.level] - 1;
|
|
updateData[this.setting.level] = s[this.setting.level] - 1;
|
|
updateData[this.setting.fullPath] = s[this.setting.fullPath].replace(s[this.setting.pid] + '-', '');
|
|
updateData[this.setting.fullPath] = s[this.setting.fullPath].replace(s[this.setting.pid] + '-', '');
|
|
newPath.push(updateData[this.setting.fullPath]);
|
|
newPath.push(updateData[this.setting.fullPath]);
|
|
- if (s.is_leaf && s.id === last.id) {
|
|
|
|
|
|
+ if (s.id === last.id) {
|
|
const nexts = await this.getNextsData(this.tableName, mid, parent[this.setting.kid], last[this.setting.order]);
|
|
const nexts = await this.getNextsData(this.tableName, mid, parent[this.setting.kid], last[this.setting.order]);
|
|
if (!this.newBills) {
|
|
if (!this.newBills) {
|
|
const ledgerNexts = await this.getNextsData(this.ctx.service.ledger.tableName, mid, parent[this.setting.kid], last[this.setting.order]);
|
|
const ledgerNexts = await this.getNextsData(this.ctx.service.ledger.tableName, mid, parent[this.setting.kid], last[this.setting.order]);
|
|
if (ledgerNexts.length > 0) {
|
|
if (ledgerNexts.length > 0) {
|
|
- throw '子节点下存在台账节点,不可升级';
|
|
|
|
|
|
+ throw '该节点下存在台账节点,不可升级';
|
|
}
|
|
}
|
|
// nexts = this._.orderBy(this._.concat(ledgerNexts, nexts), [this.setting.order], ['asc']);
|
|
// nexts = this._.orderBy(this._.concat(ledgerNexts, nexts), [this.setting.order], ['asc']);
|
|
}
|
|
}
|
|
- if (nexts.length > 0) {
|
|
|
|
|
|
+ if (s.is_leaf && nexts.length > 0) {
|
|
updateData.is_leaf = false;
|
|
updateData.is_leaf = false;
|
|
this.clearParentingData(updateData);
|
|
this.clearParentingData(updateData);
|
|
}
|
|
}
|
|
@@ -963,9 +963,9 @@ module.exports = app => {
|
|
}
|
|
}
|
|
// 选中节点--全部后兄弟节点 收编为子节点 修改pid, order, full_path
|
|
// 选中节点--全部后兄弟节点 收编为子节点 修改pid, order, full_path
|
|
await this._syncUpLevelNexts(last);
|
|
await this._syncUpLevelNexts(last);
|
|
- // if (selects) {
|
|
|
|
- // throw '阻断';
|
|
|
|
- // }
|
|
|
|
|
|
+ if (selects) {
|
|
|
|
+ throw '阻断';
|
|
|
|
+ }
|
|
await this.transaction.commit();
|
|
await this.transaction.commit();
|
|
this.transaction = null;
|
|
this.transaction = null;
|
|
} catch (err) {
|
|
} catch (err) {
|