Browse Source

中间计量,生成计算式说明

MaiXinRong 5 years ago
parent
commit
69dc104421
2 changed files with 15 additions and 1 deletions
  1. 1 1
      app/public/js/stage.js
  2. 14 0
      app/public/js/stage_im.js

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

@@ -546,7 +546,7 @@ $(document).ready(() => {
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
                     }
-                } else if (col.field !== 'postil') {
+                } else if (col.field !== 'postil' && col.field !== 'memo') {
                     if (node.children && node.children.length > 0) {
                         toastr.error('清单父项不可计量');
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);

+ 14 - 0
app/public/js/stage_im.js

@@ -217,6 +217,17 @@ const stageIm = (function () {
         generatePosData(node, lx);
     }
 
+    function getCalcMemo(im) {
+        if (im.calc_memo !== undefined && im.calc_memo !== null && im.calc_memo !== '') return;
+        const memo = ['本期计量:' + im.jl + ' ' + im.unit];
+        for (const lx of im.leafXmjs) {
+            for (const p of lx.pos) {
+                memo.push(p.name + ':' + p.qty + ' ' + im.unit);
+            }
+        }
+        return memo.join('\n');
+    }
+
     /**
      * 生成 0号台账 中间计量数据
      * @param {Object} node - 生成中间计量表的节点
@@ -320,6 +331,9 @@ const stageIm = (function () {
         }
         // 生成数据
         recursiveBuildImData(gsTree.children);
+        for (const im of ImData) {
+            im.calc_memo = getCalcMemo(im);
+        }
         return ImData;
     }