Explorar o código

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuOperation

TonyKang %!s(int64=5) %!d(string=hai) anos
pai
achega
979903b117

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@ node_modules/
 .git/
 dist/
 .idea/
+.vscode/
 tmp/
 modules/reports/util/pdf_base_files/*.ttf
 modules/reports/util/pdf_base_files/*.ttc

+ 30 - 0
modules/all_models/com_electrovalence.js

@@ -0,0 +1,30 @@
+/**
+ * Created by zhang on 2019/12/10.
+ */
+
+let mongoose = require('mongoose');
+let Schema = mongoose.Schema;
+
+let gljListSchema =new Schema({
+    ID:{type: String},
+    GLJID:Number,
+    projectGLJID:Number,
+    name:String,
+    displayName:String,
+    code:String,
+    specs:String,
+    unit:String,
+    type:Number,
+    // 加权系数
+    coe: Number,
+    from:{type: String,default:'std'}//std, cpt  来自标准工料机库、补充工料机库
+},{versionKey:false,_id: false});
+
+
+let com_electrovalenceSchema = {//综合电价
+    ID:{type:String,index: true},
+    unit_price_file_id: Number,
+    gljList:[gljListSchema]
+};
+
+mongoose.model("com_electrovalence", new Schema(com_electrovalenceSchema, {versionKey: false, collection: "com_electrovalence"}));

+ 133 - 0
modules/all_models/material_calc.js

@@ -0,0 +1,133 @@
+/**
+ * Created by zhang on 2019/3/18.
+ */
+import mongoose from "mongoose";
+
+let Schema = mongoose.Schema;
+
+var rationAssItemSchema = mongoose.Schema({
+    name: String,
+    assistID: Number,
+    assistCode: String,
+    stdValue: Number,
+    actualValue:Number,
+    stepValue: String,
+    decimal: Number,
+    carryBit: String,
+    minValue: String,
+    maxValue: String,
+    paramName:String,//参数名称
+    param:String,//参数
+    thirdRationCode:String,//第三定额
+    isAdjust:Number,//0不调整,1调整
+    groupList:[Schema.Types.Mixed],//当有分组的时候用这个
+    assRation:Schema.Types.Mixed//存放对应的定额,材料计算时用到
+}, { _id: false });
+
+var ration_glj = new Schema({
+    ID:{type: String},
+    GLJID:Number,
+    repositoryId:Number,
+    rationID:String,
+    projectGLJID:Number,
+    name:String,
+    code:String,
+    //原始的编码
+    original_code: {type: String},
+    rcode:String,
+    //新结构,计录替换前的工料机信息,对于混凝土,替换,计算等问题处理,替换时保存旧数据的5大项信息
+    mIndexObj: Schema.Types.Mixed,
+    specs:String,
+    unit:String,
+    shortName:String,
+    type:Number,
+    // 机型
+    model: Number,
+    // 调整系数ID
+    adjCoe: Number,
+    quantity:String,
+    customQuantity:String,
+    rationItemQuantity:String,
+    tenderQuantity:String,//调整后消耗量
+    createType: {type: String,default:'normal'},//normal、add、replace  正常、添加工料机、替换工料机
+    from:{type: String,default:'std'}//std, cpt  来自标准工料机库、补充工料机库
+},{versionKey:false,_id: false});
+
+let ration_schema = {
+    ID: {type: String},
+    projectID: Number,
+    code: String,
+    name: String,
+    unit: String,
+    quantity: String,
+    feeType:String,
+    caption:String,
+    libID:Number,
+    stdID:Number,
+    from:String,
+    rationAssList: [rationAssItemSchema]
+};
+
+
+let freightSchema = {
+    ID:{type:String,index: true},
+    unit_price_file_id: Number,
+    connect_key: {type: String, index: true},// 关联项目工料机的key 不能关联id,因为单价文件导入别的项目后项目工料机id不同
+    start:String,//起讫地点
+    conveyance:String,//运输工具
+    unitFreight:String,//单位运价
+    kmDistance:String,//km运距
+    unitLoadingFee:String,//装卸费单价
+    loadingTimes:String,//装卸次数
+    otherFee:String,//其它费用
+    freightIncreaseRate:String,//运价增加率
+    weightCoe:String,//加权系数
+    rations:[ration_schema],
+    ration_gljs:[ration_glj],
+    calcType:String,//计算方式
+    materialType:String//材料类型
+};
+mongoose.model("freight_calc", new Schema(freightSchema, {versionKey: false, collection: "freight_calc"}));
+
+
+let originalSchema = {
+    ID:{type:String,index: true},
+    unit_price_file_id: Number,
+    connect_key: {type: String, index: true},// 关联项目工料机的key 不能关联id,因为单价文件导入别的项目后项目工料机id不同
+    supplyLocation:String,//供应地点
+    supplyPrice:String,//供应价
+    coe:String,//加权系数
+    rations:[ration_schema],
+    ration_gljs:[ration_glj]
+};
+
+mongoose.model("original_calc", new Schema(originalSchema, {versionKey: false, collection: "original_calc"}));
+
+
+let userfreightSchema = mongoose.Schema({
+    ID:String,
+    unit_price_file_id: Number,
+    connect_key: String,// 关联项目工料机的key 不能关联id,因为单价文件导入别的项目后项目工料机id不同
+    start:String,//起讫地点
+    conveyance:String,//运输工具
+    unitFreight:String,//单位运价
+    kmDistance:String,//km运距
+    unitLoadingFee:String,//装卸费单价
+    loadingTimes:String,//装卸次数
+    otherFee:String,//其它费用
+    freightIncreaseRate:String,//运价增加率
+    weightCoe:String,//加权系数
+    rations:[ration_schema],
+    ration_gljs:[ration_glj],
+    calcType:String,//计算方式
+    materialType:String//材料类型
+}, { _id: false });
+
+let user_freights = {
+    ID:{type:String,index: true},
+    userID:{type:String,index: true},
+    compilationID:{type:String,index: true},
+    rootProjectID:Number,
+    freight:userfreightSchema
+};
+mongoose.model("user_freights", new Schema(user_freights, {versionKey: false, collection: "user_freights"}));

