|
@@ -270,12 +270,12 @@ $(document).ready(function() {
|
|
|
if (sel.rowCount > 1 && first) {
|
|
if (sel.rowCount > 1 && first) {
|
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
|
const rNode = tree.nodes[sel.row + r];
|
|
const rNode = tree.nodes[sel.row + r];
|
|
|
- childCanDel = this.checkDelete(rNode, childCanDel);
|
|
|
|
|
- // if (!hadContract) hadContract = this.checkContract(rNode);
|
|
|
|
|
if (!rNode) {
|
|
if (!rNode) {
|
|
|
sameParent = false;
|
|
sameParent = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ childCanDel = this.checkDelete(rNode, childCanDel);
|
|
|
|
|
+ // if (!hadContract) hadContract = this.checkContract(rNode);
|
|
|
if (rNode.level > first.level) continue;
|
|
if (rNode.level > first.level) continue;
|
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
|
sameParent = false;
|
|
sameParent = false;
|
|
@@ -1137,6 +1137,7 @@ $(document).ready(function() {
|
|
|
return haveContract;
|
|
return haveContract;
|
|
|
},
|
|
},
|
|
|
checkDelete: function (select, oldFlag = true) {
|
|
checkDelete: function (select, oldFlag = true) {
|
|
|
|
|
+ if (!select) return false;
|
|
|
let canDelete = oldFlag;
|
|
let canDelete = oldFlag;
|
|
|
if (select.c_code) {
|
|
if (select.c_code) {
|
|
|
if (!(select.uid === user_id || is_admin)) {
|
|
if (!(select.uid === user_id || is_admin)) {
|
|
@@ -1460,11 +1461,11 @@ $(document).ready(function() {
|
|
|
if (sel.rowCount > 1 && first) {
|
|
if (sel.rowCount > 1 && first) {
|
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
for (let r = 1; r < sel.rowCount; r++) {
|
|
|
const rNode = tree.nodes[sel.row + r];
|
|
const rNode = tree.nodes[sel.row + r];
|
|
|
- childCanDel = contractTreeSpreadObj.checkDelete(rNode, childCanDel);
|
|
|
|
|
if (!rNode) {
|
|
if (!rNode) {
|
|
|
sameParent = false;
|
|
sameParent = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ childCanDel = contractTreeSpreadObj.checkDelete(rNode, childCanDel);
|
|
|
if (rNode.level > first.level) continue;
|
|
if (rNode.level > first.level) continue;
|
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
if ((rNode.level < first.level) || (rNode.level === first.level && rNode.contract_pid !== first.contract_pid)) {
|
|
|
sameParent = false;
|
|
sameParent = false;
|
|
@@ -2644,6 +2645,7 @@ $(document).ready(function() {
|
|
|
// 列显示控制
|
|
// 列显示控制
|
|
|
const colShowMap = {};
|
|
const colShowMap = {};
|
|
|
colSet.forEach(function (col) { colShowMap[col.field] = col.show; });
|
|
colSet.forEach(function (col) { colShowMap[col.field] = col.show; });
|
|
|
|
|
+ const showSettlePrice = colShowMap.settle_price;
|
|
|
const showYfPrice = colShowMap.yf_price;
|
|
const showYfPrice = colShowMap.yf_price;
|
|
|
const showStackedBar = colShowMap.stackedBar;
|
|
const showStackedBar = colShowMap.stackedBar;
|
|
|
const showSfPrice = colShowMap.sf_price;
|
|
const showSfPrice = colShowMap.sf_price;
|
|
@@ -2660,8 +2662,10 @@ $(document).ready(function() {
|
|
|
};
|
|
};
|
|
|
// 构建表头
|
|
// 构建表头
|
|
|
let theadHtml = '<tr>';
|
|
let theadHtml = '<tr>';
|
|
|
- theadHtml += '<th style="width: 30%">节点名称</th>';
|
|
|
|
|
|
|
+ theadHtml += '<th style="width: 6%">编号</th>';
|
|
|
|
|
+ theadHtml += '<th style="width: 24%">项目名称</th>';
|
|
|
theadHtml += '<th>合同金额</th>';
|
|
theadHtml += '<th>合同金额</th>';
|
|
|
|
|
+ if (showSettlePrice) theadHtml += '<th>' + getColTitle('settle_price') + '</th>';
|
|
|
if (showYfPrice) theadHtml += '<th>' + getColTitle('yf_price') + '</th>';
|
|
if (showYfPrice) theadHtml += '<th>' + getColTitle('yf_price') + '</th>';
|
|
|
if (showStackedBar) theadHtml += '<th>' + getColTitle('stackedBar') + '</th>';
|
|
if (showStackedBar) theadHtml += '<th>' + getColTitle('stackedBar') + '</th>';
|
|
|
if (showSfPrice) theadHtml += '<th>' + getColTitle('sf_price') + '</th>';
|
|
if (showSfPrice) theadHtml += '<th>' + getColTitle('sf_price') + '</th>';
|
|
@@ -2670,32 +2674,40 @@ $(document).ready(function() {
|
|
|
$('#contract-total-thead').html(theadHtml);
|
|
$('#contract-total-thead').html(theadHtml);
|
|
|
// 构建表体(仅第一层节点)
|
|
// 构建表体(仅第一层节点)
|
|
|
let tbodyHtml = '';
|
|
let tbodyHtml = '';
|
|
|
- let sum_total = 0, sum_yf = 0, sum_sf = 0;
|
|
|
|
|
- for (const node of topLevelNodes) {
|
|
|
|
|
|
|
+ let sum_total = 0, sum_settle = 0, sum_yf = 0, sum_sf = 0;
|
|
|
|
|
+ for (const [index, node] of topLevelNodes.entries()) {
|
|
|
const nodeTotal = Number(node.total_price || 0);
|
|
const nodeTotal = Number(node.total_price || 0);
|
|
|
|
|
+ const nodeSettle = Number(node.settle_price || 0);
|
|
|
|
|
+ const nodeProgressBase = showSettlePrice && nodeSettle !== 0 ? nodeSettle : nodeTotal;
|
|
|
const nodeYf = Number(node.yf_price || 0);
|
|
const nodeYf = Number(node.yf_price || 0);
|
|
|
const nodeSf = Number(node.sf_price || 0);
|
|
const nodeSf = Number(node.sf_price || 0);
|
|
|
sum_total = ZhCalc.add(sum_total, nodeTotal);
|
|
sum_total = ZhCalc.add(sum_total, nodeTotal);
|
|
|
|
|
+ sum_settle = ZhCalc.add(sum_settle, nodeSettle);
|
|
|
sum_yf = ZhCalc.add(sum_yf, nodeYf);
|
|
sum_yf = ZhCalc.add(sum_yf, nodeYf);
|
|
|
sum_sf = ZhCalc.add(sum_sf, nodeSf);
|
|
sum_sf = ZhCalc.add(sum_sf, nodeSf);
|
|
|
tbodyHtml += '<tr>';
|
|
tbodyHtml += '<tr>';
|
|
|
|
|
+ tbodyHtml += '<td>' + (index + 1) + '</td>';
|
|
|
tbodyHtml += '<td class="text-left">' + (node.name || '') + '</td>';
|
|
tbodyHtml += '<td class="text-left">' + (node.name || '') + '</td>';
|
|
|
tbodyHtml += '<td class="text-right">' + (nodeTotal || 0) + '</td>';
|
|
tbodyHtml += '<td class="text-right">' + (nodeTotal || 0) + '</td>';
|
|
|
|
|
+ if (showSettlePrice) tbodyHtml += '<td class="text-right">' + (nodeSettle || 0) + '</td>';
|
|
|
if (showYfPrice) tbodyHtml += '<td class="text-right">' + (nodeYf || 0) + '</td>';
|
|
if (showYfPrice) tbodyHtml += '<td class="text-right">' + (nodeYf || 0) + '</td>';
|
|
|
- if (showStackedBar) tbodyHtml += '<td class="text-right">' + getProgress(nodeYf, nodeTotal) + '</td>';
|
|
|
|
|
|
|
+ if (showStackedBar) tbodyHtml += '<td class="text-right">' + getProgress(nodeYf, nodeProgressBase) + '</td>';
|
|
|
if (showSfPrice) tbodyHtml += '<td class="text-right">' + (nodeSf || 0) + '</td>';
|
|
if (showSfPrice) tbodyHtml += '<td class="text-right">' + (nodeSf || 0) + '</td>';
|
|
|
- if (showStackedBarSf) tbodyHtml += '<td class="text-right">' + getProgress(nodeSf, nodeTotal) + '</td>';
|
|
|
|
|
|
|
+ if (showStackedBarSf) tbodyHtml += '<td class="text-right">' + getProgress(nodeSf, nodeProgressBase) + '</td>';
|
|
|
tbodyHtml += '</tr>';
|
|
tbodyHtml += '</tr>';
|
|
|
}
|
|
}
|
|
|
$('#contract-total-tbody').html(tbodyHtml);
|
|
$('#contract-total-tbody').html(tbodyHtml);
|
|
|
// 构建合计行
|
|
// 构建合计行
|
|
|
let tfootHtml = '<tr class="font-weight-bold">';
|
|
let tfootHtml = '<tr class="font-weight-bold">';
|
|
|
- tfootHtml += '<td class="text-left">合计</td>';
|
|
|
|
|
|
|
+ tfootHtml += '<td></td>';
|
|
|
|
|
+ tfootHtml += '<td class="text-center">合计</td>';
|
|
|
tfootHtml += '<td class="text-right">' + (sum_total || 0) + '</td>';
|
|
tfootHtml += '<td class="text-right">' + (sum_total || 0) + '</td>';
|
|
|
|
|
+ if (showSettlePrice) tfootHtml += '<td class="text-right">' + (sum_settle || 0) + '</td>';
|
|
|
if (showYfPrice) tfootHtml += '<td class="text-right">' + (sum_yf || 0) + '</td>';
|
|
if (showYfPrice) tfootHtml += '<td class="text-right">' + (sum_yf || 0) + '</td>';
|
|
|
- if (showStackedBar) tfootHtml += '<td class="text-right">' + getProgress(sum_yf, sum_total) + '</td>';
|
|
|
|
|
|
|
+ const totalProgressBase = showSettlePrice && sum_settle !== 0 ? sum_settle : sum_total;
|
|
|
|
|
+ if (showStackedBar) tfootHtml += '<td class="text-right">' + getProgress(sum_yf, totalProgressBase) + '</td>';
|
|
|
if (showSfPrice) tfootHtml += '<td class="text-right">' + (sum_sf || 0) + '</td>';
|
|
if (showSfPrice) tfootHtml += '<td class="text-right">' + (sum_sf || 0) + '</td>';
|
|
|
- if (showStackedBarSf) tfootHtml += '<td class="text-right">' + getProgress(sum_sf, sum_total) + '</td>';
|
|
|
|
|
|
|
+ if (showStackedBarSf) tfootHtml += '<td class="text-right">' + getProgress(sum_sf, totalProgressBase) + '</td>';
|
|
|
tfootHtml += '</tr>';
|
|
tfootHtml += '</tr>';
|
|
|
$('#contract-total-tfoot').html(tfootHtml);
|
|
$('#contract-total-tfoot').html(tfootHtml);
|
|
|
// 显示弹窗
|
|
// 显示弹窗
|