Browse Source

支付审批配置,安全生产费参与人搜索与表单断开

MaiXinRong 1 năm trước cách đây
mục cha
commit
599ce54f43
1 tập tin đã thay đổi với 44 bổ sung1 xóa
  1. 44 1
      app/public/js/payment_process.js

+ 44 - 1
app/public/js/payment_process.js

@@ -42,7 +42,7 @@ $(function () {
 
     let timer = null;
     let oldSearchVal = null;
-    $('body').on('input propertychange', '.gr-search', function(e) {
+    $('#process_set').on('input propertychange', '.gr-search', function(e) {
         oldSearchVal = e.target.value;
         timer && clearTimeout(timer);
         timer = setTimeout(() => {
@@ -648,6 +648,49 @@ $(function () {
                 $(this).parents('ul').append(addhtml);
                 $(this).parents('li').remove();
             });
+
+
+            $(setting.domId).on('input propertychange', '.gr-search', function(e) {
+                oldSearchVal = e.target.value;
+                timer && clearTimeout(timer);
+                timer = setTimeout(() => {
+                    const newVal = $(this).val();
+                    const code = $(this).attr('data-trid');
+                    let html = '';
+                    if (newVal && newVal === oldSearchVal) {
+                        accountList
+                            .filter(item => item && (!self.rptInfo.uid || item.id !== self.rptInfo.uid) && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1)))
+                            .forEach(item => {
+                            html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
+                        <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
+                                class="ml-auto">${item.mobile || ''}</span></p>
+                        <span class="text-muted">${item.role || ''}</span>
+                    </dd>`
+                        });
+                    } else {
+                        if (!$('#' + code + '_dropdownMenu .acc-btn').length) {
+                            accountGroup.forEach((group, idx) => {
+                                if (!group) return;
+                                html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
+                        </a> ${group.groupName}</dt>
+                        <div class="dd-content" data-toggleid="${idx}">`;
+                                group.groupList.forEach(item => {
+                                    if (!self.rptInfo.uid || item.id !== self.rptInfo.uid) {
+                                        html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
+                                    <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
+                                            class="ml-auto">${item.mobile || ''}</span></p>
+                                    <span class="text-muted">${item.role || ''}</span>
+                                </dd>`;
+                                    }
+                                });
+                                html += '</div>';
+                            });
+                        }
+                    }
+                    $(this).parents('.dropdown-menu').children('.book-list').empty();
+                    $(this).parents('.dropdown-menu').children('.book-list').append(html);
+                }, 400);
+            });
         }
         getAccountHtml(uid) {
             const html = [];