Browse Source

隐藏变更立项功能

laiguoran 3 years ago
parent
commit
c0d1967f1d
2 changed files with 28 additions and 28 deletions
  1. 2 2
      app/controller/setting_controller.js
  2. 26 26
      app/view/setting/fun.ejs

+ 2 - 2
app/controller/setting_controller.js

@@ -763,8 +763,8 @@ module.exports = app => {
 
                 const result = await ctx.service.project.updateFunRela(projectId, ctx.request.body);
                 if (!result) throw '保存数据失败';
-                this.ctx.session.sessionProject.page_show.openChangeProject = data.openChangeProject ? 1 : 0;
-                this.ctx.session.sessionProject.page_show.openChangeApply = data.openChangeApply ? 1 : 0;
+                // this.ctx.session.sessionProject.page_show.openChangeProject = data.openChangeProject ? 1 : 0;
+                // this.ctx.session.sessionProject.page_show.openChangeApply = data.openChangeApply ? 1 : 0;
                 this.ctx.session.sessionProject.page_show.openMaterialTax = data.openMaterialTax ? 1 : 0;
                 this.ctx.session.sessionProject.page_show.openMaterialChecklist = data.openMaterialChecklist ? 1 : 0;
                 const result2 = await ctx.service.project.updatePageshow(projectId);

+ 26 - 26
app/view/setting/fun.ejs

@@ -46,25 +46,25 @@
                             </div>
                         </div>
                         <div class="row">
-                            <div class="col-6">
-                                <div class="card mb-3">
-                                    <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="openChangeProject" <% if(ctx.session.sessionProject.page_show.openChangeProject) { %>checked<% } %> onchange="updateSetting(1);">
-                                                <label class="form-check-label" for="openChangeProject">显示「变更立项」页面</label>
-                                            </div>
-                                        </div>
-                                        <div class="form-group mb-1">
-                                            <div class="form-check form-check-inline">
-                                                <input class="form-check-input" type="checkbox" id="openChangeApply" <% if(ctx.session.sessionProject.page_show.openChangeApply) { %>checked<% } %> onchange="updateSetting(2);">
-                                                <label class="form-check-label" for="openChangeApply">显示「变更申请」页面</label>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
+                            <!--<div class="col-6">-->
+                                <!--<div class="card mb-3">-->
+                                    <!--<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="openChangeProject" <% if(ctx.session.sessionProject.page_show.openChangeProject) { %>checked<% } %> onchange="updateSetting(1);">-->
+                                                <!--<label class="form-check-label" for="openChangeProject">显示「变更立项」页面</label>-->
+                                            <!--</div>-->
+                                        <!--</div>-->
+                                        <!--<div class="form-group mb-1">-->
+                                            <!--<div class="form-check form-check-inline">-->
+                                                <!--<input class="form-check-input" type="checkbox" id="openChangeApply" <% if(ctx.session.sessionProject.page_show.openChangeApply) { %>checked<% } %> onchange="updateSetting(2);">-->
+                                                <!--<label class="form-check-label" for="openChangeApply">显示「变更申请」页面</label>-->
+                                            <!--</div>-->
+                                        <!--</div>-->
+                                    <!--</div>-->
+                                <!--</div>-->
+                            <!--</div>-->
                             <div class="col-6">
                                 <div class="card mb-3">
                                     <div class="card-body">
@@ -113,18 +113,18 @@
         autoFlashHeight();
     });
     const updateSetting = function (tab = false) {
-        if ($('#openChangeApply')[0].checked && !$('#openChangeProject')[0].checked && tab === 1) {
-            $('#openChangeApply').prop('checked', false);
-        } else if ($('#openChangeApply')[0].checked && !$('#openChangeProject')[0].checked && tab === 2) {
-            $('#openChangeProject').prop('checked', true);
-        }
+        // if ($('#openChangeApply')[0].checked && !$('#openChangeProject')[0].checked && tab === 1) {
+        //     $('#openChangeApply').prop('checked', false);
+        // } else if ($('#openChangeApply')[0].checked && !$('#openChangeProject')[0].checked && tab === 2) {
+        //     $('#openChangeProject').prop('checked', true);
+        // }
         postData('/setting/fun/update', {
             imType: parseInt($('[name=im_type]:checked').val()),
             banOver: $('[name=ban_over]')[0].checked,
             hintOver: $('#hint_over')[0].checked,
             needGcl: $('#need_gcl')[0].checked,
-            openChangeProject: $('#openChangeProject')[0].checked,
-            openChangeApply: $('#openChangeApply')[0].checked,
+            // openChangeProject: $('#openChangeProject')[0].checked,
+            // openChangeApply: $('#openChangeApply')[0].checked,
             openMaterialTax: $('#openMaterialTax')[0].checked,
             openMaterialChecklist: $('#openMaterialChecklist')[0].checked,
         });