Procházet zdrojové kódy

切换单价文件重复问题

zhangweicheng před 4 roky
rodič
revize
cdbdccd931
1 změnil soubory, kde provedl 1 přidání a 6 odebrání
  1. 1 6
      modules/glj/models/unit_price_model.js

+ 1 - 6
modules/glj/models/unit_price_model.js

@@ -408,20 +408,15 @@ class UnitPriceModel extends BaseModel {
         }
 
         let codeList = [];
-        let nameList =[];
         for (let tmp of currentUnitList) {
             if (codeList.indexOf(tmp.code) >= 0) {
                 continue;
             }
             codeList.push(tmp.code);
-            if(nameList.indexOf(tmp.name)>=0){
-                continue
-            }
-            nameList.push(tmp.name);
         }
 
         // 查找即将更替的单价文件是否存在对应的工料机数据 -- (这里只根据code和名称初步过滤,因为其它的几项更改的概率不大,在下一步的比较中再精确匹配)
-        let condition = {unit_price_file_id: changeUnitPriceId, code: {"$in": codeList},name:{"$in": nameList}};
+        let condition = {unit_price_file_id: changeUnitPriceId, code: {"$in": codeList}};
         let targetUnitList = await this.findDataByCondition(condition, null, false, ['code','name','specs','unit','type']);
 
         // 如果没有重叠的数据则原有的数据都复制一份