|
@@ -19,7 +19,7 @@
|
|
<% include ../stage/stage_sub_mini_menu.ejs %>
|
|
<% include ../stage/stage_sub_mini_menu.ejs %>
|
|
<% } %>
|
|
<% } %>
|
|
<div>
|
|
<div>
|
|
- <!-- <div class="d-inline-block">
|
|
|
|
|
|
+ <div class="d-inline-block">
|
|
<div class="dropdown">
|
|
<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 class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="allBizDropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
计量期
|
|
计量期
|
|
@@ -34,17 +34,16 @@
|
|
<div class="d-inline-block">
|
|
<div class="d-inline-block">
|
|
<div class="dropdown" style="display: none" id="biz-prepay-item">
|
|
<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 class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="allPrepayButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
- 所有预付款
|
|
|
|
|
|
+ 开工预付款
|
|
</button>
|
|
</button>
|
|
<div class="dropdown-menu" aria-labelledby="allPrepayButton" id="prepay-select-item">
|
|
<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>
|
|
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="start" style="display: none">开工预付款</a>
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="material">材料预付款</a>
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="safe">安全生产费预付款</a>
|
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="dust">扬尘污染预付款</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div> -->
|
|
|
|
|
|
+ </div>
|
|
<% if (false || ![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
<% if (false || ![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
|
|
<div class="d-inline-block" id="divSelectableBizs_up">
|
|
<div class="d-inline-block" id="divSelectableBizs_up">
|
|
<div class="dropdown" id="divSelectableStages">
|
|
<div class="dropdown" id="divSelectableStages">
|
|
@@ -366,20 +365,24 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
let CURRENT_SELECTED_BIZ_TYPE = 'stage';
|
|
let CURRENT_SELECTED_BIZ_TYPE = 'stage';
|
|
- $('#prepay-select-item a').on('click', function () {
|
|
|
|
|
|
+ function advancePayClick(ele = null) {
|
|
$('#prepay-select-item a').show();
|
|
$('#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') {
|
|
|
|
- //
|
|
|
|
- }
|
|
|
|
|
|
+ const thisEle = ele === null ? this : ele;
|
|
|
|
+ $(thisEle).hide();
|
|
|
|
+ $('#prepay-select-item').siblings('button').text($(thisEle).text());
|
|
|
|
+ const type = $(thisEle).data('type');
|
|
|
|
+ const typeStr = ['start', 'material', 'safe', 'dust'];
|
|
|
|
+ const tIdx = typeStr.indexOf(type)
|
|
|
|
+ const adList = [];
|
|
|
|
+ ADVANCE_LIST.forEach(advance => {
|
|
|
|
+ if (advance.type === tIdx) {
|
|
|
|
+ adList.push(advance);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ buildAdvancePaySelection(adList);
|
|
|
|
+ }
|
|
|
|
+ $('#prepay-select-item a').on('click', function (){
|
|
|
|
+ advancePayClick(this);
|
|
});
|
|
});
|
|
|
|
|
|
$('#biz-select-item a').on('click', function () {
|
|
$('#biz-select-item a').on('click', function () {
|
|
@@ -406,6 +409,10 @@
|
|
$('#biz-prepay-item').show();
|
|
$('#biz-prepay-item').show();
|
|
$('#report_selects_ul').hide();
|
|
$('#report_selects_ul').hide();
|
|
$('#divPresets').hide();
|
|
$('#divPresets').hide();
|
|
|
|
+ // 要触发一下
|
|
|
|
+ if (current_advance_id === -1) {
|
|
|
|
+ advancePayClick( $('#prepay-select-item a')[0]);
|
|
|
|
+ }
|
|
} else if (type === 'change_material_adjustment') {
|
|
} else if (type === 'change_material_adjustment') {
|
|
// 材料调差
|
|
// 材料调差
|
|
$('#divSelectableStages').hide();
|
|
$('#divSelectableStages').hide();
|
|
@@ -414,6 +421,10 @@
|
|
$('#biz-prepay-item').hide();
|
|
$('#biz-prepay-item').hide();
|
|
$('#report_selects_ul').hide();
|
|
$('#report_selects_ul').hide();
|
|
$('#divPresets').hide();
|
|
$('#divPresets').hide();
|
|
|
|
+ // 要触发一下
|
|
|
|
+ if (current_material_id === -1) {
|
|
|
|
+ buildMaterialSelection();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
filterReportsByType();
|
|
filterReportsByType();
|
|
});
|
|
});
|
|
@@ -489,6 +500,8 @@
|
|
const SOURCE_TYPE = <%- source_type %>;
|
|
const SOURCE_TYPE = <%- source_type %>;
|
|
const ALL_CHANGES = <%- changes %>;
|
|
const ALL_CHANGES = <%- changes %>;
|
|
const BGL_OBJ = <%- bglObj %>;
|
|
const BGL_OBJ = <%- bglObj %>;
|
|
|
|
+ const ADVANCE_LIST = <%- advanceList %>;
|
|
|
|
+ const MATERIAL_LIST = <%- materialAdjList %>;
|
|
const CHANGE_ID = BGL_OBJ?.change?.cid || '-1';
|
|
const CHANGE_ID = BGL_OBJ?.change?.cid || '-1';
|
|
const CHANGE_TIMES = BGL_OBJ?.change?.times || 1;
|
|
const CHANGE_TIMES = BGL_OBJ?.change?.times || 1;
|
|
const BUSINESS_ID = BGL_OBJ?.BUSINESS_ID || '-1';
|
|
const BUSINESS_ID = BGL_OBJ?.BUSINESS_ID || '-1';
|
|
@@ -571,6 +584,8 @@
|
|
let ROLE_REL_LIST = [];
|
|
let ROLE_REL_LIST = [];
|
|
let CURRENT_ROLE_REL_ID = -1;
|
|
let CURRENT_ROLE_REL_ID = -1;
|
|
let current_stage_order = -1;
|
|
let current_stage_order = -1;
|
|
|
|
+ let current_advance_id = -1; // 预付款期id
|
|
|
|
+ let current_material_id = -1; // 材差期id
|
|
let current_stage_id = STAGE_ID;
|
|
let current_stage_id = STAGE_ID;
|
|
let current_stage_times = -1;
|
|
let current_stage_times = -1;
|
|
let current_stage_status = -1;
|
|
let current_stage_status = -1;
|
|
@@ -747,6 +762,62 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function buildAdvancePaySelection(adList) {
|
|
|
|
+ $("#optionSelectableAdvancePays").empty();
|
|
|
|
+ $("#btnCurrentAdvancePay")[0].innerText = '';
|
|
|
|
+ let hasMatch = false;
|
|
|
|
+ if (current_advance_id !== -1) {}
|
|
|
|
+ for (const advance of adList) {
|
|
|
|
+ if (current_advance_id === advance.id) {
|
|
|
|
+ hasMatch = true; // 预付款有好几种类型,需要考虑不同类型的转换检测
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ adList.forEach((advance, adIndex) => {
|
|
|
|
+ let dispStr = '';
|
|
|
|
+ if (!hasMatch && adIndex === 0 || current_advance_id === advance.id) {
|
|
|
|
+ current_advance_id = advance.id;
|
|
|
|
+ $("#btnCurrentAdvancePay")[0].innerText = `第${adIndex + 1}期`;
|
|
|
|
+ dispStr = ';display:none';
|
|
|
|
+ }
|
|
|
|
+ const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentAdvance(this)" advance_id = "${advance.id}">第${adIndex + 1}期</a>`;
|
|
|
|
+ $("#optionSelectableAdvancePays").append(str);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function buildMaterialSelection() {
|
|
|
|
+ $("#optionSelectableMaterials").empty();
|
|
|
|
+ $("#btnCurrentMaterial")[0].innerText = '';
|
|
|
|
+ MATERIAL_LIST.forEach((materialAdj, maIndex) => {
|
|
|
|
+ let dispStr = '';
|
|
|
|
+ if (current_material_id === -1 && maIndex === 0 || current_material_id === materialAdj.id) {
|
|
|
|
+ current_material_id = materialAdj.id;
|
|
|
|
+ $("#btnCurrentMaterial")[0].innerText = `第${maIndex + 1}期`;
|
|
|
|
+ dispStr = ';display:none';
|
|
|
|
+ }
|
|
|
|
+ const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentMaterial(this)" material_id = "${materialAdj.id}">第${maIndex + 1}期</a>`;
|
|
|
|
+ $("#optionSelectableMaterials").append(str);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function changeCurrentMaterial(ele) {
|
|
|
|
+ // 此方法与changeCurrentStage不同,不需要与后台交互,只需要调整 params: material_id (约定的参数),然后触发一下报表
|
|
|
|
+ $('#optionSelectableMaterials a').show();
|
|
|
|
+ $(ele).hide();
|
|
|
|
+ current_material_id = +ele.attributes[3].value;
|
|
|
|
+ $('#optionSelectableMaterials').siblings('button').text($(ele).text());
|
|
|
|
+ // 刷新报表模板
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function changeCurrentAdvance(ele) {
|
|
|
|
+ // 此方法与changeCurrentStage不同,不需要与后台交互,只需要调整 params: advance_id (约定的参数),然后触发一下报表
|
|
|
|
+ $('#optionSelectableAdvancePays a').show();
|
|
|
|
+ $(ele).hide();
|
|
|
|
+ current_advance_id = +ele.attributes[3].value;
|
|
|
|
+ $('#optionSelectableAdvancePays').siblings('button').text($(ele).text());
|
|
|
|
+ // 刷新报表模板
|
|
|
|
+ }
|
|
|
|
+
|
|
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);
|