瀏覽代碼

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

TonyKang 6 年之前
父節點
當前提交
bd1324f45c

+ 2 - 2
modules/glj/controllers/glj_controller.js

@@ -900,10 +900,10 @@ async function getGLJListByProjectID(projectId){
         }
         // 先获取对应标段的项目工料机数据
         let gljListModel = new GLJListModel();
-        let [gljList, mixRatioConnectData,mixRationMap,unitPriceMap] = await gljListModel.getListByProjectId(projectId, unitPriceFileId);
+        let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectId, unitPriceFileId);
         responseData.data.gljList = gljList;
         responseData.data.mixRatioConnectData = mixRatioConnectData;
-        responseData.data.mixRatioMap = mixRationMap;
+        responseData.data.mixRatioMap = mixRatioMap;
         responseData.data.usedTenderList = usedTenderList;
         responseData.data.unitPriceMap = unitPriceMap;
         responseData.data.originalList = await original_calc_model.find({"unit_price_file_id":unitPriceFileId});

+ 158 - 2
modules/main/facade/project_facade.js

@@ -10,7 +10,8 @@ module.exports = {
     saveProperty: saveProperty,
     getDefaultColSetting: getDefaultColSetting,
     markProjectsToChange:markProjectsToChange,
-    getBudgetSummayDatas:getBudgetSummayDatas
+    getBudgetSummayDatas:getBudgetSummayDatas,
+    getGLJSummayDatas:getGLJSummayDatas
 };
 
 let mongoose = require('mongoose');
@@ -32,6 +33,7 @@ let stdColSettingModel = mongoose.model('std_main_col_lib');
 let decimal_facade = require('../../main/facade/decimal_facade');
 const scMathUtil = require('../../../public/scMathUtil').getUtil();
 import fixedFlag from  '../../common/const/bills_fixed';
+import GLJListModel from "../../glj/models/glj_list_model";
 const projectDao = require('../../pm/models/project_model').project;
 
 
@@ -571,4 +573,158 @@ function sortChildren(lists) {
        }
     }
 
