|
@@ -431,23 +431,19 @@ var Ration = {
|
|
|
project.ration_glj.removeNodeByRation(recode.ration,projectObj.mainController);
|
|
|
project.Ration.deleteSubListOfRation(recode.ration,cleanzmhs);//删除旧定额下的相关记录
|
|
|
//添加新的记录
|
|
|
- project.Ration.addSubListOfRation(recode);
|
|
|
-
|
|
|
-
|
|
|
+ project.Ration.addSubListOfRation(recode,false);
|
|
|
project.ration_glj.addToMainTree(recode.ration_gljs);
|
|
|
}
|
|
|
}
|
|
|
- project.projectGLJ.loadData(function () {
|
|
|
- mbzm_obj.nodeChanged = true;//子目模板关联刷新
|
|
|
- gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected,"-111111111");//这里第二个参数是为了使改前和改后selectedID不一样,删除了的话下方的定额工料机不会刷新
|
|
|
- project.calcProgram.calcNodesAndSave(refershNodes, async function () {
|
|
|
- await OVER_HEIGHT.reCalcOverHeightFee();
|
|
|
- await itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(refershNodes);
|
|
|
- });
|
|
|
- projectObj.mainController.refreshTreeNode(refershNodes, true);
|
|
|
- $.bootstrapLoading.end();
|
|
|
+ project.projectGLJ.calcQuantity();
|
|
|
+ mbzm_obj.nodeChanged = true;//子目模板关联刷新
|
|
|
+ gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected,"-111111111");//这里第二个参数是为了使改前和改后selectedID不一样,删除了的话下方的定额工料机不会刷新
|
|
|
+ project.calcProgram.calcNodesAndSave(refershNodes, async function () {
|
|
|
+ await OVER_HEIGHT.reCalcOverHeightFee();
|
|
|
+ await itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(refershNodes);
|
|
|
});
|
|
|
-
|
|
|
+ projectObj.mainController.refreshTreeNode(refershNodes, true);
|
|
|
+ $.bootstrapLoading.end();
|
|
|
if(data.length < nodeInfo.length && nodeInfo[data.length].newCode!=null){//说明有部分定额编号没找到记录
|
|
|
alert('当前库中找不到定额"' + nodeInfo[data.length].newCode + '"');
|
|
|
}
|
|
@@ -522,7 +518,7 @@ var Ration = {
|
|
|
//更新缓存
|
|
|
for(let data of rstData){
|
|
|
me.datas.push(data.ration);
|
|
|
- me.addSubListOfRation(data);
|
|
|
+ me.addSubListOfRation(data,false);
|
|
|
//插入树节点
|
|
|
newSource = data.ration;
|
|
|
newNode = project.mainTree.insert(billItemID, nextID, newSource.ID);
|
|
@@ -533,34 +529,34 @@ var Ration = {
|
|
|
newNode.data = newSource;
|
|
|
ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
}
|
|
|
- project.projectGLJ.loadData(function () {
|
|
|
- for(let data of rstData){
|
|
|
- project.ration_glj.addToMainTree(data.ration_gljs);
|
|
|
- }
|
|
|
- projectObj.mainController.refreshTreeNode(newNodes, false);
|
|
|
- if(project.Bills.isFBFX(newNodes[0])) { //判断是否属于分部分项工程 ,是的话才需要做计取安装费计算
|
|
|
- project.installation_fee.calcInstallationFee(function (isChange,rations) {
|
|
|
- if(isChange){
|
|
|
- rations = rations.concat(newNodes);
|
|
|
- project.calcProgram.calcNodesAndSave(rations);
|
|
|
- itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(rations);
|
|
|
- }else {
|
|
|
- project.calcProgram.calcNodesAndSave(newNodes);
|
|
|
- itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(newNodes);
|
|
|
- }
|
|
|
- });
|
|
|
- }else {
|
|
|
- project.calcProgram.calcNodesAndSave(newNodes);
|
|
|
- itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(newNodes);
|
|
|
- }
|
|
|
- updateBillsOprRation();
|
|
|
+ project.projectGLJ.calcQuantity();
|
|
|
+ for(let data of rstData){
|
|
|
+ project.ration_glj.addToMainTree(data.ration_gljs);
|
|
|
+ }
|
|
|
+ projectObj.mainController.refreshTreeNode(newNodes, false);
|
|
|
+ if(project.Bills.isFBFX(newNodes[0])) { //判断是否属于分部分项工程 ,是的话才需要做计取安装费计算
|
|
|
+ project.installation_fee.calcInstallationFee(function (isChange,rations) {
|
|
|
+ if(isChange){
|
|
|
+ rations = rations.concat(newNodes);
|
|
|
+ project.calcProgram.calcNodesAndSave(rations);
|
|
|
+ itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(rations);
|
|
|
+ }else {
|
|
|
+ project.calcProgram.calcNodesAndSave(newNodes);
|
|
|
+ itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(newNodes);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ project.calcProgram.calcNodesAndSave(newNodes);
|
|
|
+ itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(newNodes);
|
|
|
+ }
|
|
|
+ updateBillsOprRation();
|
|
|
|
|
|
if(callback){
|
|
|
callback();
|
|
|
}
|
|
|
showLoding = false;
|
|
|
$.bootstrapLoading.end();
|
|
|
- });
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
};
|
|
@@ -653,7 +649,7 @@ var Ration = {
|
|
|
syncNodeOper(data);
|
|
|
if(callback) callback(newNode);
|
|
|
}else {
|
|
|
- if(data.projectGLJDatas) projectObj.project.projectGLJ.refreshByDatas(data.projectGLJDatas);
|
|
|
+ //if(data.projectGLJDatas) projectObj.project.projectGLJ.refreshByDatas(data.projectGLJDatas);
|
|
|
syncNodeOper(data);
|
|
|
project.calcProgram.calcAndSave(newNode,async function () {
|
|
|
await itemIncreaseFeeObj.calcItemIncreaseFeeByNodes([newNode]);
|
|
@@ -760,12 +756,13 @@ var Ration = {
|
|
|
}
|
|
|
|
|
|
};
|
|
|
- ration.prototype.addSubListOfRation = function (data) {
|
|
|
+ ration.prototype.addSubListOfRation = function (data,calquantity = true) {
|
|
|
project.ration_glj.addDatasToList(data.ration_gljs);
|
|
|
project.ration_coe.addDatasToList(data.ration_coes);
|
|
|
project.ration_installation.addDatasToList(data.ration_installations);
|
|
|
project.ration_template.addDatasToList(data.ration_templates);
|
|
|
project.quantity_detail.addDatasToList(data.quantity_details);
|
|
|
+ if(data.projectGLJList && data.projectGLJList.length > 0) projectObj.project.projectGLJ.loadNewProjectGLJToCaches(data.projectGLJList,calquantity);
|
|
|
};
|
|
|
|
|
|
ration.prototype.replaceRation = function (ration, std) {
|