|
@@ -12,6 +12,7 @@ $(document).ready(function () {
|
|
|
autoFlashHeight()
|
|
|
let oldVal = null
|
|
|
let timer = null
|
|
|
+ let oldSearchVal = null
|
|
|
handleFileList(fileList)
|
|
|
// 控制上报弹窗的文案
|
|
|
function checkModal(isHide) {
|
|
@@ -25,21 +26,50 @@ $(document).ready(function () {
|
|
|
$('#tm-submit').show()
|
|
|
}
|
|
|
}
|
|
|
- // 审批人分组选择
|
|
|
- // $('#account_group').change(function () {
|
|
|
- // let account_html = '<option value="0">选择审批人</option>'
|
|
|
- // for (const account of accountList) {
|
|
|
- // if ((parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) && account.id !== parseInt(userID)) {
|
|
|
- // const role = account.role !== '' ? '(' + account.role + ')' : ''
|
|
|
- // const company = account.company !== '' ? ' -' + account.company : ''
|
|
|
- // account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>'
|
|
|
- // }
|
|
|
- // }
|
|
|
- // $('#account_list').html(account_html)
|
|
|
- // });
|
|
|
+
|
|
|
+ $('#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.name.indexOf(newVal) !== -1 || item.mobile === newVal).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>`
|
|
|
+ })
|
|
|
+ $('.book-list').empty()
|
|
|
+ $('.book-list').append(html)
|
|
|
+ } else {
|
|
|
+ if (!$('.acc-btn').length) {
|
|
|
+ console.log('accountGroup', accountGroup)
|
|
|
+ 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 => {
|
|
|
+ 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>'
|
|
|
+ })
|
|
|
+ $('.book-list').empty()
|
|
|
+ $('.book-list').append(html)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 400);
|
|
|
+ })
|
|
|
|
|
|
// 添加审批流程按钮逻辑
|
|
|
- $('.acc-btn').click(function () {
|
|
|
+ $('.book-list').on('click', '.acc-btn', function () {
|
|
|
const idx = $(this).attr('data-groupid')
|
|
|
const type = $(this).attr('data-type')
|
|
|
if (type === 'hide') {
|
|
@@ -56,6 +86,7 @@ $(document).ready(function () {
|
|
|
}
|
|
|
return false
|
|
|
})
|
|
|
+
|
|
|
// 添加到审批流程中
|
|
|
$('dl').on('click', 'dd', function () {
|
|
|
let id = $(this).data('id')
|