|  | @@ -134,21 +134,26 @@ let cbTools = {
 | 
												
													
														
															|  |          mapObj['CHARGE'] = Object.create(null);
 |  |          mapObj['CHARGE'] = Object.create(null);
 | 
												
													
														
															|  |          mapObj['TAX'] = Object.create(null);
 |  |          mapObj['TAX'] = Object.create(null);
 | 
												
													
														
															|  |          mapObj['OTHERS'] = Object.create(null);
 |  |          mapObj['OTHERS'] = Object.create(null);
 | 
												
													
														
															|  | -        let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ', 'SQGCZJ'];
 |  | 
 | 
												
													
														
															|  | 
 |  | +        mapObj['ENGINEERINGCOST'] = Object.create(null);
 | 
												
													
														
															|  | 
 |  | +        let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ', 'SQGCZJ', 'AQWMSGZXFY'];
 | 
												
													
														
															|  | 
 |  | +        //安全文明施工专项费用只有税金和工程造价能用
 | 
												
													
														
															|  |          for(let figure in baseFigures){
 |  |          for(let figure in baseFigures){
 | 
												
													
														
															|  |              if(filter.indexOf(baseFigures[figure]['base']) === -1){
 |  |              if(filter.indexOf(baseFigures[figure]['base']) === -1){
 | 
												
													
														
															|  |                  mapObj['CONSTRUCTION_ORGANIZATION'][figure] = baseFigures[figure];
 |  |                  mapObj['CONSTRUCTION_ORGANIZATION'][figure] = baseFigures[figure];
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  | -            if(baseFigures[figure]['base'] !== 'QTXMF' && baseFigures[figure]['base'] !== 'SQGCZJ'){
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if(baseFigures[figure]['base'] !== 'QTXMF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
 | 
												
													
														
															|  |                  mapObj['OTHER'][figure] = baseFigures[figure];
 |  |                  mapObj['OTHER'][figure] = baseFigures[figure];
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  | -            if(baseFigures[figure]['base'] !== 'GF' && baseFigures[figure]['base'] !== 'SQGCZJ'){
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if(baseFigures[figure]['base'] !== 'GF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
 | 
												
													
														
															|  |                  mapObj['CHARGE'][figure] = baseFigures[figure];
 |  |                  mapObj['CHARGE'][figure] = baseFigures[figure];
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |              if(baseFigures[figure]['base'] !== 'SJ' && baseFigures[figure]['base'] !== 'SQGCZJ'){
 |  |              if(baseFigures[figure]['base'] !== 'SJ' && baseFigures[figure]['base'] !== 'SQGCZJ'){
 | 
												
													
														
															|  |                  mapObj['TAX'][figure] = baseFigures[figure];
 |  |                  mapObj['TAX'][figure] = baseFigures[figure];
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |              if(baseFigures[figure]['base'] !== 'SQGCZJ'){
 |  |              if(baseFigures[figure]['base'] !== 'SQGCZJ'){
 | 
												
													
														
															|  | 
 |  | +                mapObj['ENGINEERINGCOST'][figure] = baseFigures[figure];
 | 
												
													
														
															|  | 
 |  | +            }
 | 
												
													
														
															|  | 
 |  | +            if(baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
 | 
												
													
														
															|  |                  mapObj['OTHERS'][figure] = baseFigures[figure];
 |  |                  mapObj['OTHERS'][figure] = baseFigures[figure];
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |              if(baseFigures[figure]['base'] === 'SQGCZJ'){
 |  |              if(baseFigures[figure]['base'] === 'SQGCZJ'){
 | 
												
											
												
													
														
															|  | @@ -180,6 +185,9 @@ let cbTools = {
 | 
												
													
														
															|  |          else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.TAX){
 |  |          else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.TAX){
 | 
												
													
														
															|  |              return calcBase.baseFigureClass.TAX;
 |  |              return calcBase.baseFigureClass.TAX;
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | 
 |  | +        else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.ENGINEERINGCOST){
 | 
												
													
														
															|  | 
 |  | +            return calcBase.baseFigureClass.ENGINEERINGCOST;
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  |          else {
 |  |          else {
 | 
												
													
														
															|  |              if(!parent){
 |  |              if(!parent){
 | 
												
													
														
															|  |                  return calcBase.baseFigureClass.OTHERS;
 |  |                  return calcBase.baseFigureClass.OTHERS;
 | 
												
											
												
													
														
															|  | @@ -525,6 +533,13 @@ let baseFigureTemplate = {
 | 
												
													
														
															|  |          if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
 |  |          if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
 | 
												
													
														
															|  |          return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
 |  |          return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
 | 
												
													
														
															|  |      },
 |  |      },
 | 
												
													
														
															|  | 
 |  | +    'AQWMSGZXFY': function (tender) {
 | 
												
													
														
															|  | 
 |  | +        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
 | 
												
													
														
															|  | 
 |  | +        let bill = calcBase.fixedBills[calcBase.fixedFlag.SAFETY_CONSTRUCTION]['bill'];
 | 
												
													
														
															|  | 
 |  | +        if(cbTools.isUnDef(bill) || cbTools.isUnDef(bill.ID)) return 0;
 | 
												
													
														
															|  | 
 |  | +        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
 | 
												
													
														
															|  | 
 |  | +        return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
 | 
												
													
														
															|  | 
 |  | +    },
 | 
												
													
														
															|  |      'JZMJ': function () {
 |  |      'JZMJ': function () {
 | 
												
													
														
															|  |          let buildingArea = projFeatureView.getFeature('buildingArea');
 |  |          let buildingArea = projFeatureView.getFeature('buildingArea');
 | 
												
													
														
															|  |          return buildingArea ? parseFloat(buildingArea) : 0;
 |  |          return buildingArea ? parseFloat(buildingArea) : 0;
 | 
												
											
												
													
														
															|  | @@ -1006,6 +1021,7 @@ let baseFigureMap = {
 | 
												
													
														
															|  |      '其他项目费': {base: 'QTXMF',  fixedFlag: fixedFlag.OTHER, class: 'QTXM'},
 |  |      '其他项目费': {base: 'QTXMF',  fixedFlag: fixedFlag.OTHER, class: 'QTXM'},
 | 
												
													
														
															|  |      '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
 |  |      '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
 | 
												
													
														
															|  |      '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
 |  |      '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
 | 
												
													
														
															|  | 
 |  | +    '安全文明施工专项费用': {base: 'AQWMSGZXFY', fixedFlag: fixedFlag.SAFETY_CONSTRUCTION, class: 'CSXM'},
 | 
												
													
														
															|  |      //不于清单直接关联==========
 |  |      //不于清单直接关联==========
 | 
												
													
														
															|  |      '建筑面积': {base: 'JZMJ', class: 'FBFX'},
 |  |      '建筑面积': {base: 'JZMJ', class: 'FBFX'},
 | 
												
													
														
															|  |      '税前工程造价': {base: 'SQGCZJ', class: 'SQGCZJ'},//安全文明施工专项费用使用
 |  |      '税前工程造价': {base: 'SQGCZJ', class: 'SQGCZJ'},//安全文明施工专项费用使用
 | 
												
											
												
													
														
															|  | @@ -1187,9 +1203,12 @@ let cbAnalyzer = {
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |          //转换成ID引用
 |  |          //转换成ID引用
 | 
												
													
														
															|  |          exp = cbParser.toIDExpr(exp);
 |  |          exp = cbParser.toIDExpr(exp);
 | 
												
													
														
															|  | -        if(this.cycleCalc(node, cbTools.getFigure(node), exp)){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if(this.cycleCalc(node, calcBase.baseFigures, exp)){
 | 
												
													
														
															|  |              throw '出现循环计算';
 |  |              throw '出现循环计算';
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | 
 |  | +       /*  if(this.cycleCalc(node, cbTools.getFigure(node), exp)){
 | 
												
													
														
															|  | 
 |  | +            throw '出现循环计算';
 | 
												
													
														
															|  | 
 |  | +        }*/
 | 
												
													
														
															|  |          return exp;
 |  |          return exp;
 | 
												
													
														
															|  |       /*   if(this.inputLegal(exp)){
 |  |       /*   if(this.inputLegal(exp)){
 | 
												
													
														
															|  |              if(this.arithmeticLegal(exp)){
 |  |              if(this.arithmeticLegal(exp)){
 | 
												
											
												
													
														
															|  | @@ -1374,15 +1393,15 @@ let cbParser = {
 | 
												
													
														
															|  |          let exps = [];
 |  |          let exps = [];
 | 
												
													
														
															|  |          for(let i = 0, len = strs.length; i < len; i++){
 |  |          for(let i = 0, len = strs.length; i < len; i++){
 | 
												
													
														
															|  |              let exp = Object.create(null);
 |  |              let exp = Object.create(null);
 | 
												
													
														
															|  | -            exp.orgExp = strs[i];
 |  | 
 | 
												
													
														
															|  | 
 |  | +            exp.orgExp = `{${strs[i]}}`;
 | 
												
													
														
															|  |              exps.push(exp);
 |  |              exps.push(exp);
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |          //去{}
 |  |          //去{}
 | 
												
													
														
															|  | -        v = v.replace(/[{, },]/g, '');
 |  | 
 | 
												
													
														
															|  | 
 |  | +        //v = v.replace(/[{, },]/g, '');
 | 
												
													
														
															|  |          for(let i = 0, len = exps.length;i < len; i++){
 |  |          for(let i = 0, len = exps.length;i < len; i++){
 | 
												
													
														
															|  |              exps[i].compileExp = '$CBC.base(\'' + exps[i].orgExp + '\')';
 |  |              exps[i].compileExp = '$CBC.base(\'' + exps[i].orgExp + '\')';
 | 
												
													
														
															|  |              //暂估材料费作特殊处理
 |  |              //暂估材料费作特殊处理
 | 
												
													
														
															|  | -            if(exps[i].orgExp === '暂估材料费(从子目汇总)' || exps[i].orgExp === '暂估材料费(从工料机汇总表汇总)'){
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if(exps[i].orgExp === '{暂估材料费(从子目汇总)}' || exps[i].orgExp === '{暂估材料费(从工料机汇总表汇总)}'){
 | 
												
													
														
															|  |                  let reCount = v.split(exps[i].orgExp).length - 1;
 |  |                  let reCount = v.split(exps[i].orgExp).length - 1;
 | 
												
													
														
															|  |                  while (reCount > 0){
 |  |                  while (reCount > 0){
 | 
												
													
														
															|  |                      v = v.replace(exps[i].orgExp, exps[i].compileExp);
 |  |                      v = v.replace(exps[i].orgExp, exps[i].compileExp);
 | 
												
											
												
													
														
															|  | @@ -1393,6 +1412,8 @@ let cbParser = {
 | 
												
													
														
															|  |                  v = v.replace(new RegExp(exps[i].orgExp, 'g'), exps[i].compileExp);
 |  |                  v = v.replace(new RegExp(exps[i].orgExp, 'g'), exps[i].compileExp);
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | 
 |  | +        //去{}
 | 
												
													
														
															|  | 
 |  | +        v = v.replace(/[{, },]/g, '');
 | 
												
													
														
															|  |          //行引用
 |  |          //行引用
 | 
												
													
														
															|  |          let fidArr = this.getFIDArr(v);
 |  |          let fidArr = this.getFIDArr(v);
 | 
												
													
														
															|  |          let fExps = [];
 |  |          let fExps = [];
 | 
												
											
												
													
														
															|  | @@ -1514,6 +1535,7 @@ let calcBase = {
 | 
												
													
														
															|  |              node.changed = true;
 |  |              node.changed = true;
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |          catch (err){
 |  |          catch (err){
 | 
												
													
														
															|  | 
 |  | +            console.log(err);
 | 
												
													
														
															|  |              if(typeof err === 'object'){
 |  |              if(typeof err === 'object'){
 | 
												
													
														
															|  |                  err = '表达式不正确'
 |  |                  err = '表达式不正确'
 | 
												
													
														
															|  |              }
 |  |              }
 |