Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

TonyKang 3 rokov pred
rodič
commit
18198a69ea

+ 24 - 15
app/public/js/change_information_set.js

@@ -90,7 +90,7 @@ function getPasteHint (str, row = '') {
     }
     return returnObj;
 }
-
+let searchCodeList = [];
 $(document).ready(() => {
     const changeSpreadSetting = {
         cols: [
@@ -632,6 +632,7 @@ $(document).ready(() => {
 
     // 清单选中和移除
     $('body').on('click', '#table-list-select tr', function () {
+        searchCodeList = [];
         $('#table-list-select tr').removeClass('table-warning');
         $(this).addClass('table-warning');
         const isCheck = $(this).hasClass('table-success') ? true : false;
@@ -671,6 +672,7 @@ $(document).ready(() => {
                     '<td class="text-right">' + (ZhCalc.round(quantity, findDecimal(gcl.unit)) ? ZhCalc.round(quantity, findDecimal(gcl.unit)) : 0) + '</td>' +
                     '<td class="text-center"><input type="checkbox" ' + isDisabled + isChecked +
                     '></td></tr>';
+                searchCodeList.push(leaf.code + '|!|' + (leaf.jldy ? leaf.jldy: '') + '|!|' + (bwmx !== undefined ? bwmx : ''));
             }
         } else if (!isDeal && isCheck) {
             codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'" gcl_id="" mx_id=""><td class="text-center">1</td><td colspan="7" class="colspan_1">&nbsp;</td><td class="colspan_2"><input type="checkbox" checked></td></tr>';
@@ -1245,22 +1247,29 @@ function makeCodeTable(search = '') {
         $('#code-list tr').css('display', 'table-row');
         return;
     }
-    $('#code-list tr').css('display', 'table-row');
-    for(let i = 0; i < $('#code-list tr').length; i++) {
-        const length = $('#code-list tr').eq(i).children('td').length;
-        if (length === 9) {
-            const code = $('#code-list tr').eq(i).children('td').eq(1).text();
-            const name = $('#code-list tr').eq(i).children('td').eq(2).text();
-            const jldy = $('#code-list tr').eq(i).children('td').eq(6).text();
-            const isShow = code.indexOf(search) !== -1 || name.indexOf(search) !== -1 || jldy.indexOf(search) !== -1;
-            if (isShow) {
-                $('#code-list tr').eq(i).css('display', 'none');
+    $('#code-list tr').css('display', 'none');
+    if (searchCodeList.length > 0) {
+        for (const [index,list] of searchCodeList.entries()) {
+            if (list.indexOf(search) !== -1) {
+                $('#code-list tr').eq(index).css('display', 'table-row');
+            }
+        }
+    } else {
+        for(let i = 0; i < $('#code-list tr').length; i++) {
+            const length = $('#code-list tr').eq(i).children('td').length;
+            if (length === 9) {
+                const code = $('#code-list tr').eq(i).children('td').eq(1).text();
+                const name = $('#code-list tr').eq(i).children('td').eq(2).text();
+                const jldy = $('#code-list tr').eq(i).children('td').eq(6).text();
+                const isShow = code.indexOf(search) !== -1 || name.indexOf(search) !== -1 || jldy.indexOf(search) !== -1;
+                if (isShow) {
+                    $('#code-list tr').eq(i).css('display', 'table-row');
+                }
+                // $('#code-list tr').eq(i).css('display', (isShow ? 'table-row' : 'none'));
+            } else {
+                return;
             }
-            // $('#code-list tr').eq(i).css('display', (isShow ? 'table-row' : 'none'));
         }
-        // else {
-        //     return;
-        // }
     }
 }
 

+ 27 - 0
app/view/report/index_archive.ejs

@@ -302,6 +302,33 @@
         );
     }
 
+    $(function () {
+        //阻止事件冒泡
+        //不仅仅要stopPropagation,还要preventDefault
+        function pauseEvent(e){
+            if(e.stopPropagation) e.stopPropagation();
+            if(e.preventDefault) e.preventDefault();
+            e.cancelBubble=true;
+            e.returnValue=false;
+            return false;
+        }
+        let pe = 0;
+        $('#right-spr').mousedown(function (ev) {
+            $('iframe').css('pointerEvents', 'none');
+            let e = ev||event;
+            pauseEvent(e);
+            pe = 1;
+        });
+        $(document).mouseup(function (ev) {
+            if(pe) {
+                $('iframe').css('pointerEvents', 'auto');
+                pe = 0;
+                let e = ev||event;
+                pauseEvent(e);
+            }
+        });
+    })
+
     rptArchiveObj.iniPage();
 
 </script>