+ 25 - 0
modules/all_models/system_setting.js

@@ -0,0 +1,25 @@
+/**
+ * Created by zhang on 2020/1/2.
+ */
+let mongoose = require("mongoose");
+
+let Schema = mongoose.Schema;
+let collectionName = 'system_setting';
+let modelSchema = {
+    // ID
+    ID: {
+        type: String,
+        index: true
+    },
+    // 专业用户
+    professional: {
+        project: Number,
+        ration:Number
+    },
+    // 免费用户
+    normal: {
+        project: Number,
+        ration:Number
+    },
+};
+mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));

+ 1 - 1
modules/common/base/base_controller.js

@@ -7,7 +7,7 @@
  */
 import crypto from "crypto";
 import Url from "url";
-import Moment from "moment";
+import Moment from 'moment-timezone';
 // import menuData from "../../../config/menu";
 
 class BaseController {

+ 5 - 1
modules/ration_repository/controllers/ration_repository_controller.js

@@ -173,7 +173,11 @@ class RationRepositoryController extends baseController {
             err: 0,
             msg: ''
         };
-        const allowHeader = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
+        const allowHeader = [
+            'application/vnd.ms-excel', 
+            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+            'application/octet-stream'
+        ];
         const uploadOption = {
             uploadDir: './public'
         };

+ 5 - 1
modules/std_glj_lib/controllers/gljController.js

@@ -216,7 +216,11 @@ class GljController extends BaseController{
             err: 0,
             msg: ''
         };
-        const allowHeader = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
+        const allowHeader = [
+            'application/vnd.ms-excel', 
+            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+            'application/octet-stream'
+        ];
         const uploadOption = {
             uploadDir: './public'
         };

+ 14 - 3
modules/sys_tools/models/sys_model.js

@@ -9,7 +9,6 @@
  */
 
 import mongoose from 'mongoose';
-import schedule from 'node-schedule';
 import async from 'async';
 const projectModel = mongoose.model('projects');
 const projSettingModel = mongoose.model('proj_setting');
@@ -22,11 +21,14 @@ const rationGljModel = mongoose.model('ration_glj');
 const rationCoeMolde = mongoose.model('ration_coe');
 const installationModel = mongoose.model('installation_fee');
 const rationInstallationModel = mongoose.model('ration_installation');
-const rationTemplateModel  = mongoose.model('ration_template')
+const rationTemplateModel  = mongoose.model('ration_template');
 const quantityDetailModel = mongoose.model('quantity_detail');
 const unitPriceFileModel = mongoose.model('unit_price_file');
 const unitPriceModel = mongoose.model('unit_price');
 const mixRatioModel = mongoose.model('mix_ratio');
+let freightModel = mongoose.model("freight_calc");
+let originalModel = mongoose.model("original_calc");
+let comElectrovalenceModel = mongoose.model("com_electrovalence");
 const feeRateFileModel = mongoose.model('fee_rate_file');
 const feeRateModel = mongoose.model('fee_rates');
 const compleRationSection = mongoose.model('complementary_ration_section_tree');
@@ -35,7 +37,7 @@ const compleRationSection = mongoose.model('complementary_ration_section_tree');
 async function clearJunkData(callback){
     let functions = [];
     //获取彻底删除了的项目
-    let junkProjs = await projectModel.find({'deleteInfo.deleted': true, 'deleteInfo.completeDeleted': true});
+    let junkProjs = await projectModel.find({'deleteInfo.deleted': true, 'deleteInfo.completeDeleted': true}, '-_id ID').lean();
     let junkProjIds = [];
     for(let jProj of junkProjs){
         junkProjIds.push(jProj.ID);
@@ -103,6 +105,15 @@ async function clearJunkData(callback){
         functions.push(function(cb){
             mixRatioModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
         });
+        functions.push(function(cb){
+            freightModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
+        });
+        functions.push(function(cb){
+            originalModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
+        });
+        functions.push(function(cb){
+            comElectrovalenceModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
+        });
     }
     //彻底删除了的费率文件
     let junkFFs = await feeRateFileModel.find({'deleteInfo.deleted': true, 'deleteInfo.completeDeleted': true});

+ 39 - 0
modules/users/controllers/system_controller.js

@@ -0,0 +1,39 @@
+/**
+ * Created by zhang on 2019/12/31.
+ */
+import BaseController from "../../common/base/base_controller";
+let mongoose = require("mongoose");
+let systemSettingModel = mongoose.model("system_setting");
+const uuidV1 = require('uuid/v1');
+let config = require("../../../config/config.js");
+
+class SystemController extends BaseController {
+    async  index(request, response){
+        let setting = await systemSettingModel.findOne({});
+        if(!setting){
+            setting = {professional:{project:100,ration:2000},normal:{project:50,ration:1000}};
+        }
+        // 渲染数据
+        let renderData = {
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
+            setting:setting
+        };
+        response.render('users/views/system/index', renderData);
+    }
+
+    async save(request, response){
+        let data = request.body;
+        let setting = {professional:{project:data.professional_project,ration:data.professional_ration},normal:{project:data.normal_project,ration:data.normal_ration}};
+        if(!data.ID || data.ID == ""){
+            setting.ID = uuidV1();
+            await systemSettingModel.create(setting);
+        } else {
+            await systemSettingModel.update({ID:data.ID},setting);
+        }
+        response.redirect(request.headers.referer);
+    }
+
+}
+
+export default SystemController;

+ 17 - 0
modules/users/routes/system_route.js

@@ -0,0 +1,17 @@
+/**
+ * Created by zhang on 2019/12/31.
+ */
+
+import Express from "express";
+import SystemController from "../controllers/system_controller";
+
+const router = Express.Router();
+const systemController = new SystemController();
+
+module.exports =function (app) {
+    // action定义区域
+    router.get('/', systemController.auth, systemController.init, systemController.index);
+    router.post('/save', systemController.auth, systemController.init, systemController.save);
+    app.use("/system", router);
+};
+

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "jszip": "^3.1.3",
     "log4js": "~2.3.3",
     "multiparty": "^4.1.3",
+    "moment-timezone": "^0.5.27",
     "node-xlsx": "^0.11.2",
     "pdfkit": "^0.8.2",
     "ueditor": "^1.2.3",

+ 1 - 1
web/maintain/bill_template_lib/html/main.html

@@ -16,7 +16,7 @@
                         <% }} %>
                     </div>
                 </div>
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead>

+ 4 - 4
web/maintain/billsGuidance_lib/html/main.html

@@ -28,15 +28,15 @@
         <div class="content">
             <div class="container-fluid">
                 <div class="row">
-                  <div class="col-md-8">
+                  <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                       <table class="table table-hover table-bordered">
                         <thead>
                             <tr>
                                 <th>清单指引名称</th>
-                                <th>编办</th>
-                                <th>清单规则</th>
-                                <th>类型</th>
+                                <th width="160">编办</th>
+                                <th width="300">清单规则</th>
+                                <th width="100">类型</th>
                                 <th width="160">添加时间</th>
                                 <th width="70">操作</th>
                             </tr>

+ 1 - 1
web/maintain/bills_lib/html/main.html

@@ -29,7 +29,7 @@
         <div class="content">
             <div class="container-fluid">
                 <div class="row">
-                  <div class="col-md-8">
+                  <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                       <table class="table table-hover table-bordered">
                         <thead>

+ 1 - 1
web/maintain/calc_program_lib/html/main.html

@@ -16,7 +16,7 @@
                         <% }} %>
                     </div>
                 </div>
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead><tr><th>库名称</th><th>自定义显示名称</th><th >费用定额</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>

