Просмотр исходного кода

审批通过,只读判断调整

MaiXinRong 2 лет назад
Родитель
Сommit
525a922c2c
3 измененных файлов с 16 добавлено и 5 удалено
  1. 3 3
      app/controller/stage_controller.js
  2. 4 1
      app/middleware/stage_check.js
  3. 9 1
      app/view/setting/show.ejs

+ 3 - 3
app/controller/stage_controller.js

@@ -138,10 +138,10 @@ module.exports = app => {
             }
         }
 
-        _checkStageCanModify(ctx) {
+        _checkStageCanModify(ctx, isCheck = false) {
             // 检查登录用户,是否可操作
             if (ctx.stage.readOnly) {
-                throw '该计量期当前您无权操作';
+                if (!isCheck || !ctx.stage.canCheck) throw '该计量期当前您无权操作';
             }
             if (ctx.stage.revising) {
                 throw '台账修订中,请勿修改提交期数据';
@@ -1300,7 +1300,7 @@ module.exports = app => {
          */
         async checkAudit(ctx) {
             try {
-                this._checkStageCanModify(ctx);
+                this._checkStageCanModify(ctx, true);
                 if (!this.ctx.stage || (this.ctx.stage.status !== auditConst.status.checking && this.ctx.stage.status !== auditConst.status.checkNoPre)) {
                     throw '当前期数据有误';
                 }

+ 4 - 1
app/middleware/stage_check.js

@@ -101,7 +101,10 @@ module.exports = options => {
                 } else {
                     stage.curOrder = stage.curAuditors[0].order - 1
                 }
-                if (!stage.readOnly) stage.readOnly = !_.isEqual(stage.flowAuditorIds, stage.curAuditorIds);
+                if (!stage.readOnly) {
+                    stage.readOnly = !_.isEqual(stage.flowAuditorIds, stage.curAuditorIds);
+                    stage.canCheck = true;
+                }
             }
             if (stage.readOnly) {
                 stage.assist = accountId === stage.user_id || stage.auditorIds.indexOf(accountId) >= 0 ? null : stage.auditAssists.find(x => { return x.ass_user_id === accountId});

+ 9 - 1
app/view/setting/show.ejs

@@ -37,7 +37,7 @@
                         <div class="form-group">
                             <label>台账列显示</label>
                             <table class="table table-hover table-bordered">
-                                <thead><tr><th>名称</th><th>是否显示</th><th>别名</th><th></th></tr></thead>
+                                <thead><tr><th>名称</th><th>是否显示</th><th>别名</th><th>位置</th></tr></thead>
                                 <tbody id="ledger_col_list">
                                 <% for (const sl of sjsRela.ledgerCol) { %>
                                 <tr>
@@ -87,4 +87,12 @@
             obj.value = obj.getAttribute('org');
         });
     };
+    const updateColPos = function(sub, field, obj) {
+        const data = { sub, field, key: 'pos', value: obj.value };
+        postData('show/update-sjs', data, function() {
+            obj.setAttribute('org', obj.value);
+        }, function () {
+            obj.value = obj.getAttribute('org');
+        });
+    }
 </script>