Parcourir la source

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

Chenshilong il y a 7 ans
Parent
commit
96b591339b
39 fichiers modifiés avec 377 ajouts et 472 suppressions
  1. 2 2
      logs/log4js.json
  2. 91 0
      modules/common/std/std_glj_lib_glj_list_model.js
  3. 0 51
      modules/common/std/std_ration_lib_glj_list_model.js
  4. 22 17
      modules/glj/controllers/glj_controller.js
  5. 19 38
      modules/glj/models/glj_list_model.js
  6. 1 1
      modules/glj/routes/glj_router.js
  7. 13 11
      modules/ration_glj/facade/glj_calculate_facade.js
  8. 3 3
      modules/reports/controllers/rpt_cfg_controller.js
  9. 18 20
      modules/reports/controllers/rpt_controller.js
  10. 11 9
      modules/reports/controllers/rpt_tpl_controller.js
  11. 2 3
      modules/reports/facade/rpt_template_facade.js
  12. 1 1
      modules/reports/facade/rpt_tpl_data_demo_facade.js
  13. 1 1
      modules/reports/facade/rpt_tpl_data_facade.js
  14. 1 1
      modules/reports/models/rpt_cfg.js
  15. 1 1
      modules/reports/models/rpt_mapping_field.js
  16. 1 1
      modules/reports/models/rpt_template.js
  17. 1 1
      modules/reports/models/rpt_tpl_data.js
  18. 1 1
      modules/reports/models/rpt_tpl_data_demo.js
  19. 1 1
      modules/reports/models/tpl_tree_node.js
  20. 3 3
      modules/reports/routes/report_router.js
  21. 4 4
      modules/reports/routes/rpt_tpl_router.js
  22. 0 4
      modules/users/models/schema/compilation.js
  23. 9 0
      public/web/tree_sheet/tree_sheet_helper.js
  24. 9 0
      test/logs/testlog.js
  25. 1 1
      web/building_saas/fee_rates/fee_rate.html
  26. 55 0
      web/building_saas/glj/html/glj_index.html
  27. 0 0
      web/building_saas/glj/js/common_spread.js
  28. 0 0
      web/building_saas/glj/js/composition.js
  29. 1 1
      web/glj/js/composition_spread.js
  30. 77 14
      web/glj/js/project_glj.js
  31. 5 4
      web/glj/js/project_glj_spread.js
  32. 0 0
      web/building_saas/glj/js/socket.io.slim.js
  33. 0 0
      web/building_saas/glj/js/socket.js
  34. 2 70
      web/building_saas/main/html/main.html
  35. 20 1
      web/building_saas/main/js/views/std_bills_lib.js
  36. 1 1
      web/building_saas/pm/js/pm_main.js
  37. 0 14
      web/glj/html/footer.html
  38. 0 102
      web/glj/html/glj_index.html
  39. 0 90
      web/glj/html/header.html

+ 2 - 2
logs/log4js.json

@@ -16,7 +16,7 @@
     "default": { "appenders": ["console"], "level": "debug"},
     "logInfo":{ "appenders": ["logInfo","console"], "level": "debug"},
     "logDebug":{ "appenders": ["logDebug","console"], "level": "debug"},
-    "logWarn":{ "appenders": ["logWarn"], "level": "debug"},
-    "logErr":{ "appenders": ["logErr"], "level": "debug"}
+    "logWarn":{ "appenders": ["logWarn","console"], "level": "debug"},
+    "logErr":{ "appenders": ["logErr","console"], "level": "debug"}
   }
 }

+ 91 - 0
modules/common/std/std_glj_lib_glj_list_model.js

@@ -0,0 +1,91 @@
+/**
+ * 工料机总库相关业务逻辑
+ *
+ * @author CaiAoLin
+ * @date 2017/7/11
+ * @version
+ */
+import BaseModel from "../base/base_model";
+import STDRationLibGLJListSchemas from "./schemas/std_ration_lib_glj_list";
+
+class STDGLJLibGLJListModel extends BaseModel {
+
+    /**
+     * 构造函数
+     *
+     * @return {void}
+     */
+    constructor() {
+        let parent = super();
+        parent.model = STDRationLibGLJListSchemas;
+        parent.init();
+    }
+
+    /**
+     * 根据id获取数据
+     *
+     * @param {Number|Array} id
+     * @return {Promise}
+     */
+    async getDataById(id) {
+        let result = null;
+        try {
+            if (!id instanceof Array) {
+                id = parseInt(id);
+                if (isNaN(id)) {
+                    throw 'id有误';
+                }
+            }
+            let condition = {ID: {"$in": id}};
+            result = await this.findDataByCondition(condition, null, false);
+        } catch (error) {
+            console.log(error);
+            result = null;
+        }
+
+        return result;
+    }
+
+    /**
+     * 获取对应组成物数据
+     *
+     * @param {String} code
+     * @return {Promise}
+     */
+    async getComponent(code) {
+        let result = [];
+        let libGljData = await this.findDataByCondition({code: code});
+        if (libGljData === null || libGljData.component.length <= 0) {
+            return result;
+        }
+
+        let componentIdList = [];
+        let componentConsume = {};
+        // 整理数据
+        for (let component of libGljData.component) {
+            componentIdList.push(component.ID);
+            componentConsume[component.ID] = component.consumeAmt;
+        }
+
+        let condition = {ID: {$in: componentIdList}};
+        let componentGljData = await this.findDataByCondition(condition, null, false);
+
+        if (componentGljData === null) {
+            return result;
+        }
+
+        let componentData = [];
+        componentGljData = JSON.stringify(componentGljData);
+        componentGljData = JSON.parse(componentGljData);
+        for(let gljData of componentGljData) {
+            gljData.connectCode = code;
+            gljData.consumption = componentConsume[gljData.ID];
+            componentData.push(gljData);
+        }
+
+        return componentData;
+    }
+
+}
+
+export default STDGLJLibGLJListModel;

+ 0 - 51
modules/common/std/std_ration_lib_glj_list_model.js

@@ -1,51 +0,0 @@
-/**
- * 工料机总库相关业务逻辑
- *
- * @author CaiAoLin
- * @date 2017/7/11
- * @version
- */
-import BaseModel from "../base/base_model";
-import STDRationLibGLJListSchemas from "./schemas/std_ration_lib_glj_list";
-
-class STDRationLibGLJListModel extends BaseModel {
-
-    /**
-     * 构造函数
-     *
-     * @return {void}
-     */
-    constructor() {
-        let parent = super();
-        parent.model = STDRationLibGLJListSchemas;
-        parent.init();
-    }
-
-    /**
-     * 根据id获取数据
-     *
-     * @param {Number|Array} id
-     * @return {Promise}
-     */
-    async getDataById(id) {
-        let result = null;
-        try {
-            if (!id instanceof Array) {
-                id = parseInt(id);
-                if (isNaN(id)) {
-                    throw 'id有误';
-                }
-            }
-            let condition = {ID: {"$in": id}};
-            result = await this.findDataByCondition(condition, null, false);
-        } catch (error) {
-            console.log(error);
-            result = null;
-        }
-
-        return result;
-    }
-
-}
-
-export default STDRationLibGLJListModel;

