|
@@ -8,65 +8,81 @@
|
|
|
* @version
|
|
|
*/
|
|
|
const tenderListSpec = (function(){
|
|
|
+ let colSetCache;
|
|
|
+ function generateColSetCache() {
|
|
|
+ const result = {};
|
|
|
+ colSet.forEach(x => {
|
|
|
+ result[x.field] = { show: x.show, alias: x.alias || x.name };
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ };
|
|
|
function getTenderNodeHtml(node, arr, pid) {
|
|
|
const html = [];
|
|
|
html.push('<tr pid="' + pid + '">');
|
|
|
// 名称
|
|
|
- html.push('<td style="min-width: 300px;" class="in-' + node.level + '">');
|
|
|
- if (node.cid) {
|
|
|
- html.push('<span onselectstart="return false" style="{-moz-user-select:none}" class="fold-switch mr-1" title="收起" cid="'+ node.sort_id +'"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ');
|
|
|
- html.push((node.level === 1 ? '<b>' : ''), node.name, (node.level === 1 ? '</b>' : ''));
|
|
|
- } else {
|
|
|
- html.push('<span class="text-muted mr-2">');
|
|
|
- html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
|
|
|
- html.push('</span>');
|
|
|
- //html.push('<a href="/tender/' + node.id + '">', node[c.field], '</a>');
|
|
|
- html.push('<a href="javascript: void(0)" name="name" style="min-width: 300px;word-break:break-all;" id="' + node.id + '">', node.name, '</a>');
|
|
|
- }
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.name.show) {
|
|
|
+ html.push('<td style="min-width: 300px;" class="in-' + node.level + '">');
|
|
|
+ if (node.cid) {
|
|
|
+ html.push('<span onselectstart="return false" style="{-moz-user-select:none}" class="fold-switch mr-1" title="收起" cid="' + node.sort_id + '"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ');
|
|
|
+ html.push((node.level === 1 ? '<b>' : ''), node.name, (node.level === 1 ? '</b>' : ''));
|
|
|
+ } else {
|
|
|
+ html.push('<span class="text-muted mr-2">');
|
|
|
+ html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
|
|
|
+ html.push('</span>');
|
|
|
+ //html.push('<a href="/tender/' + node.id + '">', node[c.field], '</a>');
|
|
|
+ html.push('<a href="javascript: void(0)" name="name" style="min-width: 300px;word-break:break-all;" id="' + node.id + '">', node.name, '</a>');
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 计量模式
|
|
|
- html.push('<td style="width: 85px" class="text-center">');
|
|
|
- if (node.measure_type) {
|
|
|
- html.push(node.measure_type === measureType.tz.value ? '0号台账' : '工程量清单');
|
|
|
+ if (colSetCache.measure_type.show) {
|
|
|
+ html.push('<td style="width: 85px" class="text-center">');
|
|
|
+ if (node.measure_type) {
|
|
|
+ html.push(node.measure_type === measureType.tz.value ? '0号台账' : '工程量清单');
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
}
|
|
|
- html.push('</td>');
|
|
|
// 计量进度
|
|
|
- html.push('<td style="width: 125px">');
|
|
|
- if (!node.cid && node.cur_flow) {
|
|
|
- if (node.progress) {
|
|
|
- html.push(node.progress.title + ' (' + '<span class="' + node.progress.status_class +'">' + node.progress.status + '</span>' + ')');
|
|
|
- } else {
|
|
|
- html.push(node.cur_flow.title + ' (' + '<span class="' + node.cur_flow.status_class +'">' + node.cur_flow.status + '</span>' + ')');
|
|
|
+ if (colSetCache.calc_flow.show) {
|
|
|
+ html.push('<td style="width: 125px">');
|
|
|
+ if (!node.cid && node.cur_flow) {
|
|
|
+ if (node.progress) {
|
|
|
+ html.push(node.progress.title + ' (' + '<span class="' + node.progress.status_class + '">' + node.progress.status + '</span>' + ')');
|
|
|
+ } else {
|
|
|
+ html.push(node.cur_flow.title + ' (' + '<span class="' + node.cur_flow.status_class + '">' + node.cur_flow.status + '</span>' + ')');
|
|
|
+ }
|
|
|
}
|
|
|
+ html.push('</td>');
|
|
|
}
|
|
|
- html.push('</td>');
|
|
|
// 当前流程
|
|
|
- html.push('<td style="width: 230px">');
|
|
|
- if (!node.cid && node.cur_flow) {
|
|
|
- const curUser = node.cur_flow instanceof Array && node.cur_flow[0].audit_type && node.cur_flow[0].audit_type !== auditType.key.common
|
|
|
- ? transFormToChinese(node.cur_flow[0].audit_order) + '审'
|
|
|
- : node.cur_flow instanceof Array ? (node.cur_flow[0].name + (node.cur_flow[0].role ? '-'+node.cur_flow[0].role : '')): (node.cur_flow.name + (node.cur_flow.role ? '-'+node.cur_flow.role : ''));
|
|
|
- if (node.stage_status !== undefined) {
|
|
|
- html.push(((node.stage_count && node.stage_status === auditConst.stage.status.uncheck) || node.ledger_status === auditConst.ledger.status.uncheck)
|
|
|
- ? curUser
|
|
|
- : `<a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="${node.stage_count ? 'stage' : 'ledger'}" data-tender="${node.id}" data-order="${node.stage_count ? node.stage_count + '' : ''}">${curUser}</a>`
|
|
|
- );
|
|
|
- html.push(`<span class="${node.progress.status_class} ml-1">${node.progress.status}</span>`);
|
|
|
- } else {
|
|
|
- html.push((node.lastStage && node.lastStage.status === auditConst.stage.status.uncheck) || (!node.lastStage && node.ledger_status === auditConst.ledger.status.uncheck ) ? '' :
|
|
|
- '<a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="'+ (node.lastStage ? 'stage' : 'ledger') +'"' +
|
|
|
- ' data-tender="'+ node.id +'" data-order="'+ (node.lastStage ? node.lastStage.order : '') +'">');
|
|
|
- html.push(curUser);
|
|
|
- html.push((node.lastStage && node.lastStage.status === auditConst.stage.status.uncheck) || (!node.lastStage && node.ledger_status === auditConst.ledger.status.uncheck ) ? ' ':
|
|
|
- '</a> ');
|
|
|
- if (node.cur_flow instanceof Array) {
|
|
|
- html.push('<span class="' + node.cur_flow[0].status_class +'">' + node.cur_flow[0].status + '</span>');
|
|
|
+ if (colSetCache.cur_flow.show) {
|
|
|
+ html.push('<td style="width: 230px">');
|
|
|
+ if (!node.cid && node.cur_flow) {
|
|
|
+ const curUser = node.cur_flow instanceof Array && node.cur_flow[0].audit_type && node.cur_flow[0].audit_type !== auditType.key.common
|
|
|
+ ? transFormToChinese(node.cur_flow[0].audit_order) + '审'
|
|
|
+ : node.cur_flow instanceof Array ? (node.cur_flow[0].name + (node.cur_flow[0].role ? '-' + node.cur_flow[0].role : '')) : (node.cur_flow.name + (node.cur_flow.role ? '-' + node.cur_flow.role : ''));
|
|
|
+ if (node.stage_status !== undefined) {
|
|
|
+ html.push(((node.stage_count && node.stage_status === auditConst.stage.status.uncheck) || node.ledger_status === auditConst.ledger.status.uncheck)
|
|
|
+ ? curUser
|
|
|
+ : `<a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="${node.stage_count ? 'stage' : 'ledger'}" data-tender="${node.id}" data-order="${node.stage_count ? node.stage_count + '' : ''}">${curUser}</a>`
|
|
|
+ );
|
|
|
+ html.push(`<span class="${node.progress.status_class} ml-1">${node.progress.status}</span>`);
|
|
|
} else {
|
|
|
- html.push('<span class="' + node.cur_flow.status_class +'">' + node.cur_flow.status + '</span>');
|
|
|
+ html.push((node.lastStage && node.lastStage.status === auditConst.stage.status.uncheck) || (!node.lastStage && node.ledger_status === auditConst.ledger.status.uncheck) ? '' :
|
|
|
+ '<a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="' + (node.lastStage ? 'stage' : 'ledger') + '"' +
|
|
|
+ ' data-tender="' + node.id + '" data-order="' + (node.lastStage ? node.lastStage.order : '') + '">');
|
|
|
+ html.push(curUser);
|
|
|
+ html.push((node.lastStage && node.lastStage.status === auditConst.stage.status.uncheck) || (!node.lastStage && node.ledger_status === auditConst.ledger.status.uncheck) ? ' ' :
|
|
|
+ '</a> ');
|
|
|
+ if (node.cur_flow instanceof Array) {
|
|
|
+ html.push('<span class="' + node.cur_flow[0].status_class + '">' + node.cur_flow[0].status + '</span>');
|
|
|
+ } else {
|
|
|
+ html.push('<span class="' + node.cur_flow.status_class + '">' + node.cur_flow.status + '</span>');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ html.push('</td>');
|
|
|
}
|
|
|
- html.push('</td>');
|
|
|
// 上一流程审批时间
|
|
|
// html.push('<td style="width: 7%">');
|
|
|
// if (!node.cid && node.pre_flow) {
|
|
@@ -74,67 +90,110 @@ const tenderListSpec = (function(){
|
|
|
// }
|
|
|
// html.push('</td>');
|
|
|
// 签约合同价
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.contract_price || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.contract_price.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.contract_price || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 0号台账合同
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.total_price || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.total_price.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.total_price || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 本期完成
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.gather_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.gather_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.gather_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 截止本期合同
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.end_contract_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.end_contract_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.end_contract_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 截止本期变更
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.end_qc_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.end_qc_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.end_qc_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 截止本期完成
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.end_gather_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.end_gather_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.end_gather_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 截止上期完成
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.pre_gather_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.pre_gather_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.pre_gather_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 预付款
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.advance_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.advance_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.advance_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 本期应付
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.yf_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.yf_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.yf_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
// 截止本期应付
|
|
|
- html.push('<td style="width: 100px" class="text-right">');
|
|
|
- html.push(node.end_yf_tp || '');
|
|
|
- html.push('</td>');
|
|
|
+ if (colSetCache.end_yf_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.end_yf_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
+ // 本期实付
|
|
|
+ if (colSetCache.sf_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.yf_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
+ // 截止本期实付
|
|
|
+ if (colSetCache.end_sf_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.end_sf_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
+ // 本期未付
|
|
|
+ if (colSetCache.wf_tp.show) {
|
|
|
+ html.push('<td style="width: 100px" class="text-right">');
|
|
|
+ html.push(node.wf_tp || '');
|
|
|
+ html.push('</td>');
|
|
|
+ }
|
|
|
html.push('</tr>');
|
|
|
return html.join('');
|
|
|
}
|
|
|
function getTenderTreeHeaderHtml() {
|
|
|
+ colSetCache = generateColSetCache();
|
|
|
+ console.log(colSetCache);
|
|
|
const html = [];
|
|
|
html.push('<table class="table table-hover table-bordered">');
|
|
|
html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
|
|
|
- html.push('<th class="text-center" style="min-width: 300px;">', '标段名称', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 85px">', '计量模式', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 125px">', '计量进度', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 230px">', '当前流程', '</th>');
|
|
|
+ if (colSetCache.name.show) html.push('<th class="text-center" style="min-width: 300px;">', colSetCache.name.alias, '</th>');
|
|
|
+ if (colSetCache.measure_type.show) html.push('<th class="text-center" style="width: 85px">', colSetCache.measure_type.alias, '</th>');
|
|
|
+ if (colSetCache.calc_flow.show) html.push('<th class="text-center" style="width: 125px">', colSetCache.calc_flow.alias, '</th>');
|
|
|
+ if (colSetCache.cur_flow.show) html.push('<th class="text-center" style="width: 230px">', colSetCache.cur_flow.alias, '</th>');
|
|
|
// html.push('<th class="text-center" style="width: 7%">', '上一流程审批时间', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '签约合同价', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '0号台账', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '本期完成', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '截止本期合同', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '截止本期变更', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '截止本期完成', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '截止上期完成', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '预付款', '<i class="fa fa-question-circle text-primary" data-placement="bottom" data-toggle="tooltip" data-original-title="预付款流程中截止本期金额"></i>', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '本期应付', '</th>');
|
|
|
- html.push('<th class="text-center" style="width: 100px">', '截止本期应付', '</th>');
|
|
|
+ if (colSetCache.contract_price.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.contract_price.alias, '</th>');
|
|
|
+ if (colSetCache.total_price.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.total_price.alias, '</th>');
|
|
|
+ if (colSetCache.gather_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.gather_tp.alias, '</th>');
|
|
|
+ if (colSetCache.end_contract_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.end_contract_tp.alias, '</th>');
|
|
|
+ if (colSetCache.end_qc_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.end_qc_tp.alias, '</th>');
|
|
|
+ if (colSetCache.end_gather_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.end_gather_tp.alias, '</th>');
|
|
|
+ if (colSetCache.pre_gather_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.pre_gather_tp.alias, '</th>');
|
|
|
+ if (colSetCache.advance_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.advance_tp.alias, '<i class="fa fa-question-circle text-primary" data-placement="bottom" data-toggle="tooltip" data-original-title="预付款流程中截止本期金额"></i>', '</th>');
|
|
|
+ if (colSetCache.yf_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.yf_tp.alias, '</th>');
|
|
|
+ if (colSetCache.end_yf_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.end_yf_tp.alias, '</th>');
|
|
|
+ if (colSetCache.sf_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.sf_tp.alias, '</th>');
|
|
|
+ if (colSetCache.end_sf_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.end_sf_tp.alias, '</th>');
|
|
|
+ if (colSetCache.wf_tp.show) html.push('<th class="text-center" style="width: 100px">', colSetCache.wf_tp.alias, '</th>');
|
|
|
html.push('</tr>', '</thead>');
|
|
|
return html.join('');
|
|
|
}
|
|
@@ -147,6 +206,9 @@ const tenderListSpec = (function(){
|
|
|
tender.pre_gather_tp = ZhCalc.add(tender.stage_tp.pre_contract_tp, tender.stage_tp.pre_qc_tp);
|
|
|
tender.yf_tp = ZhCalc.add(tender.stage_tp.yf_tp);
|
|
|
tender.end_yf_tp = ZhCalc.add(tender.stage_tp.pre_yf_tp, tender.yf_tp);
|
|
|
+ tender.sf_tp = ZhCalc.add(tender.stage_tp.sf_tp);
|
|
|
+ tender.end_sf_tp = ZhCalc.add(tender.stage_tp.pre_sf_tp, tender.sf_tp);
|
|
|
+ tender.wf_tp = ZhCalc.sub(tender.end_yf_tp, tender.end_sf_tp);
|
|
|
} else if (tender.lastStage) {
|
|
|
tender.gather_tp = ZhCalc.sum([tender.lastStage.contract_tp, tender.lastStage.qc_tp, tender.lastStage.pc_tp]);
|
|
|
tender.end_contract_tp = ZhCalc.sum([tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp, tender.lastStage.contract_pc_tp]);
|
|
@@ -155,6 +217,9 @@ const tenderListSpec = (function(){
|
|
|
tender.pre_gather_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.pre_qc_tp);
|
|
|
tender.yf_tp = ZhCalc.add(tender.lastStage.yf_tp);
|
|
|
tender.end_yf_tp = ZhCalc.add(tender.lastStage.pre_yf_tp, tender.yf_tp);
|
|
|
+ tender.sf_tp = ZhCalc.add(tender.lastStage.sf_tp);
|
|
|
+ tender.end_sf_tp = ZhCalc.add(tender.lastStage.pre_sf_tp, tender.sf_tp);
|
|
|
+ tender.wf_tp = ZhCalc.sub(tender.end_yf_tp, tender.end_sf_tp);
|
|
|
}
|
|
|
}
|
|
|
function calculateParent(node) {
|
|
@@ -169,6 +234,9 @@ const tenderListSpec = (function(){
|
|
|
node.end_yf_tp = 0;
|
|
|
node.advance_tp = 0;
|
|
|
node.contract_price = 0;
|
|
|
+ node.sf_tp = 0;
|
|
|
+ node.end_sf_tp = 0;
|
|
|
+ node.wf_tp = 0;
|
|
|
for (const c of node.children) {
|
|
|
calculateParent(c);
|
|
|
node.total_price = ZhCalc.add(node.total_price, c.total_price);
|
|
@@ -181,6 +249,9 @@ const tenderListSpec = (function(){
|
|
|
node.end_yf_tp = ZhCalc.add(node.end_yf_tp, c.end_yf_tp);
|
|
|
node.advance_tp = ZhCalc.add(node.advance_tp, c.advance_tp);
|
|
|
node.contract_price = ZhCalc.add(node.contract_price, c.contract_price);
|
|
|
+ node.sf_tp = ZhCalc.add(node.sf_tp, c.sf_tp);
|
|
|
+ node.end_sf_tp = ZhCalc.add(node.end_sf_tp, c.end_sf_tp);
|
|
|
+ node.wf_tp = ZhCalc.add(node.wf_tp, c.wf_tp);
|
|
|
}
|
|
|
}
|
|
|
}
|