|
@@ -432,8 +432,8 @@ var Ration = {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
});
|
|
});
|
|
|
|
|
|
- if(data.length<recodes.length&&recodes[data.length].value!=null){//说明有部分定额编号没找到记录
|
|
|
|
- alert('当前库中找不到定额"' + recodes[data.length].value + '"');
|
|
|
|
|
|
+ if(data.length < nodeInfo.length && nodeInfo[data.length].newCode!=null){//说明有部分定额编号没找到记录
|
|
|
|
+ alert('当前库中找不到定额"' + nodeInfo[data.length].newCode + '"');
|
|
}
|
|
}
|
|
updateBillsOprRation();
|
|
updateBillsOprRation();
|
|
})
|
|
})
|
|
@@ -593,9 +593,6 @@ var Ration = {
|
|
needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
|
|
needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
|
|
}
|
|
}
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
- newNode = project.mainTree.insert(billItemID, nextID, newID);
|
|
|
|
- newNode.sourceType = project.Ration.getSourceType();
|
|
|
|
- newNode.data = newData;
|
|
|
|
CommonAjax.post("/ration/addNewRation",{itemQuery:itemQuery,newData:newData,firstLibID: rationLibObj.getFirstStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
|
|
CommonAjax.post("/ration/addNewRation",{itemQuery:itemQuery,newData:newData,firstLibID: rationLibObj.getFirstStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
|
|
//更新缓存
|
|
//更新缓存
|
|
me.datas.push(data.ration);
|
|
me.datas.push(data.ration);
|
|
@@ -605,12 +602,12 @@ var Ration = {
|
|
|
|
|
|
//插入树节点
|
|
//插入树节点
|
|
newSource = data.ration;
|
|
newSource = data.ration;
|
|
- // newNode = project.mainTree.insert(billItemID, nextID, newSource.ID); 上移到post方法外部。批量粘贴时,先插入空行,前端等不了,先生成树结点,效果同清单处理方式。
|
|
|
|
|
|
+ newNode = project.mainTree.insert(billItemID, nextID, newSource.ID);
|
|
newNode.source = newSource;
|
|
newNode.source = newSource;
|
|
- // newNode.sourceType = project.Ration.getSourceType();
|
|
|
|
|
|
+ newNode.sourceType = project.Ration.getSourceType();
|
|
newNode.data = newSource;
|
|
newNode.data = newSource;
|
|
project.projectGLJ.loadData(function () {
|
|
project.projectGLJ.loadData(function () {
|
|
- // ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
|
|
|
+ ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
project.ration_glj.addToMainTree(data.ration_gljs);
|
|
project.ration_glj.addToMainTree(data.ration_gljs);
|
|
projectObj.mainController.refreshTreeNode([newNode], false);
|
|
projectObj.mainController.refreshTreeNode([newNode], false);
|
|
project.calcProgram.calcAndSave(newNode,function () {
|
|
project.calcProgram.calcAndSave(newNode,function () {
|
|
@@ -626,11 +623,55 @@ var Ration = {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
+ return newNode;
|
|
|
|
+ }
|
|
|
|
+ else return null;
|
|
|
|
+ };
|
|
|
|
+ ration.prototype.addNewRationForPaste = function (rationType) {
|
|
|
|
+ let me = this;
|
|
|
|
+ let project = projectObj.project, sheetController = projectObj.mainController;
|
|
|
|
+ let engineering = projectInfoObj.projectInfo.property.engineering;
|
|
|
|
+ let selected = project.mainTree.selected, newSource = null, newNode = null,pre=null,br=null;
|
|
|
|
+ let billItemID = null,serialNo=1,nextID=null;
|
|
|
|
+ if (selected === null) { return null; }
|
|
|
|
+ if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
|
+ billItemID = selected.getParentID();
|
|
|
|
+ br = this.getBillsSortRation(billItemID);
|
|
|
|
+ serialNo = selected.data.serialNo+1;
|
|
|
|
+ nextID = selected.getNextSiblingID();
|
|
|
|
+ pre = selected.source;
|
|
|
|
+ };
|
|
|
|
+ if(billItemID){
|
|
|
|
+ let newID = me.getNewRationID();
|
|
|
|
+ let newData = me.getTempRationData(newID, billItemID, serialNo, rationType);
|
|
|
|
+ let brUpdate = [];
|
|
|
|
+ //更新兄弟节点的序列号
|
|
|
|
+ if (pre) {
|
|
|
|
+ let preIndex = br.indexOf(pre), i;
|
|
|
|
+ for (i = preIndex + 1; i < br.length; i++) {
|
|
|
|
+ br[i].serialNo = i < br.length - 1 ? br [i + 1].serialNo : br[i].serialNo + 1;
|
|
|
|
+ brUpdate.push({projectID:newData.projectID,ID:br[i].ID,serialNo:br[i].serialNo});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(engineering==engineeringType.BUILD_IN) {//如果是安装工程,要看需不需要生成安装增加费
|
|
|
|
+ let billsNode = project.mainTree.getNodeByID(billItemID);
|
|
|
|
+ }
|
|
|
|
+ $.bootstrapLoading.start();
|
|
|
|
+ newNode = project.mainTree.insert(billItemID, nextID, newID);
|
|
|
|
+ newNode.sourceType = project.Ration.getSourceType();
|
|
|
|
+ newNode.data = newData;
|
|
|
|
+ CommonAjax.post("/ration/addNewRation",{itemQuery:null,newData:newData,firstLibID: rationLibObj.getFirstStdRationLibID(),calQuantity:false,brUpdate:brUpdate,needInstall:false},function (data) {
|
|
|
|
+ //更新缓存
|
|
|
|
+ me.datas.push(data.ration);
|
|
|
|
+ //插入树节点
|
|
|
|
+ newSource = data.ration;
|
|
|
|
+ newNode.source = newSource;
|
|
|
|
+ newNode.data = newSource;
|
|
|
|
+ })
|
|
ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
return newNode;
|
|
return newNode;
|
|
}
|
|
}
|
|
else return null;
|
|
else return null;
|
|
-
|
|
|
|
};
|
|
};
|
|
ration.prototype.deleteSubListOfRation = function(ration){
|
|
ration.prototype.deleteSubListOfRation = function(ration){
|
|
projectObj.project.ration_glj.deleteByRation(ration);
|
|
projectObj.project.ration_glj.deleteByRation(ration);
|