浏览代码

fix: 清单精灵库,备注权限控制

vian 3 年之前
父节点
当前提交
a248acb7c7

+ 8 - 0
modules/bills_lib/controllers/bills_lib_controllers.js

@@ -117,6 +117,14 @@ module.exports = {
         });
         });
     },
     },
     updateBills: function(req, res){
     updateBills: function(req, res){
+        const zhLibID = 'cf851660-3534-11ec-9641-2da8021b8e4e';
+        if (req.session.managerData.isTemporary) {
+            const match = req.headers.referer.match(/libID=([\d,a-z,A-Z,-]{36})/);
+            if (match && match[1] && match[1] !== zhLibID) {
+                callback(req, res, '无此清单精灵库权限', '无此清单精灵库权限', null);
+                return;
+            }
+        }
         let data = JSON.parse(req.body.data);
         let data = JSON.parse(req.body.data);
         billsLibDao.updateBills(data, function(err, message){
         billsLibDao.updateBills(data, function(err, message){
             callback(req, res, err, message, null);
             callback(req, res, err, message, null);

+ 9 - 1
web/maintain/billsGuidance_lib/js/billsGuidance.js

@@ -987,11 +987,15 @@ const billsGuidance = (function () {
         }
         }
     }
     }
     //更新清单备注
     //更新清单备注
-    function updateBillsComment(updateData, callback) {
+    function updateBillsComment(updateData, callback, errCB) {
         CommonAjax.post('/stdBillsEditor/updateBills', updateData, function () {
         CommonAjax.post('/stdBillsEditor/updateBills', updateData, function () {
             if (callback) {
             if (callback) {
                 callback();
                 callback();
             }
             }
+        }, function () {
+            if(errCB) {
+                errCB();
+            }
         });
         });
     }
     }
     //更新项目指引
     //更新项目指引
@@ -1774,6 +1778,8 @@ const billsGuidance = (function () {
                     let updateData = {lastOperator: userAccount, billsLibId: billsLibId, updateId: node.getID(), field: 'comment', data: comment};
                     let updateData = {lastOperator: userAccount, billsLibId: billsLibId, updateId: node.getID(), field: 'comment', data: comment};
                     updateBillsComment(updateData, function () {
                     updateBillsComment(updateData, function () {
                         node.data.comment = comment;
                         node.data.comment = comment;
+                    }, function() {
+                        $(me).val(node.data.comment || '');
                     })
                     })
                 }
                 }
             });
             });
@@ -1788,6 +1794,8 @@ const billsGuidance = (function () {
                     let updateDatas = [{updateType: updateType.update, findData: {ID: node.getID()}, updateData: {comment: comment}}];
                     let updateDatas = [{updateType: updateType.update, findData: {ID: node.getID()}, updateData: {comment: comment}}];
                     updateGuideItems(updateDatas, function (rstData) {
                     updateGuideItems(updateDatas, function (rstData) {
                         node.data.comment = comment;
                         node.data.comment = comment;
+                    }, function() {
+                        $(me).val(node.data.comment || '');
                     });
                     });
                 }
                 }
             });
             });