Explorar o código

显示扣款列相关

MaiXinRong hai 10 meses
pai
achega
5198972d41

+ 1 - 0
app/controller/stage_controller.js

@@ -1032,6 +1032,7 @@ module.exports = app => {
 
                 const projectFunInfo = await this.ctx.service.project.getFunRela(ctx.session.sessionProject.id);
                 renderData.lockPayExpr = projectFunInfo.lockPayExpr;
+                renderData.showMinusCol = projectFunInfo.showMinusCol;
                 renderData.deleteFilePermission = PermissionCheck.delFile(this.ctx.session.sessionUser.permission);
 
                 if (!ctx.stage.readOnly || ctx.tender.isTourist) {

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

@@ -147,7 +147,7 @@ $(document).ready(() => {
                     return tips.join('<br/>');
                 }
             },
-            {title: '扣款', colSpan: '1', rowSpan: '1', field: 'minus', hAlign: 1, width: 50, cellType: 'checkbox', readOnly: 'readOnly.minus'},
+            {title: '扣款', colSpan: '1', rowSpan: '1', field: 'minus', hAlign: 1, width: 50, cellType: 'checkbox', readOnly: 'readOnly.minus', visible: showMinusCol},
             {title: '本期金额(F)', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 2, width: 120, readOnly: 'readOnly.tp', type: 'Number', /*cellType: 'tip', getTip: function (data) {return data ? data.expr : '';}*/},
             {title: '截止上期金额',  colSpan: '1', rowSpan: '1', field: 'pre_tp', hAlign: 2, width: 100, readOnly: true, type: 'Number',},
             {title: '截止本期金额',  colSpan: '1', rowSpan: '1', field: 'end_tp', hAlign: 2, width: 100, readOnly: true, type: 'Number',},

+ 4 - 1
app/service/project.js

@@ -14,6 +14,7 @@ const defaultFunRela = {
     banMinusChangeBills: true,
     minusNoValue: true,
     lockPayExpr: false,
+    showMinusCol: true,
     imType: imType.zl.value,
     needGcl: false,
 };
@@ -68,6 +69,7 @@ module.exports = app => {
                         banMinusChangeBills: {type: 'bool', required: true,},
                         minusNoValue: {type: 'bool', required: true,},
                         lockPayExpr: {type: 'bool', required: true,},
+                        showMinusCol: {type: 'bool', required: true,},
                     };
                     break;
                 default:
@@ -174,7 +176,8 @@ module.exports = app => {
             const result = await this.db.update(this.tableName, {
                 id: id, fun_rela: JSON.stringify({
                     banOver: data.banOver, hintOver: data.hintOver, banMinusChangeBills: data.banMinusChangeBills,
-                    imType: data.imType, needGcl: data.needGcl, minusNoValue: data.minusNoValue, lockPayExpr: data.lockPayExpr,
+                    imType: data.imType, needGcl: data.needGcl, minusNoValue: data.minusNoValue,
+                    lockPayExpr: data.lockPayExpr, showMinusCol: data.showMinusCol,
                 }),
             });
             return result.affectedRows === 1;

+ 7 - 1
app/view/setting/fun.ejs

@@ -58,10 +58,15 @@
                                 <h5 class="card-title">合同支付</h5>
                                 <div class="form-group mb-4">
                                     <div>
-                                        <div class="form-check form-check-inline">
+                                        <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>
                                 </div>
                             </div>
@@ -458,6 +463,7 @@
             banMinusChangeBills: $('[name=ban_minus_cb]')[0].checked,
             minusNoValue: $('[name=minusNoValue]')[0].checked,
             lockPayExpr: $('#lockPayExpr')[0].checked,
+            showMinusCol: $('#showMinusCol')[0].checked,
             needGcl: $('#need_gcl')[0].checked,
             openChangeProject: $('#openChangeProject')[0].checked,
             openChangeApply: $('#openChangeApply')[0].checked,

+ 1 - 0
app/view/stage/pay.ejs

@@ -70,5 +70,6 @@
     const preGatherTp = <%- (pre.gather_tp || 0) %>;
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     const lockPayExpr = <%- lockPayExpr %>;
+    const showMinusCol = <%- showMinusCol %>;
     const deleteFilePermission = <%- deleteFilePermission %>;
 </script>