|
@@ -1531,7 +1531,189 @@
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
+<% if (ctx.session.sessionUser.is_admin) { %>
|
|
|
+<!--游客账号-->
|
|
|
+<div class="modal fade" id="bd-set-9" data-backdrop="static">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">游客账号</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="dropdown text-right">
|
|
|
+ <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="tourist_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
+ 添加游客
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu dropdown-menu-right" id="tourist_dropdownMenu" aria-labelledby="tourist_dropdownMenuButton" style="width:220px">
|
|
|
+ <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
|
|
|
+ placeholder="姓名/手机 检索" autocomplete="off"></div>
|
|
|
+ <dl class="list-unstyled book-list">
|
|
|
+ <% accountGroup.forEach((group, idx) => { %>
|
|
|
+ <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 (item.id !== ctx.tender.data.user_id) { %>
|
|
|
+ <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>
|
|
|
+ <% } %>
|
|
|
+ <% });%>
|
|
|
+ </div>
|
|
|
+ <% }) %>
|
|
|
+ </dl>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <div class="card-header">
|
|
|
+ 游客列表
|
|
|
+ </div>
|
|
|
+ <div class="modal-height-300">
|
|
|
+ <ul class="list-group list-group-flush" id="tourist-users">
|
|
|
+ <% for (const t of tourists) { %>
|
|
|
+ <li class="list-group-item" data-id="<%- t.user_id %>">
|
|
|
+ <a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="<%- t.id %>">移除</a><%- t.user_name %> <small class="text-muted"><%- t.user_role %></small><p class="m-0 ml-2"><small class="text-muted"><%- t.user_company %></small></p></li>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
|
|
|
+ const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
|
|
|
+ const cur_tender_uid = parseInt('<%- ctx.tender.data.user_id %>');
|
|
|
+ const cur_tenderid = parseInt('<%- ctx.tender.id %>');
|
|
|
+ $(function () {
|
|
|
+ // 形象进度
|
|
|
+ let timer2 = null;
|
|
|
+ let oldSearchVal2 = null;
|
|
|
+ $('body').on('input propertychange', '#tourist_dropdownMenu .gr-search', function (e) {
|
|
|
+ oldSearchVal2 = e.target.value;
|
|
|
+ timer2 && clearTimeout(timer2);
|
|
|
+ timer2 = setTimeout(() => {
|
|
|
+ const newVal = $(this).val();
|
|
|
+ let html = '';
|
|
|
+ if (newVal && newVal === oldSearchVal) {
|
|
|
+ accountList.filter(item => item && item.id !== cur_tender_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>`
|
|
|
+ });
|
|
|
+ $('#tourist_dropdownMenu .book-list').empty();
|
|
|
+ $('#tourist_dropdownMenu .book-list').append(html);
|
|
|
+ } else {
|
|
|
+ if (!$('#tourist_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 (item.id !== cur_tender_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>';
|
|
|
+ });
|
|
|
+ $('#tourist_dropdownMenu .book-list').empty();
|
|
|
+ $('#tourist_dropdownMenu .book-list').append(html);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 400);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 添加审批流程按钮逻辑
|
|
|
+ $('body').on('click', '#tourist_dropdownMenu .book-list dt', function () {
|
|
|
+ const idx = $(this).find('.acc-btn').attr('data-groupid');
|
|
|
+ const type = $(this).find('.acc-btn').attr('data-type');
|
|
|
+ if (type === 'hide') {
|
|
|
+ $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
|
|
|
+ $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
|
|
|
+ $(this).find('.acc-btn').attr('data-type', 'show');
|
|
|
+
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
|
|
|
+ $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
|
|
|
+ $(this).find('.acc-btn').attr('data-type', 'hide');
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 选中用户
|
|
|
+ $('body').on('click', '#tourist_dropdownMenu dl dd', function () {
|
|
|
+ const id = parseInt($(this).data('id'));
|
|
|
+ if (id) {
|
|
|
+ const user = _.find(accountList, function (item) {
|
|
|
+ return item.id === id;
|
|
|
+ });
|
|
|
+ const saIdList = [];
|
|
|
+ for (let i = 0; i < $('#tourist-users li').length; i++) {
|
|
|
+ saIdList.push(parseInt($('#tourist-users li').eq(i).data('id')));
|
|
|
+ }
|
|
|
+ if (_.includes(saIdList, id)) {
|
|
|
+ toastr.error('该用户已存在列表中,无需重复添加');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const prop = {
|
|
|
+ user_id: id,
|
|
|
+ type: 'add',
|
|
|
+ };
|
|
|
+ postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
|
|
|
+ const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
|
|
|
+ '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
|
|
|
+ '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
|
|
|
+ $('#tourist-users').append(html);
|
|
|
+ // 外面显示游客数量
|
|
|
+ const num = $('#tourist-users li').length;
|
|
|
+ if (!$('#tourist-num').hasClass('badge')) {
|
|
|
+ $('#tourist-num').addClass('badge badge-secondary').text(num);
|
|
|
+ } else {
|
|
|
+ $('#tourist-num').text(num);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ // 移除用户
|
|
|
+ $('body').on('click', '#tourist-users .remove-tourist-user', function () {
|
|
|
+ const id = parseInt($(this).data('id'));
|
|
|
+ if (id) {
|
|
|
+ const prop = {
|
|
|
+ id,
|
|
|
+ type: 'del',
|
|
|
+ };
|
|
|
+ const _self = $(this);
|
|
|
+ postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
|
|
|
+ _self.parents('li').remove();
|
|
|
+ // 外面显示游客数量
|
|
|
+ const num = $('#tourist-users li').length;
|
|
|
+ if (num == 0) {
|
|
|
+ $('#tourist-num').removeClass('badge badge-secondary').text('');
|
|
|
+ } else {
|
|
|
+ $('#tourist-num').text(num);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+<% } %>
|
|
|
<% if (ctx.session.sessionProject.page_show !== null && parseInt(ctx.session.sessionProject.page_show.xxjd) === 1 && ctx.session.sessionUser.is_admin) { %>
|
|
|
<!--标段设置-形象进度-->
|
|
|
<div class="modal fade" id="xxjd-set" data-backdrop="static">
|
|
@@ -1601,22 +1783,18 @@
|
|
|
</div>
|
|
|
<script>
|
|
|
$(function () {
|
|
|
- const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
|
|
|
- const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
|
|
|
- const cur_uid = parseInt('<%- ctx.tender.data.user_id %>');
|
|
|
- const cur_tenderid = parseInt('<%- ctx.tender.id %>');
|
|
|
const scPermission = JSON.parse(unescape('<%- escape(JSON.stringify(scPermission)) %>'));
|
|
|
// 形象进度
|
|
|
let timer = null;
|
|
|
let oldSearchVal = null;
|
|
|
- $('body').on('input propertychange', '.gr-search', function(e) {
|
|
|
+ $('body').on('input propertychange', '#xxjd_dropdownMenu .gr-search', function(e) {
|
|
|
oldSearchVal = e.target.value;
|
|
|
timer && clearTimeout(timer);
|
|
|
timer = setTimeout(() => {
|
|
|
const newVal = $(this).val();
|
|
|
let html = '';
|
|
|
if (newVal && newVal === oldSearchVal) {
|
|
|
- accountList.filter(item => item && item.id !== cur_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
|
|
|
+ accountList.filter(item => item && item.id !== cur_tender_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>
|
|
@@ -1633,7 +1811,7 @@
|
|
|
</a> ${group.groupName}</dt>
|
|
|
<div class="dd-content" data-toggleid="${idx}">`;
|
|
|
group.groupList.forEach(item => {
|
|
|
- if (item.id !== cur_uid) {
|
|
|
+ if (item.id !== cur_tender_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>
|
|
@@ -1651,7 +1829,7 @@
|
|
|
});
|
|
|
|
|
|
// 添加审批流程按钮逻辑
|
|
|
- $('body').on('click', '.book-list dt', function () {
|
|
|
+ $('body').on('click', '#xxjd_dropdownMenu .book-list dt', function () {
|
|
|
const idx = $(this).find('.acc-btn').attr('data-groupid');
|
|
|
const type = $(this).find('.acc-btn').attr('data-type');
|
|
|
if (type === 'hide') {
|
|
@@ -1670,7 +1848,7 @@
|
|
|
});
|
|
|
|
|
|
// 选中用户
|
|
|
- $('body').on('click', 'dl dd', function () {
|
|
|
+ $('body').on('click', '#xxjd_dropdownMenu dl dd', function () {
|
|
|
const id = parseInt($(this).data('id'));
|
|
|
if (id) {
|
|
|
const user = _.find(accountList, function (item) {
|
|
@@ -1709,7 +1887,7 @@
|
|
|
});
|
|
|
|
|
|
// 移除用户
|
|
|
- $('body').on('click', '.remove-schedule-user', function () {
|
|
|
+ $('body').on('click', '#schedule-users .remove-schedule-user', function () {
|
|
|
const id = parseInt($(this).data('id'));
|
|
|
if (id) {
|
|
|
const prop = {
|