Explorar o código

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

zhangweicheng %!s(int64=5) %!d(string=hai) anos
pai
achega
a737d01113

+ 3 - 3
web/building_saas/main/js/views/block_lib.js

@@ -353,7 +353,7 @@ var blockLibObj = {
         };
         return new TreeCell();
     },
-    newNode: async function (nodeType, nodeName, categoryID, source){     // 1 分类(只用前两个参数)  2 块文件
+    newNode: async function (nodeType, nodeName, categoryID, source){     // nodeType: 1 分类(只用前两个参数)  2 块文件
         if (nodeName == '') return;
         let tree = blockLibObj.mainTree;
         let ID = uuid.v1();
@@ -463,12 +463,12 @@ var blockLibObj = {
     curIsCategory: function () {
         return this.mainTree.selected.data.type == 1;
     },
-    getSameNameNode: function(name){
+    getSameNameNode: function(name, categoryID){
         let rst = null;
         let nodes = blockLibObj.mainTree.items;
         for (let i = 0; i < nodes.length; i++) {
             let node = nodes[i];
-            if (node.data.nodeName == name){
+            if (node.data.nodeName == name && node.data.ParentID == categoryID){
                 rst = node;
                 break;
             }

+ 5 - 2
web/building_saas/main/js/views/project_view.js

@@ -3234,10 +3234,13 @@ $(function () {
                 let ration_glj_Map = _.groupBy(projectObj.project.ration_glj.datas, 'rationID');
                 vBlock_WC.datas.push(BlockController.getNodeDatas(node, ration_glj_Map));
                 vBlock_WC = JSON.parse(JSON.stringify(vBlock_WC));
-                let fileName = node.data.code + ' ' + node.data.name + ' ' + node.data.unit;
+                // 块文件名称:编号要根据实际情况对父清单的编号进行拼装。
+                 let newCode = divideObj.getExeBillCode(vBlock_WC.datas[0].ID);
+                 let unit = node.data.unit ? node.data.unit : '';
+                let fileName = newCode + ' ' + node.data.name + ' ' + unit;
                 fileName = fileName.replace(/^\s+|\s+$/g, "");    // 只去两头空格
 
-                let extN = blockLibObj.getSameNameNode(fileName);
+                let extN = blockLibObj.getSameNameNode(fileName, categoryID);
                 if (extN){
                     if (cover) blockLibObj.assignData(extN, vBlock_WC);
                 }