Browse Source

wap页变更调整

ellisran 1 năm trước cách đây
mục cha
commit
a4f8c4f6b8

+ 171 - 48
app/controller/wap_controller.js

@@ -135,6 +135,16 @@ module.exports = app => {
             }
             // 获取待审批的变更期
             const auditChanges = await ctx.service.changeAudit.getAuditChangeByWap(ctx.session.sessionUser.accountId);
+            // 获取待审批的变更立项
+            let auditChangeProjects = [];
+            if (ctx.session.sessionProject.page_show.openChangeProject) {
+                auditChangeProjects = await ctx.service.changeProjectAudit.getAuditChangeProjectByWap(ctx.session.sessionUser.accountId);
+            }
+            // 获取待审批的变更申请
+            let auditChangeApplys = [];
+            if (ctx.session.sessionProject.page_show.openChangeApply) {
+                auditChangeApplys = await ctx.service.changeApplyAudit.getAuditChangeApplyByWap(ctx.session.sessionUser.accountId);
+            }
             // 获取待审批的变更方案
             let auditChangePlans = [];
             if (ctx.session.sessionProject.page_show.openChangePlan) {
@@ -151,6 +161,8 @@ module.exports = app => {
             const renderData = {
                 auditStages,
                 auditChanges,
+                auditChangeProjects,
+                auditChangeApplys,
                 auditChangePlans,
                 auditRevise,
                 auditAdvance,
@@ -257,39 +269,6 @@ module.exports = app => {
                     p.end_ratio = ctx.helper.mul(ctx.helper.div(p.end_tp, tender.sum, 4), 100);
                 }
 
-                // 变更令列表
-                const changes = await ctx.service.change.getListByStatus(tender.id, 0, 0);
-
-                for (const c of changes) {
-                    c.showApprovalBtn = false;
-                    c.curAuditors = await ctx.service.changeAudit.getAuditorsByStatus(c.cid, c.status, c.times);
-                    if (c.status === auditConst.change.status.checkNoPre) {
-                        c.curAuditors2 = await ctx.service.stageAudit.getAuditorsByStatus(c.cid, auditConst.change.status.checking, c.times);
-                        const curAudit = c.curAuditors2.find(function(x) {
-                            return x.uid === ctx.session.sessionUser.accountId;
-                        });
-                        if (curAudit && curAudit.status === auditConst.change.status.checking) {
-                            c.showApprovalBtn = true;
-                        }
-                    } else {
-                        const curAudit = c.curAuditors.find(function(x) {
-                            return x.uid === ctx.session.sessionUser.accountId;
-                        });
-                        if (curAudit && curAudit.status === auditConst.change.status.checking) {
-                            c.showApprovalBtn = true;
-                        }
-                    }
-                }
-
-                // 变更令列表
-                let changePlans = [];
-                if (ctx.session.sessionProject.page_show.openChangePlan) {
-                    changePlans = await ctx.service.changePlan.getListByStatus(tender.id, 0, 0);
-                    for (const c of changePlans) {
-                        c.curAuditor = await ctx.service.changePlanAudit.getAuditorByStatus(c.id, c.status, c.times);
-                    }
-                }
-
                 // 台账修订列表
                 const revises = await ctx.service.ledgerRevise.getReviseList(ctx.tender.id);
                 for (const lr of revises) {
@@ -308,15 +287,10 @@ module.exports = app => {
                 const renderData = {
                     tender,
                     stages,
-                    changes,
-                    changePlans,
                     revises,
                     advanceList,
                     auditConst: auditConst.stage,
-                    auditChangeConst: auditConst.change,
-                    auditChangePlanConst: auditConst.changePlan,
                     auditReviseConst: auditConst.revise,
-                    changeConst,
                     advanceConst,
                     tpUnit: ctx.tender.info.decimal.tp,
                     monthProgress,
@@ -380,6 +354,106 @@ module.exports = app => {
         }
 
         /**
+         * 工程变更列表页
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async changeIndex(ctx) {
+            try {
+                // 变更令列表
+                const changes = await ctx.service.change.getListByStatus(ctx.tender.id, 0, 0);
+
+                for (const c of changes) {
+                    c.showApprovalBtn = false;
+                    c.curAuditors = await ctx.service.changeAudit.getAuditorsByStatus(c.cid, c.status, c.times);
+                    if (c.status === auditConst.change.status.checkNoPre) {
+                        c.curAuditors2 = await ctx.service.changeAudit.getAuditorsByStatus(c.cid, auditConst.change.status.checking, c.times);
+                        const curAudit = c.curAuditors2.find(function(x) {
+                            return x.uid === ctx.session.sessionUser.accountId;
+                        });
+                        if (curAudit && curAudit.status === auditConst.change.status.checking) {
+                            c.showApprovalBtn = true;
+                        }
+                    } else {
+                        const curAudit = c.curAuditors.find(function(x) {
+                            return x.uid === ctx.session.sessionUser.accountId;
+                        });
+                        if (curAudit && curAudit.status === auditConst.change.status.checking) {
+                            c.showApprovalBtn = true;
+                        }
+                    }
+                }
+                // 变更立项列表
+                let changeProjects = [];
+                if (ctx.session.sessionProject.page_show.openChangeProject) {
+                    changeProjects = await ctx.service.changeProject.getListByStatus(ctx.tender.id, 0, 0);
+                    for (const c of changeProjects) {
+                        c.showApprovalBtn = false;
+                        c.curAuditors = await ctx.service.changeProjectAudit.getAuditorsByStatus(c.id, c.status, c.times);
+                        const curAudit = c.curAuditors.find(function(x) {
+                            return x.uid === ctx.session.sessionUser.accountId;
+                        });
+                        if (curAudit && curAudit.status === auditConst.changeProject.status.checking) {
+                            c.showApprovalBtn = true;
+                        }
+                    }
+                }
+
+                // 变更申请列表
+                let changeApplys = [];
+                if (ctx.session.sessionProject.page_show.openChangeApply) {
+                    changeApplys = await ctx.service.changeApply.getListByStatus(ctx.tender.id, 0, 0);
+                    for (const c of changeApplys) {
+                        c.showApprovalBtn = false;
+                        c.curAuditors = await ctx.service.changeApplyAudit.getAuditorsByStatus(c.id, c.status, c.times);
+                        const curAudit = c.curAuditors.find(function(x) {
+                            return x.uid === ctx.session.sessionUser.accountId;
+                        });
+                        if (curAudit && curAudit.status === auditConst.changeApply.status.checking) {
+                            c.showApprovalBtn = true;
+                        }
+                    }
+                }
+
+                // 变更方案列表
+                let changePlans = [];
+                if (ctx.session.sessionProject.page_show.openChangePlan) {
+                    changePlans = await ctx.service.changePlan.getListByStatus(ctx.tender.id, 0, 0);
+                    for (const c of changePlans) {
+                        c.showApprovalBtn = false;
+                        c.curAuditors = await ctx.service.changePlanAudit.getAuditorsByStatus(c.id, c.status, c.times);
+                        const curAudit = c.curAuditors.find(function(x) {
+                            return x.uid === ctx.session.sessionUser.accountId;
+                        });
+                        if (curAudit && curAudit.status === auditConst.changePlan.status.checking) {
+                            c.showApprovalBtn = true;
+                        }
+                    }
+                }
+
+                const renderData = {
+                    tender: ctx.tender,
+                    changes,
+                    changeProjects,
+                    changeApplys,
+                    changePlans,
+                    auditChangeConst: auditConst.change,
+                    auditChangeProjectConst: auditConst.changeProject,
+                    auditChangeApplyConst: auditConst.changeApply,
+                    auditChangePlanConst: auditConst.changePlan,
+                    changeConst,
+                    tpUnit: ctx.tender.info.decimal.tp,
+                    auditType: auditConst.auditType,
+                };
+                await ctx.render('wap/shenpi_change_index.ejs', renderData);
+            } catch (err) {
+                this.log(err);
+                ctx.redirect('/wap/list');
+            }
+        }
+
+        /**
          * 变更审批详细页
          *
          * @param {Object} ctx - egg全局变量
@@ -412,6 +486,60 @@ module.exports = app => {
         }
 
         /**
+         * 变更立项审批详细页
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async changeProject(ctx) {
+            try {
+                const tender = ctx.tender.data;
+                const change = ctx.change;
+                await ctx.service.changeProject.loadChangeAuditViewData(ctx.change);
+                const renderData = {
+                    moment,
+                    tender,
+                    change,
+                    auditConst: auditConst.changeProject,
+                    changeConst,
+                    tpUnit: ctx.tender.info.decimal.tp,
+                    auditType,
+                };
+                await ctx.render('wap/shenpi_change_project.ejs', renderData);
+            } catch (err) {
+                this.log(err);
+                ctx.redirect('/wap/list');
+            }
+        }
+
+        /**
+         * 变更申请审批详细页
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async changeApply(ctx) {
+            try {
+                const tender = ctx.tender.data;
+                const change = ctx.change;
+                await ctx.service.changeApply.loadChangeAuditViewData(ctx.change);
+                const renderData = {
+                    moment,
+                    tender,
+                    change,
+                    auditConst: auditConst.changeApply,
+                    changeConst,
+                    tpUnit: ctx.tender.info.decimal.tp,
+                    auditType,
+                };
+                await ctx.render('wap/shenpi_change_apply.ejs', renderData);
+            } catch (err) {
+                this.log(err);
+                ctx.redirect('/wap/list');
+            }
+        }
+
+        /**
          * 变更方案审批详细页
          *
          * @param {Object} ctx - egg全局变量
@@ -420,22 +548,17 @@ module.exports = app => {
         async changePlan(ctx) {
             try {
                 const tender = ctx.tender.data;
-                if (!ctx.session.sessionProject.page_show.openChangePlan) {
-                    throw '该功能已关闭';
-                }
-                const change = await ctx.service.changePlan.getDataById(ctx.params.cpid);
+                const change = ctx.change;
+                await ctx.service.changePlan.loadChangeAuditViewData(ctx.change);
                 const renderData = {
+                    moment,
                     tender,
                     change,
-                    auditConst: auditConst.changePlan,
+                    auditConst: auditConst.changeApply,
                     changeConst,
                     tpUnit: ctx.tender.info.decimal.tp,
+                    auditType,
                 };
-                const times = change.status !== auditConst.changePlan.status.checkNo ? change.times : change.times - 1;
-                renderData.change.user = await ctx.service.projectAccount.getAccountInfoById(change.uid);
-                renderData.change.auditors = await ctx.service.changePlanAudit.getAuditors(change.id, times);
-                // 获取审批流程中左边列表
-                renderData.change.auditors2 = await ctx.service.changePlanAudit.getAuditGroupByList(change.id, times);
                 await ctx.render('wap/shenpi_change_plan.ejs', renderData);
             } catch (err) {
                 this.log(err);

+ 4 - 1
app/router.js

@@ -745,8 +745,11 @@ module.exports = app => {
     app.get('/wap/tender/:id/advance/:order/detail', sessionAuth, tenderCheck, advanceCheck, 'wapController.advanceDetail');
     // 针对企业微信访问判断去掉wap就能直达web端
     app.get('/wap/tender/:id/measure/stage/:order', sessionAuth, tenderCheck, uncheckTenderCheck, 'wapController.stage');
+    app.get('/wap/tender/:id/change', sessionAuth, tenderCheck, uncheckTenderCheck, 'wapController.changeIndex');
     app.get('/wap/tender/:id/change/:cid/information', sessionAuth, tenderCheck, uncheckTenderCheck, changeCheck, changeAuditCheck, 'wapController.change');
-    app.get('/wap/tender/:id/change/plan/:cpid/information', sessionAuth, tenderCheck, uncheckTenderCheck, 'wapController.changePlan');
+    app.get('/wap/tender/:id/change/project/:cpid/information', sessionAuth, tenderCheck, uncheckTenderCheck, changeProjectCheck, changeProjectAuditCheck, 'wapController.changeProject');
+    app.get('/wap/tender/:id/change/apply/:caid/information', sessionAuth, tenderCheck, uncheckTenderCheck, changeApplyCheck, changeApplyAuditCheck, 'wapController.changeApply');
+    app.get('/wap/tender/:id/change/plan/:cpid/information', sessionAuth, tenderCheck, uncheckTenderCheck, changePlanCheck, changePlanAuditCheck, 'wapController.changePlan');
 
     // 微信
     app.get('/wx', 'wechatController.index');

+ 48 - 0
app/service/change_apply_audit.js

@@ -347,8 +347,13 @@ module.exports = app => {
                     id: caId, status: auditConst.status.checking,
                 });
                 // 微信模板通知
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/apply/' + caId + '/information#shenpi'
+                );
+                // 微信模板通知
                 const wechatData = {
                     type: 'apply',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.check,
                     tips: wxConst.tips.check,
                     code: this.ctx.session.sessionProject.code,
@@ -534,8 +539,13 @@ module.exports = app => {
                             id: caId, status: auditConst.status.checking,
                         });
                         // 微信模板通知
+                        const shenpiUrl = await this.ctx.helper.urlToShort(
+                            this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/apply/' + caId + '/information#shenpi'
+                        );
+                        // 微信模板通知
                         const wechatData = {
                             type: 'apply',
+                            wap_url: shenpiUrl,
                             status: wxConst.status.check,
                             tips: wxConst.tips.check,
                             code: this.ctx.session.sessionProject.code,
@@ -568,8 +578,13 @@ module.exports = app => {
                         });
                         // 微信模板通知
                         const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                        // 微信模板通知
+                        const shenpiUrl = await this.ctx.helper.urlToShort(
+                            this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/apply/' + caId + '/information#shenpi'
+                        );
                         const wechatData = {
                             type: 'apply',
+                            wap_url: shenpiUrl,
                             status: wxConst.status.success,
                             tips: wxConst.tips.success,
                             code: this.ctx.session.sessionProject.code,
@@ -640,8 +655,13 @@ module.exports = app => {
                 await transaction.insert(this.tableName, newAuditors);
                 // 微信模板通知
                 const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                // 微信模板通知
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/apply/' + caId + '/information#shenpi'
+                );
                 const wechatData = {
                     type: 'apply',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.back,
                     tips: wxConst.tips.back,
                     code: this.ctx.session.sessionProject.code,
@@ -1357,6 +1377,34 @@ module.exports = app => {
                 throw err;
             }
         }
+
+        /**
+         * 取待审批期列表(wap用)
+         *
+         * @param auditorId
+         * @return {Promise<*>}
+         */
+        async getAuditChangeApplyByWap(auditorId) {
+            const sql =
+                'SELECT sa.`aid`, sa.`times`, sa.`begin_time`, sa.`end_time`, sa.`tid`, sa.`caid`,' +
+                '    s.*,' +
+                '    t.`name` as `t_name`, t.`project_id`, t.`type`, t.`user_id`,' +
+                '    ti.`deal_info`, ti.`decimal` ' +
+                '  FROM ?? AS sa' +
+                '    Left Join ?? AS s On sa.`caid` = s.`id`' +
+                '    Left Join ?? As t On sa.`tid` = t.`id`' +
+                '    Left Join ?? AS ti ON ti.`tid` = t.`id`' +
+                '  WHERE sa.`aid` = ? and sa.`status` = ?';
+            const sqlParam = [
+                this.tableName,
+                this.ctx.service.changeApply.tableName,
+                this.ctx.service.tender.tableName,
+                this.ctx.service.tenderInfo.tableName,
+                auditorId,
+                auditConst.status.checking,
+            ];
+            return await this.db.query(sql, sqlParam);
+        }
     }
 
     return ChangeApplyAudit;

+ 48 - 0
app/service/change_project_audit.js

@@ -355,8 +355,12 @@ module.exports = app => {
                     id: cpId, status: auditConst.status.checking,
                 });
                 // 微信模板通知
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/project/' + cpId + '/information#shenpi'
+                );
                 const wechatData = {
                     type: 'project',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.check,
                     tips: wxConst.tips.check,
                     code: this.ctx.session.sessionProject.code,
@@ -557,8 +561,12 @@ module.exports = app => {
                         });
 
                         // 微信模板通知
+                        const shenpiUrl = await this.ctx.helper.urlToShort(
+                            this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/project/' + cpId + '/information#shenpi'
+                        );
                         const wechatData = {
                             type: 'project',
+                            wap_url: shenpiUrl,
                             status: wxConst.status.check,
                             tips: wxConst.tips.check,
                             code: this.ctx.session.sessionProject.code,
@@ -589,8 +597,12 @@ module.exports = app => {
 
                         // 微信模板通知
                         const users = this._.uniq(this._.map(auditors, 'aid'));
+                        const shenpiUrl = await this.ctx.helper.urlToShort(
+                            this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/project/' + cpId + '/information#shenpi'
+                        );
                         const wechatData = {
                             type: 'project',
+                            wap_url: shenpiUrl,
                             status: wxConst.status.success,
                             tips: wxConst.tips.success,
                             code: this.ctx.session.sessionProject.code,
@@ -662,8 +674,12 @@ module.exports = app => {
                 await transaction.insert(this.tableName, newAuditors);
                 // 微信模板通知
                 const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/project/' + cpId + '/information#shenpi'
+                );
                 const wechatData = {
                     type: 'project',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.back,
                     tips: wxConst.tips.back,
                     code: this.ctx.session.sessionProject.code,
@@ -726,8 +742,12 @@ module.exports = app => {
 
                 // 微信模板通知
                 const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/project/' + cpId + '/information#shenpi'
+                );
                 const wechatData = {
                     type: 'project',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.stop,
                     tips: wxConst.tips.stop,
                     code: this.ctx.session.sessionProject.code,
@@ -1493,6 +1513,34 @@ module.exports = app => {
                 throw err;
             }
         }
+
+        /**
+         * 取待审批期列表(wap用)
+         *
+         * @param auditorId
+         * @return {Promise<*>}
+         */
+        async getAuditChangeProjectByWap(auditorId) {
+            const sql =
+                'SELECT sa.`aid`, sa.`times`, sa.`begin_time`, sa.`end_time`, sa.`tid`, sa.`cpid`,' +
+                '    s.*,' +
+                '    t.`name` as `t_name`, t.`project_id`, t.`type`, t.`user_id`,' +
+                '    ti.`deal_info`, ti.`decimal` ' +
+                '  FROM ?? AS sa' +
+                '    Left Join ?? AS s On sa.`cpid` = s.`id`' +
+                '    Left Join ?? As t On sa.`tid` = t.`id`' +
+                '    Left Join ?? AS ti ON ti.`tid` = t.`id`' +
+                '  WHERE sa.`aid` = ? and sa.`status` = ?';
+            const sqlParam = [
+                this.tableName,
+                this.ctx.service.changeProject.tableName,
+                this.ctx.service.tender.tableName,
+                this.ctx.service.tenderInfo.tableName,
+                auditorId,
+                auditConst.status.checking,
+            ];
+            return await this.db.query(sql, sqlParam);
+        }
     }
 
     return ChangeProjectAudit;

+ 45 - 1
app/view/wap/dashboard.ejs

@@ -37,7 +37,7 @@
         </nav>
         <!--待审批期列表-->
         <div class="py-6">
-            <% if (auditStages.length !== 0 || auditChanges.length !== 0 || auditRevise.length !== 0 || auditAdvance.length !== 0 || auditChangePlans.length !== 0) { %>
+            <% if (auditStages.length !== 0 || auditChanges.length !== 0 || auditRevise.length !== 0 || auditAdvance.length !== 0 || auditChangeProjects.length !== 0|| auditChangeApplys.length !== 0 || auditChangePlans.length !== 0) { %>
                 <% for (const audit of auditStages) { %>
                 <div class="card mb-3">
                     <div class="card-header d-flex justify-content-between">
@@ -111,6 +111,50 @@
                         </div>
                     </div>
                 <% } %>
+                <% for (const change of auditChangeProjects) { %>
+                    <div class="card mb-3">
+                        <div class="card-header d-flex justify-content-between">
+                            <span><%- JSON.parse(change.deal_info).buildName %></span>
+                            <span class="badge badge-pill badge-danger">变更立项</span>
+                        </div>
+                        <div class="bg-light p-2 px-3"><b><%- change.t_name %></b></div>
+                        <div class="card-body">
+                            <div class="d-flex justify-content-between"><span><%- change.code %></span></div>
+                            <div class="my-2">
+                                <table class="table table-sm table-bordered">
+                                    <tr><th width="90">工程名称</th><td><%- change.name %></td></tr>
+                                    <tr><th>变更性质</th><td><%- change.quality %></td></tr>
+                                    <tr><th>增减金额</th><td class="text-right"><%- change.crease_price %></td></tr>
+                                </table>
+                            </div>
+                            <div class="">
+                                <a href="/wap/tender/<%- change.tid %>/change/project/<%- change.id %>/information#shenpi" class="btn btn-block btn-success">审批</a>
+                            </div>
+                        </div>
+                    </div>
+                <% } %>
+                <% for (const change of auditChangeApplys) { %>
+                    <div class="card mb-3">
+                        <div class="card-header d-flex justify-content-between">
+                            <span><%- JSON.parse(change.deal_info).buildName %></span>
+                            <span class="badge badge-pill badge-danger">变更申请</span>
+                        </div>
+                        <div class="bg-light p-2 px-3"><b><%- change.t_name %></b></div>
+                        <div class="card-body">
+                            <div class="d-flex justify-content-between"><span><%- change.code %></span></div>
+                            <div class="my-2">
+                                <table class="table table-sm table-bordered">
+                                    <tr><th width="90">工程名称</th><td><%- change.name %></td></tr>
+                                    <tr><th>变更性质</th><td><%- change.quality %></td></tr>
+                                    <tr><th>变更金额</th><td class="text-right"><%- ctx.helper.roundNum(change.total_price, JSON.parse(change.decimal).tp) %></td></tr>
+                                </table>
+                            </div>
+                            <div class="">
+                                <a href="/wap/tender/<%- change.tid %>/change/apply/<%- change.id %>/information#shenpi" class="btn btn-block btn-success">审批</a>
+                            </div>
+                        </div>
+                    </div>
+                <% } %>
                 <% for (const change of auditChangePlans) { %>
                     <div class="card mb-3">
                         <div class="card-header d-flex justify-content-between">

+ 28 - 13
app/view/wap/shenpi_change.ejs

@@ -22,7 +22,7 @@
     <!--顶部-->
     <nav class="fixed-top bg-dark">
         <div class="my-2 d-flex justify-content-between">
-            <span class="text-white ml-3"><a href="/wap/tender/<%- tender.id %>#biangeng" class="mr-2 text-white show-loading"><i class="fa fa-chevron-left"></i>工程变更</a></span>
+            <span class="text-white ml-3"><a href="/wap/tender/<%- tender.id %>/change#change" class="mr-2 text-white show-loading"><i class="fa fa-chevron-left"></i>工程变更</a></span>
             <a tabindex="0" href="javascript:void(0)" class="text-white text-truncate text-center"
                style="width:150px" data-toggle="popover" data-placement="top"
                data-content="<%- tender.name %>" data-trigger="focus"><%- tender.name %></a>
@@ -220,7 +220,7 @@
 <!--审批通过弹窗-->
 <div class="modal" tabindex="-1" role="dialog" id="sp-done">
     <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/wap/tender/<%- tender.id %>/change/approval?_csrf_j=<%= ctx.csrf %>" method="post" id="success-approval">
+        <div class="modal-content" id="success-approval">
             <div class="modal-header">
                 <h5 class="modal-title">审批通过</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
@@ -246,15 +246,15 @@
                 <input type="hidden" name="status" value="<%- auditConst.status.checked %>">
                 <input type="hidden" name="w_code" value="<%- change.w_code %>">
                 <input type="hidden" name="change_id" value="<%- change.cid %>">
-                <button type="submit" class="btn btn-success approval-btn">审批通过</button>
+                <button type="button" class="btn btn-success approval-btn">审批通过</button>
             </div>
-        </form>
+        </div>
     </div>
 </div>
 <!--审批退回弹窗-->
 <div class="modal" tabindex="-1" role="dialog" id="sp-back">
     <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/wap/tender/<%- tender.id %>/change/approval?_csrf_j=<%= ctx.csrf %>" method="post" id="fail-approval">
+        <div class="modal-content" id="fail-approval">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
@@ -285,9 +285,9 @@
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <input type="hidden" name="w_code" value="<%- change.w_code %>">
                 <input type="hidden" name="change_id" value="<%- change.cid %>">
-                <button type="submit" class="btn btn-warning approval-btn">确认退回</button>
+                <button type="button" class="btn btn-warning approval-btn">确认退回</button>
             </div>
-        </form>
+        </div>
     </div>
 </div>
 <% } %>
@@ -311,6 +311,10 @@
         $('.approval-btn').on('click', function () {
             // 判断审批状态
             let returnflag = true;
+            const pData = {
+                change_id: '<%- change.cid %>',
+                w_code: '<%- change.w_code %>',
+            }
             if ($(this).hasClass('btn-success')) {
                 const sdesc = $('#success-approval').find('textarea').val();
                 if (sdesc === '') {
@@ -322,19 +326,22 @@
                     returnflag = false;
                 } else if ($('input[name="p_code"]').val() !== undefined) {
                     $('input[name="p_code"]').val($.trim($('input[name="p_code"]').val()));
-                    const postData = {
+                    const postData2 = {
                         p_code: $('input[name="p_code"]').val(),
                     };
-                    postDataWithAsync('/tender/<%- tender.id %>/change/<%- change.cid %>/check/codeRepeat',postData, function (result) {
+                    postDataWithAsync('/tender/<%- tender.id %>/change/<%- change.cid %>/check/codeRepeat',postData2, function (result) {
                     }, function (data) {
                         returnflag = false;
                     });
+                    pData.p_code = $('input[name="p_code"]').val();
                 }
                 if(returnflag) {
-                    $('input[name="w_code"]').val($.trim($('#w_code').val()));
+                    // $('input[name="w_code"]').val($.trim($('#w_code').val()));
 
                     $('#success-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
-                    $('#success-approval').submit();
+                    // $('#success-approval').submit();
+                    pData.status = <%- auditConst.status.checked %>;
+                    pData.sdesc = sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
                 }
             } else {
                 const sdesc = $('#fail-approval').find('textarea').val();
@@ -349,10 +356,18 @@
                 }
                 if(returnflag) {
                     $('#fail-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
-                    $('input[name="w_code"]').val($.trim($('#w_code').val()));
-                    $('#fail-approval').submit();
+                    // $('input[name="w_code"]').val($.trim($('#w_code').val()));
+                    // $('#fail-approval').submit();
+                    pData.status = parseInt(type);
+                    pData.sdesc = sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
                 }
             }
+            if (pData.status) {
+                console.log(pData);
+                postData('/tender/<%- tender.id %>/change/approval', pData, function (result) {
+                    window.location.reload();
+                });
+            }
         })
     });
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 268 - 0
app/view/wap/shenpi_change_apply.ejs


+ 309 - 0
app/view/wap/shenpi_change_index.ejs

@@ -0,0 +1,309 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
+    <meta http-equiv="x-ua-compatible" content="ie=edge">
+    <title>标段概况-计量支付</title>
+    <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
+    <link rel="stylesheet" href="/public/css/wap/main.css">
+    <link rel="stylesheet" href="/public/css/toast.css">
+    <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
+    <link rel="stylesheet" href="/public/css/toastr.css">
+    <script src=/public/js/echarts/echarts.min.js></script>
+    <link rel="shortcut icon" href="/public/images/favicon.ico">
+    <style>
+        body {
+            padding: 0;
+        }
+    </style>
+</head>
+<body>
+<div class="container">
+    <!--顶部-->
+    <nav class="fixed-top bg-dark">
+        <div class="my-2 d-flex justify-content-between">
+            <span class="text-white ml-3"><a href="/wap/tender/<%- tender.id %>#biangeng" class="mr-2 text-white show-loading"><i class="fa fa-chevron-left"></i>工程变更</a></span>
+            <a tabindex="0" href="javascript:void(0)" class="text-white text-truncate text-center"
+               style="width:150px" data-toggle="popover" data-placement="top"
+               data-content="<%- tender.name %>" data-trigger="focus"><%- tender.name %></a>
+            <div class="mr-3">
+                <div class="dropdown">
+                    <button class="btn btn-sm btn-light dropdown-toggle" type="button" data-toggle="dropdown">
+                        <%- ctx.session.sessionUser.name.substr(ctx.session.sessionUser.name.length > 2 ? ctx.session.sessionUser.name.length - 2 : 0) %>
+                    </button>
+                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+                        <a class="dropdown-item" href="/wap/logout">退出登录</a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </nav>
+    <!--标段概况-->
+    <div class="py-6">
+        <ul class="nav nav-tabs nav-fill">
+            <% if (ctx.session.sessionProject.page_show.openChangeProject) { %>
+                <li class="nav-item">
+                    <a class="px-1 nav-link" data-toggle="tab" href="#changeProject" role="tab">变更立项</a>
+                </li>
+            <% } %>
+            <% if (ctx.session.sessionProject.page_show.openChangeApply) { %>
+                <li class="nav-item">
+                    <a class="px-1 nav-link" data-toggle="tab" href="#changeApply" role="tab">变更申请</a>
+                </li>
+            <% } %>
+            <% if (ctx.session.sessionProject.page_show.openChangePlan) { %>
+                <li class="nav-item">
+                    <a class="px-1 nav-link" data-toggle="tab" href="#changePlan" role="tab">变更方案</a>
+                </li>
+            <% } %>
+            <li class="nav-item">
+                <a class="px-1 nav-link active" data-toggle="tab" href="#change" role="tab">变更令</a>
+            </li>
+        </ul>
+        <div class="tab-content">
+            <% if (ctx.session.sessionProject.page_show.openChangeProject) { %>
+                <div class="tab-pane" id="changeProject">
+                    <dl class="mb-2 mt-3">
+                    <% for (const c of changeProjects) { %>
+                        <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/project/<%- c.id %>/information"><%- c.code %></a></span></dt>
+                        <dd>
+                            <table class="table table-hover">
+                                <tbody>
+                                <tr>
+                                    <td colspan="2">
+                                        <p class="mb-0">工程名称</p>
+                                        <%- c.name %>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <p class="mb-0">变更性质</p>
+                                        <b><%- c.quality %></b>
+                                    </td>
+                                    <td>
+                                        <p class="mb-0">增减金额</p>
+                                        <b><%- c.crease_price %></b>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td colspan="2">
+                                        <% if (c.showApprovalBtn){ %>
+                                            <a href="/wap/tender/<%- tender.id %>/change/project/<%- c.id %>/information#shenpi" class="btn btn-block btn-success">审批变更</a>
+                                        <% } else if (c.status === auditChangeProjectConst.status.uncheck) { %>
+                                            <span>待上报</span>
+                                        <% } else { %>
+                                            <% if (c.curAuditors.length > 0) { %>
+                                                <% if (c.curAuditors[0].audit_type === auditType.key.common) { %>
+                                                    <span class="<%- auditChangeProjectConst.statusClass[c.status] %>"><%- c.curAuditors[0].name %>-<%- c.curAuditors[0].role %> <%- auditChangeProjectConst.statusString[c.status] %></span>
+                                                <% } else { %>
+                                                    <span class="<%- auditChangeProjectConst.statusClass[c.status] %>"><%- ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审' %> <%- auditChangeProjectConst.statusString[c.status] %></span>
+                                                <% } %>
+                                            <% } %>
+                                        <% } %>
+                                    </td>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </dd>
+                    <% } %>
+                    </dl>
+                </div>
+            <% } %>
+            <% if (ctx.session.sessionProject.page_show.openChangeApply) { %>
+                <div class="tab-pane" id="changeApply">
+                    <dl class="mb-2 mt-3">
+                    <% for (const c of changeApplys) { %>
+                        <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/apply/<%- c.id %>/information"><%- c.code %></a></span></dt>
+                        <dd>
+                            <table class="table table-hover">
+                                <tbody>
+                                <tr>
+                                    <td colspan="2">
+                                        <p class="mb-0">工程名称</p>
+                                        <%- c.name %>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <p class="mb-0">变更性质</p>
+                                        <b><%- c.quality %></b>
+                                    </td>
+                                    <td>
+                                        <p class="mb-0">变更金额</p>
+                                        <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td colspan="2">
+                                        <% if (c.showApprovalBtn){ %>
+                                            <a href="/wap/tender/<%- tender.id %>/change/apply/<%- c.id %>/information#shenpi" class="btn btn-block btn-success">审批变更</a>
+                                        <% } else if (c.status === auditChangeApplyConst.status.uncheck) { %>
+                                            <span>待上报</span>
+                                        <% } else { %>
+                                            <% if (c.curAuditors.length > 0) { %>
+                                                <% if (c.curAuditors[0].audit_type === auditType.key.common) { %>
+                                                    <span class="<%- auditChangeApplyConst.statusClass[c.status] %>"><%- c.curAuditors[0].name %>-<%- c.curAuditors[0].role %> <%- auditChangeApplyConst.statusString[c.status] %></span>
+                                                <% } else { %>
+                                                    <span class="<%- auditChangeApplyConst.statusClass[c.status] %>"><%- ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审' %> <%- auditChangeApplyConst.statusString[c.status] %></span>
+                                                <% } %>
+                                            <% } %>
+                                        <% } %>
+                                    </td>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </dd>
+                    <% } %>
+                    </dl>
+                </div>
+            <% } %>
+            <% if (ctx.session.sessionProject.page_show.openChangePlan) { %>
+                <div class="tab-pane" id="changePlan">
+                    <dl class="mb-2 mt-3">
+                    <% for (const c of changePlans) { %>
+                        <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/plan/<%- c.id %>/information"><%- c.code %></a></span></dt>
+                        <dd>
+                            <table class="table table-hover">
+                                <tbody>
+                                <tr>
+                                    <td colspan="2">
+                                        <p class="mb-0">工程名称</p>
+                                        <%- c.name %>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <p class="mb-0">变更性质</p>
+                                        <b><%- c.quality %></b>
+                                    </td>
+                                    <td>
+                                        <p class="mb-0">变更金额</p>
+                                        <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td colspan="2">
+                                        <% if (c.showApprovalBtn){ %>
+                                            <a href="/wap/tender/<%- tender.id %>/change/plan/<%- c.id %>/information#shenpi" class="btn btn-block btn-success">审批变更</a>
+                                        <% } else if (c.status === auditChangePlanConst.status.uncheck) { %>
+                                            <span>待上报</span>
+                                        <% } else { %>
+                                            <% if (c.curAuditors.length > 0) { %>
+                                                <% if (c.curAuditors[0].audit_type === auditType.key.common) { %>
+                                                    <span class="<%- auditChangePlanConst.statusClass[c.status] %>"><%- c.curAuditors[0].name %>-<%- c.curAuditors[0].role %> <%- auditChangePlanConst.statusString[c.status] %></span>
+                                                <% } else { %>
+                                                    <span class="<%- auditChangePlanConst.statusClass[c.status] %>"><%- ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审' %> <%- auditChangePlanConst.statusString[c.status] %></span>
+                                                <% } %>
+                                            <% } %>
+                                        <% } %>
+                                    </td>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </dd>
+                    <% } %>
+                    </dl>
+                </div>
+            <% } %>
+            <div class="tab-pane active" id="change">
+                <dl class="mb-2 mt-3">
+                    <% for (const c of changes) { %>
+                        <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/information"><% if (c.status !== auditChangeConst.status.checked) { %><%- c.code %><% } else { %><%- c.p_code %><% } %></a></span></dt>
+                        <dd>
+                            <table class="table table-hover">
+                                <tbody>
+                                <tr>
+                                    <td colspan="2">
+                                        <p class="mb-0">工程名称</p>
+                                        <%- c.name %>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <p class="mb-0">变更性质</p>
+                                        <b><% for (const q in changeConst.quality) { %>
+                                                <% const cQuality = changeConst.quality[q] %><% if (cQuality.value === c.quality) { %><%- cQuality.name %><% } %><% } %></b>
+                                    </td>
+                                    <td>
+                                        <p class="mb-0">变更金额</p>
+                                        <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td colspan="2">
+                                        <% if (c.showApprovalBtn){ %>
+                                            <a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/information#shenpi" class="btn btn-block btn-success">审批变更</a>
+                                        <% } else if (c.status === auditChangeConst.status.uncheck) { %>
+                                            <span>待上报</span>
+                                        <% } else { %>
+                                            <% if (c.curAuditors.length > 0) { %>
+                                                <% if (c.curAuditors[0].audit_type === auditType.key.common) { %>
+                                                    <span class="<%- auditChangeConst.statusClass[c.status] %>"><%- c.curAuditors[0].name %>-<%- c.curAuditors[0].role %> <%- auditChangeConst.statusString[c.status] %></span>
+                                                <% } else { %>
+                                                    <span class="<%- auditChangeConst.statusClass[c.status] %>"><%- ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审' %> <%- auditChangeConst.statusString[c.status] %></span>
+                                                <% } %>
+                                            <% } %>
+                                        <% } %>
+                                    </td>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </dd>
+                    <% } %>
+                </dl>
+            </div>
+        </div>
+    </div>
+    <!--底栏菜单-->
+    <nav class="fixed-bottom navbar-dark bg-light border-top">
+        <ul class="nav nav-fill my-2">
+            <li class="nav-item">
+                <a class="nav-link text-muted show-loading" href="/wap/dashboard"><i class="fa fa-check-square-o"></i> 待审批</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link active show-loading" href="/wap/list"><i class="fa fa-list-ul"></i> 项目</a>
+            </li>
+        </ul>
+    </nav>
+</div>
+<!-- JS. -->
+<script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
+<script src="/public/js/popper/popper.min.js"></script>
+<script src="/public/js/bootstrap/bootstrap.min.js"></script>
+<script src="/public/js/cookies.js"></script>
+<script src="/public/js/toastr.min.js"></script>
+<script src="/public/js/wap/global.js"></script>
+<script>
+    $(document).ready(function () {
+        <% if (ctx.session.sessionProject.page_show.openChangeProject) { %>
+        if (window.location.hash && window.location.hash === '#changeProject') {
+            $('#change').removeClass('active');
+            $('.nav-item a[href="#change"]').removeClass('active');
+
+            $('#changeProject').addClass('active');
+            $('.nav-item a[href="#changeProject"]').addClass('active');
+        }
+        <% } %>
+        <% if (ctx.session.sessionProject.page_show.openChangeApply) { %>
+        if (window.location.hash && window.location.hash === '#changeApply') {
+            $('#change').removeClass('active');
+            $('.nav-item a[href="#change"]').removeClass('active');
+
+            $('#changeApply').addClass('active');
+            $('.nav-item a[href="#changeApply"]').addClass('active');
+        }
+        <% } %>
+        <% if (ctx.session.sessionProject.page_show.openChangePlan) { %>
+        if (window.location.hash && window.location.hash === '#changePlan') {
+            $('#change').removeClass('active');
+            $('.nav-item a[href="#change"]').removeClass('active');
+
+            $('#changePlan').addClass('active');
+            $('.nav-item a[href="#changePlan"]').addClass('active');
+        }
+        <% } %>
+    });
+</script>
+</body>
+</html>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 27 - 25
app/view/wap/shenpi_change_plan.ejs


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 247 - 0
app/view/wap/shenpi_change_project.ejs


+ 26 - 82
app/view/wap/tender.ejs

@@ -208,88 +208,32 @@
                 </dl>
             </div>
             <div class="tab-pane" id="biangeng">
-                <!--工程变更-->
-                <dl class="mb-2 mt-3">
-                    <% for (const c of changePlans) { %>
-                        <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/plan/<%- c.id %>/info"><%- c.code %></a></span></dt>
-                        <dd>
-                            <table class="table table-hover">
-                                <tbody>
-                                <tr>
-                                    <td colspan="2">
-                                        <p class="mb-0">工程名称</p>
-                                        <%- c.name %>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <p class="mb-0">变更性质</p>
-                                        <b><%- c.quality %></b>
-                                    </td>
-                                    <td>
-                                        <p class="mb-0">变更金额</p>
-                                        <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td colspan="2">
-                                        <% if (c.status === auditChangePlanConst.status.checking && c.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
-                                            <a href="/wap/tender/<%- tender.id %>/change/plan/<%- c.id %>/info#shenpi" class="btn btn-block btn-success">审批变更</a>
-                                        <% } else if (c.status === auditChangePlanConst.status.uncheck) { %>
-                                            <span>待上报</span>
-                                        <% } else { %>
-                                            <span class="<%- auditChangePlanConst.auditStringClass[c.curAuditor.status] %>"><%- c.curAuditor.name %><%if (c.curAuditor.role !== '' && c.curAuditor.role !== null) { %>-<%- c.curAuditor.role %><% } %> <%- auditChangePlanConst.auditString[c.curAuditor.status] %></span>
-                                        <% } %>
-                                    </td>
-                                </tr>
-                                </tbody>
-                            </table>
-                        </dd>
-                    <% } %>
-                    <% for (const c of changes) { %>
-                    <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/info"><% if (c.status !== auditChangeConst.status.checked) { %><%- c.code %><% } else { %><%- c.p_code %><% } %></a></span></dt>
-                    <dd>
-                        <table class="table table-hover">
-                            <tbody>
-                            <tr>
-                                <td colspan="2">
-                                    <p class="mb-0">工程名称</p>
-                                    <%- c.name %>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <p class="mb-0">变更性质</p>
-                                    <b><% for (const q in changeConst.quality) { %>
-                                            <% const cQuality = changeConst.quality[q] %><% if (cQuality.value === c.quality) { %><%- cQuality.name %><% } %><% } %></b>
-                                </td>
-                                <td>
-                                    <p class="mb-0">变更金额</p>
-                                    <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan="2">
-                                    <% if (c.showApprovalBtn){ %>
-                                    <a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/information#shenpi" class="btn btn-block btn-success">审批变更</a>
-                                    <% } else if (c.status === auditChangeConst.status.uncheck) { %>
-                                    <span>待上报</span>
-                                    <% } else { %>
-                                        <% if (c.curAuditors.length > 0) { %>
-                                            <% if (c.curAuditors[0].audit_type === auditType.key.common) { %>
-                                                <span class="<%- auditChangeConst.statusClass[c.status] %>"><%- c.curAuditors[0].name %>-<%- c.curAuditors[0].role %> <%- auditChangeConst.statusString[c.status] %></span>
-                                            <% } else { %>
-                                                <span class="<%- auditChangeConst.statusClass[c.status] %>"><%- ctx.helper.transFormToChinese(c.curAuditors[0].audit_order) + '审' %> <%- auditChangeConst.statusString[c.status] %></span>
-                                            <% } %>
-                                        <% } %>
-                                    <% } %>
-                                </td>
-                            </tr>
-                            </tbody>
-                        </table>
-                    </dd>
-                    <% } %>
-                </dl>
+                <% if (ctx.session.sessionProject.page_show.openChangeProject) { %>
+                <div class="card my-3">
+                    <div class="card-body">
+                        <a href="/wap/tender/<%- tender.id %>/change#changeProject"><h5 class="card-title d-flex justify-content-between">变更立项</h5></a>
+                    </div>
+                </div>
+                <% } %>
+                <% if (ctx.session.sessionProject.page_show.openChangeApply) { %>
+                    <div class="card my-3">
+                        <div class="card-body">
+                            <a href="/wap/tender/<%- tender.id %>/change#changeApply"><h5 class="card-title d-flex justify-content-between">变更申请</h5></a>
+                        </div>
+                    </div>
+                <% } %>
+                <% if (ctx.session.sessionProject.page_show.openChangePlan) { %>
+                    <div class="card my-3">
+                        <div class="card-body">
+                            <a href="/wap/tender/<%- tender.id %>/change#changePlan"><h5 class="card-title d-flex justify-content-between">变更方案</h5></a>
+                        </div>
+                    </div>
+                <% } %>
+                <div class="card my-3">
+                    <div class="card-body">
+                        <a href="/wap/tender/<%- tender.id %>/change#change"><h5 class="card-title d-flex justify-content-between">变更令</h5></a>
+                    </div>
+                </div>
             </div>
         </div>
     </div>