+ 22 - 17
modules/glj/controllers/glj_controller.js

@@ -25,16 +25,21 @@ class GLJController extends BaseController {
     }
 
     /**
-     * 工料机汇总页
+     * 获取工料机相关数据
      *
      * @param {object} request
      * @param {object} response
      * @return {void}
      */
-    async index(request, response) {
+    async getGljList(request, response) {
         // 标段id
-        let projectId = request.query.project;
+        let projectId = request.body.project_id;
         projectId = parseInt(projectId);
+        let responseData = {
+            err: 0,
+            msg: '',
+            data: {}
+        };
         try {
             if (isNaN(projectId) || projectId <= 0) {
                 throw '标段id有误';
@@ -53,21 +58,21 @@ class GLJController extends BaseController {
             let gljListModel = new GLJListModel();
             let [gljList, mixRatioConnectData] = await gljListModel.getListByProjectId(projectId, unitPriceFileId);
 
-            let renderData = {
-                gljList: JSON.stringify(gljList),
-                mixRatioConnectData: JSON.stringify(mixRatioConnectData),
+            responseData.data.gljList = gljList;
+            responseData.data.mixRatioConnectData = mixRatioConnectData;
+            responseData.data.constData = {
                 materialIdList: gljListModel.materialIdList,
                 ownCompositionTypes: gljListModel.ownCompositionTypes,
                 hostname: request.hostname,
                 roomId: unitPriceFileId,
                 GLJTypeConst: JSON.stringify(GLJTypeConst),
-                userID: request.session.sessionUser.ssoId,
             };
-            response.render('glj/html/glj_index', renderData);
         } catch (error) {
-            response.status(404).send('404 Error');
+            responseData.err = 1;
+            responseData.msg = error;
         }
 
+        response.json(responseData);
     }
 
     /**
@@ -241,15 +246,15 @@ class GLJController extends BaseController {
     async test(request, response) {
         // 从定额库获取的数据
         let data = {
-            glj_id: 803,
+            glj_id: 17,
             project_id: 1,
-            code: '85011701',
-            name: '电动夯实机 夯能20~62N·m',
-            specs: '夯能20~62N·m',
-            unit: '台班',
-            type: GLJTypeConst.GENERAL_MACHINE,
-            base_price: 120.45,
-            market_price: 120.45
+            code: '00010201',
+            name: '土石方综合工日',
+            specs: '',
+            unit: '工日',
+            type: GLJTypeConst.LABOUR,
+            base_price: 50,
+            market_price: 50
         };
         try {
             let gljListModel = new GLJListModel();

+ 19 - 38
modules/glj/models/glj_list_model.js

@@ -13,7 +13,7 @@ import STDMixRatioModel from "../../common/std/std_mix_ratio_model";
 import UnitPriceFileModel from "./unit_price_file_model";
 import GLJTypeConst from "../../common/const/glj_type_const";
 import RationGLJFacade from "../../ration_glj/facade/ration_glj_facade";
-import STDRationLibGLJListModel from "../../common/std/std_ration_lib_glj_list_model";
+import STDGLJLibGLJListModel from "../../common/std/std_glj_lib_glj_list_model";
 import STDGLJType from "../../../public/cache/std_glj_type_util";
 import MixRatioModel from "./mix_ratio_model";
 
@@ -410,18 +410,18 @@ class GLJListModel extends BaseModel {
      */
     async compositionInit(code, projectId, unitPriceFileId) {
         // 查找对应组成物的项目工料机数据
-        let [projectGljList, compositionList] = await this.getCompositionGLJList(code, projectId, 'name');
+        let [projectGljList, compositionGljList] = await this.getCompositionGLJList(code, projectId, 'name');
 
         // 整理配合比待插入数据
         let mixRatioInsertData = [];
-        for (let tmp of compositionList) {
+        for (let tmp of compositionGljList) {
             // 配合比数据插入
             let mixRatioData = {
                 consumption: tmp.consumption,
-                glj_id: tmp.glj_id,
+                glj_id: tmp.ID,
                 unit_price_file_id: unitPriceFileId,
-                connect_code: tmp.connect_code,
-                glj_type: tmp.glj_type
+                connect_code: tmp.connectCode,
+                glj_type: tmp.gljType
             };
             mixRatioInsertData.push(mixRatioData);
         }
@@ -434,32 +434,9 @@ class GLJListModel extends BaseModel {
             throw '组成物插入单价数据失败!';
         }
         // 如果已经存在则后续操作停止
-        if(projectGljList.length === compositionList.length) {
-            return;
-        }
-
-        // 插入不存在的项目工料机数据
-        let notInGLJId = [];
-        let compositionData = {};
-        for(let tmp of compositionList) {
-            compositionData[tmp.glj_id] = tmp;
-            if (projectGljList[tmp.name] !== undefined) {
-                continue;
-            }
-            // 把不存在的工料机总库id加入数组
-            notInGLJId.push(tmp.glj_id);
-        }
-
-        // 如果没有对应的数据则忽略后面的操作
-        if (notInGLJId.length <= 0) {
+        if(projectGljList.length === compositionGljList.length) {
             return;
         }
-        // 查找对应工料机总库数据
-        let stdRationLibGLJListModel = new STDRationLibGLJListModel();
-        let stdGLJData = await stdRationLibGLJListModel.getDataById(notInGLJId);
-        if (stdGLJData === null || stdGLJData.length <= 0) {
-            throw '没有找到对应的工料机总库数据';
-        }
 
         // 获取工料机类型以及整理数据
         let gljTypeList = STDGLJType.getStdGljTypeCacheObj().toArray();
@@ -471,7 +448,10 @@ class GLJListModel extends BaseModel {
         // 整理插入的数据
         let gljInsertData = [];
         let unitPriceInsertData = [];
-        for (let tmp of stdGLJData) {
+        for(let tmp of compositionGljList) {
+            if (projectGljList[tmp.name] !== undefined) {
+                continue;
+            }
             // 项目工料机插入的数据
             let gljData = {
                 glj_id: tmp.ID,
@@ -479,7 +459,7 @@ class GLJListModel extends BaseModel {
                 code: tmp.code,
                 name: tmp.name,
                 specs: tmp.specs,
-                unit: tmp.unit,
+                unit: tmp.unit === undefined ? '' : tmp.unit,
             };
             gljInsertData.push(gljData);
 
@@ -523,6 +503,7 @@ class GLJListModel extends BaseModel {
         try {
             // 查找对应的项目工料机数据
             let projectGLJData = await this.getDataById(projectGLJId);
+
             let allowType = [GLJTypeConst.MIX_RATIO, GLJTypeConst.CONCRETE, GLJTypeConst.MORTAR,
                 GLJTypeConst.GENERAL_MACHINE];
 
@@ -587,17 +568,17 @@ class GLJListModel extends BaseModel {
      * @return {Promise} 返回组成物工料机数据和组成物列表数据
      */
     async getCompositionGLJList(code, projectId, indexBy = null) {
-        // 首先获取对应组成物列表
-        let stdMixRatioModel = new STDMixRatioModel();
-        let compositionList = await stdMixRatioModel.getDataByCode(code);
+        // 获取对应的组成物数据
+        let stdGljLibGljListModel = new STDGLJLibGLJListModel();
+        let componentGljList = await stdGljLibGljListModel.getComponent(code);
 
-        if (compositionList.length <= 0) {
+        if (componentGljList.length <= 0) {
             throw '不存在对应的组成物';
         }
 
         let codeList = [];
         let nameList = [];
-        for(let tmp of compositionList) {
+        for(let tmp of componentGljList) {
             codeList.push(tmp.code);
             nameList.push(tmp.name);
         }
@@ -606,7 +587,7 @@ class GLJListModel extends BaseModel {
         let condition = {code: {"$in": codeList}, name: {"$in": nameList}, project_id: projectId};
         let gljData = await this.findDataByCondition(condition, {_id: 0}, false, indexBy);
 
-        return [gljData, compositionList];
+        return [gljData, componentGljList];
     }
 
     /**

+ 1 - 1
modules/glj/routes/glj_router.js

@@ -13,7 +13,7 @@ const router = Express.Router();
 let gljController = new GLJController();
 
 // action定义区域
-router.get('/', gljController.init, gljController.index);
+router.post('/getData', gljController.init, gljController.getGljList);
 router.post('/update', gljController.init, gljController.updateData);
 router.post('/get-ratio', gljController.init, gljController.getRatio);
 router.post('/delete-ratio', gljController.init, gljController.deleteMixRatio);

+ 13 - 11
modules/ration_glj/facade/glj_calculate_facade.js

@@ -51,7 +51,7 @@ async function calculateQuantity(query,isMarkPriceAjust){
                  }
          }
          for(let i =0;i<gljList.length;i++ ){
-             let r = await calculateQuantityPerGLJ(gljList[i],impactRation,coeList,assList,adjustState,isMarkPriceAjust);
+             let r = await calculateQuantityPerGLJ(gljList[i],i,coeList,assList,adjustState,isMarkPriceAjust);
              result.glj_result.push(r);
          }
 
@@ -85,7 +85,7 @@ function generateUpdateTasks(result) {
 }
 
 
-async function calculateQuantityPerGLJ(glj,ration,coeList,assList,adjustState,isMarkPriceAjust) {
+async function calculateQuantityPerGLJ(glj,index,coeList,assList,adjustState,isMarkPriceAjust) {
     let quantity =  glj.quantity;
     let result={
         query:{
@@ -112,7 +112,7 @@ async function calculateQuantityPerGLJ(glj,ration,coeList,assList,adjustState,is
             }
             result.doc.quantity =_.round(quantity,3);
         }
-        generateAdjustState(glj,coeList,adjustState);
+        generateAdjustState(glj,coeList,adjustState,index);
         return result;
     }catch (err){
         throw err;
@@ -134,23 +134,25 @@ function calculateAss(quantity,assList,glj) {
     return quantity;
 }
 
-function generateAdjustState(glj,coeList,adjustState) {
+function generateAdjustState(glj,coeList,adjustState,index) {
    //替换工料机 and  添加工料机
 
     // to do
 
   //标准附注条件调整 + 自定义乘系数
-    for(let i=0;i<coeList.length;i++){
-        if(coeList[i].isAdjust==1){
-            if(i==coeList.length-1){
-                adjustState.push({index:stateSeq.cusCoe,content:coeList[i].content});
-            }else {
-                adjustState.push({index:stateSeq.coe,content:"调 : "+coeList[i].content});
+    if(0==index){
+        for(let i=0;i<coeList.length;i++){
+            if(coeList[i].isAdjust==1){
+                if(i==coeList.length-1){
+                    adjustState.push({index:stateSeq.cusCoe,content:coeList[i].content});
+                }else {
+                    adjustState.push({index:stateSeq.coe,content:"调 : "+coeList[i].content});
+                }
             }
         }
     }
 
- //自定义消耗量
+    //自定义消耗量
     if(glj._doc.hasOwnProperty('customQuantity')){
         if(glj.customQuantity!==null){
             adjustState.push({index:stateSeq.cusQuantity,content:glj.code+'量'+glj.customQuantity});

+ 3 - 3
modules/reports/controllers/rpt_cfg_controller.js

@@ -2,15 +2,15 @@
  * Created by Tony on 2017/7/5.
  */
 
-let mongoose = require('mongoose');
-let rpt_util = require('../util/rpt_util');
+import mongoose from "mongoose";
+import rpt_util from "../util/rpt_util";
 let Rpt_Map_Fld_Mdl = mongoose.model('rpt_mapping_field');
 
 
 //统一回调函数
 let callback = function(req, res, err, message, data){
     res.json({error: err, message: message, data: data});
-}
+};
 
 module.exports = {
     getReportUserCfg: function(req, res){

+ 18 - 20
modules/reports/controllers/rpt_controller.js

@@ -2,21 +2,21 @@
  * Created by Tony on 2017/3/13.
  */
 
-let mongoose = require('mongoose');
-let async = require('async');
+import mongoose from "mongoose";
+import async from "async";
 
-let JV = require('../rpt_component/jpc_value_define');
+import JV from "../rpt_component/jpc_value_define";
 
 let Template = mongoose.model('rpt_templates');
-let rptTplFacade = require('../facade/rpt_template_facade');
-let demoTemplateFacade = require('../facade/rpt_tpl_data_demo_facade');
+import rptTplFacade from "../facade/rpt_template_facade";
+import demoTemplateFacade from "../facade/rpt_tpl_data_demo_facade";
 
-let JpcEx = require('../rpt_component/jpc_ex');
-let rptUtil = require("../util/rpt_util");
-let rpt_xl_util = require('../util/rpt_excel_util');
-let rpt_pdf_util = require('../util/rpt_pdf_util');
-let fs = require('fs');
-let strUtil = require('../../../public/stringUtil');
+import JpcEx from "../rpt_component/jpc_ex";
+import rptUtil from "../util/rpt_util";
+import rpt_xl_util from "../util/rpt_excel_util";
+import rpt_pdf_util from "../util/rpt_pdf_util";
+import fs from "fs";
+import strUtil from "../../../public/stringUtil";
 
 //统一回调函数
 let callback = function(req, res, err, data){
@@ -66,7 +66,7 @@ function getAllPagesCommonOrg(rpt_id, pageSize, option, cb) {
             }
         }
     );
-};
+}
 
 function getAllPagesCommon(rpt_id, pageSize, cb) {
     let rptTpl = null;
@@ -76,23 +76,23 @@ function getAllPagesCommon(rpt_id, pageSize, cb) {
             let tplData = {};
             if (rptTpl[JV.NODE_FIELD_MAP]) {
                 //1. 离散数据
-                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS].leng > 0) {
+                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS].length > 0) {
                     tplData[JV.DATA_DISCRETE_DATA] = [];
                 }
                 //2. 主数据
-                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS].leng > 0) {
+                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS].length > 0) {
                     tplData[JV.DATA_MASTER_DATA] = [];
                 }
                 //3. 从数据
-                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS].leng > 0) {
+                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS].length > 0) {
                     tplData[JV.DATA_DETAIL_DATA] = [];
                 }
                 //2. Ex主数据
-                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS_EX] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS_EX].leng > 0) {
+                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS_EX] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS_EX].length > 0) {
                     tplData[JV.DATA_MASTER_DATA_EX] = [];
                 }
                 //3. Ex从数据
-                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS_EX] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS_EX].leng > 0) {
+                if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS_EX] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS_EX].length > 0) {
                     tplData[JV.DATA_DETAIL_DATA_EX] = [];
                 }
                 //4. 重点: 开始组装$PROJECT对象
