Explorar o código

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang %!s(int64=2) %!d(string=hai) anos
pai
achega
16338e81ab
Modificáronse 2 ficheiros con 6 adicións e 1 borrados
  1. 5 1
      app/lib/sum_load.js
  2. 1 0
      app/public/js/stage.js

+ 5 - 1
app/lib/sum_load.js

@@ -551,7 +551,7 @@ class sumLoad {
         const stageBills = await this.ctx.service.stageBills.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
         const importLid = await this.ctx.service.stageImportChange.getLeafXmjImportLid(this.ctx.stage.id, select.id);
         this.ctx.helper.assignRelaData(posterity, [
-            { data: extraData, fields: ['is_import'], prefix: '', relaId: 'id' },
+            { data: extraData, fields: ['is_tp'], prefix: '', relaId: 'id' },
             { data: importLid, fields: ['is_import'], prefix: '', relaId: 'lid' },
             { data: stageBills, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'positive_qc_qty', 'positive_qc_tp', 'negative_qc_qty', 'negative_qc_tp'], prefix: '', relaId: 'lid' },
         ]);
@@ -561,6 +561,10 @@ class sumLoad {
         for (const tender of tenders) {
             if (!tender.stage) continue;
             const billsData = await this.ctx.service.ledger.getData(tender.tid);
+            const billsExtraData = await this.ctx.service.ledgerExtra.getData(tender.tid, ['is_tp']);
+            this.ctx.helper.assignRelaData(billsData, [
+                { data: billsExtraData, fields: ['is_tp'], prefix: '', relaId: 'id' },
+            ]);
             const stage = await this.ctx.service.stage.getDataByCondition({tid: tender.tid, order: tender.stage});
             if (!stage) throw '选择的期不存在';
             const curStageData = await this.ctx.service.stageBills.getLastestStageData2(tender.tid, stage.id);

+ 1 - 0
app/public/js/stage.js

@@ -4904,6 +4904,7 @@ $(document).ready(() => {
             const ass_lid = assist.ass_ledger_id.split(',');
             for (const lid of ass_lid) {
                 const node = stageTree.getItems(lid);
+                if (!node) continue;
                 if (checkUsed(stageTree, stagePos, node)) return true;
             }
             return false;