Forráskód Böngészése

Merge branch 'budget' of http://192.168.1.41:3000/SmartCost/ConstructionCost into budget

vian 4 éve
szülő
commit
6bf89643fc

+ 1 - 1
modules/equipment_purchase/facade/equipment_purchase_facade.js

@@ -72,7 +72,7 @@ async function getEquipmentSummary(projectIDs) {
             /*/
             // 以下是根据实际来调整
             if(map[projectID]) {
-                for (let item of map[e.projectID].equipments) {
+                for (let item of map[projectID].equipments) {
                     let dtlData = {projectID: -1, total: 0, equipSummaryType: 'budget_equipment'};
                     // 属性summaryType是作为一个判断依据给后来代码用
                     dtlData.projectID = projectID;

+ 4 - 4
modules/main/facade/info_price_facade.js

@@ -34,7 +34,7 @@ let nameWeightMap ={
 
 
 async function getOptions(data,compilation){//data 是预留对象,暂时不用
-  let compilationID = compilation._id;
+  let compilationID = '5b52b027fd3bb0000b257cf8';
   let areaMap={};
   let periodMap={};
   let areas =await infoAreasModel.find({"compilationID":compilationID}).lean();
@@ -59,7 +59,7 @@ async function getOptions(data,compilation){//data 是预留对象,暂时不
 async function getClassByAreaID(data,compilation){
   //要先知道根据期数和编办查找库ID
   let newList = [];
-  let lib = await infoLibModel.findOne({compilationID:compilation._id,period:data.period})
+  let lib = await infoLibModel.findOne({compilationID:'5b52b027fd3bb0000b257cf8',period:data.period})
   if(lib){
     let tList =await getClassList(data.areaID,lib.ID);
     newList.push(...tList);
@@ -99,7 +99,7 @@ async function getClassByAreaID(data,compilation){
 
 async function getDataByCondition(data,compilation){
   let result = {};
-  data.condition["compilationID"] = compilation._id;
+  data.condition["compilationID"] = '5b52b027fd3bb0000b257cf8';
   //特殊处理重庆的,地区选择非“通用”时,搜索范围应是当前选择的地区,加上“通用”中的信息价。
   if (data.condition.commonInfoPriceID) { 
     let idArray = [data.condition.areaID,data.condition.commonInfoPriceID];
@@ -327,7 +327,7 @@ async function getDataByFuzzyMatch(keyword, data){
 
 
 async function mutiApplyInfoPrice(data,compilation){
-  data.condition["compilationID"] = compilation._id;
+  data.condition["compilationID"] = '5b52b027fd3bb0000b257cf8';
   let infoPrices = await infoItemsModel.find(data.condition).lean();
   let tasks = [];
   let projectGLJMap = {};

+ 2 - 1
modules/main/models/project_consts.js

@@ -57,7 +57,8 @@ let summaryConstList = [
     'Budget',
     'BudgetDetail',
     'BudgetCalcType',
-    'BudgetCalcTypeDetail'
+    'BudgetCalcTypeDetail',
+    'BudgetEquipmentDetail'
 ];
 
 let projectFieldConstList = [

+ 2 - 0
web/building_saas/main/html/equipment_purchase.html

@@ -2,6 +2,8 @@
 <div class="container-fluid">
     <div class="row">
         <div class="toolsbar px-1 d-flex " style="width: 100%;height: 30px;">
+          <a href="javascript:void(0)" class="btn btn-light btn-sm" id="equipment_insert" data-toggle="tooltip"
+          data-placement="bottom" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
           <a href="javascript:void(0)" class="btn btn-light btn-sm" id="equipment_upLevel" data-toggle="tooltip"
             data-placement="bottom" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
           <a href="javascript:void(0)" class="btn btn-light btn-sm" id="equipment_downLevel" data-toggle="tooltip"

+ 10 - 6
web/building_saas/main/html/main.html

@@ -128,11 +128,11 @@
                 data-placement="bottom" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
              <!--  <a id="switchTznr" href="javascript:void(0);" class="btn btn-light btn-sm"><i class="fa fa-eye"
                 aria-hidden="true"></i> 显示特征</a>  -->
-             <!--  <div class="btn-group ">
+               <div class="btn-group ">
                 <a class="dropdown-toggle btn btn-light btn-sm" data-toggle="dropdown" href="#" id="moreMenuA" role="button"
                   aria-haspopup="true" aria-expanded="false">更多</a>
                 <div class="dropdown-menu dropright" id="moreMenu">
-                  <a id="displayA" href="javascript:void(0);" data-toggle="dropdown"
+                  <!-- <a id="displayA" href="javascript:void(0);" data-toggle="dropdown"
                     class="dropdown-item dropdown-toggle"><i class="fa fa-list-ol"></i> 显示至...</a>
                   <div id="subDisplay" class="dropdown-menu dropdown-menu-left"
                     style="min-width: 6.5rem; position: absolute; transform: translate3d(158px, 3px, 0px); top: 0px; left: 0px; will-change: transform;"
@@ -168,13 +168,13 @@
                   <% } else { %>
                   <a href="javascript:void(0)" class="dropdown-item" name="lockBills"> <i class="fa fa-lock"
                       aria-hidden="true"></i> 锁定清单</a>
-                  <% } %>
+                  <% } %> -->
                   <a id="menu_calc_program_manage" href="javascript:void(0);" class="dropdown-item"><i
                       class="fa fa-calculator" aria-hidden="true"></i> 总计算程序</a>
-                  <a id="menu_index_info" href="javascript:void(0);" style="display: none" class="dropdown-item"><i
-                      class="fa fa-database" aria-hidden="true"></i> 指标信息</a>
+                 <!--  <a id="menu_index_info" href="javascript:void(0);" style="display: none" class="dropdown-item"><i
+                      class="fa fa-database" aria-hidden="true"></i> 指标信息</a> -->
                 </div>
-              </div> -->
+              </div> 
              <!--  <a href="javascript:void(0)" class="btn btn-light btn-sm" id="locate-sub">分项</a>
               <a href="javascript:void(0)" class="btn btn-light btn-sm" id="locate-measure">措施</a>
               <a href="javascript:void(0)" class="btn btn-light btn-sm" id="locate-other">其他</a> -->
@@ -211,6 +211,10 @@
                 <!-- <li class="nav-item">
                               <a class="nav-link px-3" href="javascript:void(0)" id = 'stdBillsTab' relaPanel="#qd">清单规则</a>
                           </li>-->
+                <li class="nav-item">
+                  <a class="nav-link px-1 right-nav-link" href="javascript:void(0)" id='stdBillsGuidanceTab'
+                    relaPanel="#zy">章节表</a>
+                </li>
                 <li class="nav-item" id="li_stdRationTab">
                   <a class="nav-link px-1 right-nav-link" href="javascript:void(0)" id="stdRationTab"
                     relaPanel="#de">定额库</a>

+ 5 - 6
web/building_saas/main/js/controllers/project_controller.js

@@ -154,9 +154,9 @@ ProjectController = {
 
             if (std) {
                 let fixedNode = getRootFixedNode(target);
-                if(!isFlag(fixedNode.data) || (fixedNode.data.flagsIndex.fixed.flag !== fixedFlag.SUB_ENGINERRING && fixedNode.data.flagsIndex.fixed.flag !== fixedFlag.MEASURE)){
+                /* if(!isFlag(fixedNode.data) || (fixedNode.data.flagsIndex.fixed.flag !== fixedFlag.SUB_ENGINERRING && fixedNode.data.flagsIndex.fixed.flag !== fixedFlag.MEASURE)){
                     return false;
-                }
+                } */
                 //焦点行属于分部分项
                 if(fixedNode.data.flagsIndex.fixed.flag === fixedFlag.SUB_ENGINERRING){
                     std.type = billType.FX;
@@ -177,12 +177,11 @@ ProjectController = {
                             return false;
                         }
                     }
-                }
-                else {
+                }else {
                     std.type = billType.BILL;
                 }
