|
@@ -17,6 +17,7 @@ let rptSignatureHelper = {
|
|
|
// $("#project_account_select_div").empty();
|
|
|
let accDiv = $('#project_account_select_div');
|
|
|
let accSelect = $('#project_account_select_dom'); //绑定成员
|
|
|
+ let searchInput = $('#search_account').val();
|
|
|
accDiv.empty();
|
|
|
accSelect.empty();
|
|
|
//2. 一个个加可选用户项
|
|
@@ -25,29 +26,31 @@ let rptSignatureHelper = {
|
|
|
const acc_role_keys = [];
|
|
|
for (let accIdx = 0; accIdx < PRJ_ACCOUNT_LIST.length; accIdx++) {
|
|
|
const prjAccount = PRJ_ACCOUNT_LIST[accIdx];
|
|
|
- let companyKey = prjAccount.account_group;
|
|
|
- let roleKey = prjAccount.role;
|
|
|
- if (companyKey === '') {
|
|
|
- companyKey = '其他单位';
|
|
|
- }
|
|
|
- if (roleKey === '') {
|
|
|
- roleKey = DFT_ROLE_NAME;
|
|
|
- }
|
|
|
- let keyIdx = acc_role_keys.indexOf(companyKey);
|
|
|
- if (keyIdx < 0) {
|
|
|
- acc_role_keys.push(companyKey);
|
|
|
- prj_accounts.push([]);
|
|
|
- prj_sel_option_accounts.push([]);
|
|
|
- keyIdx = prj_accounts.length - 1;
|
|
|
- //这里先push一些 html prefix,在后面统一在push html suffix
|
|
|
- prj_accounts[keyIdx].push('<ul class="list-group">');
|
|
|
- prj_accounts[keyIdx].push('<li class="px-2 text-muted"><i class="fa fa-caret-down"></i> ' + companyKey + '</li>');
|
|
|
- prj_sel_option_accounts[keyIdx].push('<optgroup label=" ' + companyKey + '">');
|
|
|
+ if (searchInput === '' || (searchInput !== '' && prjAccount.name.indexOf(searchInput) !== -1)) {
|
|
|
+ let companyKey = prjAccount.account_group;
|
|
|
+ let roleKey = prjAccount.role;
|
|
|
+ if (companyKey === '') {
|
|
|
+ companyKey = '其他单位';
|
|
|
+ }
|
|
|
+ if (roleKey === '') {
|
|
|
+ roleKey = DFT_ROLE_NAME;
|
|
|
+ }
|
|
|
+ let keyIdx = acc_role_keys.indexOf(companyKey);
|
|
|
+ if (keyIdx < 0) {
|
|
|
+ acc_role_keys.push(companyKey);
|
|
|
+ prj_accounts.push([]);
|
|
|
+ prj_sel_option_accounts.push([]);
|
|
|
+ keyIdx = prj_accounts.length - 1;
|
|
|
+ //这里先push一些 html prefix,在后面统一在push html suffix
|
|
|
+ prj_accounts[keyIdx].push('<ul class="list-group">');
|
|
|
+ prj_accounts[keyIdx].push('<li class="px-2 text-muted"><i class="fa fa-caret-down"></i> ' + companyKey + '</li>');
|
|
|
+ prj_sel_option_accounts[keyIdx].push('<optgroup label=" ' + companyKey + '">');
|
|
|
+ }
|
|
|
+ //push item
|
|
|
+ prj_accounts[keyIdx].push('<li class="add-sign-list-item"><a href="javascript:void(0)" onclick="rptSignatureHelper.createEsignatureByAccIdx(' + accIdx + ')" class="btn-link pull-right" title="添加" data-dismiss="modal"><i class="fa fa-plus"></i></a>' +
|
|
|
+ prjAccount.name + '-<small class="text-muted">' + roleKey + '</small></li>');
|
|
|
+ prj_sel_option_accounts[keyIdx].push('<option value="' + accIdx + '">' + prjAccount.name + '-' + roleKey + '</option>');
|
|
|
}
|
|
|
- //push item
|
|
|
- prj_accounts[keyIdx].push('<li class="add-sign-list-item"><a href="javascript:void(0)" onclick="rptSignatureHelper.createEsignatureByAccIdx(' + accIdx + ')" class="btn-link pull-right" title="添加" data-dismiss="modal"><i class="fa fa-plus"></i></a>' +
|
|
|
- prjAccount.name + '-<small class="text-muted">' + roleKey + '</small></li>');
|
|
|
- prj_sel_option_accounts[keyIdx].push('<option value="' + accIdx + '">' + prjAccount.name + '-' + roleKey + '</option>');
|
|
|
}
|
|
|
for (const prjAccList of prj_accounts) {
|
|
|
prjAccList.push('</ul>');
|