|
@@ -117,16 +117,16 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
|
|
|
function getTenderTreeHtml () {
|
|
|
if (tenderTree.length > 0) {
|
|
|
const html = [];
|
|
|
- html.push('<table class="table table-hover table-bordered">');
|
|
|
- html.push('<thead>', '<tr>');
|
|
|
- html.push('<th>名称</th>');
|
|
|
- html.push('<th width="40">选择</th>');
|
|
|
- html.push('</tr>', '</thead>');
|
|
|
+ // html.push('<table class="table table-hover table-bordered">');
|
|
|
+ // html.push('<thead>', '<tr>');
|
|
|
+ // html.push('<th>名称</th>');
|
|
|
+ // html.push('<th width="60">选择 <input type="checkbox" id="select-tender-all"></th>');
|
|
|
+ // html.push('</tr>', '</thead>');
|
|
|
parentId = 0;
|
|
|
for (const t of tenderTree) {
|
|
|
html.push(recursiveGetTenderNodeHtml(t, tenderTree, ''));
|
|
|
}
|
|
|
- html.push('</table>');
|
|
|
+ // html.push('</table>');
|
|
|
return html.join('');
|
|
|
} else {
|
|
|
return EmptyTenderHtml.join('');
|
|
@@ -138,6 +138,11 @@ $(document).ready(function () {
|
|
|
const html = getTenderTreeHtml();
|
|
|
$('#copyModalContent').html(html);
|
|
|
$('#sort input[value="'+ addDataCollect +'"]').prop('checked', true);
|
|
|
+ if($('#copyModalContent input[type="checkbox"]:not(:checked)').length === 0) {
|
|
|
+ $('#select-tender-all').prop('checked', true);
|
|
|
+ } else {
|
|
|
+ $('#select-tender-all').prop('checked', false);
|
|
|
+ }
|
|
|
$('#sort').modal('show');
|
|
|
});
|
|
|
|
|
@@ -157,7 +162,6 @@ $(document).ready(function () {
|
|
|
if (parseInt(add_datacollect) === addDataCollect) {
|
|
|
is_collect_update = false;
|
|
|
}
|
|
|
- console.log(_.sortBy(dcTidList), _.sortBy(noTidList), is_list_update, is_collect_update);
|
|
|
if (is_list_update || is_collect_update) {
|
|
|
postData('/setting/datacollect/save', { type: 'tender', add_datacollect: parseInt(add_datacollect), tids: noTidList }, function (result) {
|
|
|
addDataCollect = result.addDataCollect;
|
|
@@ -167,4 +171,20 @@ $(document).ready(function () {
|
|
|
}
|
|
|
$('#sort').modal('hide');
|
|
|
});
|
|
|
+
|
|
|
+ $('#select-tender-all').click(function () {
|
|
|
+ const is_checked = $(this).is(':checked');
|
|
|
+ if(is_checked) {
|
|
|
+ $("#copyModalContent input[type='checkbox']").prop('checked', true);
|
|
|
+ } else {
|
|
|
+ $("#copyModalContent input[type='checkbox']").prop('checked', false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('body').on('click', "#copyModalContent input[type='checkbox']", function () {
|
|
|
+ if($('#copyModalContent input[type="checkbox"]:not(:checked)').length === 0) {
|
|
|
+ $('#select-tender-all').prop('checked', true);
|
|
|
+ } else {
|
|
|
+ $('#select-tender-all').prop('checked', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
});
|