+ 37 - 21
web/maintain/fee_rate_lib/html/main.html

@@ -6,33 +6,48 @@
                     <div class="list-group mt-3">
                         <% for (let compilation of compilationList) { %>
                         <% if (compilation._id === 'all') { %>
-                        <a href="/feeRate/main" class="list-group-item list-group-item-action <%= compilation.active %>">
+                        <a href="/feeRate/main"
+                            class="list-group-item list-group-item-action <%= compilation.active %>">
                             所有
                         </a>
                         <% } else { %>
-                        <a id="<%= compilation._id %>" href="/feeRate/main?filter=<%= compilation._id %>" class="list-group-item list-group-item-action <%= compilation.active %>">
+                        <a id="<%= compilation._id %>" href="/feeRate/main?filter=<%= compilation._id %>"
+                            class="list-group-item list-group-item-action <%= compilation.active %>">
                             <%= compilation.name %>
                         </a>
                         <% }} %>
                     </div>
                 </div>
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
-                            <thead><tr><th>库名称</th><th >费用定额</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>
+                            <thead>
+                                <tr>
+                                    <th>库名称</th>
+                                    <th width="160">费用定额</th>
+                                    <th width="160">添加时间</th>
+                                    <th width="70">操作</th>
+                                </tr>
+                            </thead>
                             <tbody id="showArea">
