Parcourir la source

fix: 修复材料、计量审核弹窗数据显示异常的bug

lanjianrong il y a 4 ans
Parent
commit
6433411526
3 fichiers modifiés avec 19 ajouts et 18 suppressions
  1. 2 1
      app/service/stage_audit.js
  2. 16 16
      app/view/material/audit_modal.ejs
  3. 1 1
      app/view/stage/audit_modal.ejs

+ 2 - 1
app/service/stage_audit.js

@@ -478,6 +478,7 @@ module.exports = app => {
         }
 
         async _checkNo(pid, stageId, checkData, times) {
+            console.log('checkData', checkData);
             const time = new Date();
             // 整理当前流程审核人状态更新
             const audit = await this.getDataByCondition({ sid: stageId, times, status: auditConst.status.checking });
@@ -518,7 +519,7 @@ module.exports = app => {
                         content: noticeContent,
                     });
                 });
-                await transaction.insert('zh_notice', records);
+                await transaction.insert(this.ctx.service.noticePush.tableName, records);
 
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);

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

@@ -287,10 +287,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% ctx.material.auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                    <div class="text-center text-muted"
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -422,11 +426,7 @@
                                         <% }) %>
                                     </ul>
                                 </div>
-                                <!-- 展开/收起历史流程 -->
-                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
-                                <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
-                                        data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
-                                <% } %>
+
                                 <% }) %>
                             </div>
                         </div>
@@ -479,10 +479,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% ctx.material.auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                    <div class="text-center text-muted"
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -657,11 +661,7 @@
                                         <% }) %>
                                     </ul>
                                 </div>
-                                <!-- 展开/收起历史流程 -->
-                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
-                                <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
-                                        data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
-                                <% } %>
+
                                 <% }) %>
                             </div>
                         </div>

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

@@ -853,7 +853,7 @@
         function auditCheck(i) {
             const checkType = parseInt($(i === 0 ? '[name=checkType]' : '[name=checkType]:checked').val())
             const data = {
-                opinion: $('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+                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) {