|
|
@@ -118,6 +118,8 @@ var Ration = {
|
|
|
};
|
|
|
if(rType == rationType.ration){//空定额暂时不输入取费专业
|
|
|
// newData['programID'] = projectInfoObj.projectInfo.property.engineering;
|
|
|
+ }else if(rType == rationType.volumePrice){//量价取费专业默认为费率为0
|
|
|
+ newData['programID'] = projectObj.project.calcProgram.compiledTemplateMaps["费率为0"];
|
|
|
}else {
|
|
|
if(pEngineer) newData['programID'] = pEngineer;
|
|
|
}
|
|
|
@@ -545,7 +547,7 @@ var Ration = {
|
|
|
};
|
|
|
|
|
|
|
|
|
- ration.prototype.addNewRation = function (itemQuery,rationType,callback=null,isEmpty=false,priceType) {//priceType 是量价类型
|
|
|
+ ration.prototype.addNewRation = function (itemQuery,rationType,callback=null,isEmpty=false,priceType,needCalcAndSave=true) {//priceType 是量价类型
|
|
|
let me = this;
|
|
|
let project = projectObj.project, sheetController = projectObj.mainController;
|
|
|
let engineering = projectInfoObj.projectInfo.property.engineering;
|
|
|
@@ -595,34 +597,38 @@ var Ration = {
|
|
|
CommonAjax.post("/ration/addNewRation",{itemQuery:itemQuery,newData:newData,defaultLibID: rationLibObj.getDefaultStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
|
|
|
//更新缓存
|
|
|
me.datas.push(data.ration);
|
|
|
-
|
|
|
me.addSubListOfRation(data);
|
|
|
-
|
|
|
//插入树节点
|
|
|
newSource = data.ration;
|
|
|
- newNode = project.mainTree.insert(billItemID, nextID, newSource.ID);
|
|
|
- newNode.source = newSource;
|
|
|
- newNode.sourceType = project.Ration.getSourceType();
|
|
|
- newNode.data = newSource;
|
|
|
- project.projectGLJ.loadData(function () {
|
|
|
- ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
- project.ration_glj.addToMainTree(data.ration_gljs);
|
|
|
- projectObj.mainController.refreshTreeNode([newNode], false);
|
|
|
- project.calcProgram.calcAndSave(newNode,function () {
|
|
|
- if(project.Bills.isFBFX(newNode)) { //判断是否属于分部分项工程 ,是的话才需要做计取安装费计算
|
|
|
- installationFeeObj.calcInstallationFee();
|
|
|
- }
|
|
|
+ if(needCalcAndSave == false){
|
|
|
+ syncNodeOper(data);
|
|
|
+ if(callback) callback(newNode);
|
|
|
+ }else {
|
|
|
+ project.projectGLJ.loadData(function () {
|
|
|
+ syncNodeOper(data);
|
|
|
+ project.calcProgram.calcAndSave(newNode,function () {
|
|
|
+ if(project.Bills.isFBFX(newNode)) { //判断是否属于分部分项工程 ,是的话才需要做计取安装费计算
|
|
|
+ installationFeeObj.calcInstallationFee();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //如果添加规则中,添加内容为定额子目,则更新相关清单
|
|
|
+ if(callback) callback(newNode);
|
|
|
});
|
|
|
- //如果添加规则中,添加内容为定额子目,则更新相关清单
|
|
|
- if(callback){
|
|
|
- callback(newNode);
|
|
|
- }
|
|
|
- $.bootstrapLoading.end();
|
|
|
- });
|
|
|
- })
|
|
|
+ }
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ });
|
|
|
return newNode;
|
|
|
}
|
|
|
else return null;
|
|
|
+ function syncNodeOper(data) {//插入后刷新节点操作
|
|
|
+ newNode = project.mainTree.insert(billItemID, nextID, newSource.ID);
|
|
|
+ newNode.source = newSource;
|
|
|
+ newNode.sourceType = project.Ration.getSourceType();
|
|
|
+ newNode.data = newSource;
|
|
|
+ ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
+ project.ration_glj.addToMainTree(data.ration_gljs);
|
|
|
+ projectObj.mainController.refreshTreeNode([newNode], false);
|
|
|
+ }
|
|
|
};
|
|
|
ration.prototype.addNewRationFast = function (rationType,callback) {
|
|
|
let me = this;
|