|
@@ -147,6 +147,26 @@
|
|
|
<a href="/tender/<%- tender_id %>/report/format/setup" class=" btn btn-light btn-sm text-primary">设置</a>
|
|
<a href="/tender/<%- tender_id %>/report/format/setup" class=" btn btn-light btn-sm text-primary">设置</a>
|
|
|
</div>
|
|
</div>
|
|
|
<% } %>
|
|
<% } %>
|
|
|
|
|
+ <% if ([-800, -801, -802, -803].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="allCostBizDropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
|
+ 成本报审
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="cost-select-item">
|
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="cost_ledger" style="display: none">成本报审</a>
|
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="cost_book">财务账面</a>
|
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="cost_analysis">成本分析</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="d-inline-block">
|
|
|
|
|
+ <div class="dropdown" id="divSelectableCostStages">
|
|
|
|
|
+ <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="btnCurrentCostStage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
|
|
|
|
+ <div class="dropdown-menu" aria-labelledby="divSelectableCostStages" id="optionSelectableCostStages"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <% } %>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
</div>
|
|
</div>
|
|
@@ -195,7 +215,7 @@
|
|
|
导出报表
|
|
导出报表
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <% if(![-600, -700].includes(stg_id)) { %>
|
|
|
|
|
|
|
+ <% if(![-600, -700, -800, -801, -802].includes(stg_id)) { %>
|
|
|
<div class="panel" id="archiveTopDiv" <% if (pageShow === null || parseInt(pageShow.showArchive) === 0 || isNaN(parseInt(pageShow.showArchive))) { %> style="display:none" <% } %>>
|
|
<div class="panel" id="archiveTopDiv" <% if (pageShow === null || parseInt(pageShow.showArchive) === 0 || isNaN(parseInt(pageShow.showArchive))) { %> style="display:none" <% } %>>
|
|
|
<div class="panel-body">
|
|
<div class="panel-body">
|
|
|
<div class="btn-group" role="group">
|
|
<div class="btn-group" role="group">
|
|
@@ -439,6 +459,50 @@
|
|
|
advancePayClick(this);
|
|
advancePayClick(this);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ $('#cost-select-item a').on('click', function () {
|
|
|
|
|
+ $('#cost-select-item a').show();
|
|
|
|
|
+ $(this).hide();
|
|
|
|
|
+ $('#cost-select-item').siblings('button').text($(this).text());
|
|
|
|
|
+ const type = $(this).data('type');
|
|
|
|
|
+ CURRENT_SELECTED_BIZ_TYPE = type;
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case 'cost_ledger':
|
|
|
|
|
+ current_stage_id = -800;
|
|
|
|
|
+ current_stage_times = BGL_OBJ.ledge[0].audit_times;
|
|
|
|
|
+ SOURCE_TYPE = 400;
|
|
|
|
|
+ BGL_OBJ.source_type = 400;
|
|
|
|
|
+ if (BGL_OBJ.ledge.length > 0) {
|
|
|
|
|
+ BGL_OBJ.BUSINESS_ID = BGL_OBJ.ledge[0].id;
|
|
|
|
|
+ BGL_OBJ.status = BGL_OBJ.ledge[0].audit_status;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'cost_book':
|
|
|
|
|
+ current_stage_id = -801;
|
|
|
|
|
+ current_stage_times = BGL_OBJ.book[0].audit_times;
|
|
|
|
|
+ SOURCE_TYPE = 401;
|
|
|
|
|
+ BGL_OBJ.source_type = 401;
|
|
|
|
|
+ if (BGL_OBJ.book.length > 0) {
|
|
|
|
|
+ BGL_OBJ.BUSINESS_ID = BGL_OBJ.book[0].id;
|
|
|
|
|
+ BGL_OBJ.status = BGL_OBJ.book[0].audit_status;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'cost_analysis':
|
|
|
|
|
+ current_stage_id = -802;
|
|
|
|
|
+ current_stage_times = BGL_OBJ.analysis[0].audit_times;
|
|
|
|
|
+ SOURCE_TYPE = 402;
|
|
|
|
|
+ BGL_OBJ.source_type = 402;
|
|
|
|
|
+ if (BGL_OBJ.analysis.length > 0) {
|
|
|
|
|
+ BGL_OBJ.BUSINESS_ID = BGL_OBJ.analysis[0].id;
|
|
|
|
|
+ BGL_OBJ.status = BGL_OBJ.analysis[0].audit_status;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ rptArchiveObj.toggleBtn(true);
|
|
|
|
|
+ filterReportsByType(ALL_COMMON_TREE_NODES, ALL_INDIVI_TREE_NODES, CURRENT_SELECTED_BIZ_TYPE, TOP_TREE_NODES, CUST_TREE_NODES);
|
|
|
|
|
+ zTreeOprObj.getReportTemplateTree();
|
|
|
|
|
+ buildCostStageSelection();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
$('#biz-select-item a').on('click', function () {
|
|
$('#biz-select-item a').on('click', function () {
|
|
|
$('#biz-select-item a').show();
|
|
$('#biz-select-item a').show();
|
|
|
$(this).hide();
|
|
$(this).hide();
|
|
@@ -465,6 +529,7 @@
|
|
|
// 还有归档按钮处理
|
|
// 还有归档按钮处理
|
|
|
// current_stage_id
|
|
// current_stage_id
|
|
|
rptArchiveObj.toggleBtn(true);
|
|
rptArchiveObj.toggleBtn(true);
|
|
|
|
|
+ buildMaterialSelection();
|
|
|
filterReportsByType(ALL_COMMON_TREE_NODES, ALL_INDIVI_TREE_NODES, CURRENT_SELECTED_BIZ_TYPE, TOP_TREE_NODES, CUST_TREE_NODES);
|
|
filterReportsByType(ALL_COMMON_TREE_NODES, ALL_INDIVI_TREE_NODES, CURRENT_SELECTED_BIZ_TYPE, TOP_TREE_NODES, CUST_TREE_NODES);
|
|
|
zTreeOprObj.getReportTemplateTree();
|
|
zTreeOprObj.getReportTemplateTree();
|
|
|
} else if (type === 'change_prepay') {
|
|
} else if (type === 'change_prepay') {
|
|
@@ -738,6 +803,9 @@
|
|
|
<% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600, -700, -800, -801, -802, -803].includes(stg_id)) { %>
|
|
<% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600, -700, -800, -801, -802, -803].includes(stg_id)) { %>
|
|
|
buildStageSelection();
|
|
buildStageSelection();
|
|
|
<% } %>
|
|
<% } %>
|
|
|
|
|
+ <% if ([-800, -801, -802, -803].includes(stg_id)) { %>
|
|
|
|
|
+ buildCostStageSelection();
|
|
|
|
|
+ <% } %>
|
|
|
setupSignature();
|
|
setupSignature();
|
|
|
|
|
|
|
|
for (let item of TOP_TREE_NODES) {
|
|
for (let item of TOP_TREE_NODES) {
|
|
@@ -821,6 +889,42 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function buildCostStageSelection() {
|
|
|
|
|
+ $("#optionSelectableCostStages").empty();
|
|
|
|
|
+ const commonOperation = (costObjs) => {
|
|
|
|
|
+ if (costObjs.length === 0) {
|
|
|
|
|
+ $("#divSelectableCostStages")[0].style.display = 'none';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#divSelectableCostStages")[0].style.display = '';
|
|
|
|
|
+ $("#optionSelectableCostStages")[0].style.display = '';
|
|
|
|
|
+ const obj = costObjs.find(costObj => costObj.id === BGL_OBJ.BUSINESS_ID);
|
|
|
|
|
+ const stgOrder = obj ? obj.stage_order : costObjs.length;
|
|
|
|
|
+ $("#btnCurrentCostStage")[0].innerText = `第${stgOrder}期`;
|
|
|
|
|
+ $("#optionSelectableCostStages").empty();
|
|
|
|
|
+ for (let i = 0; i < costObjs.length; i++) {
|
|
|
|
|
+ if (costObjs[i].stage_order !== stgOrder) {
|
|
|
|
|
+ const str = `<a class="dropdown-item" style="cursor:pointer" onclick="changeCurrentCostStage(this)" stg_id="${costObjs[i].id}" stg_order="${costObjs[i].stage_order}">第${costObjs[i].stage_order}期</a>`;
|
|
|
|
|
+ $("#optionSelectableCostStages").append(str);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ switch (SOURCE_TYPE) {
|
|
|
|
|
+ case 400:
|
|
|
|
|
+ commonOperation(BGL_OBJ.allStages.ledge);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ commonOperation(BGL_OBJ.allStages.book);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 402:
|
|
|
|
|
+ commonOperation(BGL_OBJ.allStages.analysis);
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ $("#divSelectableCostStages")[0].style.display = 'none';
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function buildStageSelection() {
|
|
function buildStageSelection() {
|
|
|
if (STAGE_LIST.length === 0) {
|
|
if (STAGE_LIST.length === 0) {
|
|
|
$("#optionSelectableStages")[0].style.display = 'none';
|
|
$("#optionSelectableStages")[0].style.display = 'none';
|
|
@@ -949,6 +1053,39 @@
|
|
|
getReportArchive();
|
|
getReportArchive();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function changeCurrentCostStage(ele) {
|
|
|
|
|
+ const costStgId = ele.attributes.stg_id.value;
|
|
|
|
|
+ const changeCostStage = (stgObjs) => {
|
|
|
|
|
+ for (const stg of stgObjs) {
|
|
|
|
|
+ if (stg.id === costStgId) {
|
|
|
|
|
+ BGL_OBJ.BUSINESS_ID = stg.id;
|
|
|
|
|
+ BUSINESS_ID = stg.id;
|
|
|
|
|
+ BGL_OBJ.status = stg.audit_status;
|
|
|
|
|
+ current_stage_times = stg.audit_times;
|
|
|
|
|
+ current_stage_status = stg.audit_status;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ switch (BGL_OBJ.source_type) {
|
|
|
|
|
+ case 400:
|
|
|
|
|
+ changeCostStage(BGL_OBJ.allStages.ledge);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ changeCostStage(BGL_OBJ.allStages.book);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 402:
|
|
|
|
|
+ changeCostStage(BGL_OBJ.allStages.analysis);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ buildCostStageSelection();
|
|
|
|
|
+ setupSignature();
|
|
|
|
|
+ zTreeOprObj.refreshNodes();
|
|
|
|
|
+ zTreeOprObj.countChkedRptTpl();
|
|
|
|
|
+ selectPreRptTpl();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function changeCurrentStage(ele) {
|
|
function changeCurrentStage(ele) {
|
|
|
// alert('you are selecting: ' + ele.innerText);
|
|
// alert('you are selecting: ' + ele.innerText);
|
|
|
current_stage_order = parseInt(ele.attributes.stg_order.value);
|
|
current_stage_order = parseInt(ele.attributes.stg_order.value);
|
|
@@ -973,6 +1110,8 @@
|
|
|
params.bizId = current_advance_id;
|
|
params.bizId = current_advance_id;
|
|
|
} else if (current_stage_id === -500) {
|
|
} else if (current_stage_id === -500) {
|
|
|
params.bizId = current_material_id;
|
|
params.bizId = current_material_id;
|
|
|
|
|
+ } else if (current_stage_id === -800) {
|
|
|
|
|
+ params.bizId = BGL_OBJ.BUSINESS_ID;
|
|
|
}
|
|
}
|
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
|
CommonAjax.postXsrfEx("/tender/report_api/getReportArchive", params, 10000, true, getCookie('csrfToken_j'),
|
|
CommonAjax.postXsrfEx("/tender/report_api/getReportArchive", params, 10000, true, getCookie('csrfToken_j'),
|
|
@@ -980,7 +1119,11 @@
|
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
|
ARCHIVE_LIST = result.data;
|
|
ARCHIVE_LIST = result.data;
|
|
|
LAST_AUDITOR = result.lastAuditor;
|
|
LAST_AUDITOR = result.lastAuditor;
|
|
|
- buildStageSelection();
|
|
|
|
|
|
|
+ if (current_stage_id === -800) {
|
|
|
|
|
+ buildCostStageSelection();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ buildStageSelection();
|
|
|
|
|
+ }
|
|
|
setupSignature();
|
|
setupSignature();
|
|
|
zTreeOprObj.refreshNodes();
|
|
zTreeOprObj.refreshNodes();
|
|
|
zTreeOprObj.countChkedRptTpl();
|
|
zTreeOprObj.countChkedRptTpl();
|