-                            <% for(let lib of feeRateLibs){ %>
-                            <tr class="libTr">
-                                <td id="<%= lib.ID%>"><a href="/feeRate/edit/<%= lib.ID%>?locked=true"><%= lib.libName%></a></td>
-                                <td><%= lib.compilationName%></td>
-                                <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
-                                <td>
-                                    <a class="lock-btn-control disabled" href="javascript:void(0);" style="color: #0275d8" onclick='getFeeRateLib("<%= lib.ID%>")' title="编辑"><i class="fa fa-pencil-square-o"></i></a>
-                                    <a class="text-danger lock-btn-control disabled" href="javascript:void(0);" style="color: #0275d8" onclick='showDeleteModal("<%= lib.ID%>")' title="删除"><i class="fa fa-remove"></i></a>
-                                    <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i class="fa fa-unlock-alt"></i></a>
-                                </td>
-                            </tr>
-                            <% } %>
+                                <% for(let lib of feeRateLibs){ %>
+                                <tr class="libTr">
+                                    <td id="<%= lib.ID%>"><a
+                                            href="/feeRate/edit/<%= lib.ID%>?locked=true"><%= lib.libName%></a></td>
+                                    <td><%= lib.compilationName%></td>
+                                    <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
+                                    <td>
+                                        <a class="lock-btn-control disabled" href="javascript:void(0);"
+                                            style="color: #0275d8" onclick='getFeeRateLib("<%= lib.ID%>")' title="编辑"><i
+                                                class="fa fa-pencil-square-o"></i></a>
+                                        <a class="text-danger lock-btn-control disabled" href="javascript:void(0);"
+                                            style="color: #0275d8" onclick='showDeleteModal("<%= lib.ID%>")'
+                                            title="删除"><i class="fa fa-remove"></i></a>
+                                        <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i
+                                                class="fa fa-unlock-alt"></i></a>
+                                    </td>
+                                </tr>
+                                <% } %>
                             </tbody>
                         </table>
                     </div>
@@ -53,7 +68,8 @@
                 </button>
             </div>
             <div class="modal-body">
-                <form id="addLibForm" method="post" action="/feeRate/addLib" enctype="application/x-www-form-urlencoded21">
+                <form id="addLibForm" method="post" action="/feeRate/addLib"
+                    enctype="application/x-www-form-urlencoded21">
                     <div class="form-group">
                         <label>库名称</label>
                         <input id="name" name="name" class="form-control" placeholder="请输入费率标准库名称" type="text">
