|
|
@@ -783,12 +783,14 @@ class GLJListModel extends BaseModel {
|
|
|
mixRatioData[m_index]=tmp;
|
|
|
}
|
|
|
// 查找对应的项目工料机数据
|
|
|
- let gcondition = {project_id: glj.project_id,code: {"$in": codeList}, name: {"$in": nameList},specs:{"$in": specsList},type:{"$in": typeList},unit:{"$in": unitList} };
|
|
|
+ //let gcondition = {project_id: glj.project_id,code: {"$in": codeList}, name: {"$in": nameList},specs:{"$in": specsList},type:{"$in": typeList},unit:{"$in": unitList} };
|
|
|
+ let gcondition = {project_id: glj.project_id,code: {"$in": codeList}, name: {"$in": nameList},type:{"$in": typeList},unit:{"$in": unitList} };
|
|
|
let gljData = await this.findDataByCondition(gcondition, {_id: 0}, false);
|
|
|
|
|
|
// 查找对应的单价数据
|
|
|
let unitPriceModel = new UnitPriceModel();
|
|
|
- let ucondition = { unit_price_file_id: unitPriceFileId,code: {"$in": codeList}, name: {"$in": nameList},specs:{"$in": specsList},type:{"$in": typeList},unit:{"$in": unitList}};
|
|
|
+ //let ucondition = { unit_price_file_id: unitPriceFileId,code: {"$in": codeList}, name: {"$in": nameList},specs:{"$in": specsList},type:{"$in": typeList},unit:{"$in": unitList}};
|
|
|
+ let ucondition = { unit_price_file_id: unitPriceFileId,code: {"$in": codeList}, name: {"$in": nameList},type:{"$in": typeList},unit:{"$in": unitList}};
|
|
|
let unitPriceList = await unitPriceModel.findDataByCondition(ucondition, {_id: 0}, false);
|
|
|
|
|
|
|
|
|
@@ -796,7 +798,9 @@ class GLJListModel extends BaseModel {
|
|
|
let unitPriceData = {};
|
|
|
for(let tmp of unitPriceList) {
|
|
|
let u_index = this.getIndex(tmp,['code','name','specs','unit','type']);
|
|
|
- unitPriceData[u_index] = tmp;
|
|
|
+ if (mixRatioData[u_index]) {
|
|
|
+ unitPriceData[u_index] = tmp;
|
|
|
+ }
|
|
|
}
|
|
|
return [gljData,mixRatioData,unitPriceData];
|
|
|
|
|
|
@@ -825,6 +829,10 @@ class GLJListModel extends BaseModel {
|
|
|
specs:projectGLJData.specs,
|
|
|
type:projectGLJData.type,
|
|
|
unit:projectGLJData.unit
|
|
|
+ };
|
|
|
+ if (!condition.specs) {
|
|
|
+ delete condition.specs;
|
|
|
+ condition.$or = [{specs: null}, {specs: ''}];
|
|
|
}
|
|
|
let unitPrice = await unitPriceModel.findDataByCondition(condition);
|
|
|
|