Просмотр исходного кода

决算对比,允许不选择合同

MaiXinRong 1 день назад
Родитель
Сommit
73a7c8c6d1
2 измененных файлов с 13 добавлено и 4 удалено
  1. 2 0
      app/lib/budget_final.js
  2. 11 4
      app/public/js/budget_compare.js

+ 2 - 0
app/lib/budget_final.js

@@ -317,6 +317,8 @@ class BudgetFinal {
     }
     }
 
 
     async _loadDeal(deal, stage) {
     async _loadDeal(deal, stage) {
+        if (!deal || deal.length === 0) return;
+
         const helper = this.ctx.helper;
         const helper = this.ctx.helper;
         const treeData = await this.ctx.service.contractTree.getAllDataByCondition({ where: { id: deal, spid: this.ctx.subProject.id, contract_type: 1 } });
         const treeData = await this.ctx.service.contractTree.getAllDataByCondition({ where: { id: deal, spid: this.ctx.subProject.id, contract_type: 1 } });
         const contractData = await this.ctx.service.contract.getAllDataByCondition({ where: { id: deal, spid: this.ctx.subProject.id, contract_type: 1 } });
         const contractData = await this.ctx.service.contract.getAllDataByCondition({ where: { id: deal, spid: this.ctx.subProject.id, contract_type: 1 } });

+ 11 - 4
app/public/js/budget_compare.js

@@ -554,11 +554,18 @@ $(document).ready(() => {
 
 
             $('[name=sf-tab]').click(function() {
             $('[name=sf-tab]').click(function() {
                 const content = this.getAttribute('href');
                 const content = this.getAttribute('href');
-                if (content === '#sf-contract') {
-                    self.contractSpread.refresh();
-                }
-                if (content === '#sf-tender') self.spread.refresh();
+                setTimeout(function() {
+                    if (content === '#sf-contract') self.contractSpread.refresh();
+                    if (content === '#sf-tender') self.spread.refresh();
+                }, 200);
             });
             });
+            // 说是bootstrap v4有,但是不生效
+            // $('#sf-contract').on('shown.bs.tab', function() {
+            //     self.contractSpread.refresh();
+            // });
+            // $('#sf-tender').on('shown.bs.tab', function() {
+            //     self.spread.refresh();
+            // });
 
 
             $('#sf-select-all').click(function() {
             $('#sf-select-all').click(function() {
                 for (const n of self.selectTree.nodes) {
                 for (const n of self.selectTree.nodes) {