@@ -63,11 +79,11 @@
                         <label>编办名称</label>
                         <select id="compilationSels" name="compilationId" class="form-control"></select>
                     </div>
-                    <input type="hidden" name = "userAccount" value="<%= userAccount%>">
+                    <input type="hidden" name="userAccount" value="<%= userAccount%>">
                 </form>
             </div>
             <div class="modal-footer">
-                <button id="addLibs"  class="btn btn-primary">新建</button>
+                <button id="addLibs" class="btn btn-primary">新建</button>
                 <button type="button" id="cancelBtn" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -95,7 +111,7 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <a id="rename" href="javascript: void(0);" class="btn btn-primary" >确定</a>
+                <a id="rename" href="javascript: void(0);" class="btn btn-primary">确定</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -118,7 +134,7 @@
                 <input type="hidden" id="delCount">
             </div>
             <div class="modal-footer">
-                <a id="delete" href="javascript:void(0);" class="btn btn-danger" >确认</a>
+                <a id="delete" href="javascript:void(0);" class="btn btn-danger">确认</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>

+ 1 - 1
web/maintain/main_col_lib/html/main.html

@@ -2,7 +2,7 @@
     <div class="content">
         <div class="container-fluid">
             <div class="row">
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead><tr><th>列设置名称</th><th width="160">编办</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>

+ 37 - 21
web/maintain/material_replace_lib/html/main.html

@@ -2,24 +2,39 @@
     <div class="content">
         <div class="container-fluid">
             <div class="row">
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
-                            <thead><tr><th>库名称</th><th>清单规则</th><th >费用定额</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>
+                            <thead>
+                                <tr>
+                                    <th>库名称</th>
+                                    <th width="300">清单规则</th>
+                                    <th width="160">费用定额</th>
+                                    <th width="160">添加时间</th>
+                                    <th width="70">操作</th>
+                                </tr>
+                            </thead>
                             <tbody id="showArea">
-                            <% for(let lib of materialLibs){ %>
-                            <tr class="libTr">
-                                <td id="<%= lib.ID%>"><a href="/materialReplace/edit/<%= lib.ID%>?locked=true"><%= lib.name%></a></td>
-                                <td><%= lib.billsLibName%></td>
-                                <td><%= lib.compilationName%></td>
-                                <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
-                                <td>
-                                    <a class="lock-btn-control disabled" href="javascript:void(0);" style="color: #0275d8" onclick='getMaterialLib("<%= lib.ID%>")' title="编辑"><i class="fa fa-pencil-square-o"></i></a>
-                                    <a class="text-danger lock-btn-control disabled" href="javascript:void(0);" style="color: #0275d8" onclick='showDeleteModal("<%= lib.ID%>")' title="删除"><i class="fa fa-remove"></i></a>
-                                    <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i class="fa fa-unlock-alt"></i></a>
-                                </td>
-                            </tr>
-                            <% } %>
+                                <% for(let lib of materialLibs){ %>
+                                <tr class="libTr">
+                                    <td id="<%= lib.ID%>"><a
+                                            href="/materialReplace/edit/<%= lib.ID%>?locked=true"><%= lib.name%></a>
+                                    </td>
+                                    <td><%= lib.billsLibName%></td>
+                                    <td><%= lib.compilationName%></td>
+                                    <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
+                                    <td>
+                                        <a class="lock-btn-control disabled" href="javascript:void(0);"
+                                            style="color: #0275d8" onclick='getMaterialLib("<%= lib.ID%>")'
+                                            title="编辑"><i class="fa fa-pencil-square-o"></i></a>
+                                        <a class="text-danger lock-btn-control disabled" href="javascript:void(0);"
+                                            style="color: #0275d8" onclick='showDeleteModal("<%= lib.ID%>")'
+                                            title="删除"><i class="fa fa-remove"></i></a>
+                                        <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i
+                                                class="fa fa-unlock-alt"></i></a>
+                                    </td>
+                                </tr>
+                                <% } %>
                             </tbody>
                         </table>
                     </div>
@@ -40,7 +55,8 @@
                 </button>
             </div>
             <div class="modal-body">
-                <form id="addLibForm" method="post" action="/materialReplace/addLib" enctype="application/x-www-form-urlencoded21">
+                <form id="addLibForm" method="post" action="/materialReplace/addLib"
+                    enctype="application/x-www-form-urlencoded21">
                     <div class="form-group">
                         <label>库名称</label>
                         <input id="name" name="name" class="form-control" placeholder="请输入材料库名称" type="text">
