Jelajahi Sumber

fix: 单价文件编辑器,共用工程数量统计错误

zhangweicheng 4 tahun lalu
induk
melakukan
e4146c2e74

+ 1 - 1
modules/unit_price_file/controllers/unit_price_controller.js

@@ -43,7 +43,7 @@ module.exports={
           versionName: req.session.compilationVersion,
           unitFileName:unitPriceFile.name,
           rootProjectName:project.name,
-          usedTenderList:usedTenderList,
+          usedTenderList:JSON.stringify(usedTenderList),
           usedTenderString:usedTenderString,
           unitpriceList:JSON.stringify(unitpriceList),
           gljTypeMap:JSON.stringify(gljTypeMap),

+ 1 - 1
public/web/socket/connection.js

@@ -82,7 +82,7 @@ socketObject = {
         socket.on('handleAvatarList', function ({ editingUsers }) {
             projectInfoObj.handleAvatarList(editingUsers);
         });
-        SHARE_TO.permissionChangeListener();
+        if(typeof SHARE_TO !== 'undefined')SHARE_TO.permissionChangeListener();
 
 
         //=============================================================================================

+ 2 - 1
web/building_saas/unit_price_file/index.html

@@ -40,6 +40,7 @@
   let unitPriceFileID = parseInt('<%- unitPriceFileID %>');
   let userID = '<%- userID %>';
   let projectID = '<%- projectID %>';
+  let usedTenderList = JSON.parse(`<%- usedTenderList %>`);
   let unitPriceList = JSON.parse(`<%- unitpriceList %>`);
   let gljTypeMap = JSON.parse(`<%- gljTypeMap %>`);
   let mixRatioMap = JSON.parse(`<%- mixRatioMap %>`);
@@ -74,7 +75,7 @@
             <span class="text-muted px-1"></span>
              <span><i class="fa fa-puzzle-piece"></i></span>
             <span class="text-truncate" data-toggle="tooltip" data-placement="bottom" data-original-title="<%= unitFileName%>">&nbsp;<%= unitFileName%></span>
-            &nbsp;(<span class="a_color" data-toggle="tooltip" id="pop-used-list"  style="float: none;" data-original-title="" title="<%= usedTenderString%>">与<span id="used-project-count" style="float: none;">1</span>个单位工程同步</span>)
+            &nbsp;(<span class="a_color" data-toggle="tooltip" id="pop-used-list"  style="float: none;" data-original-title="" title="<%= usedTenderString%>">与<span id="used-project-count" style="float: none;"> </span>个单位工程同步</span>)
           </div>
         </nav>
     </div>

+ 2 - 0
web/building_saas/unit_price_file/index.js

@@ -803,6 +803,8 @@ function initPage() {
   unitPriceObj.showMainDatas();
   unitPriceObj.showSubDatas();
   socketObject.connect("unitPrice");
+  let usedCount = usedTenderList.length;
+  $("#used-project-count").text(usedCount); 
 }
 
 unitPriceObj.setUntiPriceMap();