|
@@ -123,6 +123,44 @@ function getTenderTreeHtml4User () {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function recursiveGetFilterTenderNodeHtml (node, arr) {
|
|
|
+ const html = [];
|
|
|
+ html.push(`<tr ${node.id ? 'tid="'+ node.id +'"' : ''}>`);
|
|
|
+ // 名称
|
|
|
+ html.push('<td class="in-' + node.level + '">');
|
|
|
+ if (node.cid) {
|
|
|
+ html.push('<i class="fa fa-folder-o"></i> ', node.name);
|
|
|
+ } else {
|
|
|
+ html.push('<span class="text-muted mr-2">');
|
|
|
+ html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
|
|
|
+ html.push('</span>', node.name);
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
+ html.push('<td class="text-center">');
|
|
|
+ if (!node.cid) {
|
|
|
+ html.push(`<input data-tid="${node.id}" data-type="filter_budget" type="checkbox" ${node.filter_budget ? 'checked' : ''}>`);
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
+ html.push('<td class="text-center">');
|
|
|
+ if (!node.cid) {
|
|
|
+ html.push(`<input data-tid="${node.id}" data-type="filter_fund" type="checkbox" ${node.filter_fund ? 'checked' : ''}>`);
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
+ html.push('</tr>');
|
|
|
+ if (node.children) {
|
|
|
+ for (const c of node.children) {
|
|
|
+ html.push(recursiveGetFilterTenderNodeHtml(c, node.children));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return html.join('');
|
|
|
+}
|
|
|
+function getFilterTenderTreeHtml() {
|
|
|
+ const html = [];
|
|
|
+ for (const t of tenderTree4User) {
|
|
|
+ html.push(recursiveGetFilterTenderNodeHtml(t, tenderTree4User));
|
|
|
+ }
|
|
|
+ $('#filter-tender-list').html(html.join(''));
|
|
|
+}
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
autoFlashHeight();
|
|
@@ -500,6 +538,7 @@ $(document).ready(() => {
|
|
|
});
|
|
|
sortCategory4User();
|
|
|
initTenderTree4User();
|
|
|
+ getFilterTenderTreeHtml();
|
|
|
$('#set-other-tender-user-a').click(function () {
|
|
|
if(!cur_tenderid) {
|
|
|
toastr.warning('未选中标段无法设置');
|
|
@@ -719,7 +758,23 @@ $(document).ready(() => {
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
-})
|
|
|
+
|
|
|
+ $('#filter-tender-ok').click(function() {
|
|
|
+ const updateData = [];
|
|
|
+ const tr = $('tr[tid]', '#filter-tender');
|
|
|
+ for (const t of tr) {
|
|
|
+ const data = { id: t.getAttribute('tid')};
|
|
|
+ const checkes = $('input', t);
|
|
|
+ for (const c of checkes) {
|
|
|
+ data[c.getAttribute('data-type')] = c.checked ? 1 : 0;
|
|
|
+ }
|
|
|
+ updateData.push(data);
|
|
|
+ }
|
|
|
+ postData(`/sp/${spid}/list/batchUpdate`, updateData, function() {
|
|
|
+ window.location.reload();
|
|
|
+ });
|
|
|
+ });
|
|
|
+});
|
|
|
|
|
|
const tenderListSpec = (function(){
|
|
|
function getTenderTreeHeaderHtml() {
|