Explorar el Código

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang hace 1 año
padre
commit
d4e5999e03

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

@@ -77,10 +77,6 @@ $(document).ready(function () {
         return false
     });
 
-    $('#hideSp').click(function () {
-        $('#sub-sp2').modal('hide');
-    });
-
     // 添加到审批流程中
     $('dl').on('click', 'dd', function () {
         const id = parseInt($(this).data('id'));

+ 1 - 1
app/router.js

@@ -558,7 +558,7 @@ module.exports = app => {
     app.post('/tender/:id/change/:cid/information/audit/delete', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.deleteAudit');
     app.post('/tender/:id/change/:cid/information/audit/spgroup', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.changeSpGroup');
     app.post('/tender/:id/change/cancel/audit', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.checkAuditCancel');
-    app.post('/tender/:id/change/:cid/information/audit/save', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.saveAudit');
+    app.post('/tender/:id/change/:cid/information/audit/save', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, changeAuditCheck, 'changeController.saveAudit');
     // 变更新增部位页
     app.get('/tender/:id/change/:cid/information/revise', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.reviseInfo');
     app.post('/tender/:id/change/:cid/information/revise/update', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.updateRevise');

+ 3 - 2
app/service/change_audit.js

@@ -1270,7 +1270,7 @@ module.exports = app => {
             return auditor;
         }
 
-        async saveAudit(cid, times, data) {
+        async saveAudit(cid, times, sp_group, data) {
             const transaction = await this.db.beginTransaction();
             try {
                 const auditors = await this.getAuditGroupByList(cid, times);
@@ -1349,7 +1349,7 @@ module.exports = app => {
                     newAuditors.shift();
                     const newAuditorGroup = this.ctx.helper.groupAuditors(newAuditors, 'usort');
                     const uniqNewAuditorGroup = this.ctx.helper.groupAuditorsUniq(newAuditorGroup);
-                    await this.ctx.service.shenpiAudit.updateAuditListWithAuditType(transaction, this.ctx.tender.id, this.ctx.tender.info.shenpi.change, shenpiConst.sp_type.change, uniqNewAuditorGroup);
+                    await this.ctx.service.shenpiAudit.updateAuditListWithAuditType(transaction, this.ctx.tender.id, this.ctx.tender.info.shenpi.change, shenpiConst.sp_type.change, uniqNewAuditorGroup, sp_group);
                 } else if (this.ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs) {
                     const newAuditors = await this.getListGroupByWithoutYB(cid, times, transaction);
                     await this.ctx.service.shenpiAudit.updateAuditList(transaction, this.ctx.tender.id, this.ctx.tender.info.shenpi.change, shenpiConst.sp_type.change, this._.map(newAuditors, 'uid'));
@@ -1357,6 +1357,7 @@ module.exports = app => {
                 // 更新到审批流程方法
                 await transaction.commit();
             } catch (err) {
+                console.log(err);
                 await transaction.rollback();
                 throw err;
             }

+ 9 - 7
app/view/change/information_modal.ejs

@@ -255,11 +255,9 @@
                     <div class="row">
                         <div class="col-4">
                             <% if((ctx.change.status === auditConst.status.checkNo || ctx.change.status === auditConst.status.revise) && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
-                                <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp"
-                                   id="hideSp">修改审批流程</a>
+                                <a class="sp-list-item hideSp" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
                             <% } else if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
-                                <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
-                                   id="hideSp">修改审批流程</a>
+                                <a class="sp-list-item hideSp" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
                             <% } %>
                             <div class="card modal-height-500 mt-3" style="overflow: auto">
                                 <ul class="list-group list-group-flush auditors-list" id="auditors-list">
@@ -414,7 +412,7 @@
                     <div class="row">
                         <div class="col-4">
                             <% if(change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
-                                <a href="#sub-sp2" data-toggle="modal" data-category="" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
+                                <a class="sp-list-item hideSp" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
                             <% } %>
                             <div class="card modal-height-500 mt-3" style="overflow: auto">
                                 <ul class="list-group list-group-flush auditors-list">
@@ -584,7 +582,7 @@
                     <div class="row">
                         <div class="col-4">
                             <% if(change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
-                                <a href="#sub-sp2" data-toggle="modal" data-category="" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
+                                <a class="sp-list-item hideSp" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
                             <% } %>
                             <div class="card modal-height-500 mt-3" style="overflow: auto">
                                 <ul class="list-group list-group-flush auditors-list">
@@ -1170,12 +1168,16 @@
     }
 
     // 退回选择修改审批人流程
-    $('#hideSp').click(function () {
+    $('.hideSp').click(function () {
         $('#sp-list').modal('hide');
         $('#sp-done').modal('hide');
         $('#sp-back').modal('hide');
     });
 
+    $('a[f-target]').click(function () {
+        $($(this).attr('f-target')).modal('show');
+    });
+
     // 展开历史审核记录
     $('.modal-body #fold-btn').click(function () {
         const type = $(this).data('target')