@@ -108,7 +108,7 @@ function getAllPagesCommon(rpt_id, pageSize, cb) {
             cb('No report template was found!', null);
         }
     })
-};
+}
 
 module.exports = {
     getReportAllPages: function(req, res){
@@ -125,7 +125,6 @@ module.exports = {
             rptName = req.params.rptName,
             isOneSheet = req.params.isOneSheet,
             option = req.params.option;
-        ;
         let dftOption = option||JV.PAGING_OPTION_NORMAL;
         getAllPagesCommonOrg(rpt_id, pageSize, dftOption, function(err, pageRst){
             fs.writeFileSync('D:/GitHome/ConstructionOperation/tmp/testRpt.js', JSON.stringify(pageRst));
@@ -151,7 +150,6 @@ module.exports = {
             pageSize = req.params.size,
             rptName = req.params.rptName,
             option = req.params.option;
-        ;
         let parallelFucs = [];
         let dftOption = option||JV.PAGING_OPTION_NORMAL;
         for (let id of rpt_ids) {

+ 11 - 9
modules/reports/controllers/rpt_tpl_controller.js

@@ -2,24 +2,26 @@
  * Created by Tony on 2017/6/1.
  */
 
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 
-let async = require("async");
-let counter = require('../../../public/counter/counter');
+import async from "async";
+import counter from "../../../public/counter/counter";
 
 let RptTplModel = mongoose.model('rpt_templates');
 let TreeNodeModel = mongoose.model('rpt_tpl_tree');
 
-let rptTplDef = require("../../../public/rpt_tpl_def").getUtil();
-let stringUtil = require("../../../public/stringUtil");
-let JV = require('../rpt_component/jpc_value_define');
+import rpttplDefObj from "../../../public/rpt_tpl_def";
+let rptTplDef = rpttplDefObj.getUtil();
 
-//let test_glj_type_util = require("../../../public/cache/std_glj_type_util");
+//import stringUtil from "../../../public/stringUtil";
+import JV from "../rpt_component/jpc_value_define";
+
+//import test_glj_type_util from "../../../public/cache/std_glj_type_util");
 
 //统一回调函数
 let callback = function(req, res, err, message, data){
     res.json({error: err, message: message, data: data});
-}
+};
 
 module.exports = {
     getDftTemplates(req, res) {
@@ -174,4 +176,4 @@ module.exports = {
             }
         });
     }
-}
+};

+ 2 - 3
modules/reports/facade/rpt_template_facade.js

@@ -1,7 +1,7 @@
 /**
  * Created by Tony on 2017/8/9.
  */
-let mongoose = require("mongoose");
+import mongoose from "mongoose";
 let rpt_tpl_mdl = mongoose.model("rpt_templates");
 
 module.exports = {
@@ -10,6 +10,5 @@ module.exports = {
 
 async function getRptTemplate(tplId) {
     //console.log('templateId: ' + parseInt(tplId));
-    let rst = await  rpt_tpl_mdl.findOne({"ID": parseInt(tplId)}, '-_id');
-    return rst;
+    return await  rpt_tpl_mdl.findOne({"ID": parseInt(tplId)}, '-_id');
 }

+ 1 - 1
modules/reports/facade/rpt_tpl_data_demo_facade.js

@@ -1,7 +1,7 @@
 /**
  * Created by Tony on 2017/8/9.
  */
-let mongoose = require("mongoose");
+import mongoose from "mongoose";
 let rpt_tpl_data_demo_mdl = mongoose.model("rpt_temp_tpl_data");
 
 module.exports = {

+ 1 - 1
modules/reports/facade/rpt_tpl_data_facade.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2017/8/9.
  */
 
-let mongoose = require("mongoose");
+import mongoose from "mongoose";
 let rpt_tpl_mdl = mongoose.model("rpt_templates");
 
 module.exports = {

+ 1 - 1
modules/reports/models/rpt_cfg.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2017/6/14.
  * 把报表相关的配置(字体、边框、格式等都放在一条记录中,方便整理,毕竟用户的报表格式基本是固定的,无需怎样调整)
  */
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 let Schema = mongoose.Schema;
 let FormatSchema = new Schema({
     "ID" : String,

+ 1 - 1
modules/reports/models/rpt_mapping_field.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2017/7/11.
  * 为后台报表模板选择指标用
  */
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 let MapFieldSchema = new mongoose.Schema({
     "fieldMapGrpName" : String,
     "Name": String,

+ 1 - 1
modules/reports/models/rpt_template.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2016/12/23.
  * 仅仅是存放报表模板的地方,由谁来引用是TreeNodeSchema的事情
  */
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 let Schema = mongoose.Schema;
 let RptTemplateSchema = new Schema({
     "ID" : Number,

+ 1 - 1
modules/reports/models/rpt_tpl_data.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2017/7/24.
  */
 
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 let Schema = mongoose.Schema;
 
 let rptTplPrjSchema = new Schema({

+ 1 - 1
modules/reports/models/rpt_tpl_data_demo.js

@@ -1,7 +1,7 @@
 /**
  * Created by Tony on 2016/12/28.
  */
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 // let dbm = require("../../../config/db/db_manager");
 // let smartcostdb = dbm.getCfgConnection("scConstruct");
 let Schema = mongoose.Schema;

+ 1 - 1
modules/reports/models/tpl_tree_node.js

@@ -2,7 +2,7 @@
  * Created by Tony on 2017/5/31.
  * 不同的用户会有一套自己的模板结构列表
  */
-let mongoose = require('mongoose');
+import mongoose from "mongoose";
 let Schema = mongoose.Schema;
 let TreeNodeSchema = new Schema({
     ID:Number,

+ 3 - 3
modules/reports/routes/report_router.js

@@ -2,9 +2,9 @@
  * Created by Tony on 2017/3/13.
  */
 
-let express = require('express');
+import express from "express";
 let rptRouter = express.Router();
-let reportController = require('./../controllers/rpt_controller');
+import reportController from "./../controllers/rpt_controller";
 
 module.exports =function (app) {
     app.get('/report',  function(req, res) {
@@ -24,4 +24,4 @@ module.exports =function (app) {
 
     rptRouter.get('/getPDF/:id/:size/:rptName', reportController.getPDF);//2/A4/07-1表
     app.use("/report_api", rptRouter);
-}
+};

+ 4 - 4
modules/reports/routes/rpt_tpl_router.js

@@ -1,7 +1,7 @@
-let express = require("express");
+import express from "express";
 let rptTplRouter = express.Router();
-let reportTplController = require('./../controllers/rpt_tpl_controller');
-let reportCfgController = require('./../controllers/rpt_cfg_controller');
+import reportTplController from "./../controllers/rpt_tpl_controller";
+import reportCfgController from "./../controllers/rpt_cfg_controller";
 
 module.exports = function (app) {
     app.get('/rpt_tpl',  function(req, res) {
@@ -26,4 +26,4 @@ module.exports = function (app) {
     rptTplRouter.post('/getUserRptCfg', reportCfgController.getReportUserCfg);
     rptTplRouter.post('/getMappingFields', reportCfgController.getAllMappingFields);
     app.use("/report_tpl_api", rptTplRouter);
-}
+};

+ 0 - 4
modules/users/models/schema/compilation.js

@@ -54,10 +54,6 @@ let modelSchema = {
         type: Boolean,
         default: false
     },
-    // 自增id
-    id: {
-        type: Number
-    },
     // 清单计价规则
     bill_valuation: {
         type: [childrenSchema],

+ 9 - 0
public/web/tree_sheet/tree_sheet_helper.js

@@ -164,6 +164,15 @@ var TREE_SHEET_HELPER = {
         };
         TreeNodeCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
+            console.log(style);
+            if (style.backColor) {
+                ctx.save();
+                ctx.fillStyle = style.backColor;
+                ctx.fillRect(x, y, w, h);
+                ctx.restore();
+            } else {
+                ctx.clearRect(x, y, w, h);
+            }
             // ������(x1, y1)���(��, ��), (x2, y2)�յ�(��, ��), ��ɫ
             var drawLine = function (canvas, x1, y1, x2, y2, color) {
                 ctx.save();

+ 9 - 0
test/logs/testlog.js

@@ -0,0 +1,9 @@
+/**
+ * Created by chen on 2017/9/13.
+ */
+let logger = require("../../logs/log_helper").logger;
+
+logger.info("log info...");
+logger.debug("log debug...");
+logger.warn("log warn...");
+logger.err("log err...");

+ 1 - 1
web/building_saas/fee_rates/fee_rate.html

@@ -169,7 +169,7 @@
 
 </body>
 
-<script src="/web/glj/js/socket.io.slim.js"></script>
+<script src="/web/building_saas/glj/js/socket.io.slim.js"></script>
 <script src="/public/web/socket/connection.js"></script>
 <script src="/public/web/uuid.js"></script>
 </html>

+ 55 - 0
web/building_saas/glj/html/glj_index.html

@@ -0,0 +1,55 @@
+<div class="toolsbar px-1">
+    <div class="tools-btn btn-group align-top">
+        <a href="" class="btn btn-sm"><i class="fa fa-arrow-down" aria-hidden="true"></i>下移</a>
+        <a href="" class="btn btn-sm"><i class="fa fa-arrow-up" aria-hidden="true"></i>上移</a>
+        <a href="" class="btn btn-sm"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
+        <a href="" class="btn btn-sm"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
+        <a href="" class="btn btn-sm"><i class="fa fa-undo" aria-hidden="true"></i></a>
+    </div>
+</div>
+<div class="container-fluid">
+    <div class="row">
+        <div class="main-content col-lg-12 p-0">
+            <div class="top-content">
+                <div class="main-data-top" id="project-glj">
+                    <p style="text-align: center; margin-top: 30px;">正在加载数据</p>
+                </div>
+            </div>
+            <div class="bottom-content">
+                <ul class="nav nav-tabs" role="tablist">
+                    <li class="nav-item">
+                        <a class="nav-link active" data-toggle="tab" data-name="ration" href="#de" role="tab">相关定额</a>
+                    </li>
+                    <li class="nav-item">
+                        <a class="nav-link" data-toggle="tab" data-name="mix-ratio" href="#ph" role="tab">配合比表</a>
+                    </li>
+                    <li class="nav-item">
+                        <a class="nav-link" data-toggle="tab" data-name="machine" href="#jx" role="tab">机械单价</a>
+                    </li>
+                </ul>
+                <!-- Tab panes -->
+                <div class="tab-content">
+                    <div class="tab-pane active" id="de" role="tabpanel">
+                        <div class="main-data-bottom ovf-hidden">
+                            相关定额
+                        </div>
+                    </div>
+                    <div class="tab-pane" id="ph" role="tabpanel">
+                        <div class="main-data-bottom" id="mix-ratio">
+                        </div>
+                    </div>
+                    <div class="tab-pane" id="jx" role="tabpanel">
+                        <div class="main-data-bottom" id="machine">
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript" src="/web/building_saas/glj/js/project_glj.js"></script>
+<script type="text/javascript" src="/web/building_saas/glj/js/composition.js"></script>
+<script type="text/javascript" src="/web/building_saas/glj/js/socket.js"></script>
+<script type="text/javascript" src="/web/building_saas/glj/js/common_spread.js"></script>
+<script type="text/javascript" src="/web/building_saas/glj/js/composition_spread.js"></script>
+<script type="text/javascript" src="/web/building_saas/glj/js/project_glj_spread.js"></script>

web/glj/js/common_spread.js → web/building_saas/glj/js/common_spread.js


web/glj/js/composition.js → web/building_saas/glj/js/composition.js


+ 1 - 1
web/glj/js/composition_spread.js

@@ -125,7 +125,7 @@ CompositionSpread.prototype.getRatioData = function(projectGLJid) {
         success: function(response) {
             if (response.err === 0) {
                 response.data = JSON.parse(response.data);
-                console.log(response.data);
+
                 // 设置数据
                 self.sheetObj.setData(response.data);
                 self.specialColumn(response.data);

+ 77 - 14
web/glj/js/project_glj.js

@@ -7,12 +7,87 @@
  */
 let projectGLJSpread = null;
 let projectGLJSheet = null;
+
+// websocket所需
+let host = '';
+let socket = null;
+let roomId = 0;
+// 判定常量
+let materialIdList = [];
+let canNotChangeTypeId = [];
+let GLJTypeConst = [];
+// spreadjs载入数据所需
+let jsonData = [];
+let mixRatioConnectData = [];
+
 let currentTag = '';
 let isChanging = false;
 $(document).ready(function () {
+    $('#tab_gongliaoji').on('shown.bs.tab', function (e) {
+        init();
+    });
+
+    // 是否主动更改数据
+    // $("#message").on('click', '#load-data', function() {
+    //     $("#notify").slideUp('fast');
+    //     if (changeInfo.length > 0) {
+    //         for (let index in changeInfo) {
+    //             let cell = gljSheet.getCell(changeInfo[index].row, changeInfo[index].col, GC.Spread.Sheets.SheetArea.viewport);
+    //             cell.value(changeInfo[index].newValue);
+    //         }
+    //     }
+    //     changeInfo = [];
+    // });
+});
+
+/**
+ * 初始化数据
+ *
+ * @return {void}
+ */
+function init() {
+    // 加载工料机数据
+    $.ajax({
+        url: '/glj/getData',
+        type: 'post',
+        dataType: 'json',
+        data: {project_id: scUrlUtil.GetQueryString('project')},
+        error: function() {
+            alert('数据传输错误');
+        },
+        beforeSend: function() {
+
+        },
+        success: function(response) {
+            if (response.err === 1) {
+                let msg = response.msg !== undefined && response.msg !== '' ? response.msg : '读取工料机数据失败!';
+                alert(msg);
+                return false;
+            }
+            let data = response.data;
+            // 赋值
+            jsonData = data.gljList !== undefined && data.gljList.length > 0 ? data.gljList : [];
+            mixRatioConnectData = data.mixRatioConnectData !== undefined ? data.mixRatioConnectData : mixRatioConnectData;
 
-    projectInfoObj.showProjectInfo();
+            host = data.constData.hostname !== undefined ? data.constData.hostname : '';
+            materialIdList = data.constData.materialIdList !== undefined ? data.constData.materialIdList : materialIdList;
+            roomId = data.constData.roomId !== undefined ? data.constData.roomId : roomId;
+            canNotChangeTypeId = data.constData.ownCompositionTypes !== undefined ?
+                data.constData.ownCompositionTypes : canNotChangeTypeId;
+            GLJTypeConst = data.constData.GLJTypeConst !== undefined ? JSON.parse(data.constData.GLJTypeConst) : GLJTypeConst;
 
+            spreadInit();
+        }
+    });
+
+}
+
+/**
+ * spreadjs相关初始化
+ *
+ * @return {void}
+ */
+function spreadInit() {
     projectGLJSpread = new ProjectGLJSpread();
     projectGLJSpread.successCallback = successTrigger;
     projectGLJSheet = projectGLJSpread.init();
@@ -45,19 +120,7 @@ $(document).ready(function () {
             projectGLJSheet.filterData('unit_price.type', []);
         }
     });
-
-    // 是否主动更改数据
-    // $("#message").on('click', '#load-data', function() {
-    //     $("#notify").slideUp('fast');
-    //     if (changeInfo.length > 0) {
-    //         for (let index in changeInfo) {
-    //             let cell = gljSheet.getCell(changeInfo[index].row, changeInfo[index].col, GC.Spread.Sheets.SheetArea.viewport);
-    //             cell.value(changeInfo[index].newValue);
-    //         }
-    //     }
-    //     changeInfo = [];
-    // });
-});
+}
 
 /**
  * 成功事件

+ 5 - 4
web/glj/js/project_glj_spread.js

@@ -61,7 +61,7 @@ ProjectGLJSpread.prototype.init = function () {
         {name: '父级关联编码', field: 'connect_code', visible: false},
         {name: '消耗量', field: 'ratio_data', visible: false},
     ];
-    let sourceData = JSON.parse(jsonData);
+    let sourceData = jsonData;
 
     this.sheetObj = new CommonSpreadJs(header);
     this.sheetObj.init('project-glj');
@@ -115,7 +115,7 @@ ProjectGLJSpread.prototype.init = function () {
         let type = activeSheet.getValue(row, typeColumn);
 
         // 如果类型为混凝土、砂浆、配合比、机械,则提示
-        if (field === 'unit_price.market_price' && canNotChangeTypeId.indexOf(type + '') >= 0) {
+        if (field === 'unit_price.market_price' && canNotChangeTypeId.indexOf(type) >= 0) {
             alert('当前工料机的市场单价由组成物计算得出,不可直接修改');
         }
     });
@@ -224,9 +224,10 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
     let connectCodeColumn = this.sheetObj.getFieldColumn('connect_code');
     let consumptionColumn = this.sheetObj.getFieldColumn('consumption');
     let activeSheet = this.sheetObj.getSheet();
+
     for (let data of sourceData) {
         // 只有材料才显示是否暂估
-        if (materialIdList.indexOf(data.unit_price.type + '') < 0) {
+        if (materialIdList.indexOf(data.unit_price.type) < 0) {
             let string = new GC.Spread.Sheets.CellTypes.Text();
             activeSheet.setCellType(rowCounter, isEvaluateColumn, string, GC.Spread.Sheets.SheetArea.viewport);
             // 锁定该单元格
@@ -235,7 +236,7 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
         }
 
         // 如果类型为混凝土、砂浆、配合比、机械,则市场单价不能修改
-        if (canNotChangeTypeId.indexOf(data.unit_price.type + '') >= 0) {
+        if (canNotChangeTypeId.indexOf(data.unit_price.type) >= 0) {
             this.firstMixRatioRow = this.firstMixRatioRow === -1 && data.unit_price.type !== GLJTypeConst.GENERAL_MACHINE ?
                 rowCounter : this.firstMixRatioRow;
             this.firstMachineRow = this.firstMachineRow === -1 && data.unit_price.type === GLJTypeConst.GENERAL_MACHINE ?

web/glj/js/socket.io.slim.js → web/building_saas/glj/js/socket.io.slim.js


web/glj/js/socket.js → web/building_saas/glj/js/socket.js


+ 2 - 70
web/building_saas/main/html/main.html

@@ -90,7 +90,7 @@
         <div class="main-nav">
             <ul class="nav nav-tabs flex-column" role="tablist">
                 <li class="nav-item"><a class="active" data-toggle="tab" href="#zaojiashu" role="tab">造价书</a></li>
-                <li class="nav-item"><a href="#" id="glj-link">工料机</a></li>
+                <li class="nav-item"><a data-toggle="tab" href="#gongliaoji" id="tab_gongliaoji" role="tab">工料机</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#fee_rates" id="tab_fee_rate" role="tab" onclick="">费率</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#calc_program_manage" id="tab_calc_program_manage" role="tab" onclick="">计算程序</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#baobiao" role="tab" onclick="">报表</a></li>
@@ -240,72 +240,7 @@
               </div>
             </div>
             <div class="tab-pane" id="gongliaoji" role="tabpanel">
-              <!--工料机-->
-              <div class="toolsbar px-1">
-                  <div class="tools-btn btn-group align-top">
-                      <a href="" class="btn btn-sm"><i class="fa fa-arrow-down" aria-hidden="true"></i>下移</a>
-                      <a href="" class="btn btn-sm"><i class="fa fa-arrow-up" aria-hidden="true"></i>上移</a>
-                      <a href="" class="btn btn-sm"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
-                      <a href="" class="btn btn-sm"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
-                      <a href="" class="btn btn-sm"><i class="fa fa-undo" aria-hidden="true"></i></a>
-                  </div>
-              </div>
-              <div class="container-fluid">
-                  <div class="row">
-                      <div class="main-content col-lg-12 p-0">
-                          <div class="fluid-content">
-                              <div class="warp-p2">
-                                  <table class="table table-sm table-bordered m-0">
-                                      <thead>
-                                          <tr>
-                                              <th>编码</th>
-                                              <th>名称</th>
-                                              <th>规格型号</th>
-                                              <th>单位</th>
-                                              <th>类型</th>
-                                              <th>人工工种</th>
-                                              <th>调整系数</th>
-                                              <th>总消耗量</th>
-                                              <th>基价单价</th>
-                                              <th>调整基价</th>
-                                              <th>市场单价</th>
-                                              <th>市场价合计</th>
-                                              <th>是否暂估</th>
-                                              <th>供货方式</th>
-                                              <th>甲供数量</th>
-                                              <th>出厂价</th>
-                                              <th>交货方式</th>
-                                              <th>... </th>
-                                          </tr>
-                                      </thead>
-                                      <tbody>
-                                          <tr>
-                                              <td>00010201</td>
-                                              <td>土石方综合工日</td>
-                                              <td> </td>
-                                              <td>工日</td>
-                                              <td>人</td>
-                                              <td>土石方人工</td>
-                                              <td> </td>
-                                              <td>100.232</td>
-                                              <td>38</td>
-                                              <td> </td>
-                                              <td>38</td>
-                                              <td>市场价合计</td>
-                                              <td>是否暂估</td>
-                                              <td>供货方式</td>
-                                              <td>甲供数量</td>
-                                              <td>出厂价</td>
-                                              <td>交货方式</td>
-                                              <td>... </td>
-                                          </tr>
-                                      </tbody>
-                                  </table>
-                              </div>
-                          </div>
-                      </div>
-                  </div>
-              </div>
+                <%include ../../glj/html/glj_index.html %>
             </div>
             <div class="tab-pane" id="baobiao" role="tabpanel">
               <!--报表-->
@@ -615,9 +550,6 @@
 
         $(document).ready(function(){
   			//createTree();
-            // 获取project
-            var projectId = getQueryString('project');
-            $("#glj-link").attr("href", "/glj?project=" + projectId);
 
 /*            $("#tab_calc_program").click(function(){
                 location.href = '/web/building_saas/main/html/calc_program.html';

+ 20 - 1
web/building_saas/main/js/views/std_bills_lib.js

@@ -38,6 +38,14 @@ var billsLibObj = {
             this.stdBillsFeatureSpread.refresh();
         }
     },
+    clearHighLight: function (spread) {
+        if (spread) {
+            let sheet = spread.getActiveSheet();
+            sheet.suspendPaint();
+            sheet.getRange(0, -1, sheet.getRowCount(), -1, GC.Spread.Sheets.SheetArea.viewport).backColor(undefined);
+            sheet.resumePaint();
+        }
+    },
     loadStdBillsLib: function () {
         let i, select = $('#stdBillsLibSelect');
         select.empty();
@@ -163,6 +171,10 @@ var billsLibObj = {
                 stdBillsTreeController.setTreeSelected(result[0]);
                 billsLibObj.stdBillsSpread.getActiveSheet().setSelection(result[0].serialNo(), sel[0].col, 1, 1);
 
+                for (let node of result) {
+                    billsLibObj.stdBillsSpread.getActiveSheet().getRange(node.serialNo(), -1, 1, -1).backColor('lemonChiffon');
+                }
+
                 $('#nextStdBills').show();
                 $('#nextStdBills').click(function () {
                     var cur = stdBillsTree.selected, resultIndex = result.indexOf(cur), sel = billsLibObj.stdBillsSpread.getActiveSheet().getSelections();
@@ -175,6 +187,7 @@ var billsLibObj = {
                     }
                 });
             } else {
+                billsLibObj.clearHighLight(billsLibObj.stdBillsSpread);
                 $('#nextStdBills').hide();
             }
             $('#stdBillsSearchResultCount').text('搜索结果:' + result.length);
@@ -332,13 +345,19 @@ $('#stdBillsTab').bind('click', function () {
     };
 });
 $('#stdBillsLibSelect').change(function () {
+    $('#stdBillsSearchResult').hide();
+    $(".main-data-side-q").height($(window).height() - $(".header").height() - $(".toolsbar").height() -  $(".tools-bar-height-q").height() - 202);
+    billsLibObj.clearHighLight(billsLibObj.stdBillsSpread);
+
     var select = $(this);
     if (this.children.length !== 0) {
-        LoadStdBills(select.val());
+        billsLibObj.loadStdBills(select.val());
     }
 });
 
+// 关闭搜索结果
 $('#closeSearchStdBills').click(function () {
     $('#stdBillsSearchResult').hide();
     $(".main-data-side-q").height($(window).height() - $(".header").height() - $(".toolsbar").height() -  $(".tools-bar-height-q").height() - 202);
+    billsLibObj.clearHighLight(billsLibObj.stdBillsSpread);
 });

+ 1 - 1
web/building_saas/pm/js/pm_main.js

@@ -180,7 +180,7 @@ $(document).ready(function() {
     $("input[name='valuation_type']").click(function() {
         let type = $(this).val();
         let targetData = type === 'bill' ? JSON.parse(billValuation) : JSON.parse(rationValuation);
-        let html = '<option value="">请选择计规则</option>';
+        let html = '<option value="">请选择计规则</option>';
 
         for(let valuation of targetData) {
             if (valuation === null) {

+ 0 - 14
web/glj/html/footer.html

@@ -1,14 +0,0 @@
-<!-- JS. -->
-<script src="/lib/jquery/jquery.min.js"></script>
-<script src="/lib/tether/tether.min.js"></script>
-<script src="/lib/bootstrap/bootstrap.min.js"></script>
-<script src="/web/building_saas/js/global.js"></script>
-<script src="/web/glj/js/socket.io.slim.js"></script>
-<script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 102
web/glj/html/glj_index.html

@@ -1,102 +0,0 @@
-<%include header.html %>
-<link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css">
-<div class="main">
-    <div class="main-nav">
-        <ul class="nav flex-column">
-            <li><a href="">造价书</a></li>
-            <li><a href="#" class="active">工料机</a></li>
-            <li><a href="">报表</a></li>
-            <li><a href="">费率</a></li>
-        </ul>
-    </div>
-    <div class="content">
-        <div class="toolsbar px-1">
-            <div class="tools-btn btn-group align-top">
-                <a href="" class="btn btn-sm"><i class="fa fa-arrow-down" aria-hidden="true"></i>下移</a>
-                <a href="" class="btn btn-sm"><i class="fa fa-arrow-up" aria-hidden="true"></i>上移</a>
-                <a href="" class="btn btn-sm"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
-                <a href="" class="btn btn-sm"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
-                <a href="" class="btn btn-sm"><i class="fa fa-undo" aria-hidden="true"></i></a>
-            </div>
-        </div>
-        <div class="container-fluid">
-            <div class="row">
-                <div class="main-content col-lg-12 p-0">
-                    <div class="top-content">
-                        <div class="main-data-top" id="project-glj">
-                            <p style="text-align: center; margin-top: 30px;">正在加载数据</p>
-                        </div>
-                    </div>
-                    <div class="bottom-content">
-                        <ul class="nav nav-tabs" role="tablist">
-                            <li class="nav-item">
-                                <a class="nav-link active" data-toggle="tab" data-name="ration" href="#de" role="tab">相关定额</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" data-toggle="tab" data-name="mix-ratio" href="#ph" role="tab">配合比表</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" data-toggle="tab" data-name="machine" href="#jx" role="tab">机械单价</a>
-                            </li>
-                        </ul>
-                        <!-- Tab panes -->
-                        <div class="tab-content">
-                            <div class="tab-pane active" id="de" role="tabpanel">
-                                <div class="main-data-bottom ovf-hidden">
-                                    相关定额
-                                </div>
-                            </div>
-                            <div class="tab-pane" id="ph" role="tabpanel">
-                                <div class="main-data-bottom" id="mix-ratio">
-                                </div>
-                            </div>
-                            <div class="tab-pane" id="jx" role="tabpanel">
-                                <div class="main-data-bottom" id="machine">
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script type="text/javascript">
-    let jsonData = '<%- gljList %>';
-    let mixRatioConnectData = '<%- mixRatioConnectData %>';
-    mixRatioConnectData = JSON.parse(mixRatioConnectData);
-
-    let materialIdList = '<%- materialIdList %>';
-    materialIdList = materialIdList !== '' ? materialIdList.split(",") : '';
-    let host = '<%= hostname %>';
-    let socket = null;
-    let roomId = '<%= roomId %>';
-    let changeInfo = [];
-    let GLJTypeConst = '<%- GLJTypeConst %>';
-    GLJTypeConst = JSON.parse(GLJTypeConst);
-
-    // 混凝土、砂浆、配合比、机械 市场单价不能修改
-    let canNotChangeTypeId = '<%- ownCompositionTypes %>';
-    canNotChangeTypeId = canNotChangeTypeId !== '' ? canNotChangeTypeId.split(",") : '';
-    let userID = '<%=userID %>';
-</script>
-<%include footer.html %>
-<script type="text/javascript" src="/lib/jquery-contextmenu/jquery.contextMenu.js"></script>
-<script type="text/javascript" src="/public/web/sheet/sheet_data_helper.js"></script>
-<script type="text/javascript" src="/public/web/number_util.js"></script>
-<script type="text/javascript" src="/web/glj/js/socket.js"></script>
-<script type="text/javascript" src="/web/glj/js/common_spread.js"></script>
-<script type="text/javascript" src="/web/glj/js/composition_spread.js"></script>
-<script type="text/javascript" src="/web/glj/js/project_glj_spread.js"></script>
-<script type="text/javascript" src="/web/glj/js/project_glj.js"></script>
-<script type="text/javascript" src="/web/glj/js/composition.js"></script>
-<script type="text/javascript" src="/web/building_saas/js/global.js"></script>
-<script type="text/javascript" src="/public/web/common_ajax.js"></script>
-<script type="text/javascript" src="/public/web/url_util.js"></script>
-<script type="text/javascript" src="/web/building_saas/main/js/views/project_info.js"></script>
-<script type="text/javascript">
-$(document).ready(function() {
-    let projectId = getQueryString("project");
-    $(".main-nav .nav li > a").not(".active").attr("href", "/main?project=" + projectId);
-});
-</script>

+ 0 - 90
web/glj/html/header.html

@@ -1,90 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title><%= title %>-Smartcost</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/building_saas/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013lightGray.10.0.1.css">
-    <script type="text/javascript" src="/public/web/sheet/sheet_common.js"></script>
-    <script type="text/javascript" src="/public/web/sheet/sheet_data_helper.js"></script>
-    <script src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <style type="text/css">
-        #chat-content {
-            border: 1px solid #000;
-            width: 500px;
-            height: 600px;
-        }
-        #notify {
-            display: none;
-        }
-    </style>
-</head>
-<body>
-<div class="header">
-    <div class="top-msg clearfix" id="notify">
-        <div class="alert alert-warning mb-0 py-0" role="alert">
-            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
-                <span aria-hidden="true">&times;</span>
-            </button>
-            <span id="message"><strong>注意!</strong> 这是一条消息通知 <a href="#">链接</a></span>
-        </div>
-    </div>
-    <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 justify-content-between">
-        <span class="header-logo px-2">Smartcost</span>
-        <div class="navbar-text" id="fullpath"><a href="project-management.html">项目管理</a><i class="fa fa-angle-right fa-fw"></i>文件夹<i
-                class="fa fa-angle-right fa-fw"></i>建设项目<i class="fa fa-angle-right fa-fw"></i>单项工程<i
-                class="fa fa-angle-right fa-fw"></i>单位工程
-        </div>
-        <div class="float-lg-right navbar-text pt-0">
-            <div class="dropdown d-inline-block">
-                <button class="btn btn-link btn-sm dropdown-toggle" type="button" data-toggle="dropdown">陈特</button>
-                <div class="dropdown-menu dropdown-menu-right">
-                    <a class="dropdown-item" href="user-info.html" target="_blank">账号资料</a>
-                    <a class="dropdown-item" href="user-buy.html" target="_blank">产品购买</a>
-                    <a class="dropdown-item" href="user-set.html" target="_blank">偏好设置</a>
-                </div>
-            </div>
-            <span class="btn btn-link btn-sm new-msg">
-                  <i class="fa fa-envelope-o" aria-hidden="true"></i>&nbsp;2
-                </span>
-            <button class="btn btn-link btn-sm">注销</button>
-        </div>
-    </nav>
-    <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-        <ul class="nav navbar-nav px-1">
-            <li class="nav-item">
-                <a class="nav-link" href="#" aria-haspopup="true" aria-expanded="false"><i class="fa fa-sliders"></i> 选项</a>
-            </li>
-            <li class="nav-item dropdown">
-                <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true"
-                   aria-expanded="false"><i class="fa fa-wrench"></i> 工具</a>
-                <div class="dropdown-menu">
-                    <a class="dropdown-item" href="#">定额库编辑器</a>
-                    <a class="dropdown-item" href="#">工料机库编辑器</a>
-                </div>
-            </li>
-            <li class="nav-item dropdown">
-                <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true"
-                   aria-expanded="false"><i class="fa fa-question-circle-o"></i> 帮助</a>
-                <div class="dropdown-menu">
-                    <a class="dropdown-item" href="#">帮助</a>
-                    <a class="dropdown-item" href="#">升级说明</a>
-                    <a class="dropdown-item" href="#">重庆市2008定额说明</a>
-                    <a class="dropdown-item" href="#">纵横官网</a>
-                    <a class="dropdown-item" href="#">动画教程</a>
-                    <a class="dropdown-item" href="#">联系客服</a>
-                    <a class="dropdown-item" href="#">关于</a>
-                </div>
-            </li>
-            <li class="nav-item">
-                <a class="nav-link" href="#" aria-haspopup="true" aria-expanded="false"><i class="fa fa-history"></i>
-                    历史记录</a>
-            </li>
-        </ul>
-        <form class="form-inline">
-            <input class="form-control form-control-sm mr-1" type="text" placeholder="告诉我你想做什么">
-        </form>
-    </nav>
-</div>