ソースを参照

中间计量,应在排序后,再编号

MaiXinRong 5 年 前
コミット
a93c61e0ac
1 ファイル変更8 行追加7 行削除
  1. 8 7
      app/public/js/stage_im.js

+ 8 - 7
app/public/js/stage_im.js

@@ -405,7 +405,7 @@ const stageIm = (function () {
             const im = {
             const im = {
                 lid: node.id, pid: '', code: node.code,
                 lid: node.id, pid: '', code: node.code,
                 jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
                 jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
-                im_code: getNewImCode(),
+                //im_code: getNewImCode(),
                 peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
                 peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
             };
             };
             if (stage.im_gather && node.check) {
             if (stage.im_gather && node.check) {
@@ -508,7 +508,7 @@ const stageIm = (function () {
                 im = {
                 im = {
                     lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
                     lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
                     jl: 0, contract_jl: 0, qc_jl: 0,
                     jl: 0, contract_jl: 0, qc_jl: 0,
-                    im_code: getNewImCode(),
+                    //im_code: getNewImCode(),
                     peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(p),
                     peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(p),
                 };
                 };
                 if (stage.im_gather && node.check) {
                 if (stage.im_gather && node.check) {
@@ -546,7 +546,7 @@ const stageIm = (function () {
                     const im = {
                     const im = {
                         lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, pid: pp.id,
                         lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, pid: pp.id,
                         jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
                         jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
-                        im_code: getNewImCode(),
+                        //im_code: getNewImCode(),
                         bw: bw,
                         bw: bw,
                         peg: CheckPeg(pp.name) ? getPegStr(pp.name) : (peg ? getPegStr(peg.name) : ''),
                         peg: CheckPeg(pp.name) ? getPegStr(pp.name) : (peg ? getPegStr(peg.name) : ''),
                         xm: pp.name,
                         xm: pp.name,
@@ -625,15 +625,16 @@ const stageIm = (function () {
         }
         }
         // 生成数据
         // 生成数据
         recursiveBuildImData(gsTree.children);
         recursiveBuildImData(gsTree.children);
-        for (const im of ImData) {
-            getCalcMemo(im);
-            getChangeInfo(im);
-        }
         if (stage.im_type !== imType.tz.value) {
         if (stage.im_type !== imType.tz.value) {
             ImData.sort(function (x, y) {
             ImData.sort(function (x, y) {
                 return compareCode(x.code, y.code);
                 return compareCode(x.code, y.code);
             });
             });
         }
         }
+        for (const [i, im] of ImData.entries()) {
+            getCalcMemo(im);
+            getChangeInfo(im);
+            im.im_code = pre + getNumberFormat(stage.order, 2) + splitChar + getNumberFormat(i + 1, 3)
+        }
         return ImData;
         return ImData;
     }
     }