Selaa lähdekoodia

台账修订,移除审批人相关

MaiXinRong 11 kuukautta sitten
vanhempi
commit
902c2602ca

+ 1 - 2
app/controller/ledger_audit_controller.js

@@ -63,8 +63,7 @@ module.exports = app => {
                     throw '添加审核人失败';
                 }
 
-                // responseData.data = await ctx.service.ledgerAudit.getAuditor(ctx.tender.id, id, ctx.tender.data.ledger_times);
-                responseData.data = await ctx.service.ledgerAudit.getAuditorsWithOwner(ctx.tender.id, ctx.tender.data.ledger_times);
+                responseData.data = await ctx.service.ledgerAudit.getUserGroup(ctx.tender.id, ctx.tender.data.ledger_times);
             } catch (err) {
                 responseData.err = 1;
                 responseData.msg = err.toString();

+ 1 - 1
app/controller/revise_controller.js

@@ -755,7 +755,7 @@ module.exports = app => {
                 const result = await ctx.service.reviseAudit.addAuditor(revise, id, is_gdzs);
                 if (!result) throw '添加审核人失败';
 
-                const resultData = await ctx.service.reviseAudit.getAuditorsWithOwner(revise.id, revise.times);
+                const resultData = await ctx.service.reviseAudit.getUserGroup(revise.id, revise.times);
                 ctx.body = { err: 0, msg: '', data: resultData };
             } catch (err) {
                 this.log(err, '数据错误');

+ 37 - 33
app/public/js/ledger.js

@@ -4151,42 +4151,46 @@ $(document).ready(function() {
 
     // 添加到审批流程中
     $('#book-list').on('click', 'dd', function () {
-        const auditorId = parseInt($(this).data('id'))
-        if (auditorId) {
-            postData('/tender/' + getTenderId() + '/ledger/audit/add', { auditorId }, (datas) => {
-                const html = [];
-                // 如果是重新上报,添加到重新上报列表中
-                const auditorshtml = [];
-                for (const [index,data] of datas.entries()) {
-                    if (index !== 0) {
-                        html.push('<li class="list-group-item" auditorId="' + data.audit_id + '">');
-                        if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
-                            html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
-                        }
-                        html.push('<span>');
-                        html.push(data.audit_order + ' ');
-                        html.push(data.name + ' ');
-                        html.push('</span>');
-                        html.push('<small class="text-muted">');
-                        html.push(data.role);
-                        html.push('</small></li>');
+        const auditorId = parseInt($(this).data('id'));
+        if (!auditorId) return;
+
+        postData('/tender/' + getTenderId() + '/ledger/audit/add', { auditorId }, (datas) => {
+            const html = [];
+            // 如果是重新上报,添加到重新上报列表中
+            const auditorshtml = [];
+            for (const [index,data] of datas.entries()) {
+                if (index !== 0) {
+                    html.push('<li class="list-group-item d-flex" auditorId="'+ data[0].audit_id +'">');
+                    html.push(`<div class="col-auto">${index}</div>`);
+                    html.push('<div class="col">');
+                    for (const auditor of data) {
+                        html.push(`<div class="d-inline-block mx-1"><i class="fa fa-user text-muted"></i> ${auditor.name} <small class="text-muted">${auditor.role}</small></div>`);
                     }
-                    auditorshtml.push('<li class="list-group-item" ' + (index !== 0 ? 'data-auditorid="' + data.audit_id + '"' : '') + '>');
-                    auditorshtml.push('<i class="fa ' + (index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i> ');
-                    auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
-                    if (index === 0) {
-                        auditorshtml.push('<span class="pull-right">原报</span>');
-                    } else if (index+1 === datas.length) {
-                        auditorshtml.push('<span class="pull-right">终审</span>');
-                    } else {
-                        auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
+                    html.push('</div>');
+                    html.push('<div class="col-auto">');
+                    // todo 添加会签或签时
+                    // html.push('<span class="badge badge-pill badge-primary badge-bg-small"><small></small></span>');
+                    if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
+                        html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
                     }
-                    auditorshtml.push('</li>');
+                    html.push('</div>');
+                    html.push('</li>');
                 }
-                $('#auditors').html(html.join(''));
-                $('#auditors-list').html(auditorshtml.join(''));
-            });
-        }
+                auditorshtml.push('<li class="list-group-item" data-auditorid="' + data.audit_id + '">');
+                auditorshtml.push('<i class="fa ' + (index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i> ');
+                auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                if (index === 0) {
+                    auditorshtml.push('<span class="pull-right">原报</span>');
+                } else if (index+1 === datas.length) {
+                    auditorshtml.push('<span class="pull-right">终审</span>');
+                } else {
+                    auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
+                }
+                auditorshtml.push('</li>');
+            }
+            $('#auditors').html(html.join(''));
+            $('#auditors-list').html(auditorshtml.join(''));
+        });
     });
     $('body').on('click', '#auditors li>div>a', function () {
         const li = $(this).parent().parent();

+ 1 - 1
app/service/ledger_revise.js

@@ -157,7 +157,7 @@ module.exports = app => {
                     tender_id: this.ctx.tender.id,
                     rid: rid,
                     in_time: inTime,
-                    audit_order: newAuditors.length + 1,
+                    audit_order: a.audit_order,
                     audit_id: a.audit_id,
                     audit_type: a.audit_type,
                     audit_ledger_id: a.audit_ledger_id,

+ 39 - 35
app/view/revise/info_modal.ejs

@@ -730,46 +730,50 @@
         });
 
         $('dl').on('click', 'dd', function () {
-            const auditorId = parseInt($(this).data('id'))
-            if (auditorId) {
-                postData('/tender/<%- ctx.tender.id %>/revise/audit/add', { auditorId }, (datas) => {
-                    const html = [];
-                    // 如果是重新上报,添加到重新上报列表中
-                    const auditorshtml = [];
-                    for (const [index,data] of datas.entries()) {
-                        if (index !== 0) {
-                            html.push('<li class="list-group-item" auditorId="' + data.audit_id + '">');
-                            if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
-                                html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
-                            }
-                            html.push('<span>');
-                            html.push(data.audit_order + ' ');
-                            html.push(data.name + ' ');
-                            html.push('</span>');
-                            html.push('<small class="text-muted">');
-                            html.push(data.role);
-                            html.push('</small></li>');
+            const auditorId = parseInt($(this).data('id'));
+            if (!auditorId) return;
+
+            postData('/tender/<%- ctx.tender.id %>/revise/audit/add', { auditorId }, (datas) => {
+                const html = [];
+                // 如果是重新上报,添加到重新上报列表中
+                const auditorshtml = [];
+                for (const [index,data] of datas.entries()) {
+                    if (index !== 0) {
+                        html.push('<li class="list-group-item d-flex" auditorId="'+ data[0].audit_id +'">');
+                        html.push(`<div class="col-auto">${index}</div>`);
+                        html.push('<div class="col">');
+                        for (const auditor of data) {
+                            html.push(`<div class="d-inline-block mx-1"><i class="fa fa-user text-muted"></i> ${auditor.name} <small class="text-muted">${auditor.role}</small></div>`);
                         }
-                        auditorshtml.push('<li class="list-group-item" ' + (index !== 0 ? 'data-auditorid="' + data.audit_id + '"' : '') + '>');
-                        auditorshtml.push('<i class="fa ' + (index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i> ');
-                        auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
-                        if (index === 0) {
-                            auditorshtml.push('<span class="pull-right">原报</span>');
-                        } else if (index+1 === datas.length) {
-                            auditorshtml.push('<span class="pull-right">终审</span>');
-                        } else {
-                            auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
+                        html.push('</div>');
+                        html.push('<div class="col-auto">');
+                        // todo 添加会签或签时
+                        // html.push('<span class="badge badge-pill badge-primary badge-bg-small"><small></small></span>');
+                        if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
+                            html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
                         }
-                        auditorshtml.push('</li>');
+                        html.push('</div>');
+                        html.push('</li>');
                     }
-                    $('#auditors').html(html.join(''));
-                    $('#auditors-list').html(auditorshtml.join(''));
-                });
-            }
+                    auditorshtml.push('<li class="list-group-item" data-auditorid="' + data.audit_id + '">');
+                    auditorshtml.push('<i class="fa ' + (index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i> ');
+                    auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                    if (index === 0) {
+                        auditorshtml.push('<span class="pull-right">原报</span>');
+                    } else if (index+1 === datas.length) {
+                        auditorshtml.push('<span class="pull-right">终审</span>');
+                    } else {
+                        auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
+                    }
+                    auditorshtml.push('</li>');
+                }
+                $('#auditors').html(html.join(''));
+                $('#auditors-list').html(auditorshtml.join(''));
+            });
         });
 
-        $('body').on('click', '#auditors li>a', function () {
-            const li = $(this).parent();
+        $('body').on('click', '#auditors li>div>a', function () {
+            const li = $(this).parent().parent();
             const data = {
                 auditorId: parseInt(li.attr('auditorId')),
             };