فهرست منبع

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong 5 سال پیش
والد
کامیت
8407236eae
3فایلهای تغییر یافته به همراه250 افزوده شده و 39 حذف شده
  1. 6 0
      app/public/js/ledger_audit.js
  2. 243 39
      app/view/ledger/audit_modal.ejs
  3. 1 0
      app/view/material/audit_modal.ejs

+ 6 - 0
app/public/js/ledger_audit.js

@@ -250,3 +250,9 @@ $(document).ready(() => {
         });
         });
     })('a[name=showLevel]', ledgerSpread.getActiveSheet());
     })('a[name=showLevel]', ledgerSpread.getActiveSheet());
 });
 });
+// texterea换行
+function auditCheck() {
+    const opinion = $('textarea[name="opinion"]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+    $('textarea[name="opinion"]').val(opinion);
+    return true;
+}

+ 243 - 39
app/view/ledger/audit_modal.ejs

@@ -1,31 +1,133 @@
 <% if (tender.ledger_status === auditConst.status.checking && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
 <% if (tender.ledger_status === auditConst.status.checking && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
 <!--审批通过-->
 <!--审批通过-->
 <div class="modal fade" id="sp-done" data-backdrop="static">
 <div class="modal fade" id="sp-done" data-backdrop="static">
-    <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
+    <div class="modal-dialog modal-lg" role="document">
+        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
             <div class="modal-header">
                 <h5 class="modal-title">审批通过</h5>
                 <h5 class="modal-title">审批通过</h5>
             </div>
             </div>
             <div class="modal-body">
             <div class="modal-body">
-                <div class="card mt-3">
-                    <ul class="list-group list-group-flush">
-                        <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
-                        <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
-                            <% if (auditors[i].status !== auditConst.status.uncheck) { %>
-                            <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
-                            <% } %>
-                            <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
-                            <% if (auditors[i].status === auditConst.status.checked) { %>
-                            <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
-                            <% } else if (auditors[i].status === auditConst.status.checking) { %>
-                            <div class="form-group">
-                                <label>审批意见<b class="text-danger">*</b></label>
-                                <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                <div class="row">
+                    <div class="col-4">
+                        <div class="card mt-3">
+                            <ul class="list-group list-group-flush">
+                                <li class="list-group-item">
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %>  <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                </li>
+                                <% for (let i = 0; i < auditors.length; i++) { %>
+                                    <li class="list-group-item">
+                                        <% if (i < auditors.length - 1) { %>
+                                            <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
+                                        <% } else {%>
+                                            <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
+                                        <% } %>
+                                    </li>
+                                <% } %>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="col-8 modal-height-500" style="overflow: auto">
+                        <% for (const ah of auditHistory) { %>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (let iA = 0; iA < ah.length; iA++) { %>
+                                        <% if (iA === 0) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                </div>
+                                            </li>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else if (iA === ah.length - 1) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        <% } %>
+                        <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <li class="list-group-item">
+                                        <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
+                                        <div class="ml-3">
+                                            <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
+                                        </div>
+                                    </li>
+                                    <% for (let iA = 0; iA < auditors.length; iA++) { %>
+                                        <li class="list-group-item">
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span>审批中</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } %>
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                            <% } else if (auditors[iA].status === auditConst.status.checking) { %>
+                                                <div class="form-group">
+                                                    <label>审批意见<b class="text-danger">*</b></label>
+                                                    <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                                                </div>
+                                            <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
                             </div>
                             </div>
-                            <% } %>
-                        </li>
                         <% } %>
                         <% } %>
-                    </ul>
+                    </div>
                 </div>
                 </div>
             </div>
             </div>
             <div class="modal-footer">
             <div class="modal-footer">
@@ -39,32 +141,134 @@
 </div>
 </div>
 <!--审批退回-->
 <!--审批退回-->
 <div class="modal fade" id="sp-back" data-backdrop="static">
 <div class="modal fade" id="sp-back" data-backdrop="static">
-    <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
+    <div class="modal-dialog modal-lg" role="document">
+        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
                 <h5 class="modal-title">审批退回</h5>
             </div>
             </div>
             <div class="modal-body">
             <div class="modal-body">
-                <div class="card mt-3">
-                    <ul class="list-group list-group-flush">
-                        <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
-                        <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
-                            <% if (auditors[i].status !== auditConst.status.uncheck) { %>
-                            <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
-                            <% } %>
-                            <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
-                            <% if (auditors[i].status === auditConst.status.checked) { %>
-                            <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
-                            <% } else if (auditors[i].status === auditConst.status.checking) { %>
-                            <div class="form-group">
-                                <label>审批意见<b class="text-danger">*</b></label>
-                                <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
+                <div class="row">
+                    <div class="col-4">
+                        <div class="card mt-3">
+                            <ul class="list-group list-group-flush">
+                                <li class="list-group-item">
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %>  <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                </li>
+                                <% for (let i = 0; i < auditors.length; i++) { %>
+                                    <li class="list-group-item">
+                                        <% if (i < auditors.length - 1) { %>
+                                            <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
+                                        <% } else {%>
+                                            <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
+                                        <% } %>
+                                    </li>
+                                <% } %>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="col-8 modal-height-500" style="overflow: auto">
+                        <% for (const ah of auditHistory) { %>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (let iA = 0; iA < ah.length; iA++) { %>
+                                        <% if (iA === 0) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                </div>
+                                            </li>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else if (iA === ah.length - 1) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        <% } %>
+                        <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <li class="list-group-item">
+                                        <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
+                                        <div class="ml-3">
+                                            <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
+                                        </div>
+                                    </li>
+                                    <% for (let iA = 0; iA < auditors.length; iA++) { %>
+                                        <li class="list-group-item">
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span>审批中</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } %>
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                            <% } else if (auditors[iA].status === auditConst.status.checking) { %>
+                                                <div class="form-group">
+                                                    <label>审批意见<b class="text-danger">*</b></label>
+                                                    <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
+                                                </div>
+                                                <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
+                                            <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
                             </div>
                             </div>
-                            <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
-                            <% } %>
-                        </li>
                         <% } %>
                         <% } %>
-                    </ul>
+                    </div>
                 </div>
                 </div>
             </div>
             </div>
             <div class="modal-footer">
             <div class="modal-footer">

+ 1 - 0
app/view/material/audit_modal.ejs

@@ -211,6 +211,7 @@
                                         <label>审批意见<b class="text-danger">*</b></label>
                                         <label>审批意见<b class="text-danger">*</b></label>
                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                     </div>
                                     </div>
+                                    <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
                                     <% } %>
                                     <% } %>
                                 </li>
                                 </li>
                                 <% } %>
                                 <% } %>