Browse Source

1. 计量台账,改版导致的上报、审批通过、审批退回自检功能丢失
2. 台账修订,右侧错误列表,检查错误拖动刷新问题

MaiXinRong 4 years ago
parent
commit
017b3ee84f
3 changed files with 55 additions and 102 deletions
  1. 9 0
      app/public/js/revise.js
  2. 16 9
      app/public/js/stage.js
  3. 30 93
      app/view/stage/audit_modal.ejs

+ 9 - 0
app/public/js/revise.js

@@ -2231,6 +2231,12 @@ $(document).ready(() => {
             if (searchLedger) {
                 searchLedger.spread.refresh();
             }
+            if (errorList) {
+                errorList.spread.refresh();
+            }
+            if (checkList) {
+                checkList.spread.refresh();
+            }
         }
     });
     $.subMenu({
@@ -2266,6 +2272,9 @@ $(document).ready(() => {
             if (searchLedger) {
                 searchLedger.spread.refresh();
             }
+            if (errorList) {
+                errorList.spread.refresh();
+            }
             if (checkList) {
                 checkList.spread.refresh();
             }

+ 16 - 9
app/public/js/stage.js

@@ -3353,22 +3353,29 @@ $(document).ready(() => {
         return false;
     });
     $('#audit-check0').submit(function (e) {
-        $(this).parent().parent().modal('hide');
+        const checkType = parseInt($('[name=checkType]').val());
         const data = {
-            opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-            checkType: parseInt($('[name=checkType]', this).val()),
+            opinion: $(`${'#sp-done'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+            checkType,
         };
-        dataChecker.checkAndPost(this.action, data);
+        $('#sp-done').modal('hide');
+        checkType && dataChecker.checkAndPost(this.action, data);
         $('#hide-all').hide();
         return false;
     });
-    $('#audit-check2').submit(function (e) {
-        $(this).parent().parent().modal('hide');
+    $('#audit-check1').submit(function (e) {
+        const checkType = parseInt($('[name=checkType]:checked').val());
         const data = {
-            opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-            checkType: parseInt($('[name=checkType]', this).val()),
+            opinion: $(`${'#sp-back'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+            checkType,
         };
-        dataChecker.checkAndPost(this.action, data);
+        if ($('#warning-text').length) $('#warning-text').remove()
+        if (!checkType && !$('#warning-text').length) {
+            $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
+            return false
+        }
+        $('#sp-back').modal('hide');
+        checkType && dataChecker.checkAndPost(this.action, data);
         $('#hide-all').hide();
         return false;
     });

+ 30 - 93
app/view/stage/audit_modal.ejs

@@ -52,8 +52,7 @@
                         </div>
                     </div>
                 </div>
-                <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" name="stage-start"
-                    onsubmit="return checkAuditorFrom()">
+                <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" name="stage-start">
                     <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
                     <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
                     <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
@@ -241,8 +240,7 @@
                         </div>
                     </div>
                 </div>
-                <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" name="stage-start"
-                    onsubmit="return checkAuditorFrom()">
+                <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" name="stage-start">
                     <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
                     <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
                     <% if(ctx.stage.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.stage.user_id) { %>
@@ -258,7 +256,7 @@
     <!--审批通过-->
     <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
         <div class="modal-dialog modal-lg" role="document">
-            <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
+            <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" id="audit-check0">
                 <div class="modal-header">
                     <h5 class="modal-title">审批通过</h5>
                 </div>
@@ -449,8 +447,7 @@
     <!--审批退回-->
     <div class="modal fade sp-location-list" 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"
-                onsubmit="return auditCheck(1);">
+            <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" id="audit-check1">
                 <div class="modal-header">
                     <h5 class="modal-title">审批退回</h5>
                 </div>
@@ -819,94 +816,34 @@
             }
             return false;
         });
-    // $('#audit-check0').submit(function (e) {
-    //     $(this).parent().parent().modal('hide');
-    //     const data = {
-    //         opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-    //         checkType: parseInt($('[name=checkType]', this).val()),
-    //     };
-    //     dataChecker.checkAndPost(this.action, data);
-    //     $('#hide-all').hide();
-    //     return false;
-    // });
-    // $('#audit-check2').submit(function (e) {
-    //     $(this).parent().parent().modal('hide');
-    //     const data = {
-    //         opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-    //         checkType: parseInt($('[name=checkType]', this).val()),
-    //     };
-    //     dataChecker.checkAndPost(this.action, data);
-    //     $('#hide-all').hide();
-    //     return false;
-    // });
-    <% } %>
-        // 审批通过
-        // $('#audit-check1').submit(function (e) {
-        //     const data = {
-        //         opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-        //         checkType: parseInt($('[name=checkType]', this).val()),
-        //     };
-        //     postData(this.action, data, function () {
-        //         window.location.reload();
-        //     })
-        //     return false
-        // });
-        // 审批
-        function auditCheck(i) {
-            const checkType = parseInt($(i === 0 ? '[name=checkType]' : '[name=checkType]:checked').val())
-            const data = {
-                opinion: $(`${i === 0 ? '#sp-done' : '#sp-back'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-                checkType,
-            }
-            if (i === 1) {
-                if ($('#warning-text').length) $('#warning-text').remove()
-                if (!checkType && !$('#warning-text').length) {
-                    $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
-                    return false
-                }
-            }
-            checkType && postData(preUrl + '/audit/check', data, function () {
-                window.location.reload();
-            })
+    $('#audit-check0').submit(function (e) {
+        const checkType = parseInt($('[name=checkType]').val());
+        const data = {
+            opinion: $(`${'#sp-done'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+            checkType,
+        };
+        $('#sp-done').modal('hide');
+        checkType && dataChecker.checkAndPost(this.action, data);
+        $('#hide-all').hide();
+        return false;
+    });
+    $('#audit-check1').submit(function (e) {
+        const checkType = parseInt($('[name=checkType]:checked').val());
+        const data = {
+            opinion: $(`${'#sp-back'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+            checkType,
+        };
+        if ($('#warning-text').length) $('#warning-text').remove()
+        if (!checkType && !$('#warning-text').length) {
+            $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
             return false
         }
-    // $('#audit-check2').submit(function (e) {
-    //     debugger
-    //     // $(this).parent().parent().modal('hide');
-    //     const data = {
-    //         opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-    //         checkType: parseInt($('[name=checkType]:checked', this).val()),
-    //     };
-    //     if (!$('[name=checkType]:checked', this).val()) {
-    //         if (!$('#warning-text').length) {
-    //             $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
-    //         }
-    //         return false
-    //     } else {
-    //         postData(this.action, data, function () {
-    //             window.location.reload();
-    //         })
-    //     }
-    //     return false
-    // });
-    // $('#audit-check3').submit(function (e) {
-    //     // $(this).parent().parent().modal('hide');
-    //     const data = {
-    //         opinion: $('[name=opinion]', this).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
-    //         checkType: parseInt($('[name=checkType]:checked', this).val()),
-    //     };
-    //     if (!parseInt($('[name=checkType]:checked', this).val())) {
-    //         if (!$('#warning-text').length) {
-    //             $('.reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
-    //         }
-    //         return false;
-    //     } else {
-    //         postData(this.action, data, function () {
-    //         window.location.reload();
-    //     });
-    //     }
-    //     return false
-    // });
+        $('#sp-back').modal('hide');
+        checkType && dataChecker.checkAndPost(this.action, data);
+        $('#hide-all').hide();
+        return false;
+    });
+    <% } %>
 
     $('.sp-location-list').on('shown.bs.modal', function () {
         const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');