zhangweicheng 7 tahun lalu
induk
melakukan
69bbed3fbc
1 mengubah file dengan 76 tambahan dan 0 penghapusan
  1. 76 0
      web/building_saas/main/js/views/zlfb_view.js

+ 76 - 0
web/building_saas/main/js/views/zlfb_view.js

@@ -0,0 +1,76 @@
+/**
+ * Created by zhang on 2018/1/22.
+ */
+let zlfb_object={
+    sectionInfo:null,
+    getSectionInfo:function () {
+        let controller = projectObj.mainController, project = projectObj.project;
+        let Bill = project.Bills;
+        let FBFX = Bill.getFBFXNode(controller);//取分部分项工程节点;
+        let all_sub_nodes=[],FB_nodes =[],FX_nodes =[], query={};
+        let codeMap = {};
+        let reorganize = false;
+        controller.tree.getAllSubNode(FBFX.source,all_sub_nodes);//取分部分项工程节点下的所有节点,不包括定额和工料机节点;
+        for(let tem_node of all_sub_nodes){
+            if(tem_node.data.type == billType.FB){
+                FB_nodes.push(tem_node);
+            }
+            if(tem_node.data.type == billType.FX){
+                FX_nodes.push(tem_node);
+                let l_code = zlfb_object.getLibCode(tem_node.data.code);
+                if(tem_node.data.billsLibId&&l_code!=false){
+                    reorganize= true;
+                    if(codeMap[l_code]){
+                        codeMap[l_code].push(tem_node);
+                    }else {
+                        codeMap[l_code]=[tem_node];
+                    }
+                    if(query[tem_node.data.billsLibId]){
+                        query[tem_node.data.billsLibId][l_code]=true;
+                    }else {
+                        query[tem_node.data.billsLibId]={};
+                        query[tem_node.data.billsLibId][l_code]=true;
+                    }
+                }
+            }
+        }
+        if(reorganize==true){
+            zlfb_object.sectionInfo = {
+                'codeMap':codeMap,
+                'FB_nodes':FB_nodes,
+                'FX_nodes':FX_nodes
+            }
+            CommonAjax.post('/bills/getSectionInfo',query,function (data) {
+                $("#zlfb").modal({show:true});
+            });
+        }else {
+            $("#zlfb").modal({show:true});
+        }
+
+        console.log(query);
+
+    },
+    getLibCode:function (billCode) {//根据清单编号得到清单库中的编号
+        if(billCode&&billCode.length>=9){
+            return billCode.substr(0,9);
+        }else {
+            return false;
+        }
+    }
+}
+
+
+
+
+$(function () {
+    $('#zlfb_confirm').click(function (){
+        console.log("confirm click")
+
+
+
+
+
+
+
+    })
+})