فهرست منبع

fix: 查找定位人材机,应过滤定额人材机消耗量为0的定额

vian 4 سال پیش
والد
کامیت
6081885628
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 2 2
      web/building_saas/main/js/models/project_glj.js
  2. 1 1
      web/building_saas/main/js/views/locate_view.js

+ 2 - 2
web/building_saas/main/js/models/project_glj.js

@@ -1575,7 +1575,7 @@ ProjectGLJ.prototype.getMainAndEquGLJNodeByID = function (id) {//通过ID取显
 };
 
 //根据工料机,取得所有受影响的定额节点
-ProjectGLJ.prototype.getImpactRationNodes = function (gljs) {
+ProjectGLJ.prototype.getImpactRationNodes = function (gljs, skipEmptyQuantity) {
     let nodes = [];
     let rationMap = {};
     let idArray = _.map(gljs,'id');
@@ -1583,7 +1583,7 @@ ProjectGLJ.prototype.getImpactRationNodes = function (gljs) {
     //先根据项目工料机ID,找到受影响定额的ID
     let ration_glj_list = projectObj.project.ration_glj.datas; //取定额工料机数据
     for (let rg of ration_glj_list) {
-        if (_.indexOf(idArray,rg.projectGLJID)!=-1) {
+        if (_.indexOf(idArray,rg.projectGLJID)!=-1 && (!skipEmptyQuantity || (skipEmptyQuantity && +rg.quantity))) {
             rationMap[rg.rationID] = true;  //取所有定额ID,用MAP方式去重
         }
     }

+ 1 - 1
web/building_saas/main/js/views/locate_view.js

@@ -211,7 +211,7 @@ let locateObject={
         if(this.gljDatas && this.gljDatas.length > 0){
             let glj = this.gljDatas[oldSel.row];
             if(!glj) return datas;
-            let  nodes = projectObj.project.projectGLJ.getImpactRationNodes([glj.reference]);
+            let  nodes = projectObj.project.projectGLJ.getImpactRationNodes([glj.reference], true);
             for(let n of nodes){
                 datas.push(this.getShowRationDatas(n.data));
             }