فهرست منبع

1. 中间计量,设置生成规则,关闭再次打开应还原
2. 中间计量,计量汇总勾选,兼容新id类型

MaiXinRong 6 سال پیش
والد
کامیت
3e07a393f7
1فایلهای تغییر یافته به همراه25 افزوده شده و 4 حذف شده
  1. 25 4
      app/public/js/stage_detail.js

+ 25 - 4
app/public/js/stage_detail.js

@@ -272,6 +272,27 @@ $(document).ready(() => {
             }
         }
     });
+    $('#choose').on('show.bs.modal', function () {
+        function chooseType(obj) {
+            obj.style.cursor = 'default';
+            $(obj).children().addClass('text-primary');
+            $('h5', obj).prepend('<i class="fa fa-check pull-right"></i>');
+        }
+        function validType(obj) {
+            obj.style.cursor = 'pointer';
+            $(obj).children().removeClass('text-primary');
+            $('i', obj).remove();
+        }
+        $('#im-pre').val(stage.im_pre ? stage.im_pre : '');
+        const typeArr = $('div[name="im-type"]');
+        for (const t of typeArr) {
+            if ($(t).attr('im-type') === stage.im_type) {
+                chooseType(t);
+            } else {
+                validType(t)
+            }
+        }
+    });
     // 提交 中间计量模式
     $('#choose-ok').click(() => {
         const chooseType = _.find($('div[name="im-type"]', '#im-type'), function (it) {
@@ -389,17 +410,17 @@ $(document).ready(() => {
                 }
             });
             SpreadJsObj.loadSheetData(gsSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, gsTree);
-            const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(','), _.toNumber) : [];
+            const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(',')) : [];
             for (const node of gsTree.datas) {
-                node.check = gatherNodes.indexOf(node.id) !== -1;
+                node.check = gatherNodes.indexOf(node.id + '') !== -1;
             }
             gsTree.expandByLevel(4);
             SpreadJsObj.refreshTreeRowVisible(gsSpread.getActiveSheet());
             SpreadJsObj.resetFieldReadOnly(gsSpread.getActiveSheet, 'check', !$('#im-gather-check')[0].checked);
         } else {
-            const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(','), _.toNumber) : [];
+            const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(',')) : [];
             for (const node of gsTree.datas) {
-                node.check = gatherNodes.indexOf(node.id) !== -1;
+                node.check = gatherNodes.indexOf(node.id + '') !== -1;
             }
             SpreadJsObj.reLoadColsData(gsSpread.getActiveSheet(), [0]);
         }