Преглед на файлове

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

MaiXinRong преди 5 години
родител
ревизия
a4cbd3b1b1

+ 14 - 0
app/controller/change_controller.js

@@ -308,11 +308,18 @@ module.exports = app => {
                         const auditList3 = [];
                         for (let time = 1; time <= change.times; time++) {
                             const auditTimeList = [];
+                            let max_sort = 1;
                             for (const al of auditList2) {
                                 if (al.times === time) {
                                     auditTimeList.push(al);
+                                    if (al.usite > max_sort) {
+                                        max_sort = al.usite;
+                                    }
                                 }
                             }
+                            for (const i in auditTimeList) {
+                                auditTimeList[i].max_sort = max_sort;
+                            }
                             auditList3.push(auditTimeList);
                         }
                         renderData.auditList3 = auditList3;
@@ -359,11 +366,18 @@ module.exports = app => {
                     const auditList3 = [];
                     for (let time = 1; time <= change.times; time++) {
                         const auditTimeList = [];
+                        let max_sort = 1;
                         for (const al of auditList) {
                             if (al.times === time) {
                                 auditTimeList.push(al);
+                                if (al.usite > max_sort) {
+                                    max_sort = al.usite;
+                                }
                             }
                         }
+                        for (const i in auditTimeList) {
+                            auditTimeList[i].max_sort = max_sort;
+                        }
                         auditList3.push(auditTimeList);
                     }
                     renderData.auditList3 = auditList3;

+ 4 - 0
app/public/js/change_approval.js

@@ -74,6 +74,8 @@ $(document).ready(() => {
 
             if(returnflag) {
                 $('input[name="w_code"]').val($('#w_code').val());
+                sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+                $('#success-approval').find('textarea').val(sdesc);
                 $('#success-approval').submit();
             }
         } else {
@@ -88,6 +90,8 @@ $(document).ready(() => {
                 returnflag = false;
             }
             if(returnflag) {
+                sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+                $('#fail-approval').find('textarea').val(sdesc);
                 $('input[name="w_code"]').val($('#w_code').val());
                 $('#fail-approval').submit();
             }

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

@@ -156,3 +156,9 @@ function checkAuditorFrom () {
     }
     $('#hide-all').show();
 }
+// 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;
+}

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

@@ -156,3 +156,9 @@ function checkAuditorFrom () {
     }
     $('#hide-all').show();
 }
+// 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;
+}

+ 2 - 2
app/view/change/info_modal.ejs

@@ -281,7 +281,7 @@
                                                     <% } else if (al.status === 5 || al.status === 6) { %>
                                                         <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-warning"></i>
                                                     <% } %>
-                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
+                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (al.usite === 0 && al.status === 2) { %>
@@ -371,7 +371,7 @@
                                         <% } else if (al.status === 7) { %>
                                         <i class="fa fa-chevron-circle-down text-warning"></i>
                                         <% } %>
-                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(aindex) + '审')  %></span>
+                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审')  %></span>
                                     </h5>
                                     <div class="ml-3">
                                         <% if (al.usite === 0 && al.status === 2) { %>

+ 2 - 2
app/view/material/audit_modal.ejs

@@ -55,7 +55,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
     <div class="modal-dialog modal-lg" role="document">
-        <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+        <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批通过</h5>
             </div>
@@ -143,7 +143,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
     <div class="modal-dialog modal-lg" role="document">
-        <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post">
+        <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
             </div>

+ 4 - 4
app/view/stage/audit_modal.ejs

@@ -78,7 +78,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批通过</h5>
                     </div>
@@ -179,7 +179,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批退回</h5>
                     </div>
@@ -987,7 +987,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批通过</h5>
                     </div>
@@ -1088,7 +1088,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批退回</h5>
                     </div>