|
@@ -8,6 +8,7 @@
|
|
|
function ProjectGLJ() {
|
|
|
this.datas = null;
|
|
|
this.isLoading = false;
|
|
|
+ this.quantityChangeMap=null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -690,15 +691,16 @@ ProjectGLJ.prototype.getShortNameByID = function (ID) {
|
|
|
return gljTypeMap["typeId" + ID].shortName;
|
|
|
};
|
|
|
|
|
|
-ProjectGLJ.prototype.calcQuantity = function (){
|
|
|
+ProjectGLJ.prototype.calcQuantity = function (init=false){
|
|
|
let project_gljs = this.datas.gljList;
|
|
|
let mixRatioConnectData = this.datas.mixRatioConnectData;
|
|
|
let mixRatioMap = this.datas.mixRatioMap;
|
|
|
let rations = projectObj.project.Ration.datas;
|
|
|
let rationMap = _.indexBy(rations,'ID');
|
|
|
- let quantityMap={};
|
|
|
+ let quantityMap={},changeArray=[];
|
|
|
let rationGljGroup = _.groupBy(projectObj.project.ration_glj.datas,'projectGLJID')
|
|
|
let q_decimal = getDecimal("glj.quantity");
|
|
|
+ console.log(init);
|
|
|
for(let pglj of project_gljs ){
|
|
|
let pg_index = gljOprObj.getIndex(pglj,gljKeyArray);
|
|
|
pglj.subdivisionQuantity = 0;
|
|
@@ -709,7 +711,6 @@ ProjectGLJ.prototype.calcQuantity = function (){
|
|
|
pglj.subdivisionQuantity = result.subdivisionQuantity;
|
|
|
pglj.techQuantity = result.techQuantity;
|
|
|
pglj.quantity = result.quantity;
|
|
|
-
|
|
|
quantityMap[pg_index] = pglj;
|
|
|
}
|
|
|
//计算做为组成物的消耗量
|
|
@@ -729,8 +730,29 @@ ProjectGLJ.prototype.calcQuantity = function (){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(init == true || this.quantityChangeMap == null){//如果是初始化,建立一个映射表
|
|
|
+ this.quantityChangeMap = {};
|
|
|
+ for(let pglj of project_gljs){
|
|
|
+ this.quantityChangeMap[pglj.id] = pglj.quantity;
|
|
|
+ }
|
|
|
+ }else if(this.quantityChangeMap != null){
|
|
|
+ for(let pglj of project_gljs){
|
|
|
+ if(this.quantityChangeMap[pglj.id] != undefined|| this.quantityChangeMap[pglj.id] != null){
|
|
|
+ if(this.quantityChangeMap[pglj.id] != pglj.quantity){
|
|
|
+ changeArray.push(pglj);
|
|
|
+ this.quantityChangeMap[pglj.id] = pglj.quantity;
|
|
|
+ }
|
|
|
+ }else { //映射表没有,说明是新添加的项目工料机
|
|
|
+ changeArray.push(pglj);
|
|
|
+ this.quantityChangeMap[pglj.id] = pglj.quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ changeArray.length > 0 && projectGljObject.calcPartASupplyFeeByProjectGLJs ?projectGljObject.calcPartASupplyFeeByProjectGLJs(changeArray):'';
|
|
|
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+};
|
|
|
|
|
|
ProjectGLJ.prototype.getQuantityPerGLJ = function (ration_glj_list,rations,rationMap,pglj) {
|
|
|
let billIDs = projectObj.project.Bills.getSubdivisionProjectLeavesID();//取分部分项上的所有叶子清单ID
|