|
@@ -125,6 +125,7 @@ function get_lib_glj_info(ration_glj) {
|
|
ration_glj.unit = glj.unit;
|
|
ration_glj.unit = glj.unit;
|
|
ration_glj.specs = glj.specs;
|
|
ration_glj.specs = glj.specs;
|
|
ration_glj.basePrice = glj.basePrice;
|
|
ration_glj.basePrice = glj.basePrice;
|
|
|
|
+ ration_glj.marketPrice = glj.basePrice;
|
|
ration_glj.shortName = glj.shortName;
|
|
ration_glj.shortName = glj.shortName;
|
|
ration_glj.type = glj.gljType;
|
|
ration_glj.type = glj.gljType;
|
|
ration_glj.repositoryId = glj.repositoryId;
|
|
ration_glj.repositoryId = glj.repositoryId;
|
|
@@ -161,8 +162,8 @@ function createNewRecord(ration_glj) {
|
|
newRecoed.original_code = ration_glj.original_code;
|
|
newRecoed.original_code = ration_glj.original_code;
|
|
newRecoed.unit = ration_glj.unit;
|
|
newRecoed.unit = ration_glj.unit;
|
|
newRecoed.specs = ration_glj.specs;
|
|
newRecoed.specs = ration_glj.specs;
|
|
- newRecoed.from = ration_glj.from ? ration_glj.from : undefined;
|
|
|
|
- newRecoed.createType = ration_glj.createType ? ration_glj.createType : undefined;
|
|
|
|
|
|
+ newRecoed.from = ration_glj.from ? ration_glj.from : 'std';
|
|
|
|
+ newRecoed.createType = ration_glj.createType ? ration_glj.createType : 'normal';
|
|
newRecoed.shortName = ration_glj.shortName;
|
|
newRecoed.shortName = ration_glj.shortName;
|
|
newRecoed.billsItemID = ration_glj.billsItemID;
|
|
newRecoed.billsItemID = ration_glj.billsItemID;
|
|
newRecoed.type = ration_glj.type;
|
|
newRecoed.type = ration_glj.type;
|
|
@@ -500,22 +501,16 @@ function save(user_id, datas, callback) {
|
|
}
|
|
}
|
|
|
|
|
|
async function getLibInfo(req) {
|
|
async function getLibInfo(req) {
|
|
- let gljLibId = null, engineeringId, sessionCompilation = req.session.sessionCompilation,
|
|
|
|
- rationValuation = sessionCompilation.ration_valuation,
|
|
|
|
- billValuation = sessionCompilation.bill_valuation,
|
|
|
|
- engineeringLibModel = new EngineeringLibModel();
|
|
|
|
- if (rationValuation[0]) {
|
|
|
|
- let engineeringList = rationValuation[0].engineering_list;
|
|
|
|
- engineeringId = engineeringList.length > 0 ? engineeringList[0].engineering_id : null;
|
|
|
|
- let engineeringInfo = await engineeringLibModel.getEngineering(engineeringId);
|
|
|
|
- gljLibId = engineeringInfo.glj_lib.length > 0 && typeof engineeringInfo.glj_lib !== 'undefined' ? engineeringInfo.glj_lib[0].id : null;
|
|
|
|
- }
|
|
|
|
- else if (billValuation[0]) {
|
|
|
|
- let engineeringList = billValuation[0].engineering_list;
|
|
|
|
- engineeringId = engineeringList.length > 0 ? engineeringList[0].engineering_id : null;
|
|
|
|
- let engineeringInfo = await engineeringLibModel.getEngineering(engineeringId);
|
|
|
|
|
|
+ let gljLibId = null, engineerID, sessionCompilation = req.session.sessionCompilation,
|
|
|
|
+ engineeringLibModel = new EngineeringLibModel() ;
|
|
|
|
+ engineerID = req.params.engineerID;
|
|
|
|
+ if(engineerID){
|
|
|
|
+ let engineeringInfo = await engineeringLibModel.findDataByCondition({'_id': engineerID});
|
|
gljLibId = engineeringInfo.glj_lib.length > 0 && typeof engineeringInfo.glj_lib !== 'undefined' ? engineeringInfo.glj_lib[0].id : null;
|
|
gljLibId = engineeringInfo.glj_lib.length > 0 && typeof engineeringInfo.glj_lib !== 'undefined' ? engineeringInfo.glj_lib[0].id : null;
|
|
|
|
+ }else {
|
|
|
|
+ throw new Error("工程专业ID为空!");
|
|
}
|
|
}
|
|
|
|
+
|
|
let data = {
|
|
let data = {
|
|
userID: req.session.sessionUser.id,
|
|
userID: req.session.sessionUser.id,
|
|
gljLibId: gljLibId,
|
|
gljLibId: gljLibId,
|
|
@@ -575,7 +570,7 @@ function getGLJSearchInfo(ration_glj) {
|
|
type: ration_glj.subType ? ration_glj.subType : ration_glj.type,//如果有subType,则是通过插入定额级的工料机进来的
|
|
type: ration_glj.subType ? ration_glj.subType : ration_glj.type,//如果有subType,则是通过插入定额级的工料机进来的
|
|
type_of_work: ration_glj.subType ? ration_glj.subType : ration_glj.type,
|
|
type_of_work: ration_glj.subType ? ration_glj.subType : ration_glj.type,
|
|
base_price: ration_glj.basePrice,
|
|
base_price: ration_glj.basePrice,
|
|
- market_price: ration_glj.basePrice,
|
|
|
|
|
|
+ market_price: ration_glj.marketPrice,
|
|
repositoryId: ration_glj.repositoryId,
|
|
repositoryId: ration_glj.repositoryId,
|
|
adjCoe: ration_glj.adjCoe,
|
|
adjCoe: ration_glj.adjCoe,
|
|
materialType:ration_glj.materialType,
|
|
materialType:ration_glj.materialType,
|