-}
+}
+
+async function getGLJSummayDatas(projectIDs) {
+    let projects = [];
+    let names = [];
+    let prjTypeNames = [];
+    try {
+        for(let ID of projectIDs){
+            projects.push(await getProjectData(ID)) ;
+        }
+        if(projects.length == 0){
+            return [];
+        }
+        let mp = projects[0];
+        for(let p of projects){
+            names.push(p.name);
+            prjTypeNames.push(p.prjTypeName);
+            p.gljList = await getProjectGLJData(p.ID,p.unitPriceFileId,mp.property);
+        }
+
+        let mList =  mergeGLJ(mp,projects,names,prjTypeNames);
+        mList =  gljUtil.sortProjectGLJ(mList,_);
+        let summaryGLJDatas =   getSummaryGLJDatas(mList,mp.property.decimal,names,prjTypeNames);
+
+        let parentProject = await projectsModel.findOne({ID:mp.ParentID});
+        let result = {
+            prj: {},
+            SummaryAudit:{
+                "name": parentProject?parentProject.name:"",
+                "编制": mp.author,
+                "复核": mp.auditor,
+                "编制范围":mp.compilationScope
+            },
+            SummaryAuditDetail:summaryGLJDatas
+        };
+        return result;
+    }catch (e){
+        console.log(e);
+    }
+}
+
+function getSummaryGLJDatas(gljList,decimal,nameList,prjTypeNames) {
+    let datas = [],qdecimal = decimal.glj.quantity,process = decimal.process;
+    for(let tem of gljList){
+        let d = {
+            code:tem.code,
+            name:tem.name,
+            type:tem.type,
+            unit:tem.unit,
+            specs:tem.specs,
+            marketPrice:tem.marketPrice,
+            prjNames:nameList,
+            prjTypeNames:prjTypeNames,
+            quantityList:[]
+        };
+        let totalQuantity = 0;
+        for(let n of nameList){
+            let q = tem.quantityMap[n]?scMathUtil.roundForObj(tem.quantityMap[n],qdecimal):0;
+            totalQuantity = scMathUtil.roundForObj(q+totalQuantity,process);
+            d.quantityList.push(q);
+        }
+        d.totalQuantity = scMathUtil.roundForObj(totalQuantity,qdecimal);
+        datas.push(d);
+    }
+    return datas;
+
+
+}
+
+function mergeGLJ(mp,projects) {
+    let gljMap = {},gljList=[];
+    for(let g of mp.gljList){
+        g.quantityMap={};
+        g.quantityMap[mp.name] = g.quantity;
+       gljMap[gljUtil.getIndex(g)] = g;
+       gljList.push(g);
+
+    }
+    for(let i = 1;i<projects.length;i++){
+        let temList = projects[i].gljList;
+        for(let t of temList){
+            t.quantityMap={};
+            t.quantityMap[projects[i].name] = t.quantity;
+            //这里除了5个属性相同判断为同一个之外,还要判断市场价相同,才认为是同一个工料机
+            let connect_key = gljUtil.getIndex(t);
+            let g = gljMap[connect_key];
+            if(g&&g.marketPrice == t.marketPrice){
+                g.quantityMap[projects[i].name] = t.quantity;
+            }else {
+                gljMap[connect_key] = t;
+                gljList.push(t);
+            }
+        }
+    }
+    return gljList;
+}
+
+
+
+
+
+async function getProjectGLJData(projectID,unitPriceFileId,property){
+    //取项目工料机数据
+    let projectGLJDatas =  await getProjectGLJPrice(projectID,unitPriceFileId,property);
+    await calcProjectGLJQuantity(projectID,projectGLJDatas,property);
+    _.remove(projectGLJDatas.gljList,{'quantity':0});
+    return projectGLJDatas.gljList;
+}
+
+
+async function getProjectData(projectID){
+    let project = await projectsModel.findOne({ID:projectID});
+    if(!project) throw new Error(`找不到项目:${projectID}`);
+    let projectName = project.name;
+    let author='';//编制人
+    let auditor='';//审核人
+    let compilationScope='';//编制范围
+    let engineering='';//养护类别
+    if(project.property&&project.property.projectFeature){
+        for(let f of project.property.projectFeature){
+            if(f.key == 'author') author = f.value;
+            if(f.key == 'auditor') auditor = f.value;
+            if(f.key =='compilationScope') compilationScope = f.value;
+            if(f.key == 'engineering') engineering = f.value;
+        }
+    }
+    if(!(project.property&&project.property.unitPriceFile)) throw new Error(`找不到单价文件:${projectID}`);
+    let unitPriceFileId = project.property.unitPriceFile.id;
+    return {ID:projectID,name:projectName,author:author,auditor:auditor,compilationScope:compilationScope,ParentID:project.ParentID,prjTypeName:engineering,property:project.property,unitPriceFileId:unitPriceFileId}
+}
+
+async function getProjectGLJPrice(projectID,unitPriceFileId,property){
+    //取项目工料机数据
+    let calcOptions=property.calcOptions;
+    let decimalObj = property.decimal;
+    let labourCoeDatas = [];//取调整价才需要用到
+    let gljListModel = new GLJListModel();
+    let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectID, unitPriceFileId);
+    gljList = JSON.parse(JSON.stringify(gljList));
+    for(let glj of gljList){
+        let result = gljUtil.getGLJPrice(glj,{gljList:gljList},calcOptions,labourCoeDatas,decimalObj,false,_,scMathUtil);
+        glj.marketPrice = result.marketPrice;
+        glj.basePrice =  result.basePrice;
+    }
+    return {gljList:gljList,mixRatioMap:mixRatioMap};
+}
+
+async function calcProjectGLJQuantity(projectID,projectGLJDatas,property){
+    let q_decimal = property.decimal.glj.quantity;
+    let rationGLJDatas = await ration_glj_model.find({'projectID':projectID});
+    let rationDatas = await ration_model.model.find({'projectID':projectID});
+     gljUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,[],q_decimal)
+}
+
+

+ 77 - 77
modules/users/controllers/login_controller.js

@@ -63,7 +63,7 @@ class LoginController {
             }
 
             //还要判断account是否是专业版用户
-            let isPro = true;
+            // let isPro = true;
             // const userInfo = await userModel.findDataByAccount(account);
             //
             // if (userInfo && userInfo.upgrade_list !== undefined) {
