|
@@ -204,7 +204,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="modal-footer">
|
|
<!--
|
|
<!--
|
|
- <button type="button" class="btn btn-sm btn-link float-left" data-dismiss="modal" data-toggle="modal" data-target="#batch-eSignature" id="batch-setupProjSignature" onclick="rptSignatureHelper.resetESignature(zTreeOprObj.currentRptPageRst, 'batch-eSignatureBodyDiv')">批量设置其他标段</button>
|
|
|
|
|
|
+ <button type="button" id="btn_cross_tender" class="btn btn-sm btn-link float-left" data-dismiss="modal" data-toggle="modal" data-target="#batch-eSignature" id="batch-setupProjSignature" onclick="rptSignatureHelper.resetESignature(zTreeOprObj.currentRptPageRst, 'batch-eSignatureBodyDiv'); buildTendersTree();">批量设置其他标段</button>
|
|
|
|
|
|
<button type="button" class="btn btn-sm btn-link float-left" data-toggle="modal" data-target="#batch-eSignature" id="hidden_show_batch_eSignature" style="display:none"></button>
|
|
<button type="button" class="btn btn-sm btn-link float-left" data-toggle="modal" data-target="#batch-eSignature" id="hidden_show_batch_eSignature" style="display:none"></button>
|
|
<button type="button" class="btn btn-sm btn-link float-left" data-dismiss="modal" onclick="setTimeout(function(){$('#hidden_show_batch_eSignature').trigger('click');}, 50);">批量设置其他标段</button>
|
|
<button type="button" class="btn btn-sm btn-link float-left" data-dismiss="modal" onclick="setTimeout(function(){$('#hidden_show_batch_eSignature').trigger('click');}, 50);">批量设置其他标段</button>
|
|
@@ -227,7 +227,7 @@
|
|
<div class="modal-body">
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
- <table class="table table-hover table-bordered" id="batch_projects_individual">
|
|
|
|
|
|
+ <table class="table table-hover table-bordered" id="batch_tenders_individual">
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col-6" id="batch-eSignatureBodyDiv"></div>
|
|
<div class="col-6" id="batch-eSignatureBodyDiv"></div>
|
|
@@ -236,7 +236,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
|
|
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
|
|
- <a href="" class="btn btn-sm btn-primary">确定</a>
|
|
|
|
|
|
+ <a href="javascript:void(0);" onclick="rptSignatureHelper.setupAfterSelectMultiTenders(SELECTED_TENDERS)" class="btn btn-sm btn-primary">确定</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -462,10 +462,11 @@
|
|
zTreeOprObj.iniFontCfgDom(CUST_CFG);
|
|
zTreeOprObj.iniFontCfgDom(CUST_CFG);
|
|
buildCustRptCommon('report_cust_group_common', ORG_TOP_TREE_NODES[1], CUST_TREE_NODES.common, 'true');
|
|
buildCustRptCommon('report_cust_group_common', ORG_TOP_TREE_NODES[1], CUST_TREE_NODES.common, 'true');
|
|
buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
|
|
buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
|
|
- //buildTendersTree();
|
|
|
|
|
|
+ let SELECTED_TENDERS = [];
|
|
|
|
|
|
function buildTendersTree() {
|
|
function buildTendersTree() {
|
|
let sortedCat = [];
|
|
let sortedCat = [];
|
|
|
|
+ SELECTED_TENDERS = [];
|
|
for (const cat of category) {
|
|
for (const cat of category) {
|
|
if (cat.level > 0) {
|
|
if (cat.level > 0) {
|
|
sortedCat.push(cat);
|
|
sortedCat.push(cat);
|
|
@@ -485,7 +486,8 @@
|
|
name: nv.value,
|
|
name: nv.value,
|
|
id : nv.id,
|
|
id : nv.id,
|
|
cid : nv.cid,
|
|
cid : nv.cid,
|
|
- items: []
|
|
|
|
|
|
+ items: [],
|
|
|
|
+ isParent: true
|
|
};
|
|
};
|
|
parentItems.push(item);
|
|
parentItems.push(item);
|
|
_createItems(item.items, grpLv + 1);
|
|
_createItems(item.items, grpLv + 1);
|
|
@@ -505,7 +507,7 @@
|
|
//3. 把标段挂上去
|
|
//3. 把标段挂上去
|
|
let tmpCacheArr = []; //这个临时用来储存相应标段节点挂接信息
|
|
let tmpCacheArr = []; //这个临时用来储存相应标段节点挂接信息
|
|
let _putTender = function (catLv, tender, parentItems) {
|
|
let _putTender = function (catLv, tender, parentItems) {
|
|
- if (catLv < tender.category.length) {
|
|
|
|
|
|
+ if (catLv < tender.category.length && tender.lastStage !== undefined && tender.lastStage !== null) {
|
|
let isSorted = false;
|
|
let isSorted = false;
|
|
for (let sCat of sortedCat) {
|
|
for (let sCat of sortedCat) {
|
|
if (sCat.id === tender.category[catLv].cid && sCat.level > 0) {
|
|
if (sCat.id === tender.category[catLv].cid && sCat.level > 0) {
|
|
@@ -522,13 +524,16 @@
|
|
} else {
|
|
} else {
|
|
//就是这个了
|
|
//就是这个了
|
|
let tdItem = {
|
|
let tdItem = {
|
|
- name: tender.value,
|
|
|
|
|
|
+ name: tender.name,
|
|
id : -1,
|
|
id : -1,
|
|
cid : -1,
|
|
cid : -1,
|
|
- prj_id: tender.id,
|
|
|
|
- last_stage: -1,
|
|
|
|
- signature: '',
|
|
|
|
- items: []
|
|
|
|
|
|
+ tender_id: tender.id,
|
|
|
|
+ last_stage: tender.lastStage.order,
|
|
|
|
+ last_stage_id: tender.lastStage.id,
|
|
|
|
+ report_id: zTreeOprObj.currentNode.refId,
|
|
|
|
+ signature: '临时',
|
|
|
|
+ items: [],
|
|
|
|
+ isParent: false
|
|
}; //标段节点
|
|
}; //标段节点
|
|
//
|
|
//
|
|
tmpCacheArr.push([item, tdItem]);
|
|
tmpCacheArr.push([item, tdItem]);
|
|
@@ -544,7 +549,93 @@
|
|
for (const pairItem of tmpCacheArr) {
|
|
for (const pairItem of tmpCacheArr) {
|
|
pairItem[0].items.push(pairItem[1]);
|
|
pairItem[0].items.push(pairItem[1]);
|
|
}
|
|
}
|
|
- console.log(treeCache);
|
|
|
|
|
|
+ //4. 剔除空items的项
|
|
|
|
+ let _removeEmptyItems = function (parentItem) {
|
|
|
|
+ let rst = false;
|
|
|
|
+ if (parentItem.items.length === 0) {
|
|
|
|
+ if (parentItem.isParent) {
|
|
|
|
+ rst = true;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
|
|
|
|
+ if (_removeEmptyItems(parentItem.items[idx])) {
|
|
|
|
+ parentItem.items.splice(idx, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rst = parentItem.items.length === 0;
|
|
|
|
+ }
|
|
|
|
+ return rst;
|
|
|
|
+ }
|
|
|
|
+ for (let idx = treeCache.length - 1; idx >= 0; idx--) {
|
|
|
|
+ if (_removeEmptyItems(treeCache[idx])) {
|
|
|
|
+ treeCache.splice(idx, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //console.log(treeCache);
|
|
|
|
+ //还要请求各标段的原签名数据
|
|
|
|
+ let params = {};
|
|
|
|
+ params.selectedTenders = [];
|
|
|
|
+ let _getTenderRelatedInfos = function(parentItem, rstArr) {
|
|
|
|
+ if (parentItem.items.length === 0) {
|
|
|
|
+ if (!parentItem.isParent) {
|
|
|
|
+ rstArr.push([parentItem.tender_id, parentItem.last_stage_id, parentItem.report_id]);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
|
|
|
|
+ _getTenderRelatedInfos(parentItem.items[idx], rstArr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ let _addHint = function(parentItem, relArr) {
|
|
|
|
+ if (parentItem.items.length === 0) {
|
|
|
|
+ if (!parentItem.isParent) {
|
|
|
|
+ for (const rel of relArr) {
|
|
|
|
+ if (rel.tender_id === parentItem.tender_id && rel.sid === parentItem.last_stage_id && rel.rpt_id === parentItem.report_id) {
|
|
|
|
+ let hintStr = '';
|
|
|
|
+ if (rel.rel_content instanceof Array) {
|
|
|
|
+ for (let idx = 0; idx < rel.rel_content.length; idx++) {
|
|
|
|
+ const dtlRel = rel.rel_content[idx];
|
|
|
|
+ if (idx > 0) {
|
|
|
|
+ hintStr = hintStr + '、';
|
|
|
|
+ }
|
|
|
|
+ hintStr = hintStr + '(' + dtlRel.signature_name + ')' + dtlRel.user_name;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ parentItem.signature = hintStr;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
|
|
|
|
+ _getTenderRelatedInfos(parentItem.items[idx], relArr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ for (let idx = treeCache.length - 1; idx >= 0; idx--) {
|
|
|
|
+ _getTenderRelatedInfos(treeCache[idx], params.selectedTenders);
|
|
|
|
+ }
|
|
|
|
+ $.bootstrapLoading.start();
|
|
|
|
+ CommonAjax.postXsrfEx("/tender/report_api/getMultiRoleRelationships", params, 30000, true, getCookie('csrfToken'),
|
|
|
|
+ function(result){
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
+ let relArr = result.data;
|
|
|
|
+ for (const rel of relArr) {
|
|
|
|
+ rel.rel_content = JSON.parse(rel.rel_content);
|
|
|
|
+ }
|
|
|
|
+ console.log(relArr);
|
|
|
|
+ //5. 加hint
|
|
|
|
+ for (let idx = treeCache.length - 1; idx >= 0; idx--) {
|
|
|
|
+ _addHint(treeCache[idx], relArr);
|
|
|
|
+ }
|
|
|
|
+ //6. 建树
|
|
|
|
+ _buildTenderTree('batch_tenders_individual', treeCache);
|
|
|
|
+ }, function(err){
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
+ }, function(ex){
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
|
|
function searchAccount() {
|
|
function searchAccount() {
|
|
@@ -553,6 +644,46 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function _buildTenderTree(tbDomId, tendersArr) {
|
|
|
|
+ let tbDom = $("#" + tbDomId);
|
|
|
|
+ tbDom.empty();
|
|
|
|
+ //tbDom.append('<tr><th>类别</th><th>包含报表</th><th>显示</th></tr>');
|
|
|
|
+ tbDom.append('<thead><tr><th>名称</th><th width="50">计量期</th><th width="40">签名</th><th width="40">选择</th></tr></thead>');
|
|
|
|
+ tbDom.append('<tbody>');
|
|
|
|
+ const _createRow = function (rowItem, lv) {
|
|
|
|
+ let tdClassStr = 'in-' + lv;
|
|
|
|
+ if (rowItem.isParent) {
|
|
|
|
+ tbDom.append('<tr><td class="' + tdClassStr + '"><i class="fa fa-folder-o"></i> ' + rowItem.name + '</td><td></td><td></td><td></td></tr>');
|
|
|
|
+ } else {
|
|
|
|
+ let hrefStr = '/tender/' + rowItem.tender_id;
|
|
|
|
+ //<a href="biaoduan-panel.html" target="_blank">WWUJ-1</a>
|
|
|
|
+ let lastStgStr = '';
|
|
|
|
+ if (rowItem.last_stage === -1) {
|
|
|
|
+ lastStgStr = '台账';
|
|
|
|
+ } else {
|
|
|
|
+ lastStgStr = '第' + rowItem.last_stage + '期';
|
|
|
|
+ }
|
|
|
|
+ //let chgStr = 'changeCrossTender(this, SELECTED_TENDERS,' + rowItem.tender_id + ', ' + rowItem.last_stage_id + ', ' + rowItem.report_id + ')';
|
|
|
|
+ if (rowItem.signature !== undefined && rowItem.signature !== null && rowItem.signature !== '') {
|
|
|
|
+ let hintStr = '<i class="fa fa-exclamation-circle text-primary" data-container="body" data-toggle="tooltip" data-placement="bottom" data-original-title="' + rowItem.signature + '"></i>';
|
|
|
|
+ tbDom.append('<tr><td class="' + tdClassStr + '"><a href="' + hrefStr + '" target="_blank">' + rowItem.name + '</a></td><td>' + lastStgStr + '</td><td>' + hintStr + '</td><td><input type="checkbox" onclick="changeCrossTender(this, SELECTED_TENDERS, ' + rowItem.tender_id + ', ' + rowItem.last_stage_id + ', ' + rowItem.report_id + ')' + '"></td></tr>');
|
|
|
|
+ } else {
|
|
|
|
+ tbDom.append('<tr><td class="' + tdClassStr + '"><a href="' + hrefStr + '" target="_blank">' + rowItem.name + '</a></td><td>' + lastStgStr + '</td><td></td><td><input type="checkbox" onclick="changeCrossTender(this, SELECTED_TENDERS, ' + rowItem.tender_id + ', ' + rowItem.last_stage_id + ', ' + rowItem.report_id + ')' + '"></td></tr>');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (rowItem.items && rowItem.items.length > 0) {
|
|
|
|
+ for (const subItem of rowItem.items) {
|
|
|
|
+ _createRow(subItem, lv + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let grpLv = 1;
|
|
|
|
+ for (const tItem of tendersArr) {
|
|
|
|
+ _createRow(tItem, grpLv);
|
|
|
|
+ }
|
|
|
|
+ tbDom.append('</tbody>');
|
|
|
|
+ }
|
|
|
|
+
|
|
function buildCustRptCommon(tbDomId, topTreeNode, checkingArr, isCommonStr) {
|
|
function buildCustRptCommon(tbDomId, topTreeNode, checkingArr, isCommonStr) {
|
|
let tbDom = $("#" + tbDomId);
|
|
let tbDom = $("#" + tbDomId);
|
|
tbDom.empty();
|
|
tbDom.empty();
|
|
@@ -656,6 +787,20 @@
|
|
buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
|
|
buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function changeCrossTender(dom, rstArr, tenderId, stageId, reportId) {
|
|
|
|
+ if (dom.checked) {
|
|
|
|
+ let item = [tenderId, stageId, reportId];
|
|
|
|
+ rstArr.push(item);
|
|
|
|
+ } else {
|
|
|
|
+ for (let idx = rstArr.length - 1; idx >= 0; idx--) {
|
|
|
|
+ if (rstArr[idx][0] === tenderId && rstArr[idx][1] === stageId && rstArr[idx][2] === reportId) {
|
|
|
|
+ rstArr.splice(idx, 1); //删除当前标段
|
|
|
|
+ //这里不break,防止一些冗余数据
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
function changeFolder(dom, isCommon, parentIdStr) {
|
|
function changeFolder(dom, isCommon, parentIdStr) {
|
|
let prop = null;
|
|
let prop = null;
|
|
if (isCommon) {
|
|
if (isCommon) {
|