浏览代码

项目属性、定额计算程序等处的人工系数从项目人工系数文件读取。

Chenshilong 7 年之前
父节点
当前提交
c85f9a5c26

+ 1 - 1
web/building_saas/main/html/main.html

@@ -478,7 +478,7 @@
                                 <!--人工单价调整-->
                                 <div class="tab-pane fade" id="poj-settings-6" role="tabpanel">
                                     <div class="row px-3">
-                                        <select class="col-4 form-control form-control-sm"><option>渝建[2016]71号</option><option>渝建[2017]78号</option></select>
+                                        <select class="col-4 form-control form-control-sm" id="std_labour_coe_files"><option>渝建[2016]71号</option><option>渝建[2017]78号</option></select>
                                     </div>
                                     <div style="height:8px;"></div>
                                     <div class="modal-auto-height" id="labourCoeSpread"></div>

+ 3 - 2
web/building_saas/main/js/models/calc_program.js

@@ -3463,7 +3463,7 @@ let calcTemplates = [
     }
 ];*/
 
-let calcLabourCoes = [
+/*let calcLabourCoes = [
     {
         "ID" : 1,
         "ParentID" : null,
@@ -3590,7 +3590,7 @@ let calcLabourCoes = [
         "name" : "盾构用工",
         "coe" :1.49
     }
-];
+];*/
 
 class CalcProgram {
     constructor(project){
@@ -3600,6 +3600,7 @@ class CalcProgram {
 
     compileAllTemps(){
         let calcFeeRates = this.project.FeeRate.datas.rates;
+        let calcLabourCoes = this.project.LabourCoe.datas.coes;
         this.calc.compilePublics(calcFeeRates, calcLabourCoes, feeType, rationCalcBase);
         for (let calcTemplate of calcTemplates){
             this.calc.compileTemplate(calcTemplate);

+ 23 - 1
web/building_saas/main/js/views/project_property_labour_coe_view.js

@@ -9,7 +9,8 @@ let labourCoeView = {
 
     buildSheet: function (){
         let me = this;
-        me.datas = calcLabourCoes;
+
+        me.datas = projectObj.project.LabourCoe.datas !== null ? projectObj.project.LabourCoe.datas.coes : [];
 
         if (me.spread) {
             me.spread.destroy();
@@ -73,8 +74,29 @@ let labourCoeView = {
         };
     },
 
+    init(){
+        let me = this;
+
+        function getStdLabourCoeFilesHtml(stdLabourCoeLibs) {
+            let result = '<option value="">请选择人工系数标准库</option>';
+            if (stdLabourCoeLibs.length <= 0) {
+                return result;
+            };
+
+            for (let lib of stdLabourCoeLibs){
+                result += '<option value="'+ lib.id +'">'+ lib.name +'</option>';
+            };
+
+            return result;
+        };
+
+        let stdLCHtml = getStdLabourCoeFilesHtml(projectInfoObj.projectInfo.engineeringInfo.artificial_lib);
+        $("#std_labour_coe_files").html(stdLCHtml);
+    },
+
     showData(){
         let me = this;
+        me.init();
         me.buildSheet();
         me.loadData();
     }