@@ -75,22 +75,22 @@ class LoginController {
             //     }
             // }
             // 专业版短信验证码验证
-            if (isPro) {
-                const codeMsg = request.session.code;
-                if (codeMsg !== undefined && request.body.code !== '') {
-                    const code = codeMsg.split('_')[0];
-                    const time = codeMsg.split('_')[1];
-                    console.log(code);
-                    console.log(request.body.code);
-                    if (Date.parse(new Date())/1000 > time+60*5 || request.body.code !== code) {
-                        return response.json({error: 3, msg: '验证码错误。'});
-                    } else {
-                        delete request.session.code;
-                    }
-                } else {
-                    return response.json({error: 3, msg: '验证码错误。'});
-                }
-            }
+            // if (isPro) {
+            //     const codeMsg = request.session.code;
+            //     if (codeMsg !== undefined && request.body.code !== '') {
+            //         const code = codeMsg.split('_')[0];
+            //         const time = codeMsg.split('_')[1];
+            //         console.log(code);
+            //         console.log(request.body.code);
+            //         if (Date.parse(new Date())/1000 > time+60*5 || request.body.code !== code) {
+            //             return response.json({error: 3, msg: '验证码错误。'});
+            //         } else {
+            //             delete request.session.code;
+            //         }
+            //     } else {
+            //         return response.json({error: 3, msg: '验证码错误。'});
+            //     }
+            // }
 
             // 判断极验验证码是否通过
             const captcha = new Captcha();
@@ -170,66 +170,66 @@ class LoginController {
      * @param response
      * @returns {Promise<void>}
      */
-    async accountIsPro(request, response) {
-        let res = {
-            error: 0,
-            msg: '',
-            result: false,
-        };
-        try{
-            const account = request.body.account;
-            const password = request.body.pw;
-
-            // 根据邮箱或手机号获取账号信息
-            let userModel = new UserModel();
-            // 调用接口验证登录信息
-            let responseData = await userModel.getInfoFromSSO(account, password);
-            console.log(responseData);
-            // 先判断返回值是否为未激活状态
-            if ( responseData === '-3') {
-                throw '因邮箱未完成认证,账号未激活;去<a href="https://sso.smartcost.com.cn" target="_blank">激活</a>。';
-            }
-            responseData = JSON.parse(responseData);
-            if (typeof responseData !== 'object') {
-                throw '邮箱/手机 或 密码错误';
-            }
-
-            if (responseData.length <= 0) {
-                throw '接口返回数据错误';
-            }
-
-            // 正确登录后 存入session
-            let userData = responseData[0];
-
-            if (userData.mobile === '') {
-                return response.json({error: 2,ssoId: userData.id});
-            }
-
-            // const userInfo = await userModel.findDataByAccount(account);
-            // if (userInfo && userInfo.upgrade_list !== undefined) {
-            //     for (const ul of userInfo.upgrade_list) {
-            //         if (ul.isUpgrade === true) {
-            //             res.result = true;
-            //             res.data = userInfo.mobile;
-            //             break;
-            //         }
-            //     }
-            // } else {
-            //     res.msg = '当前未存在此用户';
-            // }
-            res.result = true;
-            // if (userInfo) {
-            //     res.data = userInfo.mobile;
-            // } else {
-                res.data = userData.mobile;
-            // }
-        } catch (err) {
-            res.error = 1;
-            res.msg = err;
-        }
-
-        response.json(res);
-    }
+    // async accountIsPro(request, response) {
+    //     let res = {
+    //         error: 0,
+    //         msg: '',
+    //         result: false,
+    //     };
+    //     try{
+    //         const account = request.body.account;
+    //         const password = request.body.pw;
+    //
+    //         // 根据邮箱或手机号获取账号信息
+    //         let userModel = new UserModel();
+    //         // 调用接口验证登录信息
+    //         let responseData = await userModel.getInfoFromSSO(account, password);
+    //         console.log(responseData);
+    //         // 先判断返回值是否为未激活状态
+    //         if ( responseData === '-3') {
+    //             throw '因邮箱未完成认证,账号未激活;去<a href="https://sso.smartcost.com.cn" target="_blank">激活</a>。';
+    //         }
+    //         responseData = JSON.parse(responseData);
+    //         if (typeof responseData !== 'object') {
+    //             throw '邮箱/手机 或 密码错误';
+    //         }
+    //
+    //         if (responseData.length <= 0) {
+    //             throw '接口返回数据错误';
+    //         }
+    //
+    //         // 正确登录后 存入session
+    //         let userData = responseData[0];
+    //
+    //         if (userData.mobile === '') {
+    //             return response.json({error: 2,ssoId: userData.id});
+    //         }
+    //
+    //         // const userInfo = await userModel.findDataByAccount(account);
+    //         // if (userInfo && userInfo.upgrade_list !== undefined) {
+    //         //     for (const ul of userInfo.upgrade_list) {
+    //         //         if (ul.isUpgrade === true) {
+    //         //             res.result = true;
+    //         //             res.data = userInfo.mobile;
+    //         //             break;
+    //         //         }
+    //         //     }
+    //         // } else {
+    //         //     res.msg = '当前未存在此用户';
+    //         // }
+    //         res.result = true;
+    //         // if (userInfo) {
+    //         //     res.data = userInfo.mobile;
+    //         // } else {
+    //             res.data = userData.mobile;
+    //         // }
+    //     } catch (err) {
+    //         res.error = 1;
+    //         res.msg = err;
+    //     }
+    //
+    //     response.json(res);
+    // }
 
 }
 

+ 1 - 1
modules/users/routes/login_route.js

@@ -19,7 +19,7 @@ module.exports = function (app) {
 // 登录操作
     router.post('/login', loginController.login);
 
-    router.post('/accountIsPro', loginController.accountIsPro);
+    // router.post('/accountIsPro', loginController.accountIsPro);
 
     // 验证码相关
     router.get('/captcha', loginController.captcha);

+ 7 - 2
public/gljUtil.js

@@ -21,6 +21,7 @@ module.exports = {
     isCommercialConcreteType:isCommercialConcreteType,
     getIndex:getIndex,
     sortRationGLJ:sortRationGLJ,
+    sortProjectGLJ:sortProjectGLJ,
     getCCSProjectGLJ:getCCSProjectGLJ,
     getBaseCCSMixRatio:getBaseCCSMixRatio
 };
@@ -64,8 +65,12 @@ function isCommercialConcreteType(type){
     return gljNodeUtil.isCommercialConcreteType(type);
 }
 
-function sortRationGLJ(type) {
-    return gljNodeUtil.sortRationGLJ(type);
+function sortRationGLJ(list) {
+    return gljNodeUtil.sortRationGLJ(list);
+}
+
+function sortProjectGLJ(list,lodash) {
+    return gljNodeUtil.sortProjectGLJ(list,lodash);
 }
 
 function getCCSProjectGLJ(unitFileID,project_id) {

+ 4 - 3
public/web/gljUtil.js

@@ -271,7 +271,7 @@ let gljUtil = {
         if(glj.is_evaluate==1){//先按是否暂估判断
             return calcOptions.calc_est;
         }
-        if(glj.type==gljType.MAIN_MATERIAL||glj.type==gljType.EQUIPMENT){//再判断是否是主材和设备
+        if(glj.type==this.gljType.MAIN_MATERIAL||glj.type==this.gljType.EQUIPMENT){//再判断是否是主材和设备
             return calcOptions.calc_main;
         }
         if(glj.unit_price.is_add==1){//再判断是否新增
@@ -310,9 +310,10 @@ let gljUtil = {
         return _.sortByAll(list, ["code"]);
     },
     //项目工料机 混凝土、砂浆、配合比排序与定额工料机不一样,同时,type取值的地方不一样
-    sortProjectGLJ:function (list) {
+    sortProjectGLJ:function (list,lodash) {
+        let lo = lodash?lodash:_;
         let specialMap = {1:-1,303:0,202:9,203:10,204:11};//,人工、机械工排在最前,混凝土、砂浆、配合比 排到最后
-        list = _.sortByAll(list, [function (item) {
+        list = lo.sortByAll(list, [function (item) {
             if(specialMap[item.unit_price.type] != undefined) return specialMap[item.unit_price.type];
             return gljUtil.getMainType(item.unit_price.type);
         }, "code"]);

+ 2 - 1
server.js

@@ -56,7 +56,8 @@ app.use(session({
 // 登录状态全局判断
 app.use(function (req, res, next) {
     let url = req.originalUrl;
-    if (/^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/cld/.test(url) || /^\/captcha/.test(url)  || /^\/accountIsPro/.test(url)) {
+    // if (/^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/cld/.test(url) || /^\/captcha/.test(url)  || /^\/accountIsPro/.test(url)) {
+    if (/^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/cld/.test(url) || /^\/captcha/.test(url)) {
         // 如果是登录页面或短信接口或cld接口则忽略判断数据
         next();
     } else {

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

@@ -111,34 +111,34 @@
         </div>
     </div>
     <!--弹出手机验证码-->
-    <div class="modal fade" id="phonepass" data-backdrop="static">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h5 class="modal-title">验证码安全登录</h5>
-                </div>
-                <div class="modal-body">
-                    <p class="">请您提供手机验证码进行安全登录。</p>
-                    <p class="">请点击“获取验证码”,验证码将发送至手机<span id="pro_mobile"></span>,注意查收。</p>
-                    <div class="form-row">
-                        <div class="form-group col-md-8">
-                            <input type="text" class="form-control" id="smsCode" placeholder="输入验证码">
-                            <div class="invalid-feedback">
-                            </div>
-                            <input type="hidden" class="form-control" id="proMobile">
-                        </div>
-                        <div class="form-group col-md-4">
-                            <button class="btn btn-primary" id="get-code2">获取验证码</button>
-                        </div>
-                    </div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <button class="btn btn-primary" id="loginPro">登录</button>
-                </div>
-            </div>
-        </div>
-    </div>
+    <!--<div class="modal fade" id="phonepass" data-backdrop="static">-->
+        <!--<div class="modal-dialog" role="document">-->
+            <!--<div class="modal-content">-->
+                <!--<div class="modal-header">-->
+                    <!--<h5 class="modal-title">验证码安全登录</h5>-->
+                <!--</div>-->
+                <!--<div class="modal-body">-->
+                    <!--<p class="">请您提供手机验证码进行安全登录。</p>-->
+                    <!--<p class="">请点击“获取验证码”,验证码将发送至手机<span id="pro_mobile"></span>,注意查收。</p>-->
+                    <!--<div class="form-row">-->
+                        <!--<div class="form-group col-md-8">-->
+                            <!--<input type="text" class="form-control" id="smsCode" placeholder="输入验证码">-->
+                            <!--<div class="invalid-feedback">-->
+                            <!--</div>-->
+                            <!--<input type="hidden" class="form-control" id="proMobile">-->
+                        <!--</div>-->
+                        <!--<div class="form-group col-md-4">-->
+                            <!--<button class="btn btn-primary" id="get-code2">获取验证码</button>-->
+                        <!--</div>-->
+                    <!--</div>-->
+                <!--</div>-->
+                <!--<div class="modal-footer">-->
+                    <!--<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>-->
+                    <!--<button class="btn btn-primary" id="loginPro">登录</button>-->
+                <!--</div>-->
+            <!--</div>-->
+        <!--</div>-->
+    <!--</div>-->
     <!-- JS. -->
     <!-- inject:js -->
     <script type="text/javascript" src="/public/web/scMathUtil.js"></script>

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

@@ -51,47 +51,47 @@ $(document).ready(function () {
                 return false;
             }
             let account = $("#inputEmail").val();
-            let pw = $("#inputPassword").val();
+            // let pw = $("#inputPassword").val();
 
             // 判断输入的邮箱/手机是否格式正确
             if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
                 // 先判断是否是专业版用户,是的话弹出短信验证
-                $.ajax({
-                    url: '/accountIsPro',
-                    type: 'post',
-                    async: true,
-                    data: {"account": account, "pw": pw},
-                    success: function (response) {
-                        if (response.error === 0) {
-                            const ispro = response.result;
-                            if (!ispro) {
+                // $.ajax({
+                //     url: '/accountIsPro',
+                //     type: 'post',
+                //     async: true,
+                //     data: {"account": account, "pw": pw},
+                //     success: function (response) {
+                //         if (response.error === 0) {
+                //             const ispro = response.result;
+                //             if (!ispro) {
                                 login(captchaObj);
-                            } else {
-                                $('#phonepass').modal('show');
-                                $('#proMobile').val(response.data);
-                                $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
-                            }
-                        } else if(response.error === 2) {
-                            $('#check_ssoId').val(response.ssoId);
-                            $('#phone').modal('show');
-                        } else {
-                            let msg = response.msg !== undefined ? response.msg : '未知错误';
-                            showError(msg, $("input"));
-                        }
-                    }
-                });
+                //             } else {
+                //                 $('#phonepass').modal('show');
+                //                 $('#proMobile').val(response.data);
+                //                 $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
+                //             }
+                //         } else if(response.error === 2) {
+                //             $('#check_ssoId').val(response.ssoId);
+                //             $('#phone').modal('show');
+                //         } else {
+                //             let msg = response.msg !== undefined ? response.msg : '未知错误';
+                //             showError(msg, $("input"));
+                //         }
+                //     }
+                // });
             } else {
                 $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
             }
         });
 
-        $('#loginPro').click(function () {
-            if ($('#smsCode').val() === '') {
-                showValidError('请输入验证码',$('#smsCode'));
-            } else {
-                login(captchaObj);
-            }
-        });
+        // $('#loginPro').click(function () {
+        //     if ($('#smsCode').val() === '') {
+        //         showValidError('请输入验证码',$('#smsCode'));
+        //     } else {
+        //         login(captchaObj);
+        //     }
+        // });
 
         $('#check-code').click(function () {
             const mobile = $("#mobile").val();
@@ -172,32 +172,32 @@ $(document).ready(function () {
         }
     });
 
-    $("#get-code2").click(function() {
-        const mobile = $("#proMobile").val();
-        if(!validMobile(mobile)){
-            return false;
-        }
-        const btn = $(this);
-        if(!btn.hasClass('disabled')){
-            $.ajax({
-                url: '/sms/code',
-                type: 'post',
-                data: { mobile: mobile, type: 3},
-                error: function() {
-                    showValidError('短信接口出错!',$('#smsCode'));
-                },
-                beforeSend: function() {
-                },
-                success: function(response) {
-                    if (response.err === 0) {
-                        codeSuccess(btn);
-                    } else {
-                        showValidError(response.msg,$('#smsCode'));
-                    }
-                }
-            });
-        }
-    });
+    // $("#get-code2").click(function() {
+    //     const mobile = $("#proMobile").val();
+    //     if(!validMobile(mobile)){
+    //         return false;
+    //     }
+    //     const btn = $(this);
+    //     if(!btn.hasClass('disabled')){
+    //         $.ajax({
+    //             url: '/sms/code',
+    //             type: 'post',
+    //             data: { mobile: mobile, type: 3},
+    //             error: function() {
+    //                 showValidError('短信接口出错!',$('#smsCode'));
+    //             },
+    //             beforeSend: function() {
+    //             },
+    //             success: function(response) {
+    //                 if (response.err === 0) {
+    //                     codeSuccess(btn);
+    //                 } else {
+    //                     showValidError(response.msg,$('#smsCode'));
+    //                 }
+    //             }
+    //         });
+    //     }
+    // });
 });
 
 function login(captchaObj) {
@@ -206,7 +206,7 @@ function login(captchaObj) {
     let geetest_challenge = $('input[name="geetest_challenge"]').val();
     let geetest_validate = $('input[name="geetest_validate"]').val();
     let geetest_seccode = $('input[name="geetest_seccode"]').val();
-    let code = $("#smsCode").val();
+    // let code = $("#smsCode").val();
 
     $.ajax({
         url: '/login',
@@ -217,11 +217,11 @@ function login(captchaObj) {
             "geetest_challenge": geetest_challenge,
             "geetest_validate": geetest_validate,
             "geetest_seccode": geetest_seccode,
-            "code": code,
+            // "code": code,
         },
         success: function (response) {
             if (response.error === 0) {
-                $('#phonepass').modal('hide');
+                // $('#phonepass').modal('hide');
                 const url = response.last_page !== null && response.last_page !== undefined && response.last_page !== '' ?
                     response.last_page : '/pm';
                 if (response.login_ask === 0) {
@@ -238,14 +238,14 @@ function login(captchaObj) {
                     $('#ver').modal('show');
                 }
             } else if(response.error === 2) {
-                $('#phonepass').modal('hide');
+                // $('#phonepass').modal('hide');
                 captchaObj.reset();
                 $('#check_ssoId').val(response.ssoId);
                 $('#phone').modal('show');
-            } else if(response.error === 3) {
-                showValidError(response.msg,$('#smsCode'));
+            // } else if(response.error === 3) {
+            //     showValidError(response.msg,$('#smsCode'));
             } else {
-                $('#phonepass').modal('hide');
+                // $('#phonepass').modal('hide');
                 let msg = response.msg !== undefined ? response.msg : '未知错误';
                 showError(msg, $("input"));
                 captchaObj.reset();
@@ -292,7 +292,7 @@ function validMobile(mobile) {
         showValidError('手机号不能为空!',$('#mobile'));
         return false;
     }
-    let mobileValid =  /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
+    let mobileValid =  /^1[3456789]\d{9}$/;
     if(!mobileValid.test(mobile)){
         showValidError('手机号码格式有误!',$('#mobile'));
         return false;