|
@@ -361,16 +361,20 @@ const importBills = (function(){
|
|
|
let newID = uuid.v1();
|
|
|
let pID = -1;
|
|
|
let preBill = null;
|
|
|
+ let preRoot = null,
|
|
|
+ preLeaf = null;
|
|
|
let nodeType = 'root';//后端以此标记来设置ParentID
|
|
|
+ let preSerialBill = billIdx[preID];
|
|
|
if(isRoot(rData)){
|
|
|
-
|
|
|
//pID = 'fixedBillID';
|
|
|
preBill = billIdx[preRootID];
|
|
|
+ preRoot = billIdx[preRootID];
|
|
|
}
|
|
|
else if(isLeaf(rData)){
|
|
|
nodeType = 'leaf';
|
|
|
//pID = preRootID !== -1 ? preRootID : fixedBill.ID;
|
|
|
preBill = billIdx[preLeafID];
|
|
|
+ preLeaf = billIdx[preLeafID];
|
|
|
}
|
|
|
//set bill data
|
|
|
billIdx[newID] = {
|
|
@@ -391,12 +395,16 @@ const importBills = (function(){
|
|
|
fees: [],
|
|
|
projectID: projectID,
|
|
|
type: getBillType(rData, flag)};
|
|
|
- //match stdBill and reset programID、jobContent、itemCharacter
|
|
|
- //matchStdBill(billIdx[newID], stdData);
|
|
|
//update preBill NextSibling
|
|
|
- if(preBill){
|
|
|
- preBill.NextSiblingID = newID;
|
|
|
+ if(nodeType === 'root' && preRoot){
|
|
|
+ preRoot.NextSiblingID = newID;
|
|
|
}
|
|
|
+ else if(nodeType === 'leaf' && preLeaf && preSerialBill && preSerialBill.nodeType === preLeaf.nodeType){
|
|
|
+ preLeaf.NextSiblingID = newID;
|
|
|
+ }
|
|
|
+ /* if(preBill){
|
|
|
+ preBill.NextSiblingID = newID;
|
|
|
+ }*/
|
|
|
//set new preID
|
|
|
preID = newID;
|
|
|
preRootID = isRoot(rData) ? newID : preRootID;
|