|
@@ -583,8 +583,8 @@ const billsGuidance = (function () {
|
|
|
for (const subKey of keys) {
|
|
for (const subKey of keys) {
|
|
|
let isPrjFeatureMatch = false;
|
|
let isPrjFeatureMatch = false;
|
|
|
for (let prjF of projectObj.project.projectInfo.property.projectFeature) {
|
|
for (let prjF of projectObj.project.projectInfo.property.projectFeature) {
|
|
|
- if (prjF.key === bmsK.key) {
|
|
|
|
|
- if (prjF.value === bmsK.value) {
|
|
|
|
|
|
|
+ if (prjF.key === subKey.key) {
|
|
|
|
|
+ if (prjF.value === subKey.value) {
|
|
|
isPrjFeatureMatch = true;
|
|
isPrjFeatureMatch = true;
|
|
|
// isKeyMatch = true;
|
|
// isKeyMatch = true;
|
|
|
break;
|
|
break;
|
|
@@ -604,10 +604,12 @@ const billsGuidance = (function () {
|
|
|
let isMatch = true;
|
|
let isMatch = true;
|
|
|
// 1. 基本数量
|
|
// 1. 基本数量
|
|
|
// 先判断此bills是否有配置
|
|
// 先判断此bills是否有配置
|
|
|
|
|
+ let basicValue = 0;
|
|
|
for (const bm of billsUnitPriceFeature.feature.basicMappings) {
|
|
for (const bm of billsUnitPriceFeature.feature.basicMappings) {
|
|
|
|
|
+ isMatch = true;
|
|
|
if (bm.parentBasicKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
|
|
if (bm.parentBasicKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
|
|
|
for (let kIdx = 0; kIdx < bm.parentBasicKeys.length; kIdx++) {
|
|
for (let kIdx = 0; kIdx < bm.parentBasicKeys.length; kIdx++) {
|
|
|
- if (bm.parentBasicKeys[kIdx] !== 'ALL' && node[billsUnitPriceFeature.feature.basicKeyOptions[kIdx]] !== bm.parentBasicKeys[kIdx]) {
|
|
|
|
|
|
|
+ if (bm.parentBasicKeys[kIdx] !== 'ALL' && node.updateData[billsUnitPriceFeature.feature.basicKeyOptions[kIdx].key] !== bm.parentBasicKeys[kIdx]) {
|
|
|
isMatch = false;
|
|
isMatch = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -616,24 +618,24 @@ const billsGuidance = (function () {
|
|
|
isMatch = false;
|
|
isMatch = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- let basicValue = 0;
|
|
|
|
|
- if (isMatch) {
|
|
|
|
|
- //再根据相关项目属性指定基数
|
|
|
|
|
- for (const bms of billsUnitPriceFeature.feature.basicMappings.subs) {
|
|
|
|
|
- if (_chkKeys(bms.keys)) {
|
|
|
|
|
- basicValue = bms.basicValue;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (isMatch) {
|
|
|
|
|
+ //再根据相关项目属性指定基数
|
|
|
|
|
+ for (const bms of bm.subs) {
|
|
|
|
|
+ if (_chkKeys(bms.keys)) {
|
|
|
|
|
+ basicValue = bms.basicValue;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 2. 相关系数(允许多个)
|
|
// 2. 相关系数(允许多个)
|
|
|
let factors = [];
|
|
let factors = [];
|
|
|
- isMatch = true;
|
|
|
|
|
for (const fm of billsUnitPriceFeature.feature.factorMappings) {
|
|
for (const fm of billsUnitPriceFeature.feature.factorMappings) {
|
|
|
|
|
+ isMatch = true;
|
|
|
if (fm.basicFactorKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
|
|
if (fm.basicFactorKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
|
|
|
for (let kIdx = 0; kIdx < fm.basicFactorKeys.length; kIdx++) {
|
|
for (let kIdx = 0; kIdx < fm.basicFactorKeys.length; kIdx++) {
|
|
|
- if (fm.basicFactorKeys[kIdx] !== 'ALL' && node[billsUnitPriceFeature.feature.basicKeyOptions[kIdx]] !== fm.basicFactorKeys[kIdx]) {
|
|
|
|
|
|
|
+ if (fm.basicFactorKeys[kIdx] !== 'ALL' && node.updateData[billsUnitPriceFeature.feature.basicKeyOptions[kIdx].key] !== fm.basicFactorKeys[kIdx]) {
|
|
|
isMatch = false;
|
|
isMatch = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -642,12 +644,13 @@ const billsGuidance = (function () {
|
|
|
isMatch = false;
|
|
isMatch = false;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- if (isMatch) {
|
|
|
|
|
- for (const fms of billsUnitPriceFeature.feature.factorMappings.subs) {
|
|
|
|
|
- if (_chkKeys(fms.keys)) {
|
|
|
|
|
- factors.push(fms.basicValue); // 允许多个
|
|
|
|
|
|
|
+ if (isMatch) {
|
|
|
|
|
+ for (const fms of fm.subs) {
|
|
|
|
|
+ if (_chkKeys(fms.keys)) {
|
|
|
|
|
+ factors.push(fms.basicValue);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ // 允许多个,不break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//3. 装配(指标基价 即 默认的清单单价)
|
|
//3. 装配(指标基价 即 默认的清单单价)
|
|
@@ -656,11 +659,11 @@ const billsGuidance = (function () {
|
|
|
unitFeeVal = unitFeeVal * parseFloat(factor);
|
|
unitFeeVal = unitFeeVal * parseFloat(factor);
|
|
|
}
|
|
}
|
|
|
// 暂时未设小数位数 scMathUtil.roundTo(unitFeeVal,2);
|
|
// 暂时未设小数位数 scMathUtil.roundTo(unitFeeVal,2);
|
|
|
- node.calcFlag = 2; //当用户输入单价
|
|
|
|
|
- if (!node.hasOwnProperty('fees')) {
|
|
|
|
|
- node.fees = [];
|
|
|
|
|
|
|
+ node.updateData.calcFlag = 2; //当用户输入单价
|
|
|
|
|
+ if (!node.updateData.hasOwnProperty('fees')) {
|
|
|
|
|
+ node.updateData.fees = [];
|
|
|
}
|
|
}
|
|
|
- node.fees.push({fieldName: 'common', unitFee: unitFeeVal, totalFee: 0, tenderUnitFee: unitFeeVal, tenderTotalFee: 0});
|
|
|
|
|
|
|
+ node.updateData.fees.push({fieldName: 'common', unitFee: unitFeeVal, totalFee: 0, tenderUnitFee: unitFeeVal, tenderTotalFee: 0});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|