|
@@ -17,11 +17,12 @@
|
|
|
<button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="bizDropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
计量期
|
|
|
</button>
|
|
|
- <div class="dropdown-menu" aria-labelledby="bizDropdownMenuButton">
|
|
|
- <a class="dropdown-item" href="#">变更令</a>
|
|
|
- <a class="dropdown-item" href="#">变更立项</a>
|
|
|
- <a class="dropdown-item" href="#">变更方案</a>
|
|
|
- <a class="dropdown-item" href="#">变更申请</a>
|
|
|
+ <div class="dropdown-menu" aria-labelledby="bizDropdownMenuButton" id="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">变更令</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="change_project">变更立项</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="change_apply">变更申请</a>
|
|
|
+ <a class="dropdown-item" href="javascript:void(0);" data-type="change_plan">变更方案</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,6 +32,12 @@
|
|
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="optionSelectableStages"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="d-inline-block">
|
|
|
+ <div class="dropdown" id="divSelectableChanges" style="display: none">
|
|
|
+ <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="btnCurrentChange" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
|
|
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="optionSelectableChanges"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<% if (ctx.session.sessionUser.accountId === ctx.tender.data.user_id && needFileMsg) { %>
|
|
|
<div class="d-inline-block">
|
|
|
<button class="btn btn-sm btn-primary" type="button" onclick="sendReportFileMsg();">同步档案系统</button>
|
|
@@ -191,6 +198,8 @@
|
|
|
const STAGE_LIST = <%- stage_list %>;
|
|
|
const can_netcasign = <%- can_netcasign %>;
|
|
|
const oss_path = JSON.parse('<%- JSON.stringify(ossPath) %>');
|
|
|
+ let business_type = 'stage';
|
|
|
+ let CHANGE_LIST = [], current_change_id = -1, current_change_code = '';
|
|
|
|
|
|
const FOLDER_SEPERATER = '->';
|
|
|
|
|
@@ -301,6 +310,29 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function buildChangeSelection() {
|
|
|
+ if (CHANGE_LIST.length === 0) {
|
|
|
+ $("#optionSelectableChanges")[0].style.display = 'none';
|
|
|
+ $("#btnCurrentChange")[0].innerText = '';
|
|
|
+ } else {
|
|
|
+ $("#optionSelectableChanges")[0].style.display = '';
|
|
|
+ $("#btnCurrentChange")[0].innerText = current_change_code;
|
|
|
+
|
|
|
+ $("#optionSelectableChanges").empty();
|
|
|
+ if (CHANGE_LIST.length > 0) {
|
|
|
+ for (let i = CHANGE_LIST.length; i > 0; i--) {
|
|
|
+ if (parseInt(CHANGE_LIST[i - 1].status) === 3 && CHANGE_LIST[i - 1].code !== current_change_code) {
|
|
|
+ const str = '<a class="dropdown-item" style="cursor:pointer" onclick="changeCurrentChange(this)" change_id = "' + CHANGE_LIST[i - 1].id + '" change_code = "' + CHANGE_LIST[i - 1].code + '">' + CHANGE_LIST[i - 1].code + '</a>';
|
|
|
+ $("#optionSelectableChanges").append(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // if (CHANGE_ID > 0) {
|
|
|
+ // $("#divSelectableChanges")[0].style.display = 'none';
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
function changeCurrentStage(ele) {
|
|
|
// alert('you are selecting: ' + ele.innerText);
|
|
|
current_stage_order = parseInt(ele.attributes.stg_order.value);
|
|
@@ -332,6 +364,30 @@
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ function changeCurrentChange(ele) {
|
|
|
+ // alert('you are selecting: ' + ele.innerText);
|
|
|
+ current_change_id = ele.attributes.change_id.value;
|
|
|
+ current_change_code = ele.attributes.change_code.value;
|
|
|
+ buildChangeSelection();
|
|
|
+ //还有必要触发归档报表刷新!
|
|
|
+ //rptArchiveObj.onClick(null, null, rptArchiveObj.currentNode);
|
|
|
+ const params = {tenderId: TENDER_ID, business_type, bzId: current_change_id};
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ CommonAjax.postXsrfEx("/tender/report_api/getReportArchive4bz", params, 10000, true, getCookie('csrfToken_j'),
|
|
|
+ function(result){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ ARCHIVE_LIST = result.data;
|
|
|
+ ARCHIVE_ENCRYPTION_LIST = result.encryptionData;
|
|
|
+ TOP_TREE_NODES = JSON.parse(JSON.stringify(result.rpt_tpl_data));
|
|
|
+ rptArchiveObj.iniPage();
|
|
|
+ }, function(err){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }, function(ex){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
function sendReportFileMsg() {
|
|
|
postData('sendReportFileMsg', { sid: current_stage_id, sorder: current_stage_order }, function (result, msg) {
|
|
@@ -364,6 +420,67 @@
|
|
|
pauseEvent(e);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ $('#select-item a').on('click', function () {
|
|
|
+ $('#select-item a').show();
|
|
|
+ $(this).hide();
|
|
|
+ $('#select-item').siblings('button').text($(this).text());
|
|
|
+ const type = $(this).data('type');
|
|
|
+ business_type = type;
|
|
|
+ if (type === 'stage') {
|
|
|
+ $('#divSelectableStages').show();
|
|
|
+ $('#divSelectableChanges').hide();
|
|
|
+ // 下列树结构重新加载
|
|
|
+//还有必要触发归档报表刷新!
|
|
|
+ //rptArchiveObj.onClick(null, null, rptArchiveObj.currentNode);
|
|
|
+ const params = {prjId: PROJECT_ID, stgId: current_stage_id};
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ CommonAjax.postXsrfEx("/tender/report_api/getReportArchive", params, 10000, true, getCookie('csrfToken_j'),
|
|
|
+ function(result){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ // console.log(result);
|
|
|
+ ARCHIVE_LIST = result.data;
|
|
|
+ ARCHIVE_ENCRYPTION_LIST = result.encryptionData;
|
|
|
+ TOP_TREE_NODES = JSON.parse(JSON.stringify(ORG_TOP_TREE_NODES));
|
|
|
+ rptArchiveObj.iniPage();
|
|
|
+ }, function(err){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }, function(ex){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ $('#divSelectableStages').hide();
|
|
|
+ $('#divSelectableChanges').show();
|
|
|
+ // 下列树结构重新加载
|
|
|
+ //rptArchiveObj.onClick(null, null, rptArchiveObj.currentNode);
|
|
|
+ const params = {tenderId: TENDER_ID, business_type: type};
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ // ARCHIVE_LIST = [];
|
|
|
+ // ARCHIVE_ENCRYPTION_LIST = [];
|
|
|
+ // TOP_TREE_NODES = JSON.parse(JSON.stringify(ORG_TOP_TREE_NODES));
|
|
|
+ // rptArchiveObj.iniPage();
|
|
|
+ CommonAjax.postXsrfEx("/tender/report_api/getReportArchive4bz", params, 10000, true, getCookie('csrfToken_j'),
|
|
|
+ function(result){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ // console.log(result);
|
|
|
+ ARCHIVE_LIST = result.data;
|
|
|
+ ARCHIVE_ENCRYPTION_LIST = result.encryptionData;
|
|
|
+ CHANGE_LIST = result.changes;
|
|
|
+ current_change_id = CHANGE_LIST.length > 0 ? CHANGE_LIST[0].cid || CHANGE_LIST[0].id : -1;
|
|
|
+ current_change_code = CHANGE_LIST.length > 0 ? CHANGE_LIST[0].code : '';
|
|
|
+ TOP_TREE_NODES = JSON.parse(JSON.stringify(result.rpt_tpl_data));
|
|
|
+ rptArchiveObj.iniPage();
|
|
|
+ buildChangeSelection();
|
|
|
+ }, function(err){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }, function(ex){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
})
|
|
|
|
|
|
rptArchiveObj.iniPage();
|