@@ -54,11 +70,11 @@
                         <label>编办名称</label>
                         <select id="compilationSels" name="compilationId" class="form-control"></select>
                     </div>
-                    <input type="hidden" name = "userAccount" value="<%= userAccount%>">
+                    <input type="hidden" name="userAccount" value="<%= userAccount%>">
                 </form>
             </div>
             <div class="modal-footer">
-                <button id="addLibs"  class="btn btn-primary">新建</button>
+                <button id="addLibs" class="btn btn-primary">新建</button>
                 <button type="button" id="cancelBtn" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -86,7 +102,7 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <a id="rename" href="javascript: void(0);" class="btn btn-primary" >确定</a>
+                <a id="rename" href="javascript: void(0);" class="btn btn-primary">确定</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -109,7 +125,7 @@
                 <input type="hidden" id="delCount">
             </div>
             <div class="modal-footer">
-                <a id="delete" href="javascript:void(0);" class="btn btn-danger" >确认</a>
+                <a id="delete" href="javascript:void(0);" class="btn btn-danger">确认</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -117,4 +133,4 @@
 </div>
 
 <script src="/public/web/lock_util.js"></script>
-<script type="text/javascript" src="/web/maintain/material_replace_lib/js/material_replace.js"></script>
+<script type="text/javascript" src="/web/maintain/material_replace_lib/js/material_replace.js"></script>

+ 1 - 1
web/maintain/progressive_lib/html/main.html

@@ -2,7 +2,7 @@
     <div class="content">
         <div class="container-fluid">
             <div class="row">
-                <div class="col-md-5">
+                <div class="col-md-8">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead><tr><th >库名称</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>

+ 38 - 22
web/maintain/project_feature_lib/html/main.html

@@ -6,33 +6,48 @@
                     <div class="list-group mt-3">
                         <% for (let compilation of compilationList) { %>
                         <% if (compilation._id === 'all') { %>
-                        <a href="/projectFeature/main" class="list-group-item list-group-item-action <%= compilation.active %>">
+                        <a href="/projectFeature/main"
+                            class="list-group-item list-group-item-action <%= compilation.active %>">
                             所有
                         </a>
                         <% } else { %>
-                        <a id="<%= compilation._id %>" href="/projectFeature/main?filter=<%= compilation._id %>" class="list-group-item list-group-item-action <%= compilation.active %>">
+                        <a id="<%= compilation._id %>" href="/projectFeature/main?filter=<%= compilation._id %>"
+                            class="list-group-item list-group-item-action <%= compilation.active %>">
                             <%= compilation.name %>
                         </a>
                         <% }} %>
                     </div>
                 </div>
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
-                            <thead><tr><th >库名称</th><th>费用定额</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>
+                            <thead>
+                                <tr>
+                                    <th>库名称</th>
+                                    <th width="160">费用定额</th>
+                                    <th width="160">添加时间</th>
+                                    <th width="70">操作</th>
+                                </tr>
+                            </thead>
                             <tbody id="showArea">
-                            <% for(let lib of featureLibs){ %>
-                            <tr class="libTr">
-                                <td id="<%= lib.ID%>"><a href="/projectFeature/edit/<%= lib.ID%>?locked=true"><%= lib.name%></a></td>
-                                <td><%= lib.compilationName%></td>
-                                <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
-                                <td>
-                                    <a class="lock-btn-control disabled" href="javascript:void(0);" style="color: #0275d8" onclick='getFeatureLib("<%= lib.ID%>")' title="编辑"><i class="fa fa-pencil-square-o"></i></a>
-                                    <a class="text-danger lock-btn-control disabled" href="javascript:void(0);" onclick='showDeleteModal("<%= lib.ID%>")' title="删除"><i class="fa fa-remove"></i></a>
-                                    <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i class="fa fa-unlock-alt"></i></a>
-                                </td>
-                            </tr>
-                            <% } %>
+                                <% for(let lib of featureLibs){ %>
+                                <tr class="libTr">
+                                    <td id="<%= lib.ID%>"><a
+                                            href="/projectFeature/edit/<%= lib.ID%>?locked=true"><%= lib.name%></a></td>
+                                    <td><%= lib.compilationName%></td>
+                                    <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
+                                    <td>
+                                        <a class="lock-btn-control disabled" href="javascript:void(0);"
+                                            style="color: #0275d8" onclick='getFeatureLib("<%= lib.ID%>")' title="编辑"><i
+                                                class="fa fa-pencil-square-o"></i></a>
+                                        <a class="text-danger lock-btn-control disabled" href="javascript:void(0);"
+                                            onclick='showDeleteModal("<%= lib.ID%>")' title="删除"><i
+                                                class="fa fa-remove"></i></a>
+                                        <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i
+                                                class="fa fa-unlock-alt"></i></a>
+                                    </td>
+                                </tr>
+                                <% } %>
                             </tbody>
                         </table>
                     </div>
