|
@@ -476,9 +476,12 @@ var ration_glj = {
|
|
|
CommonAjax.post("/ration/insertGLJAsRation",postData,function (data) {
|
|
|
console.log(data);
|
|
|
// 更新兄弟节点的序列号
|
|
|
- if(selectedSerialNo!=null&&selectedSerialNo<children.length){
|
|
|
- for(let i = selectedSerialNo;i<children.length;i++){
|
|
|
- children[i].serialNo+=gljList.length;
|
|
|
+ if(selectedSerialNo!=null){
|
|
|
+ let selectIndex = _.findIndex(children,{"serialNo":selectedSerialNo});
|
|
|
+ if(selectIndex+1<children.length){
|
|
|
+ for(let i = selectIndex+1;i<children.length;i++){
|
|
|
+ children[i].serialNo+=gljList.length;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
for(let r_glj of data){
|
|
@@ -491,6 +494,9 @@ var ration_glj = {
|
|
|
newNode.data = r_glj;
|
|
|
ProjectController.syncDisplayNewNode(projectObj.mainController, newNode);
|
|
|
}
|
|
|
+ let parentNode = project.mainTree.nodes[project.mainTree.prefix+parentNodeID];
|
|
|
+ project.calcProgram.calcLeafBillChildren(parentNode);//计算父级清单的所有子节点
|
|
|
+ //this.nodes[this.prefix + parentID];
|
|
|
callback();
|
|
|
$.bootstrapLoading.end();
|
|
|
},function () {
|
|
@@ -640,6 +646,27 @@ var ration_glj = {
|
|
|
data.subType = data.type;
|
|
|
data.marketUnitFee = data.marketPrice;
|
|
|
};
|
|
|
+ ration_glj.prototype.combineRationAndGLJ = function (ration) {
|
|
|
+ if(ration){
|
|
|
+ var projectGLJData = projectObj.project.projectGLJ.datas;
|
|
|
+ var projectGljs = projectGLJData.gljList;
|
|
|
+ var mixRatioMap = projectGLJData.mixRatioMap;
|
|
|
+ var glj = _.find(projectGljs,{'id':ration.projectGLJID});
|
|
|
+ if(glj){
|
|
|
+ ration.marketUnitFee=glj.unit_price.market_price;
|
|
|
+ //ration_gljs[i].adjustPrice=glj.adjust_price;
|
|
|
+ ration.isEstimate=glj.is_evaluate;
|
|
|
+ ration.isAdd=glj.unit_price.is_add;
|
|
|
+ ration.adjustPrice=projectObj.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ var connect_index = gljOprObj.getIndex(glj,['code','name','specs','unit','subType'])
|
|
|
+ if(mixRatioMap.hasOwnProperty(connect_index)){
|
|
|
+ var mixRatios = gljOprObj.getMixRationShowDatas(mixRatioMap[connect_index],projectGljs);
|
|
|
+ ration.subList = mixRatios;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ration;
|
|
|
+ };
|
|
|
ration_glj.prototype.updateFromMainSpread=function (value,node,fieldName) {
|
|
|
if(node.data[fieldName]===value){
|
|
|
return;
|