Browse Source

上报done&类别变灰

laiguoran 4 years ago
parent
commit
6f273bf62d

+ 34 - 0
app/controller/change_controller.js

@@ -570,6 +570,7 @@ module.exports = app => {
                     authMobile: auth_mobile,
                     shenpiConst,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.change.information),
+                    preUrl: '/tender/' + ctx.tender.id + '/change/' + ctx.change.cid + '/information',
                 };
                 // 根据auditStatus状态获取的不同的数据
                 if (auditStatus === 1 || auditStatus === 2) {
@@ -811,6 +812,11 @@ module.exports = app => {
                             orders: [['lid', 'desc'], ['id', 'asc']],
                         });
                         break;
+                    case 'info':
+                        await ctx.service.change.saveInfo(data.updateData);
+                        // 取所有工料表
+                        responseData.data = '保存成功';
+                        break;
                     default: throw '参数有误';
                 }
 
@@ -821,6 +827,34 @@ module.exports = app => {
             }
         }
 
+        /**
+         * 上报和重新上报
+         * @param ctx
+         * @return {Promise<void>}
+         */
+        async startAudit(ctx) {
+            try {
+                // 检查权限等
+                if (!ctx.change) {
+                    throw '数据错误';
+                }
+                if (ctx.change.uid !== ctx.session.sessionUser.accountId) {
+                    throw '您无权上报该变更令数据';
+                }
+                if (!(ctx.change.status === audit.flow.status.uncheck || ctx.change.status === audit.flow.status.back)) {
+                    throw '该变更令当前无法上报';
+                }
+
+                await ctx.service.changeAudit.start(ctx.change.cid, ctx.change.times);
+
+                ctx.redirect(ctx.request.header.referer);
+            } catch (err) {
+                this.log(err);
+                ctx.session.postError = err.toString();
+                ctx.redirect(ctx.request.header.referer);
+            }
+        }
+
         // 审批相关
         /**
          * 添加审批人

+ 1 - 0
app/public/js/category.js

@@ -182,6 +182,7 @@ function bindCategoryControl() {
                 editCate.value.push(newValue);
                 $(this).before(getValueHtml([newValue]));
                 bindCategoryValueControl();
+                makeIconColor();
             });
             bindCategoryValueControl();
             makeIconColor();

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

@@ -181,18 +181,6 @@ $(document).ready(function () {
         $(document.body).addClass('modal-open');
     });
 });
-// 检查上报情况
-function checkAuditorFrom () {
-    if ($('#auditors li').length === 0) {
-        if(shenpi_status === shenpiConst.sp_status.gdspl) {
-            toastr.error('请联系管理员添加审批人');
-        } else {
-            toastr.error('请先选择审批人,再上报数据');
-        }
-        return false;
-    }
-    $('#hide-all').show();
-}
 // texterea换行
 function auditCheck(i) {
     const inlineRadio1 = $('#inlineRadio1:checked').val()

+ 159 - 0
app/public/js/change_information_set.js

@@ -559,7 +559,111 @@ $(document).ready(() => {
             makeCodeTable();
         }
     });
+
+    // 记录变更信息操作
+    $('body').on('valuechange', '#change_form input[type="text"]', function (e, previous) {
+        changeInfo[$(this).attr('name')] = $(this).val();
+        judgeChange();
+    });
+    $('body').on('valuechange', '#change_form textarea', function (e, previous) {
+        changeInfo[$(this).attr('name')] = $(this).val().replace(/[\r\n]/g, '<br><br>');
+        judgeChange();
+    });
+    $('body').on('change', '#change_form select', function (e, previous) {
+        changeInfo[$(this).attr('name')] = $(this).val();
+        judgeChange();
+    });
+    $('body').on('click', '#change_form input[type="radio"]', function (e, previous) {
+        changeInfo[$(this).attr('name')] = $(this).val();
+        judgeChange();
+    });
+    $('body').on('click', '#change_form input[type="checkbox"]', function (e, previous) {
+        const typecheck = [];
+        $.each($('#change_form input[name="type[]"]:checked'), function () {
+            typecheck.push($(this).val());
+        });
+        changeInfo.type = typecheck.join(',');
+        judgeChange();
+    });
+
+    // 保存修改ajax提交(不刷新页面)
+    $('.save_change_btn').on('click', function () {
+        // 保存修改modal
+        if ($('input[name="code"]').val() === '') {
+            toastr.error('申请编号不能为空!');
+            return;
+        }
+        if ($('input[name="name"]').val() === '') {
+            toastr.error('工程名称不能为空!');
+            return;
+        }
+        // 更新至服务器
+        postData(window.location.pathname + '/save', { type:'info', updateData: changeInfo }, function (result) {
+            $('.reduction-code').attr('data-code', $('input[name="code"]').val());
+            toastr.success(result);
+            $('#show-save-btn').hide();
+            $('#sp-btn').show();
+            $('.title-main').removeClass('bg-warning');
+            back_changeInfo = Object.assign({}, changeInfo);
+        });
+        return false;
+    });
+
+    $('#cancel_change').on('click', function () {
+        $('#show-save-btn').hide();
+        $('#sp-btn').show();
+        $('.title-main').removeClass('bg-warning');
+        if (!isObjEqual(changeInfo, back_changeInfo)) {
+            changeFormRemake();
+        }
+        toastr.success('已还原到上次保存状态');
+    });
 });
+function checkChangeFrom() {
+    let returnFlag = false;
+    // 表单判断
+    if ($('input[name="code"]').val() === '') {
+        toastr.error('申请编号不能为空!');
+        returnFlag = true;
+    }
+    if ($('input[name="name"]').val() === '') {
+        toastr.error('工程名称不能为空!');
+        returnFlag = true;
+    }
+    if ($('textarea[name="content"]').val() === '') {
+        toastr.error('工程变更理由及内容不能为空!');
+        returnFlag = true;
+    }
+    if (changeList.length === 0) {
+        toastr.error('请添加变更清单!');
+        returnFlag = true;
+    } else {
+        for (const [i,cl] of changeList.entries()) {
+            if (cl.code === '' || cl.name === '' || cl.oamount === '') {
+                toastr.error('变更清单第' + (i+1) + '行未完整填写数据(变更部位、变更详情、单位、单价可空)');
+                returnFlag = true;
+            }
+        }
+    }
+    if(!checkAuditorFrom ()) {
+        returnFlag = true;
+    }
+    if (returnFlag) {
+        return false;
+    }
+}
+// 检查上报情况
+function checkAuditorFrom () {
+    if ($('#auditList li').length === 0) {
+        if(shenpi_status === shenpiConst.sp_status.gdspl) {
+            toastr.error('请联系管理员添加审批人');
+        } else {
+            toastr.error('请先选择审批人,再上报数据');
+        }
+        return false;
+    }
+    return true;
+}
 function findDecimal(unit) {
     let value = precision.other.value;
     const changeUnits = precision;
@@ -747,3 +851,58 @@ function in_array(arr, obj) {
     }
     return false;
 }
+function isObjEqual(o1,o2){
+    var props1 = Object.getOwnPropertyNames(o1);
+    var props2 = Object.getOwnPropertyNames(o2);
+    if (props1.length != props2.length) {
+        return false;
+    }
+    for (var i = 0,max = props1.length; i < max; i++) {
+        var propName = props1[i];
+        if (o1[propName] !== o2[propName]) {
+            return false;
+        }
+    }
+    return true;
+}
+// 判断是否有更改过
+function judgeChange() {
+    let change = false;
+    if (!isObjEqual(changeInfo, back_changeInfo)) {
+        change = true;
+    }
+    if (change) {
+        $('#show-save-btn').show();
+        $('#sp-btn').hide();
+        $('.title-main').addClass('bg-warning');
+    } else {
+        $('#show-save-btn').hide();
+        $('#sp-btn').show();
+        $('.title-main').removeClass('bg-warning');
+    }
+}
+
+function changeFormRemake() {
+    changeInfo = Object.assign({}, back_changeInfo);
+    $('#change_form input[name="code"]').val(changeInfo.code);
+    $('#change_form input[name="name"]').val(changeInfo.name);
+    $('#change_form input[name="peg"]').val(changeInfo.peg);
+    $('#change_form input[name="org_name"]').val(changeInfo.org_name);
+    $('#change_form input[name="org_code"]').val(changeInfo.org_code);
+    $('#change_form input[name="new_name"]').val(changeInfo.new_name);
+    $('#change_form input[name="new_code"]').val(changeInfo.new_code);
+    $('#change_form textarea[name="content"]').val(changeInfo.content.replace(/<br><br>/g, '\r\n'));
+    $('#change_form textarea[name="basis"]').val(changeInfo.basis.replace(/<br><br>/g, '\r\n'));
+    $('#change_form textarea[name="expr"]').val(changeInfo.expr.replace(/<br><br>/g, '\r\n'));
+    $('#change_form textarea[name="memo"]').val(changeInfo.memo.replace(/<br><br>/g, '\r\n'));
+    $('#change_form select[name="type"]').val(changeInfo.type);
+    $('#change_form select[name="class"]').val(changeInfo.class);
+    $('#change_form select[name="quality"]').val(changeInfo.quality);
+    $('#change_form select[name="company"]').val(changeInfo.company);
+    $('#change_form input[name="charge"][value="'+ changeInfo.charge +'"]').prop('checked', true);
+    $('#change_form input[name="type[]"]').prop('checked', false);
+    const typecheck = changeInfo.type.split(',');
+    for (const type of typecheck) {
+        $('#change_form input[name="type[]"][value="'+ type +'"]').prop('checked', true);
+    }
+}

+ 1 - 0
app/router.js

@@ -335,6 +335,7 @@ module.exports = app => {
     // 变更令 - 新版本
     app.get('/tender/:id/change/:cid/information', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, changeAuditCheck, 'changeController.information');
     app.post('/tender/:id/change/:cid/information/save', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, 'changeController.saveListsData');
+    app.post('/tender/:id/change/:cid/information/audit/start', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, changeAuditCheck, 'changeController.startAudit');
     app.post('/tender/:id/change/:cid/information/file/upload', sessionAuth, 'changeController.uploadFile');
     app.post('/tender/:id/change/:cid/information/file/delete', sessionAuth, 'changeController.deleteFile');
     app.post('/tender/:id/change/:cid/information/copy', sessionAuth, tenderCheck, uncheckTenderCheck, 'changeController.copyChange');

+ 26 - 0
app/service/change.js

@@ -509,6 +509,32 @@ module.exports = app => {
         }
 
         /**
+         * 保存变更信息
+         * @param {int} postData - 表单提交的数据
+         * @param {int} tenderId - 标段id
+         * @return {void}
+         */
+        async saveInfo(postData) {
+            // 初始化事务
+            const transaction = await this.db.beginTransaction();
+            let result = false;
+            try {
+                const options = {
+                    where: {
+                        cid: this.ctx.change.cid,
+                    },
+                };
+                await transaction.update(this.tableName, postData, options);
+                await transaction.commit();
+                result = true;
+            } catch (error) {
+                await transaction.rollback();
+                result = false;
+            }
+            return result;
+        }
+
+        /**
          * 审批通过
          * @param {Number} pid 项目id
          * @param {int} postData - 表单提交的数据

+ 78 - 11
app/service/change_audit.js

@@ -8,8 +8,13 @@
  * @version
  */
 