@@ -53,7 +68,8 @@
                 </button>
             </div>
             <div class="modal-body">
-                <form id="addLibForm" method="post" action="/projectFeature/addLib" enctype="application/x-www-form-urlencoded21">
+                <form id="addLibForm" method="post" action="/projectFeature/addLib"
+                    enctype="application/x-www-form-urlencoded21">
                     <div class="form-group">
                         <label>库名称</label>
                         <input id="name" name="name" class="form-control" placeholder="请输入特征库名称" type="text">
@@ -68,11 +84,11 @@
                             <% }} %>
                         </select>
                     </div>
-                    <input type="hidden" name = "userAccount" value="<%= userAccount%>">
+                    <input type="hidden" name="userAccount" value="<%= userAccount%>">
                 </form>
             </div>
             <div class="modal-footer">
-                <button id="addLibs"  class="btn btn-primary">新建</button>
+                <button id="addLibs" class="btn btn-primary">新建</button>
                 <button type="button" id="cancelBtn" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -100,7 +116,7 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <a id="rename" href="javascript: void(0);" class="btn btn-primary" >确定</a>
+                <a id="rename" href="javascript: void(0);" class="btn btn-primary">确定</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -123,7 +139,7 @@
                 <input type="hidden" id="delCount">
             </div>
             <div class="modal-footer">
-                <a id="delete" href="javascript:void(0);" class="btn btn-danger" >确认</a>
+                <a id="delete" href="javascript:void(0);" class="btn btn-danger">确认</a>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
@@ -131,4 +147,4 @@
 </div>
 
 <script src="/public/web/lock_util.js"></script>
-<script type="text/javascript" src="/web/maintain/project_feature_lib/js/project_feature.js"></script>
+<script type="text/javascript" src="/web/maintain/project_feature_lib/js/project_feature.js"></script>

+ 6 - 0
web/maintain/ration_repository/js/section_tree.js

@@ -667,23 +667,28 @@ let sectionTreeObj = {
         const $seach = $('#rationSearch');
         $seach.val(rationCode);
         //去后台搜索该定额
+        $.bootstrapLoading.start();
         CommonAjax.post('/rationRepository/api/getRationItem', {rationLibId: pageOprObj.rationLibId, code: rationCode}, function (rstData) {
             if (!rstData) {
                 alert(`不存在定额${rationCode}`);
+                $.bootstrapLoading.end();
                 return;
             }
             //定位至相关章节
             const sectionId = rstData.sectionId;
             if (!sectionId) {
+                $.bootstrapLoading.end();
                 return;
             }
             const sectionNode = me.tree.nodes[`id_${sectionId}`];
             if (!sectionNode) {
+                $.bootstrapLoading.end();
                 return;
             }
             const sectionRow = sectionNode.serialNo();
             me.sheet.setActiveCell(sectionRow, 1);
             me.sheet.showRow(sectionRow, GC.Spread.Sheets.VerticalPosition.top);
+            $.bootstrapLoading.end();
             const doAfterGetRation = function (rations) {
                 const findRation = _.find(rations, {code: rationCode});
                 const rIdx = rations.indexOf(findRation);
@@ -694,6 +699,7 @@ let sectionTreeObj = {
             };
             me.initSelection(sectionNode, doAfterGetRation);
         }, function () {
+            $.bootstrapLoading.end();
         });
     }
 };

+ 1 - 1
web/maintain/ration_repository/main.html

@@ -47,7 +47,7 @@
                         <% }} %>
                     </div>
                 </div>
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead>

+ 3 - 3
web/maintain/std_glj_lib/html/main.html

@@ -30,14 +30,14 @@
     <div class="content">
         <div class="container-fluid">
             <div class="row">
-                <div class="col-md-8">
+                <div class="col-md-10">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead>
                                 <tr>
                                     <th>人材机库名称</th>