-
-                let newCode = project.Bills.newFormatCode(std.code);
+                std.type = billType.FB;
+                let newCode =std.code; // project.Bills.newFormatCode(std.code);
                 newSource = project.Bills.insertStdBills(parentID, nextSiblingID, std, newCode);
             } else {
                 newSource = project.Bills.insertBills(parentID, nextSiblingID);

+ 1 - 1
web/building_saas/main/js/models/bills.js

@@ -198,7 +198,7 @@ var Bills = {
             var newData = null, that = this;
             insertData.forEach(function (data) {
                 if (data.type === idTree.updateType.new) {
-                    data.data.code = that.newFormatCode(stdBillsData.code);
+                    data.data.code = stdBillsData.code;//that.newFormatCode(stdBillsData.code);
                     data.data.name = stdBillsData.name;
                     data.data.unit = stdBillsData.unit;
                     // 工程量计算规则

+ 35 - 24
web/building_saas/main/js/views/equipment_purchase_view.js

@@ -344,6 +344,33 @@ let equipmentPurchaseObj  = {
     newEquipment:function(ParentID='-1',seq=0){
         return {ID:uuid.v1(),ParentID,seq}
     },
+
+    insertEquipment:async function(number){
+        let me = this;
+        const newData = [];
+        let seq = 0;
+        let ParentID = '-1';
+        let brotherNodes = [];
+        let selected = me.getSelected();
+        if(!selected){//没有选中节点的情况,添加到最后
+            brotherNodes = me.parentMap['-1'];
+            if(brotherNodes && brotherNodes.length > 0){
+                seq = brotherNodes[brotherNodes.length -1].seq;   
+            } 
+        }else{
+            let node = selected;//选中节点时插入为选中的下一行
+            seq = node.seq;
+            ParentID = node.ParentID;
+        }
+        for (let i = 0; i < number; i++) {
+            seq+=1;
+            newData.push(me.newEquipment(ParentID,seq));
+        }
+        let updateData = me.calcSeq(ParentID,seq);
+        updateData.push({documents:newData,type:'insert'});
+        me.updateEquipments(updateData)   
+    },
+
     sumTotal: function(updateData){
         let dataMap = {};
         let temParentMap = {};
@@ -424,7 +451,7 @@ let equipmentPurchaseObj  = {
         this.showData();
         $.bootstrapLoading.end();
     },
-    insertEquipments:async function(equipments){
+  /*   insertEquipments:async function(equipments){
         try {
             $.bootstrapLoading.start();
             let projectID = projectObj.project.ID();
@@ -435,7 +462,7 @@ let equipmentPurchaseObj  = {
             alert('插入失败,请重试');
         }
         $.bootstrapLoading.end();
-    },
+    }, */
     deleteEquipment:async function(ID){
         try {
             let projectID = projectObj.project.ID();
@@ -454,28 +481,7 @@ let equipmentPurchaseObj  = {
             if (!number) {
                 return;
             }  
-            const newData = [];
-            let row = me.rightClickTarget.row;
-            let seq = 0;
-            let ParentID = '-1';
-            let brotherNodes = [];
-            if(row == undefined){//没有选中节点的情况,添加到最后
-                brotherNodes = me.parentMap['-1'];
-                if(brotherNodes && brotherNodes.length > 0){
-                    seq = brotherNodes[brotherNodes.length -1].seq;   
-                } 
-            }else{
-                let node = me.data[row];//选中节点时插入为选中的下一行
-                seq = node.seq;
-                ParentID = node.ParentID;
-            }
-            for (let i = 0; i < number; i++) {
-                seq+=1;
-                newData.push(me.newEquipment(ParentID,seq));
-            }
-            let updateData = me.calcSeq(ParentID,seq);
-            updateData.push({documents:newData,type:'insert'});
-            me.updateEquipments(updateData)   
+            me.insertEquipment(number);
         });
     },
 
@@ -523,6 +529,11 @@ $(function () {
         equipmentPurchaseObj.initSpread();
         equipmentPurchaseObj.showData();
     })
+    //插入
+    $('#equipment_insert').click(function(){
+        let me = equipmentPurchaseObj;
+        me.insertEquipment(1);
+    })
 
     //降级
     $('#equipment_downLevel').click(function(){

+ 7 - 7
web/building_saas/main/js/views/glj_col.js

@@ -17,7 +17,7 @@ let gljCol = {
             {headerName: "定额价", headerWidth: 65, dataCode: "basePrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "定额消耗", headerWidth: 65, dataCode: "rationItemQuantity", dataType: "Number", hAlign: "right"},   // dataType: "Number", formatter: "0.00"
             {headerName: "总消耗量", headerWidth: 80, dataCode: "totalQuantity", dataType: "Number", hAlign: "right"},
-            {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"},
+            {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox", visible: false},
             {headerName: "调后市场价", headerWidth: 80, dataCode: "tenderPrice", dataType: "Number", hAlign: "right", visible: false},
             {headerName: "调后消耗量", headerWidth: 80, dataCode: "tenderQuantity", dataType: "Number", hAlign: "right", visible: false}
         ],
@@ -49,12 +49,12 @@ let gljCol = {
             {headerName: "调整价", headerWidth: 70, dataCode: "adjustPrice", hAlign: "right", dataType: "Number",spanRows: [2]},//,decimalField:"glj.unitPrice"
             {headerName: "定额价", headerWidth: 70, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number",spanRows: [2]},//decimalField:'glj.unitPrice',
             {headerName: "总消耗量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity',spanRows: [2]},
-            {headerName: "暂估", headerWidth: 45, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox',spanRows: [2]},
+            {headerName: "暂估", headerWidth: 45, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox',spanRows: [2], visible: false},
             {headerName: "主要\n材料", headerWidth: 45, dataCode: "is_main_material", hAlign: "center", dataType: "String",cellType:'checkBox',spanRows: [2]},
-            {headerName: "不计税设备", headerWidth: 55, dataCode: "no_tax_eqp", dataType: "String",cellType: "checkBox",spanRows: [2]},
-            {headerName: "评标材料", headerWidth: 35, dataCode: "is_eval_material", dataType: "String",cellType: "checkBox",spanRows: [2]},
-            {headerName: "供货方式", headerWidth: 70, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap,spanRows: [2]},
-            {headerName: "甲供数量", headerWidth: 90, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity',spanRows: [2]},
+            {headerName: "不计税设备", headerWidth: 55, dataCode: "no_tax_eqp", dataType: "String",cellType: "checkBox",spanRows: [2], visible: false},
+            {headerName: "评标材料", headerWidth: 35, dataCode: "is_eval_material", dataType: "String",cellType: "checkBox",spanRows: [2], visible: false},
+            {headerName: "供货方式", headerWidth: 70, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap,spanRows: [2], visible: false},
+            {headerName: "甲供数量", headerWidth: 90, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity',spanRows: [2], visible: false},
             {headerName: "三材类别", headerWidth: 70, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap,spanRows: [2]},
             {headerName: "三材系数", headerWidth: 70, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number",spanRows: [2]},//,decimalField:'material'
             {headerName: "交货方式", headerWidth: 70, dataCode: "delivery", hAlign: "left", dataType: "String",spanRows: [2]},
@@ -64,7 +64,7 @@ let gljCol = {
             {headerName: "质量等级", headerWidth: 80, dataCode: "qualityGrace", hAlign: "left", dataType: "String",spanRows: [2]},
             {headerName: "品牌", headerWidth: 80, dataCode: "brand", hAlign: "left", dataType: "String",spanRows: [2]},
             {headerName: "备注", headerWidth: 100, dataCode: "remark", hAlign: "left", dataType: "String",spanRows: [2]},
-            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox",spanRows: [2], visible: true},
+            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox",spanRows: [2], visible: false},
             {headerName: ["调价后","市场价"], headerWidth: 75, dataCode: "tenderPrice", hAlign: "right", dataType: "Number",validator:"number",spanCols: [2,1], visible: false},
             {headerName: ["","总消耗量"], headerWidth: 90, dataCode: "tenderQuantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity',spanCols: [0,1], visible: false}
         ],

+ 10 - 4
web/building_saas/main/js/views/project_view.js

@@ -928,6 +928,8 @@ var projectObj = {
             if(colSettingObj.getVisible('itemCharacterText')){
                 switchTznrHtml(false);
             }
+            let budgetType = projectObj.project.property.budgetType||commonConstants.BudgetType.BUILDING
+            if(budgetType === commonConstants.BudgetType.BUILDING) $("#stdBillsGuidanceTab").hide();//建筑项目不显示章节表
             if (!err) {
                 that.project.projectGLJ.calcQuantity(true);//计算分部分项和技术措施项目消耗量;
                 let quantityTime = +new Date();
@@ -2985,10 +2987,14 @@ function testShow() {
 $('#delete_row').on('show.bs.modal', function (e) {//这里用show,在shown之前调用,页面不会出现按钮闪现的情况
     var controller = projectObj.mainController, project = projectObj.project;
     var selected = controller.tree.selected, parent = selected.parent;
-    var showinfo = "<label>确认要删除当前选中行吗?</label>";
+    var showinfo = "<label>是否删除其下的子项?</label><br><label>【是】则删除分部行及其下的所有子项,</label><br><label>【取消】则取消删除</label>";
     var showN = false;
-    var cancelText = "否";
-    if(selected.sourceType == project.Bills.getSourceType()&&selected.data.type==billType.FB&&selected.children.length>0){//选中的是分部,并且有子项
+    var cancelText = "取消";
+    if(isSingleSelect()&&mbzm_obj.hasReferenceRation(selected)){//“有模板关联的定额”右键点击删除,弹窗提示“删除主子目时将删除对应的关联子目,是否继续?  是 否” (只有单选中一条定额并且是有模板关联的定额)
+        showinfo = "<label>删除主子目时将删除对应的关联子目,是否继续?</label>";
+        cancelText = "否"
+    }
+  /*   if(selected.sourceType == project.Bills.getSourceType()&&selected.data.type==billType.FB&&selected.children.length>0){//选中的是分部,并且有子项
         if(isSingleSelect()||selectionChecking()){
             showinfo = "<label>是否删除其下的子项?</label><br><label>【是】则删除分部行及其下的所有子项,</label><br><label>【否】则仅删除当前分部行,子项保留,</label><br><label>【取消】则取消删除</label>";
             showN = true;
@@ -2996,7 +3002,7 @@ $('#delete_row').on('show.bs.modal', function (e) {//这里用show,在shown之
         }
     }else if(isSingleSelect()&&mbzm_obj.hasReferenceRation(selected)){//“有模板关联的定额”右键点击删除,弹窗提示“删除主子目时将删除对应的关联子目,是否继续?  是 否” (只有单选中一条定额并且是有模板关联的定额)
         showinfo = "<label>删除主子目时将删除对应的关联子目,是否继续?</label>";
-    }
+    } */
     $('#delete_showinfo').html(showinfo);
     showN==true? $('#deleteN').show():$('#deleteN').hide();
     $('#deleteCancel').text(cancelText);

+ 4 - 3
web/building_saas/main/js/views/select_FB_view.js

@@ -48,11 +48,12 @@ let selectFBObject = {
 
     showData:function(){
         let budgetType = projectObj.project.property.budgetType||commonConstants.BudgetType.BUILDING;
-        if(budgetType===commonConstants.BudgetType.BUILDING){//建筑安装工程显示清单树 显示定额章节树
+        this.showRationTree();
+       /*  if(budgetType===commonConstants.BudgetType.BUILDING){//建筑安装工程显示清单树 显示定额章节树
             this.showRationTree();
         }else{//城市轨道交通工程 显示分部
             this.showBillTree();
-        }
+        } */
     },
     showRationTree:async function(){
         let rationLibID = rationLibObj.getDefaultStdRationLibID();
@@ -125,7 +126,7 @@ let selectFBObject = {
             name:nodeData.name,
             unit:nodeData.unit
         }
-        if(nodeData.name  && budgetType === commonConstants.BudgetType.BUILDING){
+        if(nodeData.name ){
             let index = nodeData.name.indexOf(' ');
             if(index !== -1){
                 d.code = nodeData.name.substring(0,index);

+ 6 - 4
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -90,7 +90,7 @@ const billsGuidance = (function () {
         headers: [
             {name: '项目编码', dataCode: 'code', width: 140, vAlign: 'center', hAlign: 'left', formatter: '@'},
             {name: '项目名称', dataCode: 'name', width: 190, vAlign: 'center', hAlign: 'left', formatter: '@'},
-            {name: '单位', dataCode: 'unit', width: 45, vAlign: 'center', hAlign: 'center', formatter: '@'},
+            {name: '单位', dataCode: 'unit', width: 60, vAlign: 'center', hAlign: 'center', formatter: '@'},
         ],
         rowHeaderWidth:1,
         events: {
@@ -102,7 +102,10 @@ const billsGuidance = (function () {
                 if(!node){
                     return;
                 }
-                if(node.children.length > 0){
+                if(!projectReadOnly) {
+                    billsLibObj.insertBills(stdBillsJobData, stdBillsFeatureData, node);
+                }
+             /*    if(node.children.length > 0){
                     node.setExpanded(!node.expanded);
                     //设置展开收起状态
                     sessionStorage.setItem('stdBillsGuidanceExpState', bills.tree.getExpState(bills.tree.items));
@@ -117,7 +120,7 @@ const billsGuidance = (function () {
                     args.sheet.repaint();
                 } else if(!projectReadOnly) {
                     billsLibObj.insertBills(stdBillsJobData, stdBillsFeatureData, node);
-                }
+                } */
             }
         }
     };
@@ -431,7 +434,6 @@ const billsGuidance = (function () {
         }
         let modules = [bills];
         initWorkBooks(modules);
-
     }
     //展开至搜索出来点的节点
     //@param {Array}nodes @return {void}