-const audit = require('../const/audit');
+const auditConst = require('../const/audit').flow;
 const pushType = require('../const/audit').pushType;
+const shenpiConst = require('../const/shenpi');
+const smsTypeConst = require('../const/sms_type');
+const SMS = require('../lib/sms');
+const SmsAliConst = require('../const/sms_alitemplate');
+const wxConst = require('../const/wechat_template');
 
 module.exports = app => {
     class ChangeAudit extends app.BaseService {
@@ -96,8 +101,8 @@ module.exports = app => {
          * @return {void}
          */
         async getStatusByChange(change) {
-            const statusConst = audit.flow.status;
-            const auditStatusConst = audit.flow.auditStatus;
+            const statusConst = auditConst.status;
+            const auditStatusConst = auditConst.auditStatus;
             const uid = this.ctx.session.sessionUser.accountId;
             const changeAuditInfo = await this.getAllDataByCondition({ where: { cid: change.cid, times: change.times, uid }, orders: [['id', 'desc']], limit: 1, offset: 0 });
             if (!change.status === statusConst.checked && (changeAuditInfo === null || changeAuditInfo[0] === undefined)) {
@@ -271,10 +276,10 @@ module.exports = app => {
                 '  FROM ?? AS ca, ?? AS c, ?? As t ' +
                 '  WHERE ca.`uid` = ? and ca.`status` = ? and c.`status` != ?' +
                 '    and ca.`cid` = c.`cid` and ca.`tid` = t.`id` ORDER BY ca.`sin_time` DESC';
-            const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, uid, 2, audit.flow.status.uncheck];
+            const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, uid, 2, auditConst.status.uncheck];
             const changes = await this.db.query(sql, sqlParam);
             for (const c of changes) {
-                if (c.cstatus === audit.flow.status.back) {
+                if (c.cstatus === auditConst.status.back) {
                     const preSql = 'SELECT pa.`id`, pa.`account`, pa.`account_group`, pa.`name`, pa.`company`, pa.`role`, pa.`telephone` FROM ?? As ca, ?? As pa ' +
                         '  WHERE ca.cid = ? and ca.times = ? and ca.status = ? and ca.uid = pa.id';
                     const preSqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, c.cid, c.times - 1, c.cstatus];
@@ -306,7 +311,7 @@ module.exports = app => {
             //             '  WHERE t.`project_id` = ? and `ca`.`sin_time` > ? and `ca`.`usite` != 0 and `ca`.`status` != ?' +
             //             '  ORDER By ca.`sin_time` DESC LIMIT 1000) as new_t GROUP BY new_t.`id`' +
             //             '  ORDER BY new_t.`cu_time`';
-            // const sqlParam = [this.ctx.service.tender.tableName, uid, this.tableName, uid, this.ctx.service.change.tableName, this.tableName, pid, time, audit.flow.status.checking];
+            // const sqlParam = [this.ctx.service.tender.tableName, uid, this.tableName, uid, this.ctx.service.change.tableName, this.tableName, pid, time, auditConst.status.checking];
             // return await this.db.query(sql, sqlParam);
             let notice = await this.db.select('zh_notice', {
                 where: { pid, type: pushType.change, uid },
@@ -345,7 +350,7 @@ module.exports = app => {
                 '  FROM ?? AS ca, ?? AS c, ?? As t, ?? AS ti ' +
                 '  WHERE ca.`uid` = ? and ca.`status` = ? and c.`status` != ? and c.`status` != ?' +
                 '    and ca.`cid` = c.`cid` and ca.`tid` = t.`id` and ti.`tid` = t.`id`';
-            const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, this.ctx.service.tenderInfo.tableName, uid, audit.flow.auditStatus.checking, audit.flow.status.uncheck, audit.flow.status.back];
+            const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, this.ctx.service.tenderInfo.tableName, uid, auditConst.auditStatus.checking, auditConst.status.uncheck, auditConst.status.back];
             const changes = await this.db.query(sql, sqlParam);
             for (const c of changes) {
                 const preSql = 'SELECT pa.`id`, pa.`account`, pa.`account_group`, pa.`name`, pa.`company`, pa.`role`, pa.`telephone` FROM ?? As ca, ?? As pa ' +
@@ -372,7 +377,7 @@ module.exports = app => {
                     newAuditors.push({
                         tid: change.tid, cid: change.cid, uid: aid,
                         name: accountInfo.name, jobs: accountInfo.role, company: accountInfo.company,
-                        times: change.times, usite: order, usort: uSort, status: audit.flow.auditStatus.uncheck,
+                        times: change.times, usite: order, usort: uSort, status: auditConst.auditStatus.uncheck,
                     });
                     order++;
                     uSort++;
@@ -408,7 +413,7 @@ module.exports = app => {
                 const newAuditor = {
                     tid: change.tid, cid: change.cid, uid: lastId,
                     name: userInfo.name, jobs: userInfo.role, company: userInfo.company,
-                    times: change.times, usite: order, usort: uSort, status: audit.flow.auditStatus.uncheck,
+                    times: change.times, usite: order, usort: uSort, status: auditConst.auditStatus.uncheck,
                 };
                 await transaction.insert(this.tableName, newAuditor);
                 await transaction.commit();
@@ -464,7 +469,7 @@ module.exports = app => {
          */
         async getCurAuditor(cid, times = 1) {
             const sql = 'SELECT * FROM ?? WHERE `cid` = ? and `status` = ? and `times` = ? and usite != 0';
-            const sqlParam = [this.tableName, cid, audit.flow.status.checking, times];
+            const sqlParam = [this.tableName, cid, auditConst.status.checking, times];
             return await this.db.queryOne(sql, sqlParam);
         }
 
@@ -502,7 +507,7 @@ module.exports = app => {
                 const newAuditor = {
                     tid: this.ctx.tender.id, cid: cid, uid: auditorId,
                     name: userInfo.name, jobs: userInfo.role, company: userInfo.company,
-                    times: times, usite: newOrder, usort: uSort, status: audit.flow.auditStatus.uncheck,
+                    times: times, usite: newOrder, usort: uSort, status: auditConst.auditStatus.uncheck,
                 };
                 const result = await transaction.insert(this.tableName, newAuditor);
                 await transaction.commit();
@@ -540,6 +545,68 @@ module.exports = app => {
             }
             return true;
         }
+
+        /**
+         * 开始审批
+         * @param {Number} cid - 变更令id
+         * @param {Number} times - 第几次审批
+         * @return {Promise<boolean>}
+         */
+        async start(cid, times = 1) {
+            const audit = await this.getDataByCondition({ cid, times, usite: 1 });
+            const yBAudit = await this.getDataByCondition({ cid, times, usite: 0 });
+            if (!audit) {
+                if(this.ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
+                    throw '请联系管理员添加审批人';
+                } else {
+                    throw '请先选择审批人,再上报数据';
+                }
+            }
+
+            const transaction = await this.db.beginTransaction();
+            try {
+                await transaction.update(this.tableName, { id: audit.id, status: auditConst.auditStatus.checking, sin_time: new Date() });
+                const options = {
+                    where: {
+                        cid: cid,
+                    },
+                };
+                await transaction.update(this.ctx.service.change.tableName, {
+                    status: auditConst.status.checking,
+                }, options);
+                // 更新原报人审批状态
+                await transaction.update(this.tableName, {
+                    id: yBAudit.id,
+                    status: auditConst.auditStatus.checked,
+                    sin_time: new Date(),
+                });
+
+                // 添加短信通知-需要审批提醒功能
+                const sms = new SMS(this.ctx);
+                const code = await sms.contentChange(this.ctx.change.code);
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.change.tid + '/change/' + cid + '/info#shenpi'
+                );
+                await this.ctx.helper.sendAliSms(audit.uid, smsTypeConst.const.BG, smsTypeConst.judge.approval.toString(), SmsAliConst.template.change_check, {
+                    biangeng: code,
+                    code: shenpiUrl,
+                });
+                // 微信模板通知
+                const wechatData = {
+                    wap_url: shenpiUrl,
+                    status: wxConst.status.check,
+                    tips: wxConst.tips.check,
+                    code: this.ctx.session.sessionProject.code,
+                    c_name: this.ctx.change.name,
+                };
+                await this.ctx.helper.sendWechat(audit.uid, smsTypeConst.const.BG, smsTypeConst.judge.approval.toString(), wxConst.template.change, wechatData);
+                await transaction.commit();
+            } catch (err) {
+                await transaction.rollback();
+                throw err;
+            }
+            return true;
+        }
     }
 
     return ChangeAudit;

+ 11 - 2
app/view/change/information.ejs

@@ -32,10 +32,11 @@
                     </div>
                 <% } %>
             </div>
-            <div class="ml-auto">
+            <div class="ml-auto" id="sp-btn">
                 <!--info状态区分-->
                 <% if (auditStatus === 1) { %>
                     <a href="#sub-ap" data-category="up_change" data-toggle="modal" data-target="#sub-ap" class="btn btn-primary btn-sm">上报审批</a>
+                    <a href="#sub-ap" data-category="up_change" data-toggle="modal" data-target="#sub-ap" class="btn btn-primary btn-sm">上报审批</a>
                 <% } else if (auditStatus === 2) { %>
                     <a href="#sub-sp2" data-category="up_change" data-toggle="modal" data-target="#sub-sp2" class="btn btn-primary btn-sm">重新上报</a>
                 <% } else if (auditStatus === 3) { %>
@@ -59,6 +60,14 @@
                     <% } %>
                 <% } %>
             </div>
+            <!--info状态区分-->
+            <% if (auditStatus === 1 || auditStatus === 2) { %>
+                <div class="ml-auto px-4" id="show-save-btn" style="display: none">
+                    <span>您修改了变更信息,记得保存修改。</span>
+                    <button class="btn btn-sm btn-primary save_change_btn" id="save_change"><i class="fa fa-save"></i> 保存修改</button>
+                    <button class="btn btn-sm btn-light" id="cancel_change">取消</button>
+                </div>
+            <% } %>
         </div>
     </div>
     <div class="content-wrap">
@@ -88,7 +97,7 @@
                     <div class="tab-pane active" id="bgxinxi">
                         <div class="sjs-sh-1" style="overflow-y: auto;">
                             <% if (auditStatus === 1 || auditStatus === 2) { %>
-                            <form class="p-2" action="/tender/<%- change.tid %>/change/save?_csrf=<%= ctx.csrf %>" method="post" id="change_form">
+                            <form class="p-2" action="/tender/<%- change.tid %>/change/<%- change.cid %>/information/save?_csrf=<%= ctx.csrf %>" method="post" id="change_form">
                                 <div class="form-group">
                                     <label><b class="text-danger">*&nbsp;</b>申请编号</label>
                                     <a href="javascript:void(0);" class="pull-right reduction-code" data-toggle="tooltip" data-placement="bottom" title="" data-code="<%- change.code %>" data-original-title="重置"><i class="fa fa-repeat"></i></a>

+ 52 - 54
app/view/change/information_modal.ejs

@@ -38,65 +38,63 @@
             <div class="modal-header">
                 <h5 class="modal-title up-change">上报审批</h5>
             </div>
-            <form method="post" action="/tender/<%- tender.id %>/change/<%- change.cid %>/save">
-                <div class="modal-body">
-                    <div class="dropdown text-right">
-                        <% if (ctx.tender.info.shenpi.change !== shenpiConst.sp_status.gdspl) { %>
-                            <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
-                                    id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
-                                    aria-expanded="false">
-                                添加审批流程
-                            </button>
-                            <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
-                                 style="width:220px">
-                                <div class="mb-2 p-2"><input class="form-control form-control-sm"
-                                                             placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
-                                <dl class="list-unstyled book-list">
-                                    <% accountGroup.forEach((group, idx) => { %>
-                                        <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
-                                        <div class="dd-content" data-toggleid="<%- idx %>">
-                                            <% group.groupList.forEach(item => { %>
-                                                <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
-                                                    <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
-                                                                class="ml-auto"><%- item.mobile %></span></p>
-                                                    <span class="text-muted"><%- item.role %></span>
-                                                </dd>
-                                            <% });%>
-                                        </div>
-                                    <% }) %>
-                                </dl>
-                            </div>
-                        <% } %>
-                    </div>
-                    <div class="card mt-3">
-                        <div class="card-header">
-                            审批流程
+            <div class="modal-body">
+                <div class="dropdown text-right">
+                    <% if (ctx.tender.info.shenpi.change !== shenpiConst.sp_status.gdspl) { %>
+                        <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
+                                id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
+                                aria-expanded="false">
+                            添加审批流程
+                        </button>
+                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
+                             style="width:220px">
+                            <div class="mb-2 p-2"><input class="form-control form-control-sm"
+                                                         placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
+                            <dl class="list-unstyled book-list">
+                                <% accountGroup.forEach((group, idx) => { %>
+                                    <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
+                                    <div class="dd-content" data-toggleid="<%- idx %>">
+                                        <% group.groupList.forEach(item => { %>
+                                            <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
+                                                <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
+                                                            class="ml-auto"><%- item.mobile %></span></p>
+                                                <span class="text-muted"><%- item.role %></span>
+                                            </dd>
+                                        <% });%>
+                                    </div>
+                                <% }) %>
+                            </dl>
                         </div>
-                        <div class="modal-height-500" style="overflow: auto">
+                    <% } %>
+                </div>
+                <div class="card mt-3">
+                    <div class="card-header">
+                        审批流程
+                    </div>
+                    <div class="modal-height-500" style="overflow: auto">
                         <ul class="list-group list-group-flush" id="auditList">
                             <% for (const [index, audit] of auditList.entries()) { %>
                                 <% if (audit.usite !== 0) { %>
-                                <li class="list-group-item" data-auditmsg="<%= audit.uid + '/%/' + audit.name + '/%/' + audit.jobs + '/%/' + audit.company %>"
-                                    data-auditid="<%= audit.uid %>">
-                                    <% if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.sqspr ||
-                                            (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs && index+1 !== auditList.length)) { %>
-                                    <a href="javascript:void(0)" class="text-danger pull-right remove_audit_btn">移除</a>
-                                    <% } %>
-                                    <span><%= index %></span> <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small>
-                                    <p class="m-0 ml-2"><small class="text-muted"><%= audit.company %></small></p>
-                                </li>
+                                    <li class="list-group-item" data-auditmsg="<%= audit.uid + '/%/' + audit.name + '/%/' + audit.jobs + '/%/' + audit.company %>"
+                                        data-auditid="<%= audit.uid %>">
+                                        <% if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.sqspr ||
+                                                (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs && index+1 !== auditList.length)) { %>
+                                            <a href="javascript:void(0)" class="text-danger pull-right remove_audit_btn">移除</a>
+                                        <% } %>
+                                        <span><%= index %></span> <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small>
+                                        <p class="m-0 ml-2"><small class="text-muted"><%= audit.company %></small></p>
+                                    </li>
                                 <% } %>
                             <% } %>
                         </ul>
-                        </div>
-                        <input type="hidden" id="auditIdList" value="">
                     </div>
+                    <input type="hidden" id="auditIdList" value="">
                 </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
-                    <button type="button" data-sumbit="sumbit_change" data-category="up_change" class="btn btn-primary btn-sm up-change">确认上报</button>
-                    <!--<button type="button" data-sumbit="sumbit_change" data-category="save_change" class="btn btn-success btn-sm save-change">保存修改</button>-->
-                </div>
+            </div>
+            <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkChangeFrom()">
+                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+                <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
+                <button type="submit" class="btn btn-primary btn-sm">确认上报</button>
             </form>
         </div>
     </div>
@@ -280,11 +278,11 @@
                         </div>
                     </div>
                 </div>
-                <div class="modal-footer">
+                <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkChangeFrom()">
                     <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
-                    <button type="button" data-sumbit="sumbit_change" data-category="up_change" class="btn btn-primary btn-sm up-change">确认上报</button>
-                    <!--<button type="button" data-sumbit="sumbit_change" data-category="save_change" class="btn btn-success btn-sm save-change">保存修改</button>-->
-                </div>
+                    <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
+                    <button type="submit" class="btn btn-primary btn-sm">确认上报</button>
+                </form>
             </div>
         </div>
     </div>