'use strict'; /** * * * @author Mai * @date 2019/2/27 * @version */ $(document).ready(function () { let timer = null let oldSearchVal = null // 获取审核相关url function getUrlPre () { const path = window.location.pathname.split('/'); return _.take(path, 6).join('/'); } // 搜索审批人 // $('#searchAccount').click(() => { // const data = { // keyword: $('#searchName').val(), // }; // postData('/search/user', data, (data) => { // const resultDiv = $('#searchResult'); // if (data) { // $('h5>span', resultDiv).text(data.name); // $('#addAuditor').attr('auditorId', data.id); // $('h6', resultDiv).text(data.role); // $('p', resultDiv).text(data.company); // resultDiv.show(); // } else { // toast('未查询到该审核人', 'info'); // resultDiv.hide(); // } // }, () => { // $('#searchResult').hide(); // }); // }); $('#gr-search').bind('input propertychange', function(e) { oldSearchVal = e.target.value timer && clearTimeout(timer) timer = setTimeout(() => { const newVal = $('#gr-search').val() let html = '' if (newVal && newVal === oldSearchVal) { accountList.filter(item => item && cur_uid !== item.id && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => { html += `
${item.name}${item.mobile || ''}
${item.role || ''}${item.name}${item.mobile || ''}
${item.role || ''}请选择退回流程
'); } return false; } if ($('#warning-text').length) $('#warning-text').remove() } return true; }