|
@@ -404,10 +404,12 @@
|
|
|
$('#biz-prepay-item').hide();
|
|
|
$('#report_selects_ul').show();
|
|
|
$('#divPresets').show();
|
|
|
+ SOURCE_TYPE = 1;
|
|
|
current_advance_id = -1;
|
|
|
current_advance_type = '';
|
|
|
current_material_id = -1;
|
|
|
current_stage_id = bk_current_stage_id;
|
|
|
+ BUSINESS_ID = bk_current_stage_id;
|
|
|
// 还有归档按钮处理
|
|
|
// current_stage_id
|
|
|
rptArchiveObj.toggleBtn(true);
|
|
@@ -421,12 +423,13 @@
|
|
|
$('#report_selects_ul').hide();
|
|
|
$('#divPresets').hide();
|
|
|
// 要触发一下
|
|
|
+ SOURCE_TYPE = 10;
|
|
|
current_advance_id = -1;
|
|
|
current_material_id = -1;
|
|
|
bk_current_stage_id = current_stage_id;
|
|
|
current_stage_id = -400;
|
|
|
- advancePayClick( $('#prepay-select-item a')[0]);
|
|
|
rptArchiveObj.toggleBtn(true);
|
|
|
+ advancePayClick( $('#prepay-select-item a')[0]);
|
|
|
} else if (type === 'change_material_adjustment') {
|
|
|
// 材料调差
|
|
|
$('#divSelectableStages').hide();
|
|
@@ -436,13 +439,14 @@
|
|
|
$('#report_selects_ul').hide();
|
|
|
$('#divPresets').hide();
|
|
|
// 要触发一下
|
|
|
+ SOURCE_TYPE = 30;
|
|
|
current_advance_id = -1;
|
|
|
current_advance_type = '';
|
|
|
current_material_id = -1;
|
|
|
bk_current_stage_id = current_stage_id;
|
|
|
current_stage_id = -500;
|
|
|
- buildMaterialSelection();
|
|
|
rptArchiveObj.toggleBtn(true);
|
|
|
+ buildMaterialSelection();
|
|
|
filterReportsByType();
|
|
|
}
|
|
|
// filterReportsByType();
|
|
@@ -516,7 +520,7 @@
|
|
|
const DETAIL_ID = <%- detail_id %>;
|
|
|
const BUDGET_ID = <%- budget_id %>;
|
|
|
const SP_ID = '<%- sp_id %>';
|
|
|
- const SOURCE_TYPE = <%- source_type %>;
|
|
|
+ let SOURCE_TYPE = <%- source_type %>;
|
|
|
const ALL_CHANGES = <%- changes %>;
|
|
|
const BGL_OBJ = <%- bglObj %>;
|
|
|
const ADVANCE_LIST = <%- advanceList %>;
|
|
@@ -529,7 +533,7 @@
|
|
|
});
|
|
|
const CHANGE_ID = BGL_OBJ?.change?.cid || '-1';
|
|
|
const CHANGE_TIMES = BGL_OBJ?.change?.times || 1;
|
|
|
- const BUSINESS_ID = BGL_OBJ?.BUSINESS_ID || '-1';
|
|
|
+ let BUSINESS_ID = BGL_OBJ?.BUSINESS_ID || '-1';
|
|
|
const CHNAGE_PLAN_ID = BGL_OBJ?.change_plan?.id || '-1';
|
|
|
const CHNAGE_PLAN_TIMES = BGL_OBJ?.change_plan?.times || '-1';
|
|
|
const CHNAGE_PROJECT_ID = BGL_OBJ?.change_project?.id || '-1';
|
|
@@ -610,8 +614,10 @@
|
|
|
let CURRENT_ROLE_REL_ID = -1;
|
|
|
let current_stage_order = -1;
|
|
|
let current_advance_id = -1; // 预付款期id
|
|
|
+ let current_advance_order = -1; // 预付款期
|
|
|
let current_advance_type = '';// 预付款报表类型
|
|
|
let current_material_id = -1; // 材差期id
|
|
|
+ let current_material_order = -1; // 材差期
|
|
|
let current_stage_id = STAGE_ID;
|
|
|
let bk_current_stage_id = current_stage_id;
|
|
|
let current_stage_times = -1;
|
|
@@ -814,6 +820,7 @@
|
|
|
if (current_advance_id !== -1) {
|
|
|
// 这里要考虑不同预付款的切换
|
|
|
current_advance_id = -1;
|
|
|
+ current_advance_order = -1;
|
|
|
}
|
|
|
for (const advance of adList) {
|
|
|
if (current_advance_id === advance.id) {
|
|
@@ -826,10 +833,12 @@
|
|
|
let dispStr = '';
|
|
|
if (!hasMatch && adIndex === maxIdx || current_advance_id === advance.id) {
|
|
|
current_advance_id = advance.id;
|
|
|
- $("#btnCurrentAdvancePay")[0].innerText = `第${adIndex + 1}期`;
|
|
|
+ BUSINESS_ID = advance.id;
|
|
|
+ current_advance_order = adIndex + 1;
|
|
|
+ $("#btnCurrentAdvancePay")[0].innerText = `第${current_advance_order}期`;
|
|
|
dispStr = ';display:none';
|
|
|
}
|
|
|
- const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentAdvance(this)" advance_id = "${advance.id}">第${adIndex + 1}期</a>`;
|
|
|
+ const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentAdvance(this)" advance_id = "${advance.id}">第${current_advance_order}期</a>`;
|
|
|
$("#optionSelectableAdvancePays").append(str);
|
|
|
});
|
|
|
if (current_advance_id > 0) {
|
|
@@ -845,10 +854,12 @@
|
|
|
let dispStr = '';
|
|
|
if (current_material_id === -1 && maIndex === maxIdx || current_material_id === materialAdj.id) {
|
|
|
current_material_id = materialAdj.id;
|
|
|
- $("#btnCurrentMaterial")[0].innerText = `第${maIndex + 1}期`;
|
|
|
+ current_material_order = maIndex + 1;
|
|
|
+ BUSINESS_ID = materialAdj.id;
|
|
|
+ $("#btnCurrentMaterial")[0].innerText = `第${current_material_order}期`;
|
|
|
dispStr = ';display:none';
|
|
|
}
|
|
|
- const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentMaterial(this)" material_id = "${materialAdj.id}">第${maIndex + 1}期</a>`;
|
|
|
+ const str = `<a class="dropdown-item" style="cursor:pointer${dispStr}" onclick="changeCurrentMaterial(this)" material_id = "${materialAdj.id}">第${current_material_order}期</a>`;
|
|
|
$("#optionSelectableMaterials").append(str);
|
|
|
});
|
|
|
if (current_material_id > 0) {
|
|
@@ -876,6 +887,7 @@
|
|
|
$('#optionSelectableMaterials a').show();
|
|
|
$(ele).hide();
|
|
|
current_material_id = +ele.attributes[3].value;
|
|
|
+ BUSINESS_ID = current_material_id;
|
|
|
$('#optionSelectableMaterials').siblings('button').text($(ele).text());
|
|
|
// 刷新报表模板
|
|
|
zTreeOprObj.onClick(null, null, zTreeOprObj.currentNode);
|
|
@@ -888,6 +900,7 @@
|
|
|
$('#optionSelectableAdvancePays a').show();
|
|
|
$(ele).hide();
|
|
|
current_advance_id = +ele.attributes[3].value;
|
|
|
+ BUSINESS_ID = current_advance_id;
|
|
|
$('#optionSelectableAdvancePays').siblings('button').text($(ele).text());
|
|
|
// 刷新报表模板
|
|
|
zTreeOprObj.onClick(null, null, zTreeOprObj.currentNode);
|
|
@@ -899,6 +912,8 @@
|
|
|
// alert('you are selecting: ' + ele.innerText);
|
|
|
current_stage_order = parseInt(ele.attributes.stg_order.value);
|
|
|
current_stage_id = parseInt(ele.attributes.stg_id.value);
|
|
|
+ // BUSINESS_ID = current_stage_id;
|
|
|
+ BUSINESS_ID = BGL_OBJ?.BUSINESS_ID || '-1';
|
|
|
// 调整当前stage times
|
|
|
for (let i = STAGE_LIST.length; i > 0; i--) {
|
|
|
if (parseInt(STAGE_LIST[i - 1].order) === current_stage_order) {
|