Browse Source

计量审批更新

laiguoran 4 years ago
parent
commit
9de986b8de

+ 11 - 6
app/controller/stage_controller.js

@@ -13,6 +13,7 @@ const auditConst = require('../const/audit').stage;
 const changeAudit = require('../const/audit').flow;
 const spreadConst = require('../const/spread');
 const tenderConst = require('../const/tender');
+const shenpiConst = require('../const/shenpi');
 const payConst = require('../const/deal_pay.js');
 const externalDataConst = require('../const/external_data.js');
 const changeConst = require('../const/change');
@@ -58,6 +59,7 @@ module.exports = app => {
                     gxby: ctx.session.sessionProject.gxby_status,
                     dagl: ctx.session.sessionProject.dagl_status,
                 },
+                shenpiConst,
             };
             if ((ctx.stage.status === auditConst.status.uncheck || ctx.stage.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.stage.user_id) {
                 // data.accountGroup = accountGroup;
@@ -149,7 +151,9 @@ module.exports = app => {
                 }
             }
             // 获取审批流程中左边列表
-            ctx.stage.auditors2 = await ctx.service.stageAudit.getAuditGroupByListWithOwner(ctx.stage.id, times);
+            ctx.stage.auditors2 = ctx.stage.status === auditConst.status.checkNo && ctx.stage.user_id !== ctx.session.sessionUser.accountId ?
+                await ctx.service.stageAudit.getAuditGroupByListWithOwner(ctx.stage.id, times) :
+                await ctx.service.stageAudit.getAuditGroupByListWithOwner(ctx.stage.id, ctx.stage.times);
             const { status } = ctx.stage;
             if (status === auditConst.status.uncheck || status === auditConst.status.checkNo) {
                 ctx.stage.auditorList = await ctx.service.stageAudit.getAuditors(ctx.stage.id, ctx.stage.times);
@@ -974,14 +978,14 @@ module.exports = app => {
                 if (exist) {
                     throw '该审核人已存在,请勿重复添加';
                 }
-
-                const result = await ctx.service.stageAudit.addAuditor(ctx.stage.id, id, ctx.stage.times);
+                const is_gdzs = ctx.tender.info.shenpi.stage === shenpiConst.sp_status.gdzs ? 1 : 0;
+                const result = await ctx.service.stageAudit.addAuditor(ctx.stage.id, id, ctx.stage.times, is_gdzs);
                 if (!result) {
                     throw '添加审核人失败';
                 }
 
-                const audit = await ctx.service.stageAudit.getAuditor(ctx.stage.id, id, ctx.stage.times);
-                ctx.body = { err: 0, msg: '', data: audit };
+                const auditors = await ctx.service.stageAudit.getAuditGroupByListWithOwner(ctx.stage.id, ctx.stage.times);
+                ctx.body = { err: 0, msg: '', data: auditors };
             } catch (err) {
                 this.log(err);
                 ctx.body = { err: 1, msg: err.toString(), data: null };
@@ -1032,7 +1036,8 @@ module.exports = app => {
                 ctx.body = { err: 0, msg: '', data: [] };
             } catch (err) {
                 this.log(err);
-                ctx.redirect(ctx.request.header.referer);
+                ctx.session.postError = err.toString();
+                // ctx.redirect(ctx.request.header.referer);
                 ctx.body = this.ajaxErrorBody(err, '上报失败');
             }
         }

+ 1 - 1
app/middleware/material_check.js

@@ -114,7 +114,7 @@ module.exports = options => {
                     const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: { tid: material.tid, sp_type: shenpiConst.sp_type.material, sp_status: shenpi_status } });
                     const shenpiIdList = _.map(shenpiList, 'audit_id');
                     // 判断2个id数组是否相同,不同则删除原审批流,切换成固定的审批流
-                    if (!_.isEqual(auditIdList, shenpiIdList) && shenpiIdList.length !== 0) {
+                    if (!_.isEqual(auditIdList, shenpiIdList)) {
                         yield this.service.materialAudit.updateNewAuditList(material, shenpiIdList);
                     }
                 } else if (shenpi_status === shenpiConst.sp_status.gdzs) {

+ 25 - 0
app/middleware/stage_check.js

@@ -9,6 +9,7 @@
 
 const status = require('../const/audit').stage.status;
 const reviseStatus = require('../const/audit').revise.status;
+const shenpiConst = require('../const/shenpi');
 const _ = require('lodash');
 
 module.exports = options => {
@@ -114,6 +115,30 @@ module.exports = options => {
             const lastRevise = yield this.service.ledgerRevise.getLastestRevise(this.tender.id);
             stage.revising = (lastRevise && lastRevise.status !== reviseStatus.checked) || false;
             this.stage = stage;
+            // 根据状态判断是否需要更新审批人列表
+            if ((stage.status === status.uncheck || stage.status === status.checkNo) && this.tender.info.shenpi.stage !== shenpiConst.sp_status.sqspr) {
+                const shenpi_status = this.tender.info.shenpi.stage;
+                // 进一步比较审批流是否与审批流程设置的相同,不同则替换为固定审批流或固定的终审
+                const auditList = yield this.service.stageAudit.getAllDataByCondition({ where: { sid: stage.id, times: stage.times } });
+                const auditIdList = _.map(auditList, 'aid');
+                if (shenpi_status === shenpiConst.sp_status.gdspl) {
+                    const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: { tid: stage.tid, sp_type: shenpiConst.sp_type.stage, sp_status: shenpi_status } });
+                    const shenpiIdList = _.map(shenpiList, 'audit_id');
+                    // 判断2个id数组是否相同,不同则删除原审批流,切换成固定的审批流
+                    if (!_.isEqual(auditIdList, shenpiIdList)) {
+                        yield this.service.stageAudit.updateNewAuditList(stage, shenpiIdList);
+                    }
+                } else if (shenpi_status === shenpiConst.sp_status.gdzs) {
+                    const shenpiInfo = yield this.service.shenpiAudit.getDataByCondition({ tid: stage.tid, sp_type: shenpiConst.sp_type.stage, sp_status: shenpi_status });
+                    // 判断最后一个id是否与固定终审id相同,不同则删除原审批流中如果存在的id和添加终审
+                    if (shenpiInfo && shenpiInfo.audit_id !== _.last(auditIdList)) {
+                        yield this.service.stageAudit.updateLastAudit(stage, auditList, shenpiInfo.audit_id);
+                    } else if (!shenpiInfo) {
+                        // 不存在终审人的状态下这里恢复为授权审批人
+                        this.tender.info.shenpi.stage = shenpiConst.sp_status.sqspr;
+                    }
+                }
+            }
             yield next;
         } catch (err) {
             this.helper.log(err);

+ 5 - 1
app/public/js/material_audit.js

@@ -184,7 +184,11 @@ $(document).ready(function () {
 // 检查上报情况
 function checkAuditorFrom () {
     if ($('#auditors li').length === 0) {
-        toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
+        if(shenpi_status === shenpiConst.sp_status.gdspl) {
+            toast('请联系管理员添加审批人', 'error', 'exclamation-circle');
+        } else {
+            toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
+        }
         return false;
     }
     $('#hide-all').show();

+ 52 - 54
app/public/js/stage_audit.js

@@ -114,59 +114,53 @@ $(document).ready(function () {
     //     });
     // });
     // 审批人分组选择
-    $('#account_group').change(function () {
-        let account_html = '<option value="0">选择审批人</option>';
-        for (const account of accountList) {
-            if ((parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) && account.id !== parseInt(userID)) {
-                const role = account.role !== '' ? '(' + account.role + ')' : '';
-                const company = account.company !== '' ? ' -' + account.company : '';
-                account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>';
-            }
-        }
-        $('#account_list').html(account_html);
-    });
+    // $('#account_group').change(function () {
+    //     let account_html = '<option value="0">选择审批人</option>';
+    //     for (const account of accountList) {
+    //         if ((parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) && account.id !== parseInt(userID)) {
+    //             const role = account.role !== '' ? '(' + account.role + ')' : '';
+    //             const company = account.company !== '' ? ' -' + account.company : '';
+    //             account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>';
+    //         }
+    //     }
+    //     $('#account_list').html(account_html);
+    // });
     // 添加到审批流程中
     $('dl').on('click', 'dd', function () {
         const id = parseInt($(this).data('id'));
         if (id !== 0) {
-            postData(getUrlPre() + '/audit/add', { auditorId: id }, (data) => {
+            postData(getUrlPre() + '/audit/add', { auditorId: id }, (datas) => {
                 const html = [];
-                html.push('<li class="list-group-item" auditorId="'+ data.aid +'"><a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
-                html.push('<span>');
-                html.push(data.order + ' ');
-                html.push(data.name + ' ');
-                html.push('</span>');
-                html.push('<small class="text-muted">');
-                html.push(data.role);
-                html.push('</small></li>');
-                $('#auditors').append(html.join(''));
-
                 // 如果是重新上报,添加到重新上报列表中
                 const auditorshtml = [];
-                // 重新上报时。令其它的审批人流程图标转换
-                $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
-                for (let i = 0; i < $('#auditors-list li').length; i++) {
-                    $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
-                    $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                for (const [index,data] of datas.entries()) {
+                    if (index !== 0) {
+                        html.push('<li class="list-group-item" auditorId="'+ data.aid +'">');
+                        if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
+                            html.push('<a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
+                        }
+                        html.push('<span>');
+                        html.push(data.order + ' ');
+                        html.push(data.name + ' ');
+                        html.push('</span>');
+                        html.push('<small class="text-muted">');
+                        html.push(data.role);
+                        html.push('</small></li>');
+                    }
+                    auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
+                    auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
+                    auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                    if (index === 0) {
+                        auditorshtml.push('<span class="pull-right">原报</span>');
+                    } else if (index+1 === datas.length) {
+                        auditorshtml.push('<span class="pull-right">终审</span>');
+                    } else {
+                        auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
+                    }
+                    auditorshtml.push('</li>');
                 }
-                // 添加新审批人
-                auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
-                auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
-                auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
-                auditorshtml.push('<span class="pull-right">终审</span>');
-                auditorshtml.push('</li>');
-                $('#auditors-list').append(auditorshtml.join(''));
-
-                const auditorshtml2 = [];
-                // 重新上报时。令其它的审批人流程图标转换
-                $('#auditors-list2 li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
-                // 添加新审批人
-                auditorshtml2.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
-                auditorshtml2.push('<h5 class="card-title"><i class="fa fa-stop-circle"></i> ');
-                auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
-                auditorshtml2.push('<span class="pull-right">终审</span>');
-                auditorshtml2.push('</h5></li>');
-                $('#auditors-list2').append(auditorshtml2.join(''));
+                $('#auditors').html(html.join(''));
+                $('#auditors-list').html(auditorshtml.join(''));
             });
         }
     });
@@ -185,19 +179,19 @@ $(document).ready(function () {
 
             // 如果是重新上报
             // 令最后一个图标转换
-            $('#auditors-list li[data-auditid="' + data.auditorId + '"]').remove();
+            $('#auditors-list li[data-auditorid="' + data.auditorId + '"]').remove();
             if ($('#auditors-list li').length !== 0 && !$('#auditors-list li i').hasClass('fa-stop-circle')) {
                 $('#auditors-list li').eq($('#auditors-list li').length-1).children('i')
                     .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
             }
-            $('#auditors-list2 li[data-auditid="' + data.auditorId + '"]').remove();
-            if ($('#auditors-list2 li').length !== 0 && !$('#auditors-list2 li i').hasClass('fa-stop-circle')) {
-                $('#auditors-list2 li').eq($('#auditors-list2 li').length-1).children('i')
-                    .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
-            }
+            // $('#auditors-list2 li[data-auditid="' + data.auditorId + '"]').remove();
+            // if ($('#auditors-list2 li').length !== 0 && !$('#auditors-list2 li i').hasClass('fa-stop-circle')) {
+                // $('#auditors-list2 li').eq($('#auditors-list2 li').length-1).children('i')
+                //     .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
+            // }
             for (let i = 0; i < $('#auditors-list li').length; i++) {
-                $('#auditors-list li').eq(i).find('.pull-right').text((i+1 === $('#auditors-list li').length ? '终' : transFormToChinese(i+1)) + '审');
-                $('#auditors-list2 li').eq(i).find('.pull-right').text((i+1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i+1)) + '审');
+                $('#auditors-list li').eq(i).find('.pull-right').text(i === 0 ? '原报' : (i+1 === $('#auditors-list li').length ? '终' : transFormToChinese(i+1)) + '审');
+                // $('#auditors-list2 li').eq(i).find('.pull-right').text((i+1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i+1)) + '审');
             }
         });
     });
@@ -252,7 +246,11 @@ $(document).ready(function () {
 // 检查上报情况
 function checkAuditorFrom () {
     if ($('#auditors li').length === 0) {
-        toastr.error('请先选择审批人,再上报数据');
+        if(shenpi_status === shenpiConst.sp_status.gdspl) {
+            toast('请联系管理员添加审批人', 'error', 'exclamation-circle');
+        } else {
+            toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
+        }
         return false;
     }
     $('#hide-all').show();

+ 9 - 3
app/service/material_audit.js

@@ -12,6 +12,7 @@ const auditConst = require('../const/audit').material;
 const pushType = require('../const/audit').pushType;
 const smsTypeConst = require('../const/sms_type');
 const wxConst = require('../const/wechat_template');
+const shenpiConst = require('../const/shenpi');
 
 module.exports = app => {
     class MaterialAudit extends app.BaseService {
@@ -196,7 +197,12 @@ module.exports = app => {
         async start(materialId, times = 1) {
             const audit = await this.getDataByCondition({ mid: materialId, times, order: 1 });
             if (!audit) {
-                throw '请先选择审批人,再上报数据';
+                if(this.ctx.tender.info.shenpi.material === shenpiConst.sp_status.gdspl) {
+                    throw '请联系管理员添加审批人';
+                } else {
+                    throw '请先选择审批人,再上报数据';
+                }
+
             }
 
             const transaction = await this.db.beginTransaction();
@@ -254,7 +260,7 @@ module.exports = app => {
                     };
                     mehList.push(newMeh);
                 }
-                await transaction.insert(this.ctx.service.materialExponentHistory.tableName, mehList);
+                if(mehList.length !== 0) await transaction.insert(this.ctx.service.materialExponentHistory.tableName, mehList);
 
                 // 微信模板通知
                 const materialInfo = await this.ctx.service.material.getDataById(materialId);
@@ -872,7 +878,7 @@ module.exports = app => {
                     });
                     order++;
                 }
-                await transaction.insert(this.tableName, newAuditors);
+                if(newAuditors.length > 0) await transaction.insert(this.tableName, newAuditors);
                 await transaction.commit();
             } catch (err) {
                 await transaction.rollback();

+ 82 - 15
app/service/stage_audit.js

@@ -13,6 +13,7 @@ const smsTypeConst = require('../const/sms_type');
 const SMS = require('../lib/sms');
 const SmsAliConst = require('../const/sms_alitemplate');
 const wxConst = require('../const/wechat_template');
+const shenpiConst = require('../const/shenpi');
 const payConst = require('../const/deal_pay');
 const pushType = require('../const/audit').pushType;
 
@@ -163,18 +164,29 @@ module.exports = app => {
          * @param {Number} times - 第几次审批
          * @return {Promise<number>}
          */
-        async addAuditor(stageId, auditorId, times = 1) {
-            const newOrder = await this.getNewOrder(stageId, times);
-            const data = {
-                tid: this.ctx.tender.id,
-                sid: stageId,
-                aid: auditorId,
-                times,
-                order: newOrder,
-                status: auditConst.status.uncheck,
-            };
-            const result = await this.db.insert(this.tableName, data);
-            return (result.effectRows = 1);
+        async addAuditor(stageId, auditorId, times = 1, is_gdzs = 0) {
+            const transaction = await this.db.beginTransaction();
+            try {
+                let newOrder = await this.getNewOrder(stageId, times);
+                // 判断是否存在固定终审,存在则newOrder - 1并使终审order+1
+                newOrder = is_gdzs === 1 ? newOrder - 1 : newOrder;
+                if (is_gdzs) await this._syncOrderByDelete(transaction, stageId, newOrder, times, '+');
+                const data = {
+                    tid: this.ctx.tender.id,
+                    sid: stageId,
+                    aid: auditorId,
+                    times,
+                    order: newOrder,
+                    status: auditConst.status.uncheck,
+                };
+                const result = await transaction.insert(this.tableName, data);
+                await transaction.commit();
+                return result.effectRows = 1;
+            } catch (err) {
+                await transaction.rollback();
+                throw err;
+            }
+            return false;
         }
 
         /**
@@ -186,7 +198,7 @@ module.exports = app => {
          * @return {Promise<*>}
          * @private
          */
-        async _syncOrderByDelete(transaction, stageId, order, times) {
+        async _syncOrderByDelete(transaction, stageId, order, times, selfOperate = '-') {
             this.initSqlBuilder();
             this.sqlBuilder.setAndWhere('sid', {
                 value: stageId,
@@ -202,7 +214,7 @@ module.exports = app => {
             });
             this.sqlBuilder.setUpdateData('order', {
                 value: 1,
-                selfOperate: '-',
+                selfOperate: selfOperate,
             });
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName, 'update');
             const data = await transaction.query(sql, sqlParam);
@@ -246,7 +258,11 @@ module.exports = app => {
         async start(stageId, times = 1) {
             const audit = await this.getDataByCondition({ sid: stageId, times, order: 1 });
             if (!audit) {
-                throw '请先选择审批人,再上报数据';
+                if(this.ctx.tender.info.shenpi.stage === shenpiConst.sp_status.gdspl) {
+                    throw '请联系管理员添加审批人';
+                } else {
+                    throw '请先选择审批人,再上报数据';
+                }
             }
 
             const transaction = await this.db.beginTransaction();
@@ -1238,6 +1254,57 @@ module.exports = app => {
                 throw err;
             }
         }
+
+        // 固定审批流-更新
+        async updateNewAuditList(stage, newIdList) {
+            const transaction = await this.db.beginTransaction();
+            try {
+                // 先删除旧的审批流,再添加新的
+                transaction.delete(this.tableName, { sid: stage.id, times: stage.times });
+                const newAuditors = [];
+                let order = 1;
+                for (const aid of newIdList) {
+                    newAuditors.push({
+                        tid: stage.tid, sid: stage.id, aid,
+                        times: stage.times, order, status: auditConst.status.uncheck,
+                    });
+                    order++;
+                }
+                if(newAuditors.length > 0) await transaction.insert(this.tableName, newAuditors);
+                await transaction.commit();
+            } catch (err) {
+                await transaction.rollback();
+                throw err;
+            }
+        }
+
+        // 固定终审-更新
+        async updateLastAudit(stage, auditList, lastId) {
+            const transaction = await this.db.beginTransaction();
+            try {
+                // 先判断auditList里的aid是否与lastId相同,相同则删除并重新更新order
+                const idList = this._.map(auditList, 'aid');
+                let order = idList.length + 1;
+                if (idList.indexOf(lastId) !== -1) {
+                    transaction.delete(this.tableName, { sid: stage.id, times: stage.times, aid: lastId });
+                    const audit = this._.find(auditList, { 'aid': lastId });
+                    // 顺移之后审核人流程顺序
+                    await this._syncOrderByDelete(transaction, stage.id, audit.order, stage.times);
+                    order = order - 1;
+                }
+
+                // 添加终审
+                const newAuditor = {
+                    tid: stage.tid, sid: stage.id, aid: lastId,
+                    times: stage.times, order, status: auditConst.status.uncheck,
+                };
+                await transaction.insert(this.tableName, newAuditor);
+                await transaction.commit();
+            } catch (err) {
+                await transaction.rollback();
+                throw err;
+            }
+        }
     }
 
     return StageAudit;

+ 3 - 1
app/view/shares/check_data_modal.ejs

@@ -101,6 +101,8 @@
                         setting.errorList.clearErrorData();
                         postData(url, data, function () {
                             window.location.reload();
+                        }, function () {
+                            window.location.reload();
                         });
                     }, 300);
                 }
@@ -111,4 +113,4 @@
         }
         return {checkAndPost};
     }
-</script>
+</script>

+ 9 - 2
app/view/stage/audit_modal.ejs

@@ -9,6 +9,7 @@
                 </div>
                 <div class="modal-body">
                     <div class="dropdown text-right">
+                        <% if (ctx.tender.info.shenpi.stage !== 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">
                             添加审批流程
@@ -34,6 +35,7 @@
                                 <% }) %>
                             </dl>
                         </div>
+                        <% } %>
                     </div>
                     <div class="card mt-3">
                         <div class="card-header">
@@ -43,8 +45,11 @@
                             <ul class="list-group list-group-flush" id="auditors">
                                 <% for (let i = 0, iLen = ctx.stage.auditorList.length; i < iLen; i++) { %>
                                 <li class="list-group-item" auditorId="<%- ctx.stage.auditorList[i].aid %>">
+                                    <% if (ctx.tender.info.shenpi.stage === shenpiConst.sp_status.sqspr ||
+                                            (ctx.tender.info.shenpi.stage === shenpiConst.sp_status.gdzs && i+1 !== iLen)) { %>
                                     <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
-                                    <%- ctx.stage.auditorList[i].order %> <%- ctx.stage.auditorList[i].name %>
+                                    <% } %>
+                                    <span><%- ctx.stage.auditorList[i].order %> <%- ctx.stage.auditorList[i].name %></span>
                                     <small class="text-muted"><%- ctx.stage.auditorList[i].role %></small>
                                 </li>
                                 <% } %>
@@ -79,7 +84,7 @@
                                 id="hideSp">修改审批流程</a>
                             <% } %>
                             <div class="card mt-3">
-                                <ul class="list-group list-group-flush">
+                                <ul class="list-group list-group-flush" id="auditors-list">
                                     <% ctx.stage.auditors2.forEach((item, idx) => { %>
                                     <% if (idx === 0) { %>
                                     <li class="list-group-item" data-auditorId="<%- item.aid %>">
@@ -795,6 +800,8 @@
 <script>
     const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup) %>');
     const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
+    const shenpi_status = <%- ctx.tender.info.shenpi.stage %>;
+    const shenpiConst =  JSON.parse('<%- JSON.stringify(shenpiConst) %>');
 </script>
 <% } %>
 <script>