浏览代码

精简node打包后导入出错

vian 5 年之前
父节点
当前提交
51f7fe7194
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 3
      modules/pm/facade/pm_facade.js
  2. 2 1
      modules/templates/models/bills_template.js

+ 2 - 3
modules/pm/facade/pm_facade.js

@@ -2308,11 +2308,10 @@ async function isTenderOverrun(tenderCount, session) {
     const userID = session.sessionUser.id;
     const userID = session.sessionUser.id;
     const compilation = session.sessionCompilation._id;
     const compilation = session.sessionCompilation._id;
     const compilationVersion = session.compilationVersion || '免费';
     const compilationVersion = session.compilationVersion || '免费';
-    let systemSetting = session.systemSetting;
+    let systemSetting = session.systemSetting || (session.systemSetting = await systemSettingMiddleware.getSystemSetting());
     // 这种情况只有在刚上线此功能时会出现,不考虑时间差
     // 这种情况只有在刚上线此功能时会出现,不考虑时间差
     if (!systemSetting) {
     if (!systemSetting) {
-        systemSetting = await systemSettingMiddleware.getSystemSetting();
-        session.systemSetting = systemSetting;
+        return false;
     }
     }
     const type = compilationVersion.includes('免费') ? 'normal' : 'professional';
     const type = compilationVersion.includes('免费') ? 'normal' : 'professional';
     const limit = systemSetting[type].project;
     const limit = systemSetting[type].project;

+ 2 - 1
modules/templates/models/bills_template.js

@@ -103,7 +103,8 @@ function setSeqByNext(billsData) {
         sameDepthDatas[data.ParentID].push(data);
         sameDepthDatas[data.ParentID].push(data);
     }
     }
     //设置同层节点的序号
     //设置同层节点的序号
-    for (let sameDepth of Object.values(sameDepthDatas)) {
+    for (let attr in sameDepthDatas) {
+        let sameDepth = sameDepthDatas[attr];
         let sortedData = getDataBySorted(sameDepth),
         let sortedData = getDataBySorted(sameDepth),
             seq = 1;
             seq = 1;
         sortedData.forEach((data => data.seq = seq++));
         sortedData.forEach((data => data.seq = seq++));