Przeglądaj źródła

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

zhongzewei 6 lat temu
rodzic
commit
cd86d4cd19

+ 6 - 5
modules/users/controllers/login_controller.js

@@ -215,11 +215,12 @@ class LoginController {
             // }
 
             // 判断极验验证码是否通过
-            const captcha = new Captcha();
-            const captchResult = await captcha.validate(request);
-            if (!captchResult) {
-                throw '极验验证码错误';
-            }
+            // 先不使用,出现验证慢的情况
+            // const captcha = new Captcha();
+            // const captchResult = await captcha.validate(request);
+            // if (!captchResult) {
+            //     throw '极验验证码错误';
+            // }
 
             // 判断用户是否开启了只使用短信登录
             const userInfo = await userModel.findDataByAccount(userData.mobile);

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

@@ -42,10 +42,10 @@ var Bills = {
                 }
                 if (uData.fees) {
                     for (let fee of uData.fees) {
-                        fee.unitFee = fee.unitFee.toFixed(2);
-                        fee.totalFee = fee.totalFee.toFixed(2);
-                        fee.tenderUnitFee = fee.tenderUnitFee.toFixed(2);
-                        fee.tenderTotalFee = fee.tenderTotalFee.toFixed(2);
+                        if(fee.unitFee) fee.unitFee = fee.unitFee.toFixed(2);
+                        if(fee.totalFee) fee.totalFee = fee.totalFee.toFixed(2);
+                        if(fee.tenderUnitFee) fee.tenderUnitFee = fee.tenderUnitFee.toFixed(2);
+                        if(fee.tenderTotalFee) fee.tenderTotalFee = fee.tenderTotalFee.toFixed(2);
                     }
                 }
                 return uData;

+ 8 - 0
web/building_saas/main/js/models/calc_program.js

@@ -2,6 +2,11 @@
  * Created by CSL on 2017-07-19.
  * 计算程序。所有定额、清单、父清单的计算都从此入。
  */
+ 
+ /**
+ * Created by CSL on 2017-07-19.
+ * 计算程序。所有定额、清单、父清单的计算都从此入。
+ */
 
 let calcTools = {
     getNodeByFlag: function (flag) {
@@ -1845,6 +1850,8 @@ class CalcProgram {
     saveNodes(treeNodes, callback){
         if (treeNodes.length < 1) {
             $.bootstrapLoading.end();
+            this.rationMap = null;
+            this.pgljMap = null;
             return;
         }
 
@@ -2158,6 +2165,7 @@ class CalcProgram {
         } else{
             if(!this.rationMap) return [];
             let result = this.rationMap[ration.ID];
+            if(!result) return [];
             result = gljOprObj.combineWithProjectGlj(result,false,ration,this.pgljMap);
             return result;
         }

+ 10 - 0
web/building_saas/main/js/views/tender_price_view.js

@@ -52,6 +52,7 @@ let tender_obj={
         this.tenderController = TREE_SHEET_CONTROLLER.createNew(this.tenderTree, this.tenderSheet, this.tenderTreeSetting);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.onSheetValueChange);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onTenderRangeChange);
+        this.tenderSheet.bind(GC.Spread.Sheets.Events.EnterCell, this.onEnterCell);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onEditStarting);
         this.tenderController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, this.treeSelectedChanged);
        // this.tenderController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, this.onSelectionChange);
@@ -202,6 +203,15 @@ let tender_obj={
         });
 
     },
+    onEnterCell : function (sender,args) {
+        let me = tender_obj, row = args.row, col = args.col;
+        if ([8, 9].includes(col)){
+            let node = me.tenderTree.items[row];
+            if (node.children && node.children.length > 0) {   // 父结点只读
+                me.tenderSheet.getCell(row, col).locked(true);// = true;
+            }
+        }
+    },
     updateChildrenValue:function (node,dataCode,value,datas,nodes) {
          if(node.children.length > 0){
             for(let c of node.children){

+ 2 - 2
web/users/html/login.html

@@ -48,7 +48,7 @@
             <div class="form-group">
                 <div id="captcha-box"></div>
             </div>
-            <div class="form-group btn-area">
+            <div class="form-group btn-area" style="display: none">
                 <button type="button" id="login" class="btn btn-primary btn-block">登录</button>
             </div>
             <div class="pt-1 d-flex justify-content-between">
@@ -71,7 +71,7 @@
                 </div>
                 <div class="modal-body">
                     <div class="row" id="version-area">
-                        <!--<div class="col-sm-6">-->
+                        <!--<div class="col-sm-6 mb-3">-->
                             <!--<div class="card card-block">-->
                                 <!--<h3 class="card-title">重庆版免费版</h3>-->
                                 <!--<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>-->

+ 5 - 5
web/users/js/login.js

@@ -43,7 +43,7 @@ $(document).ready(function () {
         captchaObj.onSuccess(function () {
             $(".btn-area").slideDown("fast");
             // $('#login').click();
-            captchaObj.getValidate();
+            // captchaObj.getValidate();
         });
 
         $("#login").click(function () {
@@ -312,18 +312,18 @@ function login(captchaObj) {
                 }
             } else if(response.error === 2) {
                 // $('#phonepass').modal('hide');
-                captchaObj.reset();
+                // captchaObj.reset();
                 $('#check_ssoId').val(response.ssoId);
                 $('#phone').modal('show');
             } else if(response.error === 3) {
-                captchaObj.reset();
+                // captchaObj.reset();
                 $('#phonepass').modal('show');
                 $('#mobileLogin').val(response.data);
             } else {
                 // $('#phonepass').modal('hide');
                 let msg = response.msg !== undefined ? response.msg : '未知错误';
                 showError(msg, $("input"));
-                captchaObj.reset();
+                // captchaObj.reset();
             }
         },
         error: function (result) {
@@ -479,7 +479,7 @@ function setVersion(versionData) {
     let html = '';
     for (let version of versionData) {
         let description = version.description ? version.description : '介绍内容';
-        let tmpHtml = '<div class="col-sm-6">' +
+        let tmpHtml = '<div class="col-sm-6 mb-3">' +
             '<div class="card card-block">' +
             '<div class="card-body">' +
             '<h3 class="card-title">'+ version.name +'</h3>' +