فهرست منبع

迁移部分后台开关控制到前台

ellisran 3 ماه پیش
والد
کامیت
a45a45436f
3فایلهای تغییر یافته به همراه150 افزوده شده و 77 حذف شده
  1. 5 0
      app/controller/sub_proj_setting_controller.js
  2. 144 76
      app/view/sp_setting/fun.ejs
  3. 1 1
      app/view/tender/tender_sub_mini_menu.ejs

+ 5 - 0
app/controller/sub_proj_setting_controller.js

@@ -386,6 +386,11 @@ module.exports = app => {
                 this.ctx.subProject.page_show.openMaterialSelf = data.openMaterialSelf ? 1 : 0;
                 this.ctx.subProject.page_show.openMaterialEditForAudit = data.openMaterialEditForAudit ? 1 : 0;
                 this.ctx.subProject.page_show.openStageStart = data.openStageStart ? 1 : 0;
+                this.ctx.subProject.page_show.openMaterialStageRepeat = data.openMaterialStageRepeat ? 1 : 0;
+                this.ctx.subProject.page_show.openContractExpr = data.openContractExpr ? 1 : 0;
+                this.ctx.subProject.page_show.close1stStageCheckDealParam = data.close1stStageCheckDealParam ? 1 : 0;
+                this.ctx.subProject.page_show.openMultiStageCalc = data.openMultiStageCalc ? 1 : 0;
+                this.ctx.subProject.page_show.closeWapYfSf = data.closeWapYfSf ? 1 : 0;
                 const result2 = await ctx.service.subProject.updatePageshow(ctx.subProject.id);
                 if (!result2) throw '保存数据失败';
                 if (data.addFunSet) {

+ 144 - 76
app/view/sp_setting/fun.ejs

@@ -9,13 +9,15 @@
         <div class="c-body">
             <div class="sjs-height-0">
                 <div class="row m-0 mt-3">
-                    <div class="col-7">
+                    <div class="col-8">
                         <div class="row">
                             <div class="col-6">
                                 <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>超计控制</div>
+                                    </div>
                                     <div class="card-body">
-                                        <h5 class="card-title">超计控制</h5>
-                                        <div class="form-group mb-4">
+                                        <div class="form-group mb-1">
                                             <div>
                                                 <div class="form-check">
                                                     <input class="form-check-input" type="checkbox" id="ban_over" name="ban_over" <% if (funRela.banOver) { %>checked<% } %> onchange="updateSetting();">
@@ -32,9 +34,11 @@
                             </div>
                             <div class="col-6">
                                 <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>变更令调用控制</div>
+                                    </div>
                                     <div class="card-body">
-                                        <h5 class="card-title">变更令调用控制</h5>
-                                        <div class="form-group mb-4">
+                                        <div class="form-group mb-1">
                                             <div>
                                                 <div class="form-check form-check-inline">
                                                     <input class="form-check-input" type="checkbox" id="ban_minus_cb" name="ban_minus_cb" <% if (funRela.banMinusChangeBills) { %>checked<% } %> onchange="updateSetting();">
@@ -53,89 +57,136 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="card mb-3">
-                            <div class="card-body">
-                                <h5 class="card-title">合同支付</h5>
-                                <div class="form-group mb-4">
-                                    <div>
-                                        <div class="form-check">
-                                            <input class="form-check-input" type="checkbox" id="lockPayExpr" name="lockPayExpr" <% if (funRela.lockPayExpr) { %>checked<% } %> onchange="updateSetting();">
-                                            <label class="form-check-label" for="lockPayExpr">锁定往期带基数计算的合同支付项</label>
-                                        </div>
-                                        <div class="form-check">
-                                            <input class="form-check-input" type="checkbox" id="showMinusCol" name="showMinusCol" <% if (funRela.showMinusCol) { %>checked<% } %> onchange="updateSetting();">
-                                            <label class="form-check-label" for="showMinusCol">显示扣款列</label>
+                        <div class="row">
+                            <div class="col-6">
+                                <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>合同支付</div>
+                                    </div>
+                                    <div class="card-body">
+                                        <div class="form-group mb-1">
+                                            <div>
+                                                <div class="form-check">
+                                                    <input class="form-check-input" type="checkbox" id="lockPayExpr" name="lockPayExpr" <% if (funRela.lockPayExpr) { %>checked<% } %> onchange="updateSetting();">
+                                                    <label class="form-check-label" for="lockPayExpr">锁定往期带基数计算的合同支付项</label>
+                                                </div>
+                                                <div class="form-check">
+                                                    <input class="form-check-input" type="checkbox" id="showMinusCol" name="showMinusCol" <% if (funRela.showMinusCol) { %>checked<% } %> onchange="updateSetting();">
+                                                    <label class="form-check-label" for="showMinusCol">显示扣款列</label>
+                                                </div>
+                                                <div class="alert-warning p-1"><i class="fa Example of exclamation-circle fa-exclamation-circle "></i> 隐藏此列不会修改本期应付计算,旧项目请谨慎修改,防止误解</div>
+                                                <div class="form-check">
+                                                    <input class="form-check-input" type="checkbox" id="closeWapYfSf" <% if (ctx.subProject.page_show.closeWapYfSf) { %>checked<% } %> onchange="updateSetting();">
+                                                    <label class="form-check-label" for="closeWapYfSf">wap关闭「本期支付」相关信息 <a href="javascript:void(0);"  data-toggle="tooltip" data-placement="bottom" title="" data-original-title="本期计量关联的“本期应付“、”本期实付”均不显示"><i class="fa fa-question-circle "></i></a></label>
+                                                </div>
+                                            </div>
                                         </div>
-                                        <div class="alert-warning p-1"><i class="fa Example of exclamation-circle fa-exclamation-circle "></i> 隐藏此列不会修改本期应付计算,旧项目请谨慎修改,防止误解</div>
                                     </div>
                                 </div>
                             </div>
-                        </div>
-                        <div class="card mb-3 ">
-                            <div class="card-body pb-2">
-                                <div class="row m-0">
-                                    <h5 class="card-title">计量期上报</h5>
-                                    <div class="pull-right d-inline-block form-group form-check ml-auto">
-                                        <div class="custom-control custom-switch">
-                                            <input type="checkbox" class="custom-control-input" id="openStageStart" <% if(ctx.subProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">
-                                            <label class="custom-control-label" for="openStageStart"></label>
+                            <div class="col-6">
+                                <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>中间计量模式设置</div>
+                                    </div>
+                                    <div class="card-body">
+                                        <div class="form-group mb-1">
+                                            <div>
+                                                <% for (const i in imType) { %>
+                                                    <div class="form-check form-check-inline">
+                                                        <input class="form-check-input" type="radio" id="radio_<%- i %>" value="<%- imType[i].value %>" <% if (funRela.imType === imType[i].value) { %>checked<% } %> name="im_type" onchange="updateSetting();">
+                                                        <label class="form-check-label" for="radio_<%- i %>" name="im_type"><%- imType[i].name %></label>
+                                                    </div>
+                                                <% } %>
+                                            </div>
+                                            <div class="mt-3">
+                                                <label class="form-text alert alert-danger">切换模式,仅对未开始第一期计量的标段生效。</label>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>
-                                <div class="form-group mb-1">
-                                    <div>
-                                        <div class="input-group input-group-sm mb-2">
-                                            <div class="input-group-prepend">
-                                                <span class="input-group-text">开始日期:</span>
-                                                <span class="input-group-text" style="width: 90px;padding-left: 12px;">每月</span>
+                            </div>
+                        </div>
+                        <div class="row">
+                            <div class="col-6">
+                                <div class="card mb-3 ">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>计量期上报</div>
+                                        <div class="row m-0">
+                                            <div class="pull-right d-inline-block form-group form-check ml-auto">
+                                                <div class="custom-control custom-switch">
+                                                    <input type="checkbox" class="custom-control-input" id="openStageStart" <% if(ctx.subProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">
+                                                    <label class="custom-control-label" for="openStageStart"></label>
+                                                </div>
                                             </div>
-                                            <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
-                                                <option value="0">请选择日</option>
-                                                <% for (let i = 1; i <= 31;i++) { %>
-                                                    <option value="<%- i %>" <% if (funSet.stage_start.start_day === i) {%>selected<% } %>><%- i %></option>
-                                                <% } %>
-                                            </select>
-                                            <span class="text-danger mx-2"></span>
                                         </div>
-                                        <div class="input-group input-group-sm mb-2">
-                                            <div class="input-group-prepend">
-                                                <span class="input-group-text">截止日期:</span>
+                                    </div>
+                                    <div class="card-body pb-2">
+                                        <div class="form-group mb-1">
+                                            <div>
+                                                <div class="input-group input-group-sm mb-2">
+                                                    <div class="input-group-prepend">
+                                                        <span class="input-group-text">开始日期:</span>
+                                                        <span class="input-group-text" style="width: 90px;padding-left: 12px;">每月</span>
+                                                    </div>
+                                                    <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
+                                                        <option value="0">请选择日</option>
+                                                        <% for (let i = 1; i <= 31;i++) { %>
+                                                            <option value="<%- i %>" <% if (funSet.stage_start.start_day === i) {%>selected<% } %>><%- i %></option>
+                                                        <% } %>
+                                                    </select>
+                                                    <span class="text-danger mx-2"></span>
+                                                </div>
+                                                <div class="input-group input-group-sm mb-2">
+                                                    <div class="input-group-prepend">
+                                                        <span class="input-group-text">截止日期:</span>
+                                                    </div>
+                                                    <select class="form-control form-control-sm" id="end_month" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
+                                                        <option value="0">请选择月</option>
+                                                        <% for (const i of endMonth) { %>
+                                                        <option value="<%- i.val %>" <% if (funSet.stage_start.end_month === i.val) {%>selected<% } %> ><%- i.name %></option>
+                                                        <% } %>
+                                                    </select>
+                                                    <select class="form-control form-control-sm" id="end_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
+                                                        <option value="0">请选择日</option>
+                                                        <% for (let i = 1; i <= 31;i++) { %>
+                                                            <option value="<%- i %>" <% if (funSet.stage_start.end_day === i) {%>selected<% } %>><%- i %></option>
+                                                        <% } %>
+                                                    </select>
+                                                    <span class="text-danger mx-2"></span>
+                                                </div>
                                             </div>
-                                            <select class="form-control form-control-sm" id="end_month" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
-                                                <option value="0">请选择月</option>
-                                                <% for (const i of endMonth) { %>
-                                                <option value="<%- i.val %>" <% if (funSet.stage_start.end_month === i.val) {%>selected<% } %> ><%- i.name %></option>
-                                                <% } %>
-                                            </select>
-                                            <select class="form-control form-control-sm" id="end_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
-                                                <option value="0">请选择日</option>
-                                                <% for (let i = 1; i <= 31;i++) { %>
-                                                    <option value="<%- i %>" <% if (funSet.stage_start.end_day === i) {%>selected<% } %>><%- i %></option>
-                                                <% } %>
-                                            </select>
-                                            <span class="text-danger mx-2"></span>
+                                        </div>
+                                        <div class="mt-3">
+                                            <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>
                                         </div>
                                     </div>
                                 </div>
-                                <div class="mt-3">
-                                    <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>
-                                </div>
                             </div>
-                        </div>
-                        <div class="card mb-3">
-                            <div class="card-body">
-                                <h5 class="card-title">中间计量模式设置</h5>
-                                <div class="form-group mb-4">
-                                    <div>
-                                        <% for (const i in imType) { %>
+                            <div class="col-6">
+                                <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>计量相关设置</div>
+                                    </div>
+                                    <div class="card-body">
+                                        <div class="form-group mb-1">
                                             <div class="form-check form-check-inline">
-                                                <input class="form-check-input" type="radio" id="radio_<%- i %>" value="<%- imType[i].value %>" <% if (funRela.imType === imType[i].value) { %>checked<% } %> name="im_type" onchange="updateSetting();">
-                                                <label class="form-check-label" for="radio_<%- i %>" name="im_type"><%- imType[i].name %></label>
+                                                <input class="form-check-input" type="checkbox" id="openContractExpr" <% if (ctx.subProject.page_show.openContractExpr) { %>checked<% } %> onchange="updateSetting();">
+                                                <label class="form-check-label" for="openContractExpr">开启「本期合同计量设置公式」</label>
                                             </div>
-                                        <% } %>
-                                    </div>
-                                    <div class="mt-3">
-                                        <label class="form-text alert alert-danger">切换模式,仅对未开始第一期计量的标段生效。</label>
+                                        </div>
+                                        <div class="form-group mb-1">
+                                            <div class="form-check form-check-inline">
+                                                <input class="form-check-input" type="checkbox" id="close1stStageCheckDealParam" <% if (ctx.subProject.page_show.close1stStageCheckDealParam) { %>checked<% } %> onchange="updateSetting();">
+                                                <label class="form-check-label" for="close1stStageCheckDealParam">关闭「开始第一期计量判断合同参数」功能</label>
+                                            </div>
+                                        </div>
+                                        <div class="form-group mb-1">
+                                            <div class="form-check form-check-inline">
+                                                <input class="form-check-input" type="checkbox" id="openMultiStageCalc" <% if (ctx.subProject.page_show.openMultiStageCalc) { %>checked<% } %> onchange="updateSetting();">
+                                                <label class="form-check-label" for="openMultiStageCalc">开启「待上报时,允许新增下一期」功能</label>
+                                            </div>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
@@ -143,8 +194,10 @@
                         <div class="row">
                             <div class="col-6">
                                 <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>工程变更</div>
+                                    </div>
                                     <div class="card-body">
-                                        <h5 class="card-title">工程变更</h5>
                                         <div class="alert alert-dark py-1 px-2 mb-2" role="alert">
                                             页面显示
                                         </div>
@@ -193,10 +246,12 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="col-6" <% if (!ctx.subProject.page_show.openMaterial) { %>style="display: none;"<% } %>>
+                            <div class="col-6" <% if (!ctx.session.sessionProject.page_show.openMaterial) { %>style="display: none;"<% } %>>
                                 <div class="card mb-3">
+                                    <div class="card-header d-flex justify-content-between">
+                                        <div>材料调差</div>
+                                    </div>
                                     <div class="card-body">
-                                        <h5 class="card-title">材料调差</h5>
                                         <div class="form-group mb-1">
                                             <div class="form-check form-check-inline">
                                                 <input class="form-check-input" type="checkbox" id="openMaterialTax" <% if(ctx.subProject.page_show.openMaterialTax) { %>checked<% } %> onchange="updateSetting();">
@@ -223,13 +278,21 @@
                                                     <a href="javascript:void(0);"  data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,审核人允许修改部分调差工料数据"><i class="fa fa-question-circle "></i></a></label>
                                             </div>
                                         </div>
+                                        <div class="form-group mb-1">
+                                            <div class="form-check form-check-inline">
+                                                <input class="form-check-input" type="checkbox" id="openMaterialStageRepeat" <% if(ctx.subProject.page_show.openMaterialStageRepeat) { %>checked<% } %> onchange="updateSetting();">
+                                                <label class="form-check-label" for="openMaterialStageRepeat">开启「材料调差重复使用计量期」</label>
+                                            </div>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
                         </div>
                         <div class="card mb-3">
+                            <div class="card-header d-flex justify-content-between">
+                                <div>动态决算</div>
+                            </div>
                             <div class="card-body">
-                                <h5 class="card-title">动态决算</h5>
                                 <div class="form-group mb-4">
                                     <div>
                                         <div class="form-check form-check-inline">
@@ -474,7 +537,12 @@
             openMaterialChecklist: $('#openMaterialChecklist')[0].checked,
             openMaterialSelf: $('#openMaterialSelf')[0].checked,
             openMaterialEditForAudit: $('#openMaterialEditForAudit')[0].checked,
+            openMaterialStageRepeat: $('#openMaterialStageRepeat')[0].checked,
             openStageStart: $('#openStageStart')[0].checked,
+            openContractExpr: $('#openContractExpr')[0].checked,
+            close1stStageCheckDealParam: $('#close1stStageCheckDealParam')[0].checked,
+            openMultiStageCalc: $('#openMultiStageCalc')[0].checked,
+            closeWapYfSf: $('#closeWapYfSf')[0].checked,
             addFunSet: _.size(pushData) !== 0 ? pushData : null,
         }, function (result) {
             if ($('#openChangeState').is(':checked')) {

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

@@ -48,7 +48,7 @@
                 </ul>
             <% } %>
         </div>
-        <% if (ctx.subProject.page_show.openMaterial) { %>
+        <% if (ctx.session.sessionProject.page_show.openMaterial) { %>
         <div class="nav-box">
             <ul class="nav-list list-unstyled">
                 <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/measure/material') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/measure/material" class="h3"><i class="fa fa-line-chart fa-fw"></i> <span>材料调差</span></a></li>