ellisran 3 часов назад
Родитель
Сommit
a11ffe269a

+ 1 - 0
app/const/fun_set.js

@@ -73,6 +73,7 @@ const defaultInfo = {
         end_month: 0,
         end_day: 0,
     },
+    change_plan_name: '',
     change_class: changeClass,
     change_state: changeState,
 };

+ 9 - 9
app/controller/change_controller.js

@@ -3651,7 +3651,7 @@ module.exports = app => {
                 // 判断是否被变更申请调用了,是则无法发起修订
                 const projectInfo = await ctx.service.changePlan.getDataByCondition({ tid: ctx.tender.id, apply_code: ctx.change.code });
                 if (projectInfo) {
-                    throw '该变更申请已被变更方案调用,无法发起重新审批';
+                    throw '该变更申请已被' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '调用,无法发起重新审批';
                 }
                 if (ctx.session.sessionUser.loginStatus === 0) {
                     const code = ctx.request.body.code;
@@ -3705,7 +3705,7 @@ module.exports = app => {
                 // 判断是否被变更申请调用了,是则无法发起修订
                 const projectInfo = await ctx.service.changePlan.getDataByCondition({ tid: ctx.tender.id, apply_code: ctx.change.code });
                 if (projectInfo) {
-                    throw '该变更申请已被变更方案调用,无法发起修订';
+                    throw '该变更申请已被' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '调用,无法发起修订';
                 }
                 if (ctx.session.sessionUser.loginStatus === 0) {
                     const code = ctx.request.body.code;
@@ -3951,7 +3951,7 @@ module.exports = app => {
                 }
                 const data = JSON.parse(ctx.request.body.data);
                 if (!data.code || data.code === '') {
-                    throw '变更方案编号不能为空';
+                    throw (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '编号不能为空';
                 }
 
                 // 在生成新变更方案后,需要copy前一个变更方案报表的签名信息
@@ -3975,7 +3975,7 @@ module.exports = app => {
             try {
                 const result = await ctx.service.changePlan.delete(ctx.request.body.cpid);
                 if (!result) {
-                    throw '删除变更方案失败';
+                    throw '删除' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '失败';
                 }
                 ctx.redirect(ctx.request.header.referer);
             } catch (err) {
@@ -4337,10 +4337,10 @@ module.exports = app => {
                     throw '数据错误';
                 }
                 if (ctx.change.uid !== ctx.session.sessionUser.accountId) {
-                    throw '您无权上报该变更方案数据';
+                    throw '您无权上报该' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '数据';
                 }
                 if (ctx.change.status === auditConst.status.checking || ctx.change.status === auditConst.status.checked) {
-                    throw '该变更方案数据当前无法上报';
+                    throw '该' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '数据当前无法上报';
                 }
 
                 await ctx.service.changePlanAudit.start(ctx.change.id, ctx.change.times);
@@ -4362,7 +4362,7 @@ module.exports = app => {
             try {
                 const auditConst = audit.changePlan;
                 if (!ctx.change || ctx.change.status !== auditConst.status.checking) {
-                    throw '当前变更方案数据有误';
+                    throw '当前' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '数据有误';
                 }
                 if (ctx.change.curAuditorIds.length === 0 || ctx.change.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) === -1) {
                     throw '您无权进行该操作';
@@ -4502,7 +4502,7 @@ module.exports = app => {
                 // 判断是否被变更申请调用了,是则无法发起修订
                 const projectInfo = await ctx.service.change.getDataByCondition({ tid: ctx.tender.id, plan_code: ctx.change.code });
                 if (projectInfo) {
-                    throw '该变更方案已被变更令调用,无法发起重新审批';
+                    throw '该' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '已被变更令调用,无法发起重新审批';
                 }
                 if (ctx.session.sessionUser.loginStatus === 0) {
                     const code = ctx.request.body.code;
@@ -4556,7 +4556,7 @@ module.exports = app => {
                 // 判断是否被变更申请调用了,是则无法发起修订
                 const projectInfo = await ctx.service.change.getDataByCondition({ tid: ctx.tender.id, plan_code: ctx.change.code });
                 if (projectInfo) {
-                    throw '该变更方案已被变更令调用,无法发起修订';
+                    throw '该' + (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') + '已被变更令调用,无法发起修订';
                 }
                 if (ctx.session.sessionUser.loginStatus === 0) {
                     const code = ctx.request.body.code;

+ 3 - 1
app/controller/dashboard_controller.js

@@ -126,6 +126,7 @@ module.exports = app => {
                 const spChangeApply = subProject.page_show.openChangeApply ? ctx.helper._.filter(auditShenpiChangeApply, { spid: subProject.id }) : [];
                 noticeList.push(...ctx.helper.addKeyValue4ObjArray(spChangeApply, 'shenpi_type', 'changeApply'));
                 const spChangePlan = subProject.page_show.openChangePlan ? ctx.helper._.filter(auditShenpiChangePlan, { spid: subProject.id }) : [];
+                ctx.helper.addKeyValue4ObjArray(spChangePlan, 'change_plan_name', (ctx.service.subProject.getFunSet(subProject.fun_set).change_plan_name || '变更方案'));
                 noticeList.push(...ctx.helper.addKeyValue4ObjArray(spChangePlan, 'shenpi_type', 'changePlan'));
                 const spPayment = subProject.page_show.openPayment ? ctx.helper._.filter(auditShenpiPayment, { spid: subProject.id }) : [];
                 noticeList.push(...ctx.helper.addKeyValue4ObjArray(spPayment, 'shenpi_type', 'payment'));
@@ -312,6 +313,7 @@ module.exports = app => {
                 }
                 if (sp) {
                     t.sp_name = sp.name;
+                    if (type === 'changePlan') t.change_plan_name = (sp && ctx.service.subProject.getFunSet(sp.fun_set).change_plan_name || '变更方案');
                     t.start_audit = 0;
                     let calcTime;
                     let closeType = false;
@@ -474,7 +476,7 @@ module.exports = app => {
             ];
             if (ctx.subProject.page_show.openChangeProject) shenpi_count.push({ count: await ctx.service.changeProjectAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '变更立项' });
             if (ctx.subProject.page_show.openChangeApply) shenpi_count.push({ count: await ctx.service.changeApplyAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '变更申请' });
-            if (ctx.subProject.page_show.openChangePlan) shenpi_count.push({ count: await ctx.service.changePlanAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '变更方案' });
+            if (ctx.subProject.page_show.openChangePlan) shenpi_count.push({ count: await ctx.service.changePlanAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') });
             if (ctx.subProject.page_show.openMaterial) shenpi_count.push({ count: await ctx.service.materialAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '材料调差' });
             if (ctx.subProject.page_show.openFinancial) shenpi_count.push({ count: await ctx.service.financialPayAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '资金支付' });
             if (ctx.subProject.page_show.qualityInspection) shenpi_count.push({ count: await ctx.service.qualityInspectionAudit.getCountByChecked(ctx.session.sessionUser.accountId, ctx.subProject.id), name: '质量巡检' });

+ 1 - 1
app/controller/report_controller.js

@@ -1100,7 +1100,7 @@ module.exports = app => {
                 switch (stage_id) {
                     case rptBusiness.BusinessStageId.change_plan:
                         otherChangeList = await ctx.service.changePlan.getListByStatus(tenderId, 0, 0, 0, 0, state);
-                        otherHintName = '变更方案';
+                        otherHintName = (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案');
                         break;
                     case rptBusiness.BusinessStageId.change_project:
                         otherChangeList = await ctx.service.changeProject.getListByStatus(tenderId, 0, 0, 0, 0, state);

+ 11 - 4
app/controller/sub_proj_setting_controller.js

@@ -407,15 +407,16 @@ module.exports = app => {
 
         async fun(ctx) {
             try {
-                this.defaultCheck(ctx);
+                await this.defaultCheck(ctx);
                 const funRela = this.ctx.subProject.fun_rela;
                 const fun_set = this.ctx.subProject.fun_set;
-                await this.layout('sp_setting/fun.ejs', {
+                const renderData = {
                     funRela,
                     imType,
                     endMonth: funSet.endMonth,
                     funSet: fun_set,
-                }, 'sp_setting/fun_modal.ejs');
+                };
+                await this.layout('sp_setting/fun.ejs', renderData, 'sp_setting/fun_modal.ejs');
             } catch (error) {
                 ctx.log(error);
                 ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
@@ -429,13 +430,19 @@ module.exports = app => {
          */
         async updateFun(ctx) {
             try {
-                this.defaultCheck(ctx);
+                await this.defaultCheck(ctx);
 
                 const data = JSON.parse(ctx.request.body.data);
                 if (data) ctx.request.body = data;
                 const rule = ctx.service.subProject.rule('fun');
                 ctx.validate(rule);
 
+                if (data.addFunSet && Object.prototype.hasOwnProperty.call(data.addFunSet, 'change_plan_name')) {
+                    if (typeof data.addFunSet.change_plan_name !== 'string') throw '变更方案名称格式错误';
+                    data.addFunSet.change_plan_name = data.addFunSet.change_plan_name.trim();
+                    if (data.addFunSet.change_plan_name.length > 5) throw '变更方案名称字符不能超过5个';
+                }
+
                 const result = await ctx.service.subProject.updateFunRela(ctx.subProject.id, ctx.request.body);
                 if (!result) throw '保存数据失败';
                 this.ctx.subProject.page_show.openChangeProject = data.openChangeProject ? 1 : 0;

+ 1 - 0
app/controller/wap_controller.js

@@ -213,6 +213,7 @@ module.exports = app => {
                         subProjects.push(sp);
                     }
                 }
+                cp.change_plan_name = (sp && ctx.service.subProject.getFunSet(sp.fun_set).change_plan_name || '变更方案');
                 if (sp) {
                     const pageShow = JSON.parse(sp.page_show);
                     if (pageShow.openChangePlan) {

+ 2 - 2
app/middleware/change_plan_check.js

@@ -28,10 +28,10 @@ module.exports = options => {
             }
             const cpid = this.params.cpid || this.request.body.cpid;
             if (!cpid) {
-                throw '您访问的变更方案不存在';
+                throw '您访问的' + (this.subProject && this.subProject.fun_set && this.subProject.fun_set.change_plan_name || '变更方案') + '不存在';
             }
             const change = yield this.service.changePlan.getDataById(cpid);
-            if (!change) throw '变更方案数据有误';
+            if (!change) throw (this.subProject && this.subProject.fun_set && this.subProject.fun_set.change_plan_name || '变更方案') + '数据有误';
             // 读取原报、审核人数据
             yield this.service.changePlan.loadChangeUser(change);
             // decimal小数位设置

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

@@ -308,7 +308,7 @@ $(document).ready(() => {
             {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 120},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.unit_price'},
-            {title: '变更方案|数量', colSpan: '2|1', rowSpan: '1|1', field: 'pamount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.pamount'},
+            {title: planName + '|数量', colSpan: '2|1', rowSpan: '1|1', field: 'pamount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.pamount'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pa_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.pa_tp'},
             {title: '变更令|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.camount'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.ca_tp'},

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

@@ -448,7 +448,7 @@ $(document).ready(() => {
     if (orders[0] === 'time') {
         $('#bpaixu').text('排序:创建时间');
     } else {
-        $('#bpaixu').text('排序:变更方案编号');
+        $('#bpaixu').text('排序:' + planName + '编号');
     }
     // let sortSetting = getLocalCache('change-'+ $('#tenderId').val() +'-list-sort');
     // if (sortSetting && parseInt(sortSetting) === 1) {

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

@@ -199,7 +199,7 @@ function checkAuditorFrom () {
     }
     let flag = false;
     if (change.code === '') {
-        toastr.error('变更方案编号不能为空');
+        toastr.error(planName + '编号不能为空');
         flag = true;
     }
     if (!change.name) {

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

@@ -105,7 +105,7 @@ $(document).ready(() => {
         switch(val_name) {
             case 'code':
                 if(!val) {
-                    toastr.error('方案编号不能为空');
+                    toastr.error(planName + '编号不能为空');
                     $(this).val(change[val_name]);
                     return false;
                 }

+ 1 - 1
app/service/change_plan.js

@@ -82,7 +82,7 @@ module.exports = app => {
             const codeCount = await this.db.queryOne(sql, sqlParam);
             const count = codeCount.count;
             if (count > 0) {
-                throw '变更方案编号重复';
+                throw (this.ctx.subProject && this.ctx.subProject.fun_set && this.ctx.subProject.fun_set.change_plan_name || '变更方案') + '编号重复';
             }
 
             // 初始化事务

+ 1 - 0
app/view/change/information.ejs

@@ -557,6 +557,7 @@
     </div>
 </div>
 <script>
+    const planName = decodeURIComponent('<%- encodeURIComponent((ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案')).replace(/'/g, '%27') %>');
     let changeMode = parseInt('<%- changeMode %>');
     const tenderName = JSON.parse(unescape('<%- escape(JSON.stringify(tender.data.name)) %>'));
     const tenderId = '<%- tender.id %>';

+ 1 - 2
app/view/change/modal.ejs

@@ -99,7 +99,7 @@
                         }
                     </style>
                     <div class="form-group">
-                        <label>关联变更方案</label>
+                        <label>关联<%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></label>
                         <select class="form-control form-control-sm" id="plan-code">
                             <option></option>
                             <% for (const cp of changePlanList) { %>
@@ -1247,4 +1247,3 @@
         }
     });
 </script>
-

+ 4 - 3
app/view/change/plan.ejs

@@ -18,7 +18,7 @@
                                 <li class="mb-2">
                                     <div class="custom-control custom-radio">
                                         <input type="radio" class="custom-control-input" id="pai3" name="paizhi" value="code">
-                                        <label class="custom-control-label" for="pai3">变更方案编号</label>
+                                        <label class="custom-control-label" for="pai3"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>编号</label>
                                     </div>
                                 </li>
                             </ul>
@@ -57,7 +57,7 @@
             </div>
             <% if (tender.user_id === uid) { %>
             <div class="ml-auto">
-                <a href="#add-bj" data-toggle="modal" data-target="#add-bj" class="btn btn-sm btn-primary pull-right ml-1">新建变更方案</a>
+                <a href="#add-bj" data-toggle="modal" data-target="#add-bj" class="btn btn-sm btn-primary pull-right ml-1">新建<%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></a>
                 <a href="#setting" data-toggle="modal" data-target="#setting" class="btn btn-sm btn-outline-primary pull-right ml-1"><i class="fa fa-cog"></i></a>
             </div>
             <% } %>
@@ -69,7 +69,7 @@
                 <table class="table table-bordered">
                     <thead class="text-center">
                     <tr>
-                        <th width="15%" id="sort_change">变更方案编号</th><th width="20%">变更工程名称</th>
+                        <th width="15%" id="sort_change"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>编号</th><th width="20%">变更工程名称</th>
                         <th width="10%">变更性质</th><th width="15%">变更金额</th><th width="15%">变更申请编号</th>
                         <th width="7%">审批状态</th><th width="13%">审批进度</th><th width="5%">操作</th>
                     </tr>
@@ -122,6 +122,7 @@
     </div>
 </div>
 <script>
+    const planName = decodeURIComponent('<%- encodeURIComponent((ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案')).replace(/'/g, '%27') %>');
     autoFlashHeight();
     const tenderId = parseInt('<%- tender.id %>');
     const tenderName = JSON.parse(unescape('<%- escape(JSON.stringify(tender.name)) %>'));

+ 4 - 3
app/view/change/plan_information.ejs

@@ -6,7 +6,7 @@
             <div>
                 <div class="d-inline-block">
                     <div class="btn-group btn-group-toggle group-tab">
-                        <a class="btn btn-sm btn-light active" href="javascript:void(0);">方案详情</a>
+                        <a class="btn btn-sm btn-light active" href="javascript:void(0);"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>详情</a>
                         <a class="btn btn-sm btn-light" href="/tender/<%- ctx.tender.id %>/change/plan/<%- ctx.change.id %>/report">输出报表</a>
                     </div>
                 </div>
@@ -72,11 +72,11 @@
                         <!--</ul>-->
                     <!--</div>-->
                     <div class="col-xl-8 mx-auto">
-                        <h4 id="xinxi" class="text-center py-2">工程变更方案</h4>
+                        <h4 id="xinxi" class="text-center py-2">工程<%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></h4>
                         <h5>基本信息</h5>
                         <table class="table table-bordered" id="plan-table">
                             <tr>
-                                <th width="120" class="text-center" style="vertical-align: middle">变更方案编号<b class="text-danger">*&nbsp;</b></th>
+                                <th width="120" class="text-center" style="vertical-align: middle"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>编号<b class="text-danger">*&nbsp;</b></th>
                                 <td><input class="form-control form-control-sm" value="<%- change.code %>" data-name="code" <% if (change.readOnly) { %>readonly<% } %> type="text" placeholder=""></td>
                                 <th width="140" class="text-center" style="vertical-align: middle">变更申请编号</th>
                                 <td><input class="form-control form-control-sm" type="text" value="<%- change.apply_code %>" data-name="apply_code" <% if (ctx.session.sessionUser.accountId !== change.uid) { %>readonly<% } %> placeholder="自动读取,没有就为空,可编辑"></td>
@@ -172,6 +172,7 @@
     </div>
 </div>
 <script>
+    const planName = decodeURIComponent('<%- encodeURIComponent((ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案')).replace(/'/g, '%27') %>');
     autoFlashHeight();
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     const fileTypeConst = JSON.parse(unescape('<%- escape(JSON.stringify(changeConst.file_type)) %>'));

+ 3 - 4
app/view/change/plan_modal.ejs

@@ -3,7 +3,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">确认删除变更方案</h5>
+                <h5 class="modal-title">确认删除<%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></h5>
             </div>
             <div class="modal-body">
                 <h5>删除后,数据无法恢复,请谨慎操作。</h5>
@@ -48,7 +48,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">新建变更方案</h5>
+                <h5 class="modal-title">新建<%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></h5>
             </div>
             <div class="modal-body">
                 <div class="form-group">
@@ -95,7 +95,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">变更方案编号设置</h5>
+                <h5 class="modal-title"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>编号设置</h5>
             </div>
             <div class="modal-body">
                 <ul class="nav nav-tabs mb-3" role="tablist">
@@ -169,4 +169,3 @@
 </div>
 <% } %>
 
-

+ 1 - 1
app/view/change/plan_report.ejs

@@ -7,7 +7,7 @@
                 <div id="left-header" class="d-inline-block" style="min-width: 203px;">
                     <div class="d-inline-block">
                         <div class="btn-group btn-group-toggle group-tab">
-                            <a class="btn btn-sm btn-light" href="/tender/<%- ctx.tender.id %>/change/plan/<%- ctx.change.id %>/information">方案详情</a>
+                            <a class="btn btn-sm btn-light" href="/tender/<%- ctx.tender.id %>/change/plan/<%- ctx.change.id %>/information"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>详情</a>
                             <a class="btn btn-sm btn-light active" href="javascript:void(0);">输出报表</a>
                         </div>
                     </div>

+ 1 - 1
app/view/change/relation.ejs

@@ -46,7 +46,7 @@
                     <% } %>
                     <% if (ctx.subProject.page_show.openChangePlan) { %>
                     <tr id="plan">
-                        <td class="text-center">变更方案</td>
+                        <td class="text-center"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></td>
                         <td><% if (ctx.session.sessionUser.accountId === ctx.change.uid) { %><input id="plan_code" class="form-control form-control-sm" type="text" value="<% if (changePlanInfo) { %><%- changePlanInfo.code %><% } %>" data-name="plan_code" <% if (ctx.session.sessionUser.accountId !== change.uid) { %>readonly<% } %> placeholder="自动读取,没有就为空,可编辑"><% } else { %><% if (changePlanInfo) { %><%- changePlanInfo.code %><% } %><% } %></td>
                         <td><% if (changePlanInfo) { %><%- changePlanInfo.name %><% } %></td>
                         <td class="text-center"><% if (changePlanInfo) { %><a target="_blank" href="/tender/<%- tender.id %>/change/plan/<%- changePlanInfo.id %>/information">查看详情</a><% } %></td>

+ 4 - 4
app/view/dashboard/index.ejs

@@ -61,7 +61,7 @@
                                         <option value="8">变更申请(<%- auditChangeApply.length %>)</option>
                                     <% } %>
                                     <% if (ctx.subProject.page_show.openChangePlan && auditChangePlan.length !== 0) { %>
-                                        <option value="9">变更方案(<%- auditChangePlan.length %>)</option>
+                                        <option value="9"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>(<%- auditChangePlan.length %>)</option>
                                     <% } %>
                                     <% if (ctx.subProject.page_show.openMaterial && auditMaterial.length !== 0) { %>
                                     <option value="1">材料调差(<%- auditMaterial.length %>)</option>
@@ -237,7 +237,7 @@
                                         <% } %>
                                         <% for (const acp of auditChangePlan) { %>
                                             <tr data-type="9">
-                                                <td><span class="bg-new-changePlan text-new-changePlan badge text-width">变更方案</span></td>
+                                                <td><span class="bg-new-changePlan text-new-changePlan badge text-width"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></span></td>
                                                 <td><a href="/tender/<%- acp.tid %>"><%- acp.name %></a> <a href="/tender/<%- acp.tid %>/change/plan/<%- acp.cpid %>/information"><%- acp.mcode %></a></td>
                                                 <td>变更</td>
                                                 <td><%- (
@@ -558,7 +558,7 @@
                                         <option value="8">变更申请</option>
                                     <% } %>
                                     <% if (ctx.subProject.page_show.openChangePlan) { %>
-                                        <option value="9">变更方案</option>
+                                        <option value="9"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></option>
                                     <% } %>
                                     <% if (ctx.subProject.page_show.openMaterial) { %>
                                         <option value="1">材料调差</option>
@@ -681,7 +681,7 @@
                                                 </tr>
                                             <% } else if(notice.type === pushType.changePlan && ctx.subProject.page_show.openChangePlan) { %>
                                                 <tr data-type="9">
-                                                    <td><span class="bg-new-changePlan text-new-changePlan badge text-width">变更方案</span></td>
+                                                    <td><span class="bg-new-changePlan text-new-changePlan badge text-width"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></span></td>
                                                     <td><a href="/tender/<%- notice.tid %>"><%- notice.name %></a> <a href="/tender/<%- notice.tid %>/change/plan/<%- notice.cpid %>/information"><%- notice.c_code %></a></td>
                                                     <td><%- notice.su_name %><%- (notice.su_role ? '-' + notice.su_role : '') %></td>
                                                     <td><%- ctx.helper.dateTran(notice.create_time, 'YYYY/MM/DD HH:mm') %></td>

+ 2 - 2
app/view/dashboard/workspace.ejs

@@ -324,7 +324,7 @@
                                                         <% const acp = db; %>
                                                         <tr data-type="changePlan">
                                                             <% if (acp.start_audit === 2) { %><td class="text-center text-danger"><i class="fa fa-exclamation-triangle"></i></td><% } else if (acp.start_audit === 1) { %><td class="text-center text-warning"><i class="fa fa-bell"></i></td><% } else { %><td></td><% } %>
-                                                            <td><span class="bg-new-changePlan text-new-changePlan badge text-width">变更方案</span></td>
+                                                            <td><span class="bg-new-changePlan text-new-changePlan badge text-width"><%= acp.change_plan_name || '变更方案' %></span></td>
                                                             <td><a href="/sp/<%- acp.spid %>/dashboard"><%- acp.sp_name %></a></td>
                                                             <td><a href="/tender/<%- acp.tid %>"><%- acp.name %></a> <a href="/tender/<%- acp.tid %>/change/plan/<%- acp.cpid %>/information"><%- acp.mcode %></a></td>
                                                             <td>变更</td>
@@ -955,7 +955,7 @@
                                         break;
                                     case 'changePlan':
                                         html.push(`<li class="list-group-item">
-                                            <span class="${acChangePlan.auditStringClass[n.status]}">${acChangePlan.auditString[n.status]}</span> <a href="/tender/${n.id}/change/plan/${n.cpid}/information" target="_blank">${n.name}</a> 变更方案 ${n.code}<span class="float-right">${moment(new Date(n.shenpi_time)).format('HH:mm:ss')}</span></li>`);
+                                            <span class="${acChangePlan.auditStringClass[n.status]}">${acChangePlan.auditString[n.status]}</span> <a href="/tender/${n.id}/change/plan/${n.cpid}/information" target="_blank">${n.name}</a> ${_.escape(n.change_plan_name || '变更方案')} ${n.code}<span class="float-right">${moment(new Date(n.shenpi_time)).format('HH:mm:ss')}</span></li>`);
                                         break;
                                     case 'advance':
                                         html.push(`<li class="list-group-item">

+ 2 - 3
app/view/report/index.ejs

@@ -98,7 +98,7 @@
                     <a class="btn btn-sm btn-light" href="/tender/<%- tender_id %>/change/<%- bizId %>/information">变更详情</a>
                     <% } %>
                     <% if ([-301].includes(stg_id)) { %>
-                    <a class="btn btn-sm btn-light" href="/tender/<%- tender_id %>/change/plan/<%- bizId %>/information">方案详情</a>
+                    <a class="btn btn-sm btn-light" href="/tender/<%- tender_id %>/change/plan/<%- bizId %>/information"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>详情</a>
                     <% } %>
                     <% if ([-302].includes(stg_id)) { %>
                     <a class="btn btn-sm btn-light" href="/tender/<%- tender_id %>/change/project/<%- bizId %>/information">立项详情</a>
@@ -131,7 +131,7 @@
                             <a class="dropdown-item" href="javascript: void(0)" onclick="rptOtherStage.showOtherStage('advance');">预付款</a>
                             <a class="dropdown-item" href="javascript: void(0)" onclick="rptChangeRela.showChangeRela('change_project');">变更立项</a>
                             <a class="dropdown-item" href="javascript: void(0)" onclick="rptChangeRela.showChangeRela('change_apply');">变更申请</a>
-                            <a class="dropdown-item" href="javascript: void(0)" onclick="rptChangeRela.showChangeRela('change_plan');">变更方案</a>
+                            <a class="dropdown-item" href="javascript: void(0)" onclick="rptChangeRela.showChangeRela('change_plan');"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></a>
                             <a class="dropdown-item" href="javascript: void(0)" onclick="rptChangeRela.showChangeRela('change');">变更令</a>
                             <% if (viewPmData) { %>
                             <a class="dropdown-item" href="javascript: void(0)" onclick="rptOtherStage.showOtherStage('pm_deal');">项目管理-合同管理</a>
@@ -1204,4 +1204,3 @@
       height: 300px;
     }
 </style>
-

+ 1 - 2
app/view/report/index_archive.ejs

@@ -26,7 +26,7 @@
                             <a class="dropdown-item" href="javascript:void(0);" data-type="change">变更令</a>
                             <a class="dropdown-item" href="javascript:void(0);" data-type="change_project">变更立项</a>
                             <a class="dropdown-item" href="javascript:void(0);" data-type="change_apply">变更申请</a>
-                            <a class="dropdown-item" href="javascript:void(0);" data-type="change_plan">变更方案</a>
+                            <a class="dropdown-item" href="javascript:void(0);" data-type="change_plan"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></a>
                             <a class="dropdown-item" href="javascript:void(0);" data-type="advance">预付款</a>
                             <a class="dropdown-item" href="javascript:void(0);" data-type="material">材料调差</a>
                         </div>
@@ -873,4 +873,3 @@
     });
 
 </script>
-

+ 14 - 0
app/view/sp_setting/fun.ejs

@@ -278,6 +278,7 @@
                                                 <input class="form-check-input" type="checkbox" id="openChangePlan" <% if(ctx.subProject.page_show.openChangePlan) { %>checked<% } %> onchange="updateSetting(3);">
                                                 <label class="form-check-label" for="openChangePlan">显示「变更方案」页面</label>
                                             </div>
+                                            <a class="pull-right mr-3" href="#bgplan" data-toggle="modal" data-target="#bgplan">重命名</a>
                                         </div>
                                         <div class="alert alert-dark py-1 px-2 mb-2" role="alert">
                                             功能设置
@@ -440,6 +441,9 @@
     }
     $(() => {
         autoFlashHeight();
+        $('#set_change_plan_btn').click(function () {
+            updateSetting(false, 3);
+        });
         // 自定义变更类别
         $('body').on('click', '#change_class_div input[type="checkbox"]', function () {
             if ($(this).is(':checked')) {
@@ -673,6 +677,13 @@
                 return;
             }
             pushData.change_state = change_state;
+        } else if (set_type === 3) {
+            const name = $('#change_plan_name').val().trim();
+            if (name.length > 5) {
+                toastr.error('变更方案名称字符不能超过5个');
+                return;
+            }
+            pushData.change_plan_name = name;
         }
         postData('/sp/<%- ctx.subProject.id %>/setting/fun/update', {
             imType: parseInt($('[name=im_type]:checked').val()),
@@ -724,6 +735,9 @@
                 changeState = pushData.change_state;
                 toastr.success('设置成功');
                 $('#bgstatus').modal('hide');
+            } else if (set_type === 3) {
+                toastr.success('设置成功');
+                window.location.reload();
             }
         });
     }

+ 20 - 0
app/view/sp_setting/fun_modal.ejs

@@ -1,3 +1,23 @@
+<!--重命名变更方案-->
+<div class="modal fade" id="bgplan" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">重命名变更方案</h5>
+            </div>
+            <div class="modal-body">
+                <div class="alert alert-warning">设置后,仅当前项目的工程变更-变更方案按设置名称展示</div>
+                <div>
+                    <input type="text" id="change_plan_name" maxlength="5" class="form-control form-control-sm" value="<%= funSet.change_plan_name %>" placeholder="最多支持5个字,为空则恢复为变更方案">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-sm btn-primary" id="set_change_plan_btn">确认</button>
+            </div>
+        </div>
+    </div>
+</div>
 <!--设置z自定义变更类别-->
 <div class="modal fade" id="bgclass" data-backdrop="static">
     <div class="modal-dialog" role="document">

+ 2 - 2
app/view/tender/shenpi_modal.ejs

@@ -245,7 +245,7 @@
                         <% for (const c of change_type_list) { %>
                         <div class="form-check form-check-inline">
                             <input class="form-check-input" type="checkbox" data-type="<%- c.code %>" name="change_type[]" id="<%- c.code %>_checkbox" disabled>
-                            <label class="form-check-label" for="<%- c.code %>_checkbox"><%- c.name %></label>
+                            <label class="form-check-label" for="<%- c.code %>_checkbox"><%= c.code === 'changePlan' ? (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') : c.name %></label>
                         </div>
                         <% } %>
                     </div>
@@ -256,7 +256,7 @@
                         <% for (const c of contract_type_list) { %>
                             <div class="form-check form-check-inline">
                                 <input class="form-check-input" type="checkbox" data-type="<%- c.code %>" name="contract_type[]" id="<%- c.code %>_checkbox" disabled>
-                                <label class="form-check-label" for="<%- c.code %>_checkbox"><%- c.name %></label>
+                                <label class="form-check-label" for="<%- c.code %>_checkbox"><%= c.code === 'changePlan' ? (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') : c.name %></label>
                             </div>
                         <% } %>
                     </div>

+ 1 - 1
app/view/tender/tender_sub_menu.ejs

@@ -49,7 +49,7 @@
             <ul class="nav-list list-unstyled sub-list">
                 <% if (ctx.subProject.page_show.openChangeProject) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/project') !== -1) { %>class="active"<% } %>><a class="change_project_sort_link" href="/tender/<%- ctx.tender.id %>/change/project"><span>变更立项</span></a></li><% } %>
                     <% if (ctx.subProject.page_show.openChangeApply) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/apply') !== -1) { %>class="active"<% } %>><a class="change_apply_sort_link" href="/tender/<%- ctx.tender.id %>/change/apply"><span>变更申请</span></a></li><% } %>
-                    <% if (ctx.subProject.page_show.openChangePlan) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') !== -1) { %>class="active"<% } %>><a class="change_plan_sort_link" href="/tender/<%- ctx.tender.id %>/change/plan"><span>变更方案</span></a></li><% } %>
+                    <% if (ctx.subProject.page_show.openChangePlan) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') !== -1) { %>class="active"<% } %>><a class="change_plan_sort_link" href="/tender/<%- ctx.tender.id %>/change/plan"><span><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></span></a></li><% } %>
                 <li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change') !== -1 && ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/project') === -1 && ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/apply') === -1 &&  ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') === -1) { %>class="active"<% } %>><a class="change_sort_link" href="/tender/<%- ctx.tender.id %>/change"><span>变更令</span></a></li>
             </ul>
             <% } %>

+ 1 - 1
app/view/tender/tender_sub_mini_menu.ejs

@@ -43,7 +43,7 @@
                 <ul class="nav-list list-unstyled sub-list">
                     <% if (ctx.subProject.page_show.openChangeProject) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/project') !== -1) { %>class="active"<% } %>><a class="change_project_sort_link" href="/tender/<%- ctx.tender.id %>/change/project"><span>变更立项</span></a></li><% } %>
                     <% if (ctx.subProject.page_show.openChangeApply) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/apply') !== -1) { %>class="active"<% } %>><a class="change_apply_sort_link" href="/tender/<%- ctx.tender.id %>/change/apply"><span>变更申请</span></a></li><% } %>
-                    <% if (ctx.subProject.page_show.openChangePlan) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') !== -1) { %>class="active"<% } %>><a class="change_plan_sort_link" href="/tender/<%- ctx.tender.id %>/change/plan"><span>变更方案</span></a></li><% } %>
+                    <% if (ctx.subProject.page_show.openChangePlan) { %><li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') !== -1) { %>class="active"<% } %>><a class="change_plan_sort_link" href="/tender/<%- ctx.tender.id %>/change/plan"><span><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></span></a></li><% } %>
                     <li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/change') !== -1 && ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/project') === -1 && ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/apply') === -1 &&  ctx.url.indexOf('/tender/' + ctx.tender.id + '/change/plan') === -1) { %>class="active"<% } %>><a class="change_sort_link" href="/tender/<%- ctx.tender.id %>/change"><span>变更令</span></a></li>
                 </ul>
             <% } %>

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

@@ -172,7 +172,7 @@
                     <div class="card mb-3">
                         <div class="card-header d-flex justify-content-between">
                             <span><%- getBuildName(change.deal_info) %></span>
-                            <span class="badge badge-pill bg-new-changePlan text-new-changePlan">变更方案</span>
+                            <span class="badge badge-pill bg-new-changePlan text-new-changePlan"><%= change.change_plan_name || '变更方案' %></span>
                         </div>
                         <div class="bg-light p-2 px-3"><b><%- change.t_name %></b></div>
                         <div class="card-body">

+ 1 - 1
app/view/wap/shenpi_change_index.ejs

@@ -54,7 +54,7 @@
             <% } %>
             <% if (ctx.subProject.page_show.openChangePlan) { %>
                 <li class="nav-item">
-                    <a class="px-1 nav-link" data-toggle="tab" href="#changePlan" role="tab">变更方案</a>
+                    <a class="px-1 nav-link" data-toggle="tab" href="#changePlan" role="tab"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></a>
                 </li>
             <% } %>
             <li class="nav-item">

+ 1 - 1
app/view/wap/shenpi_change_plan.ejs

@@ -53,7 +53,7 @@
             <div class="tab-pane active" id="info">
                 <form>
                     <div class="form-group">
-                        <label>方案编号</label>
+                        <label><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %>编号</label>
                         <input class="form-control form-control-sm" value="<%- change.code %>" type="text" readonly="">
                     </div>
                     <div class="form-group">

+ 1 - 1
app/view/wap/tender.ejs

@@ -245,7 +245,7 @@
                 <% if (ctx.subProject.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>
+                            <a href="/wap/tender/<%- tender.id %>/change#changePlan"><h5 class="card-title d-flex justify-content-between"><%= (ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案') %></h5></a>
                         </div>
                     </div>
                 <% } %>