Explorar el Código

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

TonyKang hace 5 años
padre
commit
d0d945149d

+ 2 - 0
modules/all_models/welcome_setting.js

@@ -15,11 +15,13 @@ let modelSchema = {
     compilationId: String,
     normal:{
       showType:{type:Number,default:0},// 1 每天一次 2 每次登录显示,0 关闭
+      showTime:Number,
       context:String
     },
     // 专业用户
     professional: {
        showType:{type:Number,default:0},// 1 每天一次 2 每次登录显示,0 关闭
+       showTime:Number,
        context:String
     }
 };

+ 1 - 1
modules/main/facade/project_facade.js

@@ -288,7 +288,7 @@ async function getDefaultColSetting(libID){
     return await stdColSettingModel.findOne({ID: libID, deleted: false}, '-_id main_tree_col');
 }
 
-async function getBudgetSummayDatas(projectIDs,overWriteUrl){
+async function getBudgetSummayDatas(projectIDs,userID,compilationID,overWriteUrl){
     try {
         let projects = [];
         let names = [];

+ 2 - 1
modules/options/models/optionTypes.js

@@ -8,7 +8,8 @@
 const optionSetting = {
     GENERALOPTS: {
         rationQuanACToBillsQuan: true,//自动根据清单工程量填写定额工程量
-        rationQuanACToRationUnit: true//自动根据定额单位转换定额工程量
+        rationQuanACToRationUnit: true,
+        progressiveType:0//累进计算费用:0 统一累进办法;1 各汇总工程相加
     },
     //色彩相关
     COLOROPTS: {

+ 2 - 1
modules/pm/controllers/pm_controller.js

@@ -322,11 +322,12 @@ module.exports = {
         let absoluteUrl = compilationData.overWriteUrl ? request.app.locals.rootDir + compilationData.overWriteUrl : request.app.locals.rootDir;
         let overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile()? compilationData.overWriteUrl : null;
         //欢迎页显示控制
-        let [isShow,context] = await pm_facade.getWelcomeInfo(sessionCompilation._id,request.session.sessionUser,request.session.compilationVersion.includes('免费'));
+        let [isShow,context,showTime] = await pm_facade.getWelcomeInfo(sessionCompilation._id,request.session.sessionUser,request.session.compilationVersion.includes('免费'));
         let renderData = {
             isFirst: isFirst,
             isShow:isShow,
             context:context,
+            showTime:showTime,
             userAccount: request.session.userAccount,
             userID: request.session.sessionUser.id,
             compilationData: JSON.stringify(sessionCompilation),

+ 4 - 2
modules/pm/facade/pm_facade.js

@@ -1958,14 +1958,16 @@ async function getWelcomeInfo(compilationId,sessionUser,isFree=true) {
     let welcom_setting = await welcomeModel.findOne({compilationId:compilationId});
     let isShow = false;
     let context = "";
+    let showTime = 0;
     let setting = null
     if(welcom_setting){
       setting = isFree? welcom_setting.normal:welcom_setting.professional;//区分专业版和免费版
     }
 
     if(setting){
-        if(setting.showType == 0) return [false,""];//关闭
+        if(setting.showType == 0) return [false,"",showTime];//关闭
         context = setting.context;
+        showTime = setting.showTime && setting.showTime!=""?setting.showTime:0;
         if(setting.showType == 1){//每天一次
             let dataString =moment(Date.now()).tz("Asia/Shanghai").format('YYYY-MM-DD');//今天的日期字符串
             let userInfo =await userModel.findOne({_id: mongoose.Types.ObjectId(sessionUser.id)});
@@ -1980,6 +1982,6 @@ async function getWelcomeInfo(compilationId,sessionUser,isFree=true) {
 
     }
 
-    return [isShow,context]
+    return [isShow,context,showTime]
 
 }

+ 1 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -559,7 +559,7 @@ var TREE_SHEET_HELPER = {
             };
 
             TreeNodeCellType.prototype.deactivateEditor = function (editorContext, context) {
-                    console.log("hehe")
+                    
             };
 
             TreeNodeCellType.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context) {

+ 8 - 3
web/building_saas/main/js/views/options_view.js

@@ -12,7 +12,7 @@ let optionsOprObj = {
         let gOpts = me.options[me.optionsTypes.GENERALOPTS];
         if(gljUtil.isDef(gOpts)){
             for(let attr in gOpts){
-                me[attr].prop('checked', gOpts[attr]);
+              if(me[attr]) me[attr].prop('checked', gOpts[attr]);
             }
         }
     },
@@ -48,7 +48,9 @@ let optionsOprObj = {
         let v2 = this.rationQuanACToRationUnit.prop('checked');
         let orgV1 = this.getOption(this.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
         let orgV2 = this.getOption(this.optionsTypes.GENERALOPTS, 'rationQuanACToRationUnit');
-        return v1 !== orgV1 || v2 !== orgV2;
+        let progressiveType = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'progressiveType');
+        let progressiveTypeVal = parseInt($("input[name='progressiveType']:checked").val())
+        return v1 !== orgV1 || v2 !== orgV2 || progressiveType!== progressiveTypeVal;
     }
 };
 
@@ -56,9 +58,12 @@ let optionsOprObj = {
 $('#poj-set').on('shown.bs.modal', function () {
     let orgV1 = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
     let orgV2 = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToRationUnit');
+    let progressiveType = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'progressiveType');
     optionsOprObj.rationQuanACToBillsQuan.prop('checked', orgV1);
     optionsOprObj.rationQuanACToRationUnit.prop('checked', orgV2);
-
+    progressiveType = progressiveType?progressiveType:0;
+    $('#progressive_unite').prop('checked', progressiveType == 0);
+    $('#progressive_sum').prop('checked', progressiveType == 1);
 });
 //选项移到了项目属性的系统选项中
 /*optionsOprObj.rationQuanACToBillsQuan.click(function () {

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

@@ -2337,15 +2337,12 @@ $('#poj-set').on('show.bs.modal', function () {
 
         let zg = projectObj.project.property.zanguCalcMode !== undefined &&
                  projectObj.project.property.zanguCalcMode !== null ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
-        let progressiveType = projectObj.project.property.progressiveType?projectObj.project.property.progressiveType:0;   
         setCalcFlag($('#rationContent'), leafBillGetFeeType.rationContent, ft);
         setCalcFlag($('#rationPriceConverse'), leafBillGetFeeType.rationPriceConverse, ft);
         setCalcFlag($('#rationPrice'), leafBillGetFeeType.rationPrice, ft);
         setCalcFlag($('#billsPrice'), leafBillGetFeeType.billsPrice, ft);
         setCalcFlag($('#zangu_common'), zanguCalcType.common, zg);
         setCalcFlag($('#zangu_gatherMaterial'), zanguCalcType.gatherMaterial, zg);
-        setCalcFlag($('#progressive_unite'), 0, progressiveType);
-        setCalcFlag($('#progressive_sum'), 1, progressiveType);
         
         let showAdjustPrice = projectObj.project.projSetting.glj_col?projectObj.project.projSetting.glj_col.showAdjustPrice:false;
         showAdjustPrice === true ? $("#tab_poj-settings-6").show():$("#tab_poj-settings-6").hide();
@@ -2505,12 +2502,6 @@ $('#property_ok').click(function () {
         reCalcRations = true;
     };
 
-    let progressiveType = parseInt($("input[name='progressiveType']:checked").val())
-    if (progressiveType !== project.property.progressiveType) {
-      properties['property.progressiveType'] = progressiveType;
-      project.property.progressiveType = progressiveType;
-  };
-
     //价差预备费,预算项目才有
     if (project.property.valuationType === 'bill') {
         let costGrowthRateV = $('#costGrowthRate').val(),
@@ -2569,10 +2560,12 @@ $('#property_ok').click(function () {
     //系统选项
     if(optionsOprObj.needToSaveGeneralOpts()){
         let v1 = optionsOprObj.rationQuanACToBillsQuan.prop('checked'),
-            v2 = optionsOprObj.rationQuanACToRationUnit.prop('checked');
+            v2 = optionsOprObj.rationQuanACToRationUnit.prop('checked'),
+            progressiveType = parseInt($("input[name='progressiveType']:checked").val());
         options.updateData = {
             rationQuanACToBillsQuan: v1,
-            rationQuanACToRationUnit: v2
+            rationQuanACToRationUnit: v2,
+            progressiveType:progressiveType
         };
     }
 

+ 15 - 5
web/building_saas/pm/html/project-management.html

@@ -151,16 +151,24 @@
             <!--建设项目汇总-->
             <div class="p-3" id="summary-project">
                 <legend>单价文件</legend>
-                <table class="table table-bordered table-hover table-sm" id="summary-project-unit-price-table">
-                    <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
+                <table class="table table-bordered table-hover table-sm table-sc" id="summary-project-unit-price-table">
+                    <thead>
+                        <th style="width: 25px;" class="text-center"></th>
+                        <th style="width: 330px;" class="text-center">名称</th>
+                        <th style="width:40px;" class="text-center">使用</th>
+                    </thead>
                     <tbody>
                     </tbody>
                 </table>
 
 
                 <legend>费率文件</legend>
-                <table class="table table-bordered table-hover table-sm" id="summary-project-fee-table">
-                    <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
+                <table class="table table-bordered table-hover table-sm table-sc" id="summary-project-fee-table">
+                    <thead>
+                        <th style="width: 25px;" class="text-center"></th>
+                        <th style="width: 330px;" class="text-center">名称</th>
+                        <th style="width:40px;" class="text-center">使用</th>
+                    </thead>
                     <tbody>
                     </tbody>
                 </table>
@@ -674,11 +682,13 @@
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title">欢迎使用纵横公路养护云造价</h5>
-                <button type="button" class="close text-danger" data-dismiss="modal" aria-label="Close">
+                <label id="countdown" ></label>
+                <button type="button" id="welcomeCloseBtn" class="close text-danger" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body" id="welcomeBody">
+              <input type="hidden" id="showTime" value="<%= showTime %>">
                 <div style="max-height:465px">
                      <%- context %>
                 </div>

+ 20 - 4
web/building_saas/pm/js/pm_newMain.js

@@ -3658,7 +3658,7 @@ function set_file_table(target, poj_tenders, fileList, type){
             + '<span class="form-text text-danger" style="display: none">本建设项目已存在该文件名,请重新输入!' +
             '</span></td>';
         let fileTypeStr = type === fileType.unitPriceFile ? '单价文件' : '费率文件';
-        let fileHtml = '<tr><td>' + fileCounter + '</td><td id="file_' + fileId + '"><div>' + fileList[i].name + hoverHtml + renHtml + usedHtml + '</tr>';
+        let fileHtml = '<tr><td class="text-center">' + fileCounter + '</td><td id="file_' + fileId + '"><div>' + fileList[i].name + hoverHtml + renHtml + usedHtml + '</tr>';
         fileCounter++;
         let targetBody = type === fileType.unitPriceFile ? target + '-unit-price-table tbody' : target + '-fee-table tbody';
         $(targetBody).append(fileHtml);
@@ -3925,6 +3925,22 @@ function doAfterImport(projectDatas) {
     }
 }
 
-$(function () {
-   if(isShow)  $('#welcomePage').modal('show');//是否显示欢迎页
-});
+if(isShow){
+  let showTime = parseInt($("#showTime").val()); 
+ if(showTime > 0){
+   $("#welcomeCloseBtn").hide();
+   function countdown(){
+     if(showTime > 0){
+       showTime--
+       $("#countdown").text(showTime);
+     }else{
+       $("#countdown").text("");
+       $("#welcomeCloseBtn").show();
+       clearInterval(welcomeTimer);
+     }
+   }
+   countdown();
+   let welcomeTimer = setInterval("countdown()", 1000);   
+ }
+ $('#welcomePage').modal('show');//是否显示欢迎页
+}