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

造价对比,改个不停。

MaiXinRong 2 дней назад
Родитель
Сommit
a21fcc6ae5
3 измененных файлов с 6 добавлено и 3 удалено
  1. 2 0
      app/lib/budget_final.js
  2. 1 1
      app/lib/ledger.js
  3. 3 2
      app/public/js/budget_compare.js

+ 2 - 0
app/lib/budget_final.js

@@ -348,7 +348,9 @@ class BudgetFinal {
             calc: function (node, helper, decimal) {},
             calc: function (node, helper, decimal) {},
         });
         });
         tree.loadDatas([...treeData, ...contractData]);
         tree.loadDatas([...treeData, ...contractData]);
+        tree.calculateAll();
         this.finalTree.loadTree(tree, function (cur, source) {
         this.finalTree.loadTree(tree, function (cur, source) {
+            if (source.c_code) cur.code = source.c_code;
             cur.total_price = helper.add(cur.total_price, source.total_price);
             cur.total_price = helper.add(cur.total_price, source.total_price);
             cur.final_contract_tp = helper.add(cur.final_contract_tp, source.yf_tp);
             cur.final_contract_tp = helper.add(cur.final_contract_tp, source.yf_tp);
             cur.final_tp = helper.add(cur.final_tp, source.yf_tp);
             cur.final_tp = helper.add(cur.final_tp, source.yf_tp);

+ 1 - 1
app/lib/ledger.js

@@ -362,7 +362,7 @@ class baseTree {
         if (fun) {
         if (fun) {
             fun(node);
             fun(node);
         } else if (this.setting.calc) {
         } else if (this.setting.calc) {
-            this.setting.calc(node, this.ctx.helper, this.ctx.tender.info.decimal);
+            this.setting.calc(node, this.ctx.helper, this.ctx.tender ? this.ctx.tender.info.decimal : {});
         }
         }
     }
     }
     calculateAll(fun) {
     calculateAll(fun) {

+ 3 - 2
app/public/js/budget_compare.js

@@ -517,8 +517,9 @@ $(document).ready(() => {
             SpreadJsObj.initSheet(this.contractSheet, {
             SpreadJsObj.initSheet(this.contractSheet, {
                 cols: [
                 cols: [
                     {title: '选择', colSpan: '1', rowSpan: '1', field: 'selected', hAlign: 1, width: 40, formatter: '@', cellType: 'checkbox'},
                     {title: '选择', colSpan: '1', rowSpan: '1', field: 'selected', hAlign: 1, width: 40, formatter: '@', cellType: 'checkbox'},
-                    {title: '编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 120, formatter: '@', cellType: 'tree'},
-                    {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 200, formatter: '@'},
+                    {title: '编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 90, formatter: '@', cellType: 'tree'},
+                    {title: '合同编号', colSpan: '1', rowSpan: '1', field: 'c_code', hAlign: 0, width: 90, formatter: '@'},
+                    {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 180, formatter: '@'},
                 ],
                 ],
                 emptyRows: 0,
                 emptyRows: 0,
                 headRows: 1,
                 headRows: 1,