-                                    <th>费用定额</th>
-                                    <th>定额库</th>
+                                    <th width="160">费用定额</th>
+                                    <th width="320">定额库</th>
                                     <th width="160">添加时间</th>
                                     <th width="70">操作</th>
                                     <th width="90">价格数据</th>

+ 1 - 1
web/maintain/vehicleVesselTax_lib/html/main.html

@@ -2,7 +2,7 @@
     <div class="content">
         <div class="container-fluid">
             <div class="row">
-                <div class="col-md-5">
+                <div class="col-md-8">
                     <div class="warp-p2 mt-3">
                         <table class="table table-hover table-bordered">
                             <thead><tr><th >库名称</th><th width="160">添加时间</th><th width="70">操作</th></tr></thead>

+ 20 - 0
web/users/js/system.js

@@ -0,0 +1,20 @@
+/**
+ * Created by zhang on 2020/1/2.
+ */
+$(document).ready(function() {
+   $("#system_save").click(function () {
+       for(let ele of $("input")){
+           if(ele.name == "ID") continue;
+           if(!isNum($(ele).val())) return alert($(ele).parent().prevAll("legend").text() + $(ele).prev().text()+"输入的数据类型有误,请重新输入!");
+       }
+       $("form").submit();
+   });
+
+   function isNum(thisValue){
+       var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+       var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+       return (regPos.test(thisValue) || regNeg.test(thisValue));
+   }
+
+});
+

+ 41 - 0
web/users/views/system/index.html

@@ -0,0 +1,41 @@
+<div class="panel-content">
+    <div class="panel-title fluid">
+        <div class="title-main"><h2>系统设置<a href="javascript:void(0);" id="system_save" class="btn btn-primary btn-sm pull-right">确定修改</a></h2></div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-header">
+            <h4>版本差异</h4>
+        </div>
+        <div class="c-body">
+            <form method="post" action="/system/save" enctype="application/x-www-form-urlencoded21">
+                <div class="row">
+                    <input type="hidden" name="ID" value="<%= setting.ID%>">
+                <div class="col-lg-4">
+                    <legend>免费版</legend>
+                    <div class="form-group">
+                        <label>单位工程可创建数量</label>
+                        <input type="number" step="10" min="50" class="form-control" name ="normal_project"  value="<%= setting.normal.project%>">
+                    </div>
+                    <div class="form-group">
+                        <label>定额可创建数量</label>
+                        <input type="number" step="10" min="500" class="form-control" name ="normal_ration"  value="<%= setting.normal.ration%>">
+                    </div>
+                </div>
+                <div class="col-lg-4">
+                    <legend>专业版</legend>
+                    <div class="form-group">
+                        <label>单位工程可创建数量</label>
+                        <input type="number" step="10" min="50" class="form-control" name="professional_project" value="<%= setting.professional.project%>">
+                    </div>
+                    <div class="form-group">
+                        <label>定额可创建数量</label>
+                        <input type="number" step="10" min="500"  class="form-control" name="professional_ration" value="<%= setting.professional.ration%>">
+                    </div>
+                </div>
+            </div>
+            </form>
+        </div>
+    </div>
+</div>
+
+<script type="text/javascript" src="/web/users/js/system.js"></script>

+ 2 - 2
web/users/views/user/index.html

@@ -117,8 +117,8 @@
                     <td><%= model.province[user.province] %></td>
                     <td><%= compilationMap[user.latest_used]?compilationMap[user.latest_used].name:""%></td>
                     <td><a onclick="getOnlineInfo('<%= user._doc.filter%>')" href="#time-detail" data-toggle="modal" data-target="#time-detail"><%= user._doc.online_times %></a></td>
-                    <td><%= moment(user.create_time).format('YYYY-MM-DD HH:mm:ss') %></td>
-                    <td><%= user.latest_login?moment(user.latest_login).format('YYYY-MM-DD HH:mm:ss'):"" %></td>
+                    <td><%= moment(user.create_time).tz("Asia/Shanghai").format('YYYY-MM-DD HH:mm:ss') %></td>
+                    <td><%= user.latest_login?moment(user.latest_login).tz("Asia/Shanghai").format('YYYY-MM-DD HH:mm:ss'):"" %></td>
                     <% if (manager.superAdmin == 1) { %>
                     <td>
                         <a onclick='deleteUser("<%= user._id.toString()%>")' data-toggle="modal" data-target="#delUser" class="btn text-danger" style="padding: 0px">删除</a>