Explorar o código

feat: 新增计量进度-审批状态

lanjianrong %!s(int64=5) %!d(string=hai) anos
pai
achega
4af5dbb6f5

+ 14 - 0
app/controller/tender_controller.js

@@ -55,6 +55,20 @@ module.exports = app => {
                         if (!t.lastStage) continue;
                         await this.ctx.service.stage.checkStageGatherData(t.lastStage);
                     }
+                    if (t.lastStage) {
+                        if (t.lastStage.status === auditConst.stage.status.uncheck) {
+                            const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
+                            t.status_users = status_name ? status_name.name : '';
+                        } else {
+                            const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
+                            t.status_users = status_name ? status_name.name : '';
+                        }
+                    } else {
+                        if (t.ledger_status !== auditConst.ledger.status.uncheck) {
+                            const status_name = await this.ctx.service.ledgerAudit.getStatusName(t.id, t.ledger_times);
+                            t.status_users = status_name ? status_name.name : '';
+                        }
+                    }
                 }
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);

+ 11 - 3
app/public/js/tender_list_progress.js

@@ -308,7 +308,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];
     html.push('<tr pid="' + pid + '">');
     // 名称
-    html.push('<td width="40%" class="in-' + node.level + '">');
+    html.push('<td width="30%" 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> ', node.name);
     } else {
@@ -325,6 +325,13 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
         html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
     }
     html.push('</td>');
+
+    // 审批状态
+    html.push('<td style="width: 10%">');
+    html.push(node.lastStage ? auditConst.stage.statusString[node.lastStage.status] : auditConst.ledger.statusString[node.ledger_status]);
+    html.push(node.status_users ? '(' + node.status_users + ')' : '');
+    html.push('</td>');
+
     // 累计合同计量
     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;
@@ -352,10 +359,11 @@ function getTenderTreeHtml () {
         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 style="width: 35%" class="text-center">', '标段名称', '</th>');
+        html.push('<th style="width: 30%" class="text-center">', '标段名称', '</th>');
         html.push('<th style="width: 10%" class="text-center">', '计量期数', '</th>');
+        html.push('<th style="width: 10%" class="text-center">','审批状态','</th>');
         html.push('<th style="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 style="width: 45%" class="text-center">', '截止上期完成/本期完成/未完成', '</th>');
+        html.push('<th style="width: 40%" class="text-center">', '截止上期完成/本期完成/未完成', '</th>');
         html.push('</tr>', '</thead>');
         parentId = 0;
         for (const t of tenderTree) {

+ 1 - 0
app/view/tender/progress.ejs

@@ -11,6 +11,7 @@
     const tenders = JSON.parse('<%- JSON.stringify(tenderList) %>');
     const categoryType = JSON.parse('<%- JSON.stringify(settingConst.cType) %>');
     const category = JSON.parse('<%- JSON.stringify(categoryData) %>');
+    const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     const uid = '<%- uid %>';
     const pid = '<%- pid %>';
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_list';