瀏覽代碼

1.标段列表显示状态操作人
2.隐藏短信设置弹窗

laiguoran 5 年之前
父節點
當前提交
710d28fc32

+ 14 - 0
app/controller/tender_controller.js

@@ -82,6 +82,20 @@ module.exports = app => {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
                     }
+                    if (t.lastStage) {
+                        if (t.lastStage.status === auditConst.stage.status.uncheck || t.lastStage.status === auditConst.stage.status.checkNo) {
+                            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.getStatusName(t.lastStage.id);
+                            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.status_users = status_name ? status_name.name : '';
+                        }
+                    }
                 }
                 renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 renderData.valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);

+ 1 - 0
app/public/js/tender_list.js

@@ -303,6 +303,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     // 审批状态
     html.push('<td>');
     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('</tr>');
     if (node.children) {

+ 17 - 0
app/service/ledger_audit.js

@@ -43,6 +43,23 @@ module.exports = app => {
         }
 
         /**
+         * 获取标段审核人最后一位的名称
+         *
+         * @param {Number} tenderId - 标段id
+         * @param {Number} auditorId - 审核人id
+         * @param {Number} times - 第几次审批
+         * @returns {Promise<*>}
+         */
+        async getStatusName(tenderId) {
+            const sql = 'SELECT pa.`name` ' +
+                'FROM ?? AS la, ?? AS pa ' +
+                'WHERE la.`tender_id` = ?' +
+                '    and la.`audit_id` = pa.`id` and la.`status` != ? ORDER BY la.`id` DESC';
+            const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId, auditConst.status.uncheck];
+            return await this.db.queryOne(sql, sqlParam);
+        }
+
+        /**
          * 获取标段审核列表信息
          *
          * @param {Number} tenderId - 标段id

+ 17 - 0
app/service/stage_audit.js

@@ -65,6 +65,23 @@ module.exports = app => {
         }
 
         /**
+         * 获取标段审核人最后一位的名称
+         *
+         * @param {Number} tenderId - 标段id
+         * @param {Number} auditorId - 审核人id
+         * @param {Number} times - 第几次审批
+         * @returns {Promise<*>}
+         */
+        async getStatusName(stageId) {
+            const sql = 'SELECT pa.`name` ' +
+                'FROM ?? AS sa, ?? AS pa ' +
+                'WHERE sa.`sid` = ?' +
+                '    and sa.`aid` = pa.`id` and sa.`status` != ? ORDER BY sa.`id` DESC';
+            const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, stageId, auditConst.status.uncheck];
+            return await this.db.queryOne(sql, sqlParam);
+        }
+
+        /**
          * 获取 当前审核人
          *
          * @param {Number} stageId - 期id

+ 3 - 1
app/view/profile/sms.ejs

@@ -51,7 +51,9 @@
                             <% const user_smsType = accountData.sms_type !== '' ? JSON.parse(accountData.sms_type) : null; %>
                             <% for (const s in smsType) { %>
                             <div class="form-group row">
-                                <label class="col-auto col-form-label"><%= smsType[s].name %><a href="#sms-view" data-toggle="modal" data-target="#sms-view" class="ml-2"><i class="fa fa-info-circle"></i></a></label>
+                                <label class="col-auto col-form-label"><%= smsType[s].name %>
+                                    <!--<a href="#sms-view" data-toggle="modal" data-target="#sms-view" class="ml-2"><i class="fa fa-info-circle"></i></a>-->
+                                </label>
                                 <div class="col-5">
                                     <% for (const c of smsType[s].children) { %>
                                     <div class="form-check ">