Browse Source

计量台账,多人协作,输入密码后,刷新计量单元数据

MaiXinRong 4 years ago
parent
commit
e1778ad8d6
2 changed files with 4 additions and 2 deletions
  1. 1 1
      app/public/js/path_tree.js
  2. 3 1
      app/public/js/stage.js

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

@@ -1131,7 +1131,7 @@ const createNewPathTree = function (type, setting) {
                 if (!ledger_id || !pwd) continue;
 
                 const p = this.pwd.find(x => {return x.ledger_id == ledger_id});
-                p.check = p.pwd === pwd;
+                if (p) p.check = p.pwd === pwd;
             }
         }
         loadPwd(data, cacheKey) {

+ 3 - 1
app/public/js/stage.js

@@ -654,6 +654,7 @@ $(document).ready(() => {
     };
     posSpreadSetting.imageClick = function (data) {
         const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
+        if (node.lock) return;
         changesObj.loadChanges({bills: node, pos: data});
     };
     posSpreadSetting.getColor = function (sheet, data, row, col, defaultColor) {
@@ -1427,7 +1428,7 @@ $(document).ready(() => {
         loadCurPosData: function () {
             const sheet = slSpread.getActiveSheet();
             const node = SpreadJsObj.getSelectObject(sheet);
-            if (node.lock) spSpread.getActiveSheet().zh_setting.readOnly = node.lock;
+            spSpread.getActiveSheet().zh_setting.readOnly = node.lock;
             if (node) {
                 const posData = stagePos.ledgerPos[itemsPre + node.id] || [];
                 SpreadJsObj.loadSheetData(spSpread.getActiveSheet(), 'data', posData);
@@ -3968,6 +3969,7 @@ $(document).ready(() => {
         if (p.pwd === $('#unlock-pwd').val()) {
             const refresh = stageTree.lockNode(p, false);
             SpreadJsObj.reloadRowsReadonly(slSpread.getActiveSheet(), refresh);
+            stagePosSpreadObj.loadCurPosData();
             $('#unlock').modal('hide');
             reloadCooperationHtml();
         } else {