zhangweicheng před 6 roky
rodič
revize
b373d70edf

+ 1 - 1
modules/glj/controllers/glj_controller.js

@@ -891,7 +891,7 @@ async function getGLJListByProjectID(projectId){
             usedUnitPriceInfo: usedUnitPriceInfo,
             gljTypeMap:gljTypeMap,
             vvTaxFileID:unitFileInfo.vvTaxFileID,
-            assistProductionFeeRate:unitFileInfo.assistProductionFeeRate?unitFileInfo.assistProductionFeeRate:0
+            assistProductionFeeRate:unitFileInfo.assistProductionFeeRate?unitFileInfo.assistProductionFeeRate:3
         };
     } catch (error) {
         console.log(error);

+ 0 - 1
modules/glj/facade/glj_facade.js

@@ -114,7 +114,6 @@ async function changeVvTaxFile(data){//对于车船税,现在只是在组成
 async function changeAssistProductionFeeRate(data){
     let unitFileID = data.unitFileID,assistProductionFeeRate = data.assistProductionFeeRate;
     let unitPriceFileModel = new UnitPriceFileModel();
-    //先更新单价文件中车船税文件ID
     await unitPriceFileModel.model.update({id:unitFileID},{assistProductionFeeRate:assistProductionFeeRate});
 }
 

+ 2 - 0
modules/pm/models/project_model.js

@@ -147,6 +147,8 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                         user_id: userId,
                         root_project_id: data.updateData.property.rootProjectID
                     };
+                    let overWrite = require("../../.."+compilation.overWriteUrl);
+                    if(overWrite.getDefalutAssistProductionFeeRate) insertData.assistProductionFeeRate = overWrite.getDefalutAssistProductionFeeRate();
                     let addResult = await unitPriceFileModel.add(insertData);
                     if (!addResult) {
                         callback(1, '新增单价文件失败.', null);

+ 0 - 1
public/web/sheet/sheet_common.js

@@ -317,7 +317,6 @@ var sheetCommonObj = {
                 dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
             }
             if(editable) dynamicCombo.editable(true);
-            console.log(maxDropDownItems);
             if(maxDropDownItems) dynamicCombo.maxDropDownItems(maxDropDownItems);
         }
         sheet.setCellType(row, col,dynamicCombo,GC.Spread.Sheets.SheetArea.viewport);

+ 1 - 1
web/building_saas/glj/html/project_glj.html

@@ -224,7 +224,7 @@
             </div>
             <div class="modal-body">
                 <div class="form-group">
-                    <label>辅助生产间接费费率(%)</label>
+                    <label id = "assistProductionLabel">辅助生产间接费费率(%)</label>
                     <input class="form-control" id="assistProductionFeeRate" value="">
                 </div>
             </div>

+ 4 - 1
web/building_saas/main/js/models/project_glj.js

@@ -860,6 +860,7 @@ ProjectGLJ.prototype.calcEachFreightOrPrice = function (temp,type,priceMap) {//
          if(type == "freight" && temp.conveyance !="自办运输") return null;
         let sum =0;
         let gljMap = {};
+        let decimal = type == "freight"?getDecimal("glj.unitPrice"):getDecimal("glj.unitPriceHasMix");
         //因为材料计算的数据是保存在单价文件里的,有可能存在共享的情况,这样的话就不能用单价文件里的项目工料机ID来匹配,要用5大项匹配
         let pgljMap = {};
         for(let pg of this.datas.gljList){
@@ -871,7 +872,7 @@ ProjectGLJ.prototype.calcEachFreightOrPrice = function (temp,type,priceMap) {//
         for(let r of temp.rations){
             sum = scMathUtil.roundForObj(sum + calcRation(r,gljMap[r.ID],pgljMap,priceMap),6);
         }
-        sum = scMathUtil.roundForObj(sum,getDecimal("glj.unitPrice"))+"";
+        sum = scMathUtil.roundForObj(sum,decimal)+"";
         if(type == "freight" && temp.unitFreight!= sum) return {ID:temp.ID,doc:{unitFreight:sum}};
         if(type == "price" && temp.supplyPrice !=sum) return {ID:temp.ID,doc:{supplyPrice:sum}};
     }
@@ -986,6 +987,8 @@ ProjectGLJ.prototype.calcMaterialRation = function(ID,type){//计算带定额的
         if(task && material){
             if(type == "freight") projectObj.project.projectGLJ.updateFreightCalc([task],material.id);
             if(type == "price") projectObj.project.projectGLJ.updatePriceCalc([task],material.id);
+        }else {
+            materialCalcObj.showDatas();
         }
     }
 };

+ 3 - 1
web/building_saas/main/js/views/material_calc_view.js

@@ -639,7 +639,8 @@ materialCalcObj = {
             return;
         }
         if(dataCode == 'coe'||dataCode == 'supplyPrice'){
-            value = value?scMathUtil.roundForObj(value,getDecimal("glj.unitPrice"))+'':'0'//4舍五入加默认为0
+            let decimal = dataCode == 'supplyPrice'?getDecimal("glj.unitPriceHasMix"):getDecimal("glj.unitPrice");
+            value = value?scMathUtil.roundForObj(value,decimal)+'':'0'//4舍五入加默认为0
         }
         if(args.row >= me.priceDatas.length){//新增
             let newData = {
@@ -941,6 +942,7 @@ $(function () {
         me.updateMaterialRationAss($(this).val(),$(this));
     });
     $('#calcCoeDiv').on('show.bs.modal', function () {
+        if(materialCalcObj.getAssistProductionLabel) $("#assistProductionLabel").text(materialCalcObj.getAssistProductionLabel);
         $("#assistProductionFeeRate").val(scMathUtil.roundForObj(projectObj.project.projectGLJ.datas.constData.assistProductionFeeRate,getDecimal("feeRate")));
     })
     $("#calcCoeConfirm").click(function () {

+ 9 - 0
web/over_write/js/zhejiang_2005.js

@@ -191,6 +191,12 @@ if(typeof gljUtil !== 'undefined'){
     gljUtil.getCodeSortMath = getCodeSortMath
 }
 
+if(typeof materialCalcObj !== 'undefined'){
+    materialCalcObj.getAssistProductionLabel = function () {
+        return "辅助生产现场经费费率(%)";
+    }
+}
+
 
 if(typeof module !== 'undefined'){
     let _= require('lodash');
@@ -206,6 +212,9 @@ if(typeof module !== 'undefined'){
                 let str = type + "";
                 return parseInt(str.substr(0,1));
             }
+        },
+        getDefalutAssistProductionFeeRate:function () {
+            return 15
         }
     };
 }