Browse Source

项目列表显示调整

MaiXinRong 5 years atrás
parent
commit
a2633d6960

+ 7 - 7
app/public/js/tender_list.js

@@ -285,7 +285,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 创建人
-    html.push('<td>', node.user_name ? node.user_name : '', '</td>');
+    html.push('<td class="text-center">', node.user_name ? node.user_name : '', '</td>');
     // 创建时间
     html.push('<td>', node.create_time ? moment(node.create_time).format('YYYY-MM-DD HH:mm:ss') : '', '</td>');
     // 计量模式
@@ -295,7 +295,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     // }
     // html.push('</td>');
     // 计量期数
-    html.push('<td>');
+    html.push('<td  class="text-center">');
     if (!node.cid) {
         html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
     }
@@ -319,11 +319,11 @@ function getTenderTreeHtml () {
         const html = [];
         html.push('<table class="table table-hover table-bordered" style="margin-top: 25px">');
         html.push('<thead style="position: fixed;left:56px;top: 34px">', '<tr>');
-        html.push('<th>', '标段名称', '</th>');
-        html.push('<th>', '创建人', '</th>');
-        html.push('<th>', '创建时间', '</th>');
-        html.push('<th>', '计量期数', '</th>');
-        html.push('<th>', '审批状态', '</th>');
+        html.push('<th class="text-center">', '标段名称', '</th>');
+        html.push('<th class="text-center">', '创建人', '</th>');
+        html.push('<th class="text-center">', '创建时间', '</th>');
+        html.push('<th class="text-center">', '计量期数', '</th>');
+        html.push('<th class="text-center">', '审批状态', '</th>');
         html.push('</tr>', '</thead>');
         parentId = 0;
         for (const t of tenderTree) {

+ 40 - 14
app/public/js/tender_list_info.js

@@ -190,6 +190,29 @@ function getCategoryHtml() {
     return html.join('');
 }
 // 初始化TenderTree数据
+function calculateParent(node) {
+    if (node.children && node.cid) {
+        node.total_price = 0;
+        node.gather_tp = 0;
+        node.end_contract_tp = 0;
+        node.end_qc_tp = 0;
+        node.end_gather_tp = 0;
+        node.pre_gather_tp = 0;
+        node.yf_tp = 0;
+        node.end_yf_tp = 0;
+        for (const c of node.children) {
+            calculateParent(c);
+            node.total_price = ZhCalc.add(node.total_price, c.total_price);
+            node.gather_tp = ZhCalc.add(node.gather_tp, c.gather_tp);
+            node.end_contract_tp = ZhCalc.add(node.end_contract_tp, c.end_contract_tp);
+            node.end_qc_tp = ZhCalc.add(node.end_qc_tp, c.end_qc_tp);
+            node.end_gather_tp = ZhCalc.add(node.end_gather_tp, c.end_gather_tp);
+            node.pre_gather_tp = ZhCalc.add(node.pre_gather_tp, c.pre_gather_tp);
+            node.yf_tp = ZhCalc.add(node.yf_tp, c.yf_tp);
+            node.end_yf_tp = ZhCalc.add(node.end_yf_tp, c.end_yf_tp);
+        }
+    }
+}
 function initTenderTree () {
     const levelCategory = category.filter(function (c) {
         return c.level && c.level > 0;
@@ -265,6 +288,9 @@ function initTenderTree () {
             tenderTree.push(t);
         }
     }
+    for (const t of tenderTree) {
+        calculateParent(t);
+    }
 }
 function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];
@@ -282,13 +308,13 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 计量模式
-    html.push('<td>');
+    html.push('<td 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 class="text-center">');
     if (!node.cid) {
         html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
     }
@@ -344,18 +370,18 @@ function getTenderTreeHtml () {
         const html = [];
         html.push('<table class="table table-hover table-bordered" style="margin-top: 25px">');
         html.push('<thead style="position: fixed;left:56px;top: 34px">', '<tr>');
-        html.push('<th>', '标段名称', '</th>');
-        html.push('<th>', '计量模式', '</th>');
-        html.push('<th>', '计量期数', '</th>');
-        html.push('<th>', '审批状态', '</th>');
-        html.push('<th>', '0号台帐', '</th>');
-        html.push('<th>', '本期完成', '</th>');
-        html.push('<th>', '截止本期合同', '</th>');
-        html.push('<th>', '截止本期变更', '</th>');
-        html.push('<th>', '截止本期完成', '</th>');
-        html.push('<th>', '截止上期完成', '</th>');
-        html.push('<th>', '本期应付', '</th>');
-        html.push('<th>', '截止本期应付', '</th>');
+        html.push('<th class="text-center">', '标段名称', '</th>');
+        html.push('<th class="text-center">', '计量模式', '</th>');
+        html.push('<th class="text-center">', '计量期数', '</th>');
+        html.push('<th class="text-center">', '审批状态', '</th>');
+        html.push('<th class="text-center">', '0号台帐', '</th>');
+        html.push('<th class="text-center">', '本期完成', '</th>');
+        html.push('<th class="text-center">', '截止本期合同', '</th>');
+        html.push('<th class="text-center">', '截止本期变更', '</th>');
+        html.push('<th class="text-center">', '截止本期完成', '</th>');
+        html.push('<th class="text-center">', '截止上期完成', '</th>');
+        html.push('<th class="text-center">', '本期应付', '</th>');
+        html.push('<th class="text-center">', '截止本期应付', '</th>');
         html.push('</tr>', '</thead>');
         parentId = 0;
         for (const t of tenderTree) {

+ 7 - 7
app/public/js/tender_list_manage.js

@@ -272,11 +272,11 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 创建人
-    html.push('<td>', node.user_name, '</td>');
+    html.push('<td class="text-center">', node.user_name, '</td>');
     // 创建时间
     html.push('<td>', node.create_time ? moment(node.create_time).format('YYYY-MM-DD HH:mm:ss') : '', '</td>');
     // 完成期数
-    html.push('<td>');
+    html.push('<td class="text-center">');
     if (!node.cid) {
         html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '第0期');
     }
@@ -304,11 +304,11 @@ function getTenderTreeHeaderHtml() {
     const html = [];
     html.push('<table class="table table-hover table-bordered" style="margin-top: 25px">');
     html.push('<thead style="position: fixed;left:56px;top: 34px">', '<tr>');
-    html.push('<th>', '标段名称', '</th>');
-    html.push('<th>', '创建人', '</th>');
-    html.push('<th>', '创建时间', '</th>');
-    html.push('<th>', '完成期数', '</th>');
-    html.push('<th>', '管理', '</th>');
+    html.push('<th class="text-center">', '标段名称', '</th>');
+    html.push('<th class="text-center">', '创建人', '</th>');
+    html.push('<th class="text-center">', '创建时间', '</th>');
+    html.push('<th class="text-center">', '完成期数', '</th>');
+    html.push('<th class="text-center">', '管理', '</th>');
     html.push('</tr>', '</thead>');
     return html.join('');
 }

+ 28 - 6
app/public/js/tender_list_progress.js

@@ -190,6 +190,25 @@ function getCategoryHtml() {
     }
     return html.join('');
 }
+function calculateParent(node) {
+    if (node.children && node.cid) {
+        node.end_qc_tp = 0;
+        node.pre_gather_tp = 0;
+        node.gather_tp = 0;
+        node.sum_tp = 0;
+        node.lastStage = 0;
+        for (const c of node.children) {
+            calculateParent(c);
+            node.end_qc_tp = ZhCalc.add(node.end_qc_tp, c.end_qc_tp);
+            node.pre_gather_tp = ZhCalc.add(node.pre_gather_tp, c.pre_gather_tp);
+            node.gather_tp = ZhCalc.add(node.gather_tp, c.gather_tp);
+            node.sum_tp = ZhCalc.add(node.sum_tp, c.sum_tp);
+            node.lastStage = c.cid
+                ? Math.max(node.lastStage, c.lastStage)
+                : (c.lastStage ? Math.max(node.lastStage, c.lastStage.order) : node.lastStage);
+        }
+    }
+}
 // 初始化TenderTree数据
 function initTenderTree () {
     const levelCategory = category.filter(function (c) {
@@ -265,6 +284,9 @@ function initTenderTree () {
             tenderTree.push(t);
         }
     }
+    for (const t of tenderTree) {
+        calculateParent(t);
+    }
 }
 function getProgressHtml(total, pre, cur) {
     if (total !== 0) {
@@ -298,13 +320,13 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     }
     html.push('</td>');
     // 计量期数
-    html.push('<td width="120">');
+    html.push('<td width="120" class="text-center">');
     if (!node.cid) {
         html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
     }
     html.push('</td>');
     // 累计合同计量
-    html.push('<td width="15%">');
+    html.push('<td width="15%" class="text-right">');
     const sum = node.lastStage ? ZhCalc.add(node.total_price, node.lastStage.end_qc_tp) : node.total_price;
     html.push(node.sum_tp ? node.sum_tp : '');
     html.push('</td>');
@@ -330,10 +352,10 @@ function getTenderTreeHtml () {
         const html = [];
         html.push('<table class="table table-hover table-bordered" style="margin-top: 25px">');
         html.push('<thead style="position: fixed;left:56px;top: 34px">', '<tr>');;
-        html.push('<th width="60%">', '标段名称', '</th>');
-        html.push('<th width="120">', '计量期数', '</th>');
-        html.push('<th width="10%">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+截止本期数量变更"></i>', '</th>');
-        html.push('<th>', '截止上期完成/本期完成/未完成', '</th>');
+        html.push('<th width="60%" class="text-center">', '标段名称', '</th>');
+        html.push('<th width="120" class="text-center">', '计量期数', '</th>');
+        html.push('<th width="10%" class="text-center">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+截止本期数量变更"></i>', '</th>');
+        html.push('<th class="text-center">', '截止上期完成/本期完成/未完成', '</th>');
         html.push('</tr>', '</thead>');
         parentId = 0;
         for (const t of tenderTree) {

+ 4 - 0
app/service/report.js

@@ -88,6 +88,10 @@ module.exports = app => {
                             runnableRst.push(service.reportMemory.getStagePosData(params.tender_id, params.stage_id, memFieldKeys[filter]));
                             runnableKey.push(filter);
                             break;
+                        case 'mem_stage_pos_compare':
+                            runnableRst.push(service.reportMemory.getStagePosCompareData(params.tender_id, params.stage_id, memFieldKeys[filter]));
+                            runnableKey.push(filter);
+                            break;
                         case 'mem_stage_bills_compare':
                             runnableRst.push(service.reportMemory.getStageBillsCompareData(params.tender_id, params.stage_id, memFieldKeys[filter]));
                             runnableKey.push(filter);

+ 5 - 5
builder_report_index_define.js

@@ -10,7 +10,7 @@
 
 const fs = require('fs');
 const path = require('path');
-const savePath = path.join(__dirname, 'report_temp');
+const savePath = path.join(__dirname, 'report_temp', 'table_field_define');
 const dataType = {
     int: 'int',
     str: 'string',
@@ -144,7 +144,7 @@ const change = {
         {name: '附件名称列表', field: 'attNames', type: dataType.currency},
     ]
 };
-const changeBills = {
+const change_bills = {
     name: '变更清单(mem_change_bills)',
     remark: '',
     id: 29,
@@ -191,7 +191,7 @@ const stage_pos = {
     name: '期-计量单元(mem_stage_pos)',
     remark: '',
     id: 34,
-    key: 'stage_pos',
+    key: 'mem_stage_pos',
     prefix: '期-计量单元',
     cols: [
         {name: 'id', field: 'id', type: dataType.str},
@@ -223,7 +223,7 @@ const stage_pos_compare = {
     name: '期-计量单元-全参与人(mem_stage_pos_compare)',
     remark: '',
     id: 35,
-    key: 'stage_pos_compare',
+    key: 'mem_stage_pos_compare',
     prefix: '期-计量单元-全参与人',
     cols: [
         {name: 'id', field: 'id', type: dataType.str},
@@ -391,7 +391,7 @@ const exportTableDefine = async function (define) {
     await saveTableDefine(tableDefine, path.join(savePath, define.key + '_define.json'));
 };
 
-const defines = [stage_pay];
+const defines = [stage_jgcl, stage_bonus, stage_other, change, change_bills, stage_pos, stage_pos_compare, stage_pay];
 for (const d of defines) {
     exportTableDefine(d);
 }