浏览代码

合同支付,新增后项问题

MaiXinRong 2 周之前
父节点
当前提交
d1c0aabab2
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/service/phase_pay_detail.js

+ 2 - 1
app/service/phase_pay_detail.js

@@ -518,6 +518,7 @@ class PhasePayDetail extends TreeService {
 
     async addNext(phasePay, select, count = 1) {
         const masterId = this.getMasterKey(phasePay);
+        const parent = await this.getDataByKid(masterId, select[this.setting.pid]);
         this.transaction = await this.db.beginTransaction();
         try {
             if (select) await this._updateChildrenOrder(masterId, select[this.setting.pid], select[this.setting.order] + 1, count);
@@ -533,7 +534,7 @@ class PhasePayDetail extends TreeService {
                     ? select[this.setting.fullPath].replace('-' + select[this.setting.kid], '-' + newData[this.setting.kid])
                     : newData[this.setting.kid] + '';
                 newData[this.setting.isLeaf] = 1;
-                this._getDefaultData(newData, phasePay);
+                this._getDefaultData(newData, phasePay, parent);
                 newDatas.push(newData);
             }
             const insertResult = await this.transaction.insert(this.tableName, newDatas);