|
@@ -19,8 +19,34 @@
|
|
|
<% include ../stage/stage_sub_mini_menu.ejs %>
|
|
|
<% } %>
|
|
|
<div>
|
|
|
- <% if (false || ![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
|
+ <!-- <div class="d-inline-block">
|
|
|
+ <div class="dropdown">
|
|
|
+ <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="allBizDropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
+ 计量期
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu" aria-labelledby="allBizDropdownMenuButton" id="biz-select-item">
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="stage" style="display: none">计量期</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="change_prepay">预付款</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="change_material_adjustment">材料调差</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="d-inline-block">
|
|
|
+ <div class="dropdown" style="display: none" id="biz-prepay-item">
|
|
|
+ <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="allPrepayButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
+ 所有预付款
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu" aria-labelledby="allPrepayButton" id="prepay-select-item">
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="prepay_all" >所有预付款</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="prepay_start">开工预付款</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="prepay_material">材料预付款</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="prepay_safe">安全生产费预付款</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="prepay_dust">扬尘污染预付款</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ <% if (false || ![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
|
+ <div class="d-inline-block" id="divSelectableStages_up">
|
|
|
<div class="dropdown" id="divSelectableStages">
|
|
|
<button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="btnCurrentStage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
|
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="optionSelectableStages"></div>
|
|
@@ -28,8 +54,8 @@
|
|
|
</div>
|
|
|
<% } %>
|
|
|
<% if (stg_id === -200 || ![-100, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
|
- <div class="d-inline-block">
|
|
|
- <ul class="nav nav-pills m-0">
|
|
|
+ <div class="d-inline-block" id="report_selects_div">
|
|
|
+ <ul class="nav nav-pills m-0" id="report_selects_ul">
|
|
|
<li class="nav-item mr-1"><a href="#man-c" data-toggle="modal" data-target="#man-c" class=" btn btn-outline-primary btn-sm"><i class="fa fa-cog"></i> 推荐报表</a></li>
|
|
|
<li class="nav-item"><a href="#man-i" data-toggle="modal" data-target="#man-i" class=" btn btn-outline-primary btn-sm"><i class="fa fa-plus"></i> 定制报表</a></li>
|
|
|
<!--
|
|
@@ -65,7 +91,7 @@
|
|
|
<% if (false || ![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
|
<% if (ctx.session.sessionProject.page_show.isPreset) { %>
|
|
|
<div class="d-inline-block">
|
|
|
- <div class="dropdown">
|
|
|
+ <div class="dropdown" id="divPresets">
|
|
|
<button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">报表数据预设</button>
|
|
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
|
<a class="dropdown-item" href="javascript: void(0)" onclick="rptShowLevel.show('show_level');">显示层级</a>
|
|
@@ -331,6 +357,53 @@
|
|
|
autoFlashHeight();
|
|
|
}
|
|
|
});
|
|
|
+ let CURRENT_SELECTED_BIZ_TYPE = 'stage';
|
|
|
+ $('#prepay-select-item a').on('click', function () {
|
|
|
+ $('#prepay-select-item a').show();
|
|
|
+ $(this).hide();
|
|
|
+ $('#prepay-select-item').siblings('button').text($(this).text());
|
|
|
+ const type = $(this).data('type');
|
|
|
+ if (type === 'prepay_start') {
|
|
|
+ //
|
|
|
+ } else if (type === 'prepay_material') {
|
|
|
+ //
|
|
|
+ } if (type === 'prepay_safe') {
|
|
|
+ //
|
|
|
+ } if (type === 'prepay_dust') {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#biz-select-item a').on('click', function () {
|
|
|
+ $('#biz-select-item a').show();
|
|
|
+ $(this).hide();
|
|
|
+ $('#biz-select-item').siblings('button').text($(this).text());
|
|
|
+ const type = $(this).data('type');
|
|
|
+ CURRENT_SELECTED_BIZ_TYPE = type;
|
|
|
+ // CHANGE_ID = -1;
|
|
|
+ // BUSINESS_ID = -1;
|
|
|
+ if (type === 'stage') {
|
|
|
+ // 计量期
|
|
|
+ $('#divSelectableStages').show();
|
|
|
+ $('#biz-prepay-item').hide();
|
|
|
+ $('#report_selects_ul').show();
|
|
|
+ $('#divPresets').show();
|
|
|
+ } else if (type === 'change_prepay') {
|
|
|
+ // 预付款
|
|
|
+ $('#divSelectableStages').hide();
|
|
|
+ $('#biz-prepay-item').show();
|
|
|
+ $('#report_selects_ul').hide();
|
|
|
+ $('#divPresets').hide();
|
|
|
+ } else if (type === 'change_material_adjustment') {
|
|
|
+ // 材料调差
|
|
|
+ $('#divSelectableStages').show();
|
|
|
+ $('#biz-prepay-item').hide();
|
|
|
+ $('#report_selects_ul').hide();
|
|
|
+ $('#divPresets').hide();
|
|
|
+ }
|
|
|
+ filterReportsByType();
|
|
|
+ });
|
|
|
+
|
|
|
$.divResizer({
|
|
|
select: '#right-spr',
|
|
|
callback: function () {
|
|
@@ -440,6 +513,8 @@
|
|
|
// PAGE_SHOW['closeWatermark'] = 0; //测试用,check in 前要屏蔽
|
|
|
|
|
|
const CUST_TREE_NODES = <%- cust_tpl_data %>;
|
|
|
+ const ALL_COMMON_TREE_NODES = <%- all_common_tpl_data %>;
|
|
|
+ const ALL_INDIVI_TREE_NODES = <%- all_indivi_tpl_data %>;
|
|
|
const CUST_SELECT_KEYS = <%- cust_select_keys %>;
|
|
|
if (!(CUST_TREE_NODES.customize instanceof Array)) {
|
|
|
CUST_TREE_NODES.customize = [];
|
|
@@ -545,6 +620,34 @@
|
|
|
|
|
|
const SCREEN_DPI = [];
|
|
|
|
|
|
+ function filterReportsByType() {
|
|
|
+ function _filterBySourceType(nodes, srcType) {
|
|
|
+ for (let idx = nodes.length - 1; idx >= 0; idx--) {
|
|
|
+ if (!nodes[idx].hasOwnProperty('source_type')) {
|
|
|
+ nodes[idx].source_type = 1;
|
|
|
+ }
|
|
|
+ if (nodes[idx].source_type !== srcType) {
|
|
|
+ nodes.splice(idx, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const newCommonTreeNodes = JSON.parse(JSON.stringify(ALL_COMMON_TREE_NODES));
|
|
|
+ const newCustomTreeNodes = JSON.parse(JSON.stringify(ALL_INDIVI_TREE_NODES));
|
|
|
+ let bizType = 1;
|
|
|
+ if (CURRENT_SELECTED_BIZ_TYPE === 'stage') bizType = 1; // 计量期
|
|
|
+ if (CURRENT_SELECTED_BIZ_TYPE === 'change_prepay') bizType = 10; // 预付款
|
|
|
+ if (CURRENT_SELECTED_BIZ_TYPE === 'change_material_adjustment') bizType = 30; // 材差
|
|
|
+ _filterBySourceType(newCommonTreeNodes, bizType);
|
|
|
+ _filterBySourceType(newCustomTreeNodes, bizType);
|
|
|
+ TOP_TREE_NODES[0].items = newCustomTreeNodes;
|
|
|
+ TOP_TREE_NODES[1].items = newCommonTreeNodes;
|
|
|
+ if (bizType === 1) {
|
|
|
+ filterUnchkTplTreeNode(TOP_TREE_NODES[0], CUST_TREE_NODES.customize);
|
|
|
+ filterUnchkTplTreeNode(TOP_TREE_NODES[1], CUST_TREE_NODES.common);
|
|
|
+ }
|
|
|
+ zTreeOprObj.getReportTemplateTree();
|
|
|
+ }
|
|
|
+
|
|
|
function filterUnchkTplTreeNode(topNode, srcData) {
|
|
|
const _chkAndSpliceItem = function(pNode, pStr) {
|
|
|
let rst = false;
|