|
@@ -908,6 +908,38 @@ ProjectGLJ.prototype.calcTenderQuantity = function (){
|
|
|
gljUtil.calcProjectGLJQuantity(this.datas,rationGLJDatas,rationDatas,billsDatas,getDecimal("glj.quantity"),_,scMathUtil,true);
|
|
|
};
|
|
|
|
|
|
+ProjectGLJ.prototype.loadNewProjectGLJToCaches = function (datas) {
|
|
|
+ for (let d of datas){
|
|
|
+ this.loadNewProjectGLJToCache(d);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+ProjectGLJ.prototype.loadNewProjectGLJToCache = function (data) {//把新插入的项目工料机数据增加至缓存中
|
|
|
+ let project_gljs = this.datas.gljList;
|
|
|
+ let unitPriceMap = this.datas.unitPriceMap;
|
|
|
+ let mixRatioMap = this.datas.mixRatioMap;
|
|
|
+ let mixRatioConnectData = this.datas.mixRatioConnectData;
|
|
|
+ let tem = _.find(project_gljs,{'id':data.id});
|
|
|
+ if(tem) return; //判断该工料机是否已经存在,是的话不用再次添加
|
|
|
+ //查看是否有组成物,有组成物的话先添加组成物信息
|
|
|
+ data.ratio_data=[];
|
|
|
+ if(data.subList && data.subList.length){
|
|
|
+ for(let s of data.subList){
|
|
|
+ let ratio = s.ratio_data;
|
|
|
+ data.ratio_data.push(ratio);
|
|
|
+ mixRatioMap[ratio.connect_key]?mixRatioMap[ratio.connect_key].push(ratio):mixRatioMap[ratio.connect_key] = [ratio];
|
|
|
+ let rIndex = gljUtil.getIndex(ratio);
|
|
|
+ mixRatioConnectData[rIndex]?mixRatioConnectData[rIndex].push(ratio.connect_key):mixRatioConnectData[rIndex] = [ratio.connect_key];
|
|
|
+ this.loadNewProjectGLJToCache(s);
|
|
|
+ }
|
|
|
+ delete data.subList;
|
|
|
+ }
|
|
|
+ //添加unitPriceMap
|
|
|
+ let uIndex = gljUtil.getIndex(data.unit_price);
|
|
|
+ if(!unitPriceMap[uIndex]) unitPriceMap[uIndex] = data.unit_price;
|
|
|
+ this.datas.gljList.push(data);
|
|
|
+};
|
|
|
+
|
|
|
class EvaluateList {
|
|
|
constructor (project) {
|
|
|
this.project = project;
|