Browse Source

增加获取单位章列表方法

ellisran 3 weeks ago
parent
commit
04bf9aaa1c
1 changed files with 15 additions and 0 deletions
  1. 15 0
      app/service/project_account.js

+ 15 - 0
app/service/project_account.js

@@ -1114,6 +1114,21 @@ module.exports = app => {
             });
             return result;
         }
+
+        async getUserUnitSign(uid) {
+            const userInfo = await this.getDataById(uid);
+            if (!userInfo || !userInfo.company) {
+                return [];
+            }
+            if (userInfo.unit_sign_path) {
+                return userInfo.unit_sign_path.split('&%&');
+            }
+            const info = await this.ctx.service.constructionUnit.getDataByCondition({ pid: userInfo.project_id, name: userInfo.company });
+            if (!info || info.sign_permission === 0) {
+                return [];
+            }
+            return info.sign_path ? info.sign_path.split('&%&') : []; // 多个签章用&%&分隔
+        }
     }
 
     return ProjectAccount;