浏览代码

1. 审批流程常数冲突:台账、期 -- 审批流程调整
2. 待办事项,提示待审核期
3. 期:审批退回

MaiXinRong 6 年之前
父节点
当前提交
910009ba68

+ 60 - 6
app/const/audit.js

@@ -7,6 +7,64 @@
  * @date
  * @version
  */
+// 台账审批流程
+const ledger = (function () {
+    const status = {
+        uncheck: 1, // 待上报
+        checking: 2, // 待审批|审批中
+        checked: 3, // 审批通过
+        checkNo: 4, // 审批退回
+    };
+
+    const statusString = [];
+    statusString[status.uncheck] = '';
+    statusString[status.checking] = '审批中';
+    statusString[status.checked] = '审批完成';
+    statusString[status.checkNo] = '审批退回';
+
+    const statusClass = [];
+    statusClass[status.uncheck] = '';
+    statusClass[status.checking] = '';
+    statusClass[status.checked] = 'text-success';
+    statusClass[status.checkNo] = 'text-warning';
+    return { status, statusString, statusClass }
+})();
+
+// 期审批流程
+const stage = (function () {
+    // 流程状态
+    const status = {
+        uncheck: 1, // 待上报
+        checking: 2, // 待审批|审批中
+        checked: 3, // 审批通过
+        checkNo: 4, // 审批退回原报
+        checkNoPre: 5, // 审批退回上一人
+    };
+
+    // 流程状态提示
+    const statusString = [];
+    statusString[status.uncheck] = '待上报';
+    statusString[status.checking] = '审批中';
+    statusString[status.checked] = '审批完成';
+    statusString[status.checkNo] = '审批退回';
+    statusString[status.checkNoPre] = '审批退回';
+
+    // 流程状态样式
+    const statusClass = [];
+    statusClass[status.uncheck] = '';
+    statusClass[status.checking] = '';
+    statusClass[status.checked] = 'text-success';
+    statusClass[status.checkNo] = 'text-warning';
+    statusClass[status.checkNoPre] = 'text-warning';
+
+    const backType = {
+        org: 1,
+        pre: 2,
+    };
+    return { status, statusString, statusClass, backType }
+})();
+
+
 // 变更令状态
 const status = {
     uncheck: 1,     // 待上报
@@ -48,11 +106,6 @@ statusClass[status.checkNo] = 'text-danger';
 statusClass[status.back] = 'text-warning';
 statusClass[status.backnew] = 'text-warning';
 
-const backType = {
-    org: 1,
-    pre: 2,
-};
-
 /* ------------------------------------------------------- */
 
 // 变更令审批人状态
@@ -100,13 +153,14 @@ filter.statusString[filter.status.checked] = '已完成';
 filter.statusString[filter.status.checkNo] = '终止';
 
 module.exports = {
+    ledger,
+    stage,
     flow: {
         status,
         statusString,
         statusButton,
         statusButtonClass,
         statusClass,
-        backType,
         auditStatus,
         auditStatusString,
         auditStatusClass,

+ 6 - 0
app/controller/dashboard_controller.js

@@ -8,6 +8,8 @@
  * @version
  */
 
+const auditConst = require('../const/audit');
+
 module.exports = app => {
 
     class DashboardController extends app.BaseController {
@@ -20,8 +22,12 @@ module.exports = app => {
          */
         async index(ctx) {
             const auditTenders = await ctx.service.ledgerAudit.getAuditTender(ctx.session.sessionUser.accountId);
+            const auditStages = await ctx.service.stageAudit.getAuditStage(ctx.session.sessionUser.accountId);
             const renderData = {
                 auditTenders,
+                auditStages,
+                acLedger: auditConst.ledger,
+                acStage: auditConst.stage,
             };
             await this.layout('dashboard/index.ejs', renderData);
         }

+ 1 - 1
app/controller/ledger_controller.js

@@ -13,7 +13,7 @@ const stdDataAddType = {
     child: 2,
     next: 3,
 };
-const auditConst = require('../const/audit').flow;
+const auditConst = require('../const/audit').ledger;
 const tenderMenu = require('../../config/menu').tenderMenu;
 const measureType = require('../const/tender').measureType;
 const spreadConst = require('../const/spread');

+ 17 - 15
app/controller/stage_controller.js

@@ -9,7 +9,7 @@
  */
 
 const moment = require('moment');
-const auditConst = require('../const/audit');
+const auditConst = require('../const/audit').stage;
 const spreadConst = require('../const/spread');
 const tenderConst = require('../const/tender');
 const payConst = require('../const/deal_pay.js');
@@ -42,7 +42,7 @@ module.exports = app => {
             const data = {
                 tender: ctx.tender.data,
                 tenderMenu: JSON.parse(JSON.stringify(this.menu.stageMenu)),
-                auditConst: auditConst.flow,
+                auditConst,
                 measureType,
                 preUrl: '/tender/' + ctx.tender.id + '/measure/stage/' + ctx.params.order,
                 stage: ctx.stage,
@@ -52,7 +52,7 @@ module.exports = app => {
         }
 
         _stageReadOnly(stage) {
-            return stage.status === auditConst.flow.status.checked;
+            return stage.status === auditConst.status.checked;
         }
 
         /**
@@ -110,6 +110,7 @@ module.exports = app => {
             });
             ctx.stage.auditors = await ctx.service.stageAudit.getAuditors(ctx.stage.id, ctx.stage.times);
             ctx.stage.curAuditor = await ctx.service.stageAudit.getCurAuditor(ctx.stage.id, ctx.stage.times);
+            console.log(ctx.stage.curAuditor);
             ctx.stage.user = await ctx.service.projectAccount.getAccountInfoById(ctx.stage.user_id);
             ctx.stage.auditHistory = [];
             if (ctx.stage.times > 1) {
@@ -176,7 +177,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 } else {
@@ -226,7 +227,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 }
@@ -284,7 +285,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 }
@@ -309,7 +310,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 } else {
@@ -356,7 +357,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 } else {
@@ -404,7 +405,7 @@ module.exports = app => {
                 if (dealPay && dealPay.length > 0) {
                     renderData.dealPay = dealPay;
                 } else {
-                    await ctx.service.pay.addDefaultPayData();
+                    await ctx.service.pay.addDefaultPayData(this.ctx.tender.id);
                     await ctx.service.stagePay.addInitialStageData(ctx.stage);
                     renderData.dealPay = await ctx.service.stagePay.getStagePays(ctx.stage);
                 }
@@ -431,7 +432,7 @@ module.exports = app => {
                 await this._getStage(ctx);
                 // 检查登录用户,是否可操作
                 if (ctx.session.sessionUser.accountId === ctx.stage.user_id) {
-                    if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                    if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                         throw '该计量期当前您无权操作';
                     }
                 } else {
@@ -582,7 +583,7 @@ module.exports = app => {
                 if (ctx.stage.user_id !== ctx.session.sessionUser.accountId) {
                     throw '您无权添加审核人';
                 }
-                if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                     throw '当前不允许添加审核人';
                 }
                 // 检查审核人是否已存在
@@ -644,7 +645,7 @@ module.exports = app => {
                 if (ctx.stage.user_id !== ctx.session.sessionUser.accountId) {
                     throw '您无权上报该期数据';
                 }
-                if (ctx.stage.status === auditConst.flow.status.checking || ctx.stage.status === auditConst.flow.status.checked) {
+                if (ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checked) {
                     throw '该期数据当前无法上报';
                 }
 
@@ -665,7 +666,7 @@ module.exports = app => {
         async checkAudit(ctx) {
             try {
                 await this._getStage(ctx);
-                if (!this.ctx.stage || this.ctx.stage.status !== auditConst.flow.status.checking) {
+                if (!this.ctx.stage || this.ctx.stage.status !== auditConst.status.checking) {
                     throw '当前期数据有误';
                 }
                 if (!this.ctx.stage.curAuditor || this.ctx.stage.curAuditor.aid !== ctx.session.sessionUser.accountId) {
@@ -673,22 +674,23 @@ module.exports = app => {
                 }
                 const data = {
                     checkType: parseInt(ctx.request.body.checkType),
-                    backType: parseInt(ctx.request.body.backType),
                     opinion: ctx.request.body.opinion,
                 };
                 if (!data.checkType || isNaN(data.checkType)) {
                     throw '提交数据错误';
                 }
-                if (data.checkType === auditConst.flow.status.checkNo) {
+                if (data.checkType === auditConst.status.checkNo) {
                     if (!data.backType || isNaN(data.backType)) {
                         throw '提交数据错误';
                     }
                 }
 
                 await ctx.service.stageAudit.check(ctx.stage.id, data, ctx.stage.times);
+                console.log('success');
 
                 ctx.redirect(ctx.request.header.referer);
             } catch (err) {
+                console.log(err);
                 this.log(err);
                 ctx.session.postError = err.toString();
                 ctx.redirect(ctx.request.header.referer);

+ 1 - 1
app/controller/tender_controller.js

@@ -12,7 +12,7 @@ const tenderConst = require('../const/tender');
 const codeRuleConst = require('../const/code_rule');
 const settingConst = require('../const/setting.js');
 const tenderMenu = require('../../config/menu').tenderMenu;
-const auditConst = require('../const/audit').flow;
+const auditConst = require('../const/audit');
 const accountPermission = require('../const/account_permission');
 
 module.exports = app => {

+ 3 - 0
app/lib/pay_calc.js

@@ -123,6 +123,9 @@ class PayCalculate {
         const yfPay = pays.find(function (p) {
             return p.ptype === payType.yf;
         });
+        if (!yfPay) {
+            throw '合同支付数据错误';
+        }
         yfPay.tp = 0;
         for (const p of pays) {
             if (p.ptype === payType.normal || p.ptype === payType.wc) {

+ 1 - 1
app/public/js/tender_list_manage.js

@@ -255,7 +255,7 @@ function recursiveGetTenderNodeHtml (node, arr) {
     html.push('<td tid="' + node.id + '">');
     if (!node.cid) {
         html.push('<a href="#javascript: void(0)" name="edit" class="btn btn-outline-primary btn-sm">编辑</a>');
-        if (node.ledger_status === auditConst.status.uncheck) {
+        if (node.ledger_status === auditConst.ledger.status.uncheck) {
             html.push('<a href="javascript: void(0)" name="del" class="btn btn-outline-danger btn-sm">删除</a>');
         }
     }

+ 1 - 1
app/service/ledger_audit.js

@@ -8,7 +8,7 @@
  * @version
  */
 
-const auditConst = require('../const/audit').flow;
+const auditConst = require('../const/audit').ledger;
 
 module.exports = app => {
     class LedgerAudit extends app.BaseService {

+ 5 - 6
app/service/pay.js

@@ -28,14 +28,13 @@ module.exports = app => {
          * @param transaction
          * @returns {Promise<boolean>}
          */
-        async addDefaultPayData(transaction) {
-            if (!this.ctx.tender) { return false; }
+        async addDefaultPayData(tid, transaction) {
             const pays = JSON.parse(JSON.stringify(payConst.payTemplate));
             for (const p of pays) {
-                p.tid = this.ctx.tender.id;
-                p.csid = 0; //this.ctx.stage.id;
-                p.cstimes = 0; //this.ctx.stage.times;
-                p.csorder = 0; //this.ctx.stage.order;
+                p.tid = tid;
+                p.csid = 0;
+                p.cstimes = 0;
+                p.csorder = 0;
                 p.csaorder = 0;
             }
             let result;

+ 2 - 1
app/service/stage.js

@@ -67,8 +67,9 @@ module.exports = app => {
             try {
                 // 新增期记录
                 const result = await transaction.insert(this.tableName, newStage);
+                console.log(result);
                 if (result.affectedRows === 1) {
-                    newStage.id = result.insertedId;
+                    newStage.id = result.insertId;
                 } else {
                     throw '新增期数据失败';
                 }

+ 49 - 15
app/service/stage_audit.js

@@ -8,7 +8,7 @@
  * @version
  */
 
-const auditConst = require('../const/audit').flow;
+const auditConst = require('../const/audit').stage;
 
 module.exports = app => {
     class StageAudit extends app.BaseService {
@@ -68,6 +68,7 @@ module.exports = app => {
                 'WHERE la.`sid` = ? and la.`status` = ? and la.`times` = ?' +
                 '    and la.`aid` = pa.`id`';
             const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, stageId, auditConst.status.checking, times];
+            console.log(this.db.format(sql, sqlParam));
             return await this.db.queryOne(sql, sqlParam);
         }
 
@@ -204,8 +205,7 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async check(stageId, checkData, times = 1) {
-            console.log('check');
-            if (checkType !== auditConst.status.checked && checkType !== auditConst.status.checkNo) {
+            if (checkData.checkType !== auditConst.status.checked && checkData.checkType !== auditConst.status.checkNo) {
                 throw '提交数据错误';
             }
 
@@ -218,9 +218,8 @@ module.exports = app => {
                     throw '审核数据错误';
                 }
                 // 更新当前审核流程
-                await transaction.update(this.tableName, {id: audit.id, status: checkType, opinion: opinion, end_time: time});
-                if (checkType === auditConst.status.checked) {
-                    console.log('checked');
+                await transaction.update(this.tableName, {id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time});
+                if (checkData.checkType === auditConst.status.checked) { // 审批通过
                     const nextAudit = await this.getDataByCondition({sid: stageId, times: times, order: audit.order + 1});
                     // 无下一审核人表示,审核结束
                     if (nextAudit) {
@@ -235,12 +234,11 @@ module.exports = app => {
                         // 计算并合同支付最终数据
                         await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                         // 同步 期信息
-                        await transaction.update(this.ctx.service.stage.tableName, {id: stageId, status: checkType});
+                        await transaction.update(this.ctx.service.stage.tableName, {id: stageId, status: checkData.checkType});
                     }
-                } else {
-                    console.log('checkNo');
+                } else if (checkData.checkType === auditConst.status.checkNo) { // 审批退回 原报
                     // 同步 期信息
-                    await transaction.update(this.ctx.service.stage.tableName, {id: stageId, times: times+1, status: checkType});
+                    await transaction.update(this.ctx.service.stage.tableName, {id: stageId, status: checkData.checkType});
                     // 拷贝新一次审核流程列表
                     const auditors = await this.getAllDataByCondition({
                         where: {sid: stageId, times: times},
@@ -255,6 +253,40 @@ module.exports = app => {
                     await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                     // 复制一份最新数据给原报
                     await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times + 1, 0, transaction);
+                } else if (checkData.checkType === auditConst.status.checkNoPre) { // 审批退回 上一审批人
+                    // 同步 期信息
+                    await transaction.update(this.ctx.service.stage.tableName, {id: stageId, status: checkData.checkType});
+                    // 将当前审批人 与 上一审批人再次添加至流程,顺移其后审批人流程顺序
+                    if (audit.order > 1) {
+                        // 顺移气候审核人流程顺序
+                        this.initSqlBuilder();
+                        this.sqlBuilder.setAndWhere('sid', { value: this.ctx.stage.id, operate: '=', });
+                        this.sqlBuilder.setAndWhere('order', { value: audit.order, operate: '>', });
+                        this.sqlBuilder.setUpdateData('order', { value: 2, selfOperate: '+', });
+                        const [sql, sqlParam] = this.sqlBuilder.build(this.tableName, 'update');
+                        const data = await transaction.query(sql, sqlParam);
+
+                        // 上一审批人,当前审批人 再次添加至流程
+                        const preAuditor = await this.getDataByCondition({sid: stageId, times: times, order: audit.order - 1});
+                        const newAuditors = [];
+                        newAuditors.push({
+                            tid: preAuditor.tid, sid: preAuditor.sid, aid: preAuditor.aid,
+                            times: preAuditor.times, order: preAuditor.order + 2, status: auditConst.status.checking,
+                            begin_time: time,
+                        });
+                        newAuditors.push({
+                            tid: audit.tid, sid: audit.sid, aid: audit.aid,
+                            times: audit.times, order: audit.order + 2, status: auditConst.status.uncheck
+                        });
+                        await transaction.insert(this.tableName, newAuditors);
+
+                        // 计算该审批人最终数据
+                        await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
+                        // 复制一份最新数据给原报
+                        await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times, audit.order + 1, transaction);
+                    } else {
+                        throw '审核数据错误';
+                    }
                 }
 
                 await transaction.commit();
@@ -265,16 +297,18 @@ module.exports = app => {
         }
 
         /**
-         * 获取审核人需要审核的标段列表
+         * 获取审核人需要审核的列表
          *
          * @param auditorId
          * @returns {Promise<*>}
          */
         async getAuditStage(auditorId) {
-            const sql = 'SELECT la.`aid`, la.`times`, la.`order`, la.`begin_time`, la.`tid`, la.`sid`, s.`order`, t.`name`, t.`project_id`, t.`type`, t.`user_id` ' +
-                'FROM ?? AS la, ?? AS s, ?? As t ' +
-                'WHERE la.`aid` = ? and la.`status` = ?' +
-                '    and la.`sid` = s.`id` and la.`tid` = t.`id`';
+            const sql = 'SELECT sa.`aid`, sa.`times`, sa.`order`, sa.`begin_time`, sa.`tid`, sa.`sid`,' +
+                        '    s.`order` As `sorder`, s.`status` As `sstatus`,' +
+                        '    t.`name`, t.`project_id`, t.`type`, t.`user_id` ' +
+                        '  FROM ?? AS sa, ?? AS s, ?? As t ' +
+                        '  WHERE sa.`aid` = ? and sa.`status` = ?' +
+                        '    and sa.`sid` = s.`id` and sa.`tid` = t.`id`';
             const sqlParam = [this.tableName, this.ctx.service.stage.tableName, this.ctx.service.tender.tableName, auditorId, auditConst.status.checking];
             return await this.db.query(sql, sqlParam);
         }

+ 17 - 2
app/view/dashboard/index.ejs

@@ -13,8 +13,23 @@
                     <img class="mr-3" src="public/images/avatar.png">
                     <div class="media-body">
                         <span class="pull-right text-muted"><%- t.begin_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted">监理</small></h5>
-                        <p><a href="/ledger/explode?tenderId=<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger/audit">审批</a>。</p>
+                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- t.role %></small></h5>
+                        <p><a href="/tender/<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger/audit">审批</a>。</p>
+                    </div>
+                </li>
+                <% } %>
+                <% for (const audit of auditStages) { %>
+                <li class="media">
+                    <img class="mr-3" src="public/images/avatar.png">
+                    <div class="media-body">
+                        <span class="pull-right text-muted"><%- audit.begin_time.toLocaleString() %></span>
+                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- audit.role %></small></h5>
+                        <p><a href="/tender/<%- audit.tid %>"><%- audit.name %></a>
+                            第<%- audit.sorder %>期 <% if (audit.sstatus === acStage.status.checkNoPre) { %><span style="color: indianred">被退回</span> <% } %> 需要您
+                            <a href="/tender/<%- audit.tid %>/measure/stage/<%- audit.sorder %>">
+                                <% if (audit.sstatus === acStage.status.checkNoPre) { %>重新<% } %>审批
+                            </a>。
+                        </p>
                     </div>
                 </li>
                 <% } %>

+ 7 - 1
app/view/stage/audit_btn.ejs

@@ -12,10 +12,16 @@
         <% } %>
     <% } else if (ctx.stage.status === auditConst.status.checked) { %>
         <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-secondary btn-sm pull-right">审批完成</a>
-    <% } else if (ctx.stage.status === auditConst.statu.checkNo) { %>
+    <% } else if (ctx.stage.status === auditConst.status.checkNo) { %>
         <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm pull-right text-muted">审批退回</a>
         <% if (ctx.session.sessionUser.accountId === ctx.stage.user_id) { %>
             <a href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" class="btn btn-primary btn-sm pull-right">重新上报</a>
         <% } %>
+    <% } else if (ctx.stage.status === auditConst.status.checkNoPre) { %>
+        <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm pull-right text-muted">审批退回</a>
+        <% if (ctx.session.sessionUser.accountId === ctx.stage.curAuditor.aid) { %>
+            <a href="#sp-done" data-toggle="modal" data-target="#sp-done" class="btn btn-success btn-sm pull-right">审批通过</a>
+            <a href="#sp-back" data-toggle="modal" data-target="#sp-back" class="btn btn-warning btn-sm pull-right">审批退回</a>
+        <% } %>
     <% } %>
 </div>

+ 13 - 14
app/view/stage/audit_modal.ejs

@@ -87,7 +87,7 @@
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                <button type="button" class="btn btn-primary">确认上报</button>
+                <button type="submit" class="btn btn-primary">确认上报</button>
             </div>
         </div>
     </div>
@@ -158,7 +158,7 @@
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                 <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
                 <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
-                <button type="button" class="btn btn-success" >确认通过</button>
+                <button type="submit" class="btn btn-success" >确认通过</button>
             </div>
         </form>
     </div>
@@ -166,7 +166,7 @@
 <!--审批退回-->
 <div class="modal fade" id="sp-back" data-backdrop="static">
     <div class="modal-dialog" role="document">
-        <div class="modal-content">
+        <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
             </div>
@@ -217,12 +217,12 @@
                                     </div>
                                     <div class="alert alert-warning">
                                         <div class="form-check form-check-inline">
-                                            <input class="form-check-input" type="radio" name="checkNoType" id="inlineRadio1" value="<%- auditConst.backType.org %>">
+                                            <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
                                             <label class="form-check-label" for="inlineRadio1">退回上报 <%- ctx.stage.user.name %></label>
                                         </div>
                                         <% if (auditors[iA].order > 1) { %>
                                         <div class="form-check form-check-inline">
-                                            <input class="form-check-input" type="radio" name="checkNoType" id="inlineRadio2" value="<%- auditConst.backType.pre %>">
+                                            <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
                                             <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- auditors[iA-1].name %></label>
                                         </div>
                                         <% } %>
@@ -238,10 +238,9 @@
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                 <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
-                <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
-                <button type="button" class="btn btn-warning" >确认退回</button>
+                <button type="submit" class="btn btn-warning" >确认退回</button>
             </div>
-        </div>
+        </form>
     </div>
 </div>
 <% } else { %>
@@ -285,7 +284,7 @@
                                 </li>
                                 <li class="list-group-item">
                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <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></h5>
                                     <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
@@ -296,7 +295,7 @@
                                 <% } else if (iA === ah.length - 1) { %>
                                 <li class="list-group-item">
                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <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></h5>
                                     <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
@@ -307,7 +306,7 @@
                                 <% } else { %>
                                 <li class="list-group-item">
                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <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></h5>
                                     <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
@@ -333,7 +332,7 @@
                                 </li>
                                 <li class="list-group-item">
                                     <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
                                     <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
@@ -344,7 +343,7 @@
                                 <% } else if (iA === auditors.length - 1) { %>
                                 <li class="list-group-item">
                                     <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
                                     <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>
@@ -355,7 +354,7 @@
                                 <% } else { %>
                                 <li class="list-group-item">
                                     <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                    <span class="<%- auditConst.statusClass[auditors[iA].status] %> pull-right"><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.stage.user.name %><% } %></span>
                                     <% } %>
                                     <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
                                     <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %>