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

1.“工程量清单”项目中,造价书的“单价分析”列应默认勾选
2.人材机选择相关代码修改适应单价文件编辑器

vian 5 éve
szülő
commit
d50ed7ca12

+ 5 - 0
modules/pm/controllers/new_proj_controller.js

@@ -9,6 +9,7 @@ let async = require('async');
 const uuidV1 = require('uuid/v1');
 const mongoose = require('mongoose');
 let mainColLibModel = mongoose.model('std_main_col_lib');
+const { ValuationType } = require('../../../public/common_constants');
 
 import BillsTemplateModel from "../models/templates/bills_template_model";
 import EngineeringLibModel from "../../users/models/engineering_lib_model";
@@ -44,6 +45,10 @@ module.exports = {
                 }
                 const reg = /@\d+/;
                 billsDatas.forEach(function (template) {
+                    // 工程量清单单价分析默认勾选
+                    if (property.valuationType === ValuationType.BOQ) {
+                        template.unitPriceAnalysis = 1;
+                    }
                     template.projectID = newProjID;
                     template.ID = uuidMaping[template.ID] ? uuidMaping[template.ID] : -1;
                     template.ParentID = uuidMaping[template.ParentID] ? uuidMaping[template.ParentID] : -1;

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

@@ -32,7 +32,7 @@ import {
     bookmarkSetting
 } from './project_property_template';
 import optionSetting from '../../options/models/optionTypes';
-const { fixedFlag } = require('../../../public/common_constants');
+const { fixedFlag, ValuationType } = require('../../../public/common_constants');
 let FeeRateFiles = mongoose.model('fee_rate_file');
 let counter = require("../../../public/counter/counter.js");
 
@@ -184,7 +184,7 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                     if(data.updateData.property.featureLibID){
                         //项目类别(valuationType)、养护类别(engineering)、费用标准(feeStandard)根据新建分选的选项去赋值
                         let assign = {
-                            valuationType: data.updateData.property.valuationType === 'bill' ? '预算' : '工程量清单',
+                            valuationType: data.updateData.property.valuationType === ValuationType.BUDGET ? '预算' : '工程量清单',
                             engineering: data.updateData.property.engineeringName,
                             feeStandard: data.updateData.property.feeStandardName
                         };

+ 0 - 1
modules/ration_glj/controllers/ration_glj_controller.js

@@ -72,7 +72,6 @@ async function getGLJData(req, res) {
         }
         isInitial = JSON.parse(isInitial);
         if (!gljLibId || isInitial) { // 替换人材机的话,可能存在gljLibID,但是是初始化的操作
-            console.log(COMPILATION);
             libData = engineerID === COMPILATION 
             ? await ration_glj_facade.getLibOptionsForCompilation(req.session.sessionCompilation._id)
             : await ration_glj_facade.getLibOptions(engineerID);

+ 7 - 0
public/common_constants.js

@@ -101,9 +101,16 @@
     // 费用定额
     const COMPILATION = 'compilation';
 
+    // 项目类别,叫bill和ratoin,是建筑的计价类型为清单、定额计价,延用。
+    const ValuationType = {
+        BUDGET: 'bill',
+        BOQ: 'ration'
+    };
+
     return {
         fixedFlag,
         COMPLEMENTARY_LIB,
         COMPILATION,
+        ValuationType,
     };
 })

+ 6 - 3
web/building_saas/complementary_ration_lib/js/gljSelect.js

@@ -258,7 +258,7 @@ let gljSelOprObj = {
                     cacheSection.push(data[i]);
                 }
             }
-            sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+            //sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
             sheetsOprObj.showDataForGljSel(me.workBook.getSheet(0), me.setting, cacheSection, rationGLJOprObj.distTypeTree);
             me.workBook.getSheet(0).setRowCount(cacheSection.length);
             cacheSection = null;
@@ -332,7 +332,7 @@ $(document).ready(function () {
         const gljLibId = $(this).val();
         gljSelOprObj.initView(gljLibId, false);
     });
-    $('#gljSearchKeyword').change(function () {
+    /* $('#gljSearchKeyword').change(function () {
         gljSelOprObj.filterDatasAndShow();
     });
     $('#gljSearchKeyword').bind('keypress', function (e) {
@@ -340,7 +340,10 @@ $(document).ready(function () {
             $(this).blur();
             return false;
         }
-    });
+    }); */
+    $('#gljSearchKeyword').on('keyup', _.debounce(function () {
+        gljSelOprObj.filterDatasAndShow();  
+    }, 300));
     $('#selGlj').on('shown.bs.modal', function () {
         if (gljSelOprObj.workBook) {
             gljSelOprObj.workBook.refresh();

+ 6 - 0
web/building_saas/main/js/models/bills.js

@@ -182,6 +182,9 @@ var Bills = {
             insertData.forEach(function (data) {
                 if (data.type === idTree.updateType.new) {
                     data.data.type = billType.BILL;
+                    if (projectObj.project.property.valuationType === commonConstants.ValuationType.BOQ) {
+                        data.data.unitPriceAnalysis = 1;
+                    }
                     newData = data.data;
                 }
             });
@@ -197,6 +200,9 @@ var Bills = {
             var newData = null, that = this;
             insertData.forEach(function (data) {
                 if (data.type === idTree.updateType.new) {
+                    if (projectObj.project.property.valuationType === commonConstants.ValuationType.BOQ) {
+                        data.data.unitPriceAnalysis = 1;
+                    }
                     data.data.code = that.newFormatCode(stdBillsData.code);
                     data.data.name = stdBillsData.name;
                     data.data.unit = stdBillsData.unit;

+ 1 - 1
web/building_saas/main/js/views/glj_view_contextMenu.js

@@ -442,7 +442,7 @@ function initLibOptions(libData) {
 }
 
 function getActionUrl(actionType) {
-    const rootUrl = `/rationGlj/getGLJData/${projectObj.project.projectInfo.property.engineering_id}`
+    const rootUrl = `/rationGlj/getGLJData/${commonConstants.COMPILATION}`
     switch (actionType) {
         case 'add':
         case 'addMix':

+ 11 - 1
web/building_saas/main/js/views/importBills.js

@@ -94,7 +94,17 @@ const importBills = (function(){
             }
             //表格内的数据
             let depth = getDepth(code);
-            let data = {ID: uuid.v1(), NextSiblingID: -1, ParentID: -1, code: code, name: name, unit: unit, quantity: quantity, depth: depth};
+            let data = {
+                ID: uuid.v1(), 
+                NextSiblingID: -1, 
+                ParentID: -1, 
+                code: code, 
+                name: name, 
+                unit: unit, 
+                quantity: quantity, 
+                depth: depth,
+                unitPriceAnalysis: 1,
+            };
             let lastData = rst[rst.length - 1];
             //获取data的父节点链,成为兄弟节点,只能在父链里找前兄弟(不能跨父链)
             let parents = getParents(lastData);

+ 1 - 1
web/building_saas/main/js/views/project_view.js

@@ -1168,7 +1168,7 @@ var projectObj = {
 
     loadMainSpreadContextMenu: function () {
         var project = this.project, spread = this.mainSpread, controller = this.mainController;
-        let insertBillsName = project.projectInfo.property && project.projectInfo.property.valuationType == "bill"?"插入项目节":"插入清单";//右键“插入清单”改文字为“插入项目节”,工程量清单中保持不变。
+        let insertBillsName = project.projectInfo.property && project.projectInfo.property.valuationType == commonConstants.ValuationType.BUDGET?"插入项目节":"插入清单";//右键“插入清单”改文字为“插入项目节”,工程量清单中保持不变。
             $.contextMenu({
             selector: '#billsSpread',
             selectableSubMenu: true,

+ 3 - 0
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -367,6 +367,9 @@ const billsGuidance = (function () {
                 stdData.flags = [{flag : stdNode.data.fixedFlag, fieldName : 'fixed'}];
                 stdData.flagsIndex = {fixed: {fieldName: 'fixed', flag: stdNode.data.fixedFlag}};   //前端用
             }
+            if (projectObj.project.property.valuationType === commonConstants.ValuationType.BOQ) {
+                stdData.unitPriceAnalysis = 1;
+            }
             return stdData;
         }
         //从同层节点中获取更新数据

+ 2 - 2
web/over_write/js/nongcun_2020.js

@@ -7,7 +7,7 @@
          * 获取操作<<农村公路养护预算费用库>>时的节点片段
          * 片段为主树根节点(与其他费用定额的添加逻辑一致)
          */
-        budeget() {
+        budget() {
             return { parent: null, mainTreeFragment: projectObj.project.Bills.tree.roots };
         },
         /**
@@ -67,7 +67,7 @@
     function getFragmentFunction() {
         const selLibText = $('#stdBillsGuidanceLibSelect').text();
         if (/农村公路养护预算费用/.test(selLibText)) {
-            return functionMap.budeget;
+            return functionMap.budget;
         } else if (/农村公路小修工程量清单/.test(selLibText)) {
             return functionMap.minorRepair;
         } else if (/农村公路养护工程工程量清单/.test(selLibText)) {