|
@@ -216,18 +216,18 @@ ProjectController = {
|
|
|
if (!project || !sheetController) { return null; }
|
|
|
this.addSpecialBill(project, sheetController,null, project.mainTree.selected.nextSibling,true,billType.DXFY);
|
|
|
},
|
|
|
- addFB:function(project, sheetController,node) {//添加分部
|
|
|
+ addFB:function(project, sheetController,node,ext) {//添加分部
|
|
|
if (!project || !sheetController) { return null; }
|
|
|
let selected =node|| project.mainTree.selected;
|
|
|
if(selected.parent==null&&isFlag(selected.data)&&selected.data.flagsIndex.fixed.flag==fixedFlag.SUB_ENGINERRING){//选中的是分部分项,则插入做为最后一个子项
|
|
|
- return this.addSpecialBill(project, sheetController,selected, null,true,billType.FB);
|
|
|
+ return this.addSpecialBill(project, sheetController,selected, null,true,billType.FB,ext);
|
|
|
}
|
|
|
if(selected.parent){
|
|
|
- return this.addSpecialBill(project, sheetController,selected.parent, selected.nextSibling,true,billType.FB);
|
|
|
+ return this.addSpecialBill(project, sheetController,selected.parent, selected.nextSibling,true,billType.FB,ext);
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- addFXParent:async function(node){
|
|
|
+ addFXParent:async function(node,ext){
|
|
|
let datas = [];
|
|
|
//let parent = node.parent.parent;
|
|
|
let newBills = {
|
|
@@ -236,6 +236,8 @@ ProjectController = {
|
|
|
'type':billType.FB,
|
|
|
'projectID':node.data.projectID
|
|
|
}
|
|
|
+ if(ext) gljUtil.setProperty(newBills,ext);
|
|
|
+
|
|
|
if(node.preSibling){//有前兄弟 在当前分项和前兄弟中间新增一行“分部”空行,空行作为分项的父项,原父项变为空行的前兄弟。
|
|
|
let changeParent = false;
|
|
|
newBills.ParentID = node.parent.parent?node.parent.parent.getID():-1;
|
|
@@ -268,7 +270,6 @@ ProjectController = {
|
|
|
addFX:function(project, sheetController) {//添加分项
|
|
|
if (!project || !sheetController) { return null; }
|
|
|
let selected = project.mainTree.selected;
|
|
|
- console.log(selected);
|
|
|
if(selected.data.type==billType.FB||(selected.parent==null&&isFlag(selected.data)&&selected.data.flagsIndex.fixed.flag==fixedFlag.SUB_ENGINERRING)){//选中的是分部或者是分部分项工程,则插入做为最后一个子项
|
|
|
return this.addSpecialBill(project, sheetController,selected, null,true,billType.FX);
|
|
|
}
|
|
@@ -278,14 +279,14 @@ ProjectController = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- addSpecialBill(project,sheetController,parent,nextSibling,isUserAdd,type){
|
|
|
+ addSpecialBill(project,sheetController,parent,nextSibling,isUserAdd,type,ext){
|
|
|
let newSource = null, newNode = null;
|
|
|
let b_nexID = nextSibling==null?-1:nextSibling.source.getID();//主树和清单树,对应的树节点ID不一样
|
|
|
let m_nexID = nextSibling==null?-1:nextSibling.getID();
|
|
|
let b_parent = parent==null?-1:parent.source.getID();
|
|
|
let m_parent = parent==null?-1:parent.getID();
|
|
|
|
|
|
- newSource = project.Bills.insertSpecialBill(b_parent, b_nexID,isUserAdd,type);
|
|
|
+ newSource = project.Bills.insertSpecialBill(b_parent, b_nexID,isUserAdd,type,ext);
|
|
|
newNode = project.mainTree.insert(m_parent,m_nexID, newSource.data.ID);
|
|
|
if (newNode) {
|
|
|
newNode.source = newSource;
|