|
@@ -10,13 +10,13 @@
|
|
|
<span>新增的标段是否默认展示到决策大屏:</span>
|
|
|
<a class="btn btn-sm btn-light">
|
|
|
<div class="custom-control custom-checkbox">
|
|
|
- <input type="radio" name="add_datacollect" class="custom-control-input" value="1" <% if (ctx.session.sessionProject.page_show.addDataCollect === 1) { %>checked<% } %> id="yes_datacollect">
|
|
|
+ <input type="radio" name="add_datacollect" class="custom-control-input" value="1" <% if (ctx.subProject.page_show.addDataCollect === 1) { %>checked<% } %> id="yes_datacollect">
|
|
|
<label class="custom-control-label text-primary" for="yes_datacollect">是</label>
|
|
|
</div>
|
|
|
</a>
|
|
|
<a class="btn btn-sm btn-light">
|
|
|
<div class="custom-control custom-checkbox">
|
|
|
- <input type="radio" name="add_datacollect" class="custom-control-input" value="0" <% if (ctx.session.sessionProject.page_show.addDataCollect === 0) { %>checked<% } %> id="no_datacollect">
|
|
|
+ <input type="radio" name="add_datacollect" class="custom-control-input" value="0" <% if (ctx.subProject.page_show.addDataCollect === 0) { %>checked<% } %> id="no_datacollect">
|
|
|
<label class="custom-control-label text-primary" for="no_datacollect">否</label>
|
|
|
</div>
|
|
|
</a>
|
|
@@ -82,7 +82,7 @@
|
|
|
<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 %>">
|
|
|
- <dd class="border-bottom p-2 mb-0" data-companyid="<%- group.companyId %>"><p class="mb-0 d-flex"><span class="text-primary">该单位下所有组员</span></p></dd>
|
|
|
+ <dd class="border-bottom p-2 mb-0" data-groupname="<%- group.groupName %>"><p class="mb-0 d-flex"><span class="text-primary">该单位下所有组员</span></p></dd>
|
|
|
<% group.groupList.forEach(item => { %>
|
|
|
<% if (item.id !== ctx.session.sessionUser.accountId) { %>
|
|
|
<dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
|
|
@@ -100,12 +100,11 @@
|
|
|
<ul class="list-unstyled modal-height-500" id="audit-list" style="overflow: auto">
|
|
|
<% for (const audit of dataCollectAudits) { %>
|
|
|
<li class="border-bottom p-2 mb-0">
|
|
|
- <a href="javascript:void(0)" class="text-danger pull-right" data-id="<%- audit.id %>" data-type="<% if (audit.uid) { %>audit<% } else if (audit.groupid) { %>group<% } else { %>company<% } %>">
|
|
|
+ <a href="javascript:void(0)" class="text-danger pull-right" data-id="<%- audit.uid %>" data-type="audit">
|
|
|
<i class="fa fa-remove text-danger remove-audit"></i></a><%- audit.name %>
|
|
|
- <small class="text-muted ml-1"><% if (audit.company_id) { %>参建单位<% } else { %>账号<% if (!audit.uid) { %>组<% } %><% } %></small>
|
|
|
+ <small class="text-muted ml-1"><%- audit.company %></small>
|
|
|
</li>
|
|
|
<% } %>
|
|
|
- <!--<li class="border-bottom p-2 mb-0"><a href="" class="text-danger pull-right"><i class="fa fa-remove text-danger"></i></a>梁琪波<small class="text-muted ml-1">账号</small></li>-->
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -207,6 +206,7 @@
|
|
|
$('#cb_cate_value_select').html(cate ? cate.value.map(item => `<option value="${item.id}">${item.value}</option>`).join('') : '<option value="0">请选择值</option>');
|
|
|
});
|
|
|
$('#dpsix-set').on('show.bs.modal', function (e) {
|
|
|
+ console.log(daPing06Set);
|
|
|
if (daPing06Set.sr) {
|
|
|
$('#sr_cate_select').val(daPing06Set.sr);
|
|
|
$('#sr_cate_value_select').html(category.find(item => item.id === parseInt(daPing06Set.sr)).value.map(item => `<option value="${item.id}" ${daPing06Set.sr_value === item.id ? 'selected' : ''}>${item.value}</option>`).join(''));
|
|
@@ -274,7 +274,7 @@
|
|
|
daPing06Set.cb_value = parseInt($('#cb_cate_value_select').val());
|
|
|
daPing06Set.cb_show = $('#cb_show_select input:checked').map((index, item) => parseInt($(item).val())).get();
|
|
|
console.log(daPing06Set);
|
|
|
- postData('/setting/datacollect/save', { type: 'save-dp06', daPing06Set }, function (result) {
|
|
|
+ postData('/sp/' + spid + '/setting/datacollect/save', { type: 'save-dp06', daPing06Set }, function (result) {
|
|
|
toastr.success('设置成功');
|
|
|
$('#dpsix-set').modal('hide');
|
|
|
})
|
|
@@ -288,6 +288,7 @@
|
|
|
let oldSearchVal = null
|
|
|
const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
|
|
|
const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
|
|
|
+ let dataCollectAudits = JSON.parse(unescape('<%- escape(JSON.stringify(dataCollectAudits)) %>'));
|
|
|
const cur_uid = parseInt(<%- ctx.session.sessionUser.accountId %>);
|
|
|
$('#gr-search').bind('input propertychange', function(e) {
|
|
|
oldSearchVal = e.target.value
|
|
@@ -312,7 +313,7 @@
|
|
|
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}">
|
|
|
- <dd class="border-bottom p-2 mb-0" data-companyid="${group.companyId}"><p class="mb-0 d-flex"><span class="text-primary">该单位下所有组员</span></p></dd>`
|
|
|
+ <dd class="border-bottom p-2 mb-0" data-groupname="${group.groupName}"><p class="mb-0 d-flex"><span class="text-primary">该单位下所有组员</span></p></dd>`
|
|
|
group.groupList.forEach(item => {
|
|
|
if (item.id !== cur_uid) {
|
|
|
html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
|
|
@@ -351,31 +352,36 @@
|
|
|
// 添加到成员中
|
|
|
$('dl').on('click', 'dd', function () {
|
|
|
const id = parseInt($(this).data('id'));
|
|
|
- const compnayId = parseInt($(this).data('companyid'));
|
|
|
+ const groupName = $(this).data('groupname');
|
|
|
if (!isNaN(id) && id !== 0) {
|
|
|
- postData('/setting/datacollect/save', { type: 'add-audit', id }, function (result) {
|
|
|
- setList(result);
|
|
|
- })
|
|
|
- } else if (!isNaN(compnayId) && compnayId !== 0) {
|
|
|
- postData('/setting/datacollect/save', { type: 'add-company', id: compnayId }, function (result) {
|
|
|
- setList(result);
|
|
|
+ postData('/sp/' + spid + '/setting/datacollect/save', { type: 'add-audit', id }, function (result) {
|
|
|
+ dataCollectAudits = result;
|
|
|
+ setList(dataCollectAudits);
|
|
|
})
|
|
|
+ } else if (groupName && groupName !== '') {
|
|
|
+ const groupAuditList = _.filter(accountList, { company: groupName });
|
|
|
+ const groupAidList = _.map(groupAuditList, 'id');
|
|
|
+ const groupDAList = _.map(dataCollectAudits, 'uid');
|
|
|
+ const addAidList = _.difference(groupAidList, groupDAList);
|
|
|
+ console.log(groupAidList, groupDAList, addAidList);
|
|
|
+ if (addAidList.length > 0) {
|
|
|
+ postData('/sp/' + spid + '/setting/datacollect/save', { type: 'add-audit', id: addAidList }, function (result) {
|
|
|
+ // toastr.success(`成功添加 位用户`);
|
|
|
+ dataCollectAudits = result;
|
|
|
+ setList(dataCollectAudits);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ toastr.warning('暂无用户添加');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
// 删除审批人
|
|
|
$('body').on('click', '#audit-list li>a', function () {
|
|
|
console.log($(this).attr('data-id'), $(this).attr('data-type'));
|
|
|
if ($(this).attr('data-type') === 'audit') {
|
|
|
- postData('/setting/datacollect/save', { type: 'del-audit', id: $(this).attr('data-id') }, function (result) {
|
|
|
- setList(result);
|
|
|
- })
|
|
|
- } else if ($(this).attr('data-type') === 'group') {
|
|
|
- postData('/setting/datacollect/save', { type: 'del-group', id: $(this).attr('data-id') }, function (result) {
|
|
|
- setList(result);
|
|
|
- })
|
|
|
- } else if ($(this).attr('data-type') === 'company') {
|
|
|
- postData('/setting/datacollect/save', { type: 'del-company', id: $(this).attr('data-id') }, function (result) {
|
|
|
- setList(result);
|
|
|
+ postData('/sp/' + spid + '/setting/datacollect/save', { type: 'del-audit', id: $(this).attr('data-id') }, function (result) {
|
|
|
+ dataCollectAudits = result;
|
|
|
+ setList(dataCollectAudits);
|
|
|
})
|
|
|
}
|
|
|
});
|
|
@@ -383,8 +389,8 @@
|
|
|
function setList(datas) {
|
|
|
let list = '';
|
|
|
for (const audit of datas) {
|
|
|
- list += '<li class="border-bottom p-2 mb-0"><a href="javascript:void(0)" class="text-danger pull-right" data-id="'+ audit.id +'"' + ' data-type="'+ (audit.uid ? 'audit' : (audit.groupid ? 'group' : 'company')) +'">' +
|
|
|
- '<i class="fa fa-remove text-danger remove-audit"></i></a>'+ audit.name +'<small class="text-muted ml-1">'+ (audit.company_id ? '参建单位' : '账号'+ (!audit.uid ? '组' : '')) +'</small></li>';
|
|
|
+ list += '<li class="border-bottom p-2 mb-0"><a href="javascript:void(0)" class="text-danger pull-right" data-id="'+ audit.uid +'"' + ' data-type="audit">' +
|
|
|
+ '<i class="fa fa-remove text-danger remove-audit"></i></a>'+ audit.name +'<small class="text-muted ml-1">'+ audit.company +'</small></li>';
|
|
|
}
|
|
|
$('#audit-list').html(list);
|
|
|
}
|