Parcourir la source

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

Tony Kang il y a 2 jours
Parent
commit
7c2a14660d
2 fichiers modifiés avec 4 ajouts et 12 suppressions
  1. 1 1
      app/public/js/phase_pay_detail.js
  2. 3 11
      app/view/contract/modal.ejs

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

@@ -290,7 +290,7 @@ $(document).ready(() => {
                     }
                     if (p.type === 'left') {
                         iLeftCount += 1;
-                        if (i !== 0 && (param[i-1].type !== 'calc' || param[i-1].type !== 'left'))
+                        if (i !== 0 && (param[i-1].type !== 'calc' && param[i-1].type !== 'left'))
                             return [false, '输入的表达式非法:(前应有运算符'];
                     }
                     if (p.type === 'right') {

+ 3 - 11
app/view/contract/modal.ejs

@@ -257,12 +257,9 @@
             syncSelectedMarks();
         }
 
-        // --- 新增:同步下拉菜单选中状态的函数 ---
         function syncSelectedMarks() {
-            // 1. 获取表格中所有用户的 UID
-            const tableUids = new Set(); // 使用 Set 提高查找效率
+            const tableUids = new Set(); 
             $('#contract-audit-list tr').each(function() {
-                // 假设每个权限复选框的 value 都是用户的 uid
                 const $firstCheckbox = $(this).find('.permission-checkbox').first();
                 if ($firstCheckbox.length) {
                     const uid = parseInt($firstCheckbox.val(), 10);
@@ -271,24 +268,19 @@
                     }
                 }
             });
-
-            // 2. 遍历下拉菜单中的所有用户项 (dd),并根据 UID 状态更新 .selected-mark
             $('.dropdown-menu .book-list dd[data-id]').each(function() {
-                const userId = parseInt($(this).data('id'), 10); // 获取 dd 的 data-id
-                const $mark = $(this).find('.selected-mark'); // 找到对应的标记 span
+                const userId = parseInt($(this).data('id'), 10); 
+                const $mark = $(this).find('.selected-mark'); 
 
                 if (!isNaN(userId) && $mark.length > 0) {
                     if (tableUids.has(userId)) {
-                        // 如果用户已在表格中,则显示勾选标记
                         $mark.show();
                     } else {
-                        // 如果用户不在表格中,则隐藏勾选标记
                         $mark.hide();
                     }
                 }
             });
         }
-        // --- 新增结束 ---
 
         
         $('body').on('click', '.del-contract-audit-a', function () {