|
@@ -31,7 +31,8 @@ module.exports = {
|
|
|
addNewRation:addNewRation,
|
|
|
addMultiRation: addMultiRation,
|
|
|
getSameSectionRations:getSameSectionRations,
|
|
|
- getExtendData:getExtendData
|
|
|
+ getExtendData:getExtendData,
|
|
|
+ getDefaultProgramID:getDefaultProgramID
|
|
|
};
|
|
|
async function addNewRation(data,compilation) {
|
|
|
let query = data.itemQuery;
|
|
@@ -167,6 +168,18 @@ async function replaceRations(userID,data,compilation) {
|
|
|
return recodes;
|
|
|
}
|
|
|
|
|
|
+async function getDefaultProgramID(data) {
|
|
|
+ let searchDao = new SearchDao();
|
|
|
+ let programID;
|
|
|
+ let std = await searchDao.getRationItem(data.userID,data.compilationId,[data.libID],data.code, null);
|
|
|
+ if(std.feeType == undefined || std.feeType == null || std.feeType ==''){//定额取费专业为空的情况下,取项目属性中的定额取费专业ID
|
|
|
+ programID = await getProgramForProject(data.projectID);
|
|
|
+ }else {
|
|
|
+ programID = std.feeType;
|
|
|
+ }
|
|
|
+ return programID;
|
|
|
+}
|
|
|
+
|
|
|
async function replaceRation(nodeInfo,stdRation,defaultLibID,projectID,calQuantity,compilation) {
|
|
|
if(nodeInfo.newCode == null||nodeInfo.newCode ==""){//说明是删除编号,则要变成一条空定额
|
|
|
await deleRationSubRecode(projectID,nodeInfo.ID);//删除定额下挂的各种数据,如定额工料机等
|
|
@@ -383,6 +396,8 @@ async function addRationGLJ(std,newRation,compilation) {
|
|
|
std_glj.basePrice = std_glj.priceProperty[ext.priceField];
|
|
|
}
|
|
|
}
|
|
|
+ console.log("================================get std glj=============================================");
|
|
|
+ console.log(std_glj);
|
|
|
let std_gljTime = +new Date();
|
|
|
if(std_glj){
|
|
|
newGLJ.name = std_glj.name;
|