yanghb
2023-04-21 0481353111afb43a2322e18530dde26f1d841ead
ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tDriver/yesDriver_info.js
@@ -22,49 +22,49 @@
                }
            }
        },
        // driveCard: {
        //     validators: {
        //         notEmpty: {
        //             message: '驾驶证号码不能为空'
        //         }
        //     }
        // },
        // driverAge: {
        //     validators: {
        //         notEmpty: {
        //             message: '驾龄不能为空'
        //         },
        //         regexp: {
        //             regexp: /^[0-9]\d*$/,
        //             message: '驾龄格式不正确'
        //         }
        //     }
        // },
        // idCard: {
        //     validators: {
        //         notEmpty: {
        //             message: '身份证号不能为空'
        //         },
        //         regexp: {
        //             regexp: /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/,
        //             message: '身份证号格式不正确'
        //         }
        //     }
        // },
        // driverAddress: {
        //     validators: {
        //         notEmpty: {
        //             message: '居住地址不能为空'
        //         }
        //     }
        // },
        // taxiAptitudeCard: {
        //     validators: {
        //         notEmpty: {
        //             message: '出租车资格证号不能为空'
        //         }
        //     }
        // },
        driveCard: {
            validators: {
                notEmpty: {
                    message: '驾驶证号码不能为空'
                }
            }
        },
        driverAge: {
            validators: {
                notEmpty: {
                    message: '驾龄不能为空'
                },
                regexp: {
                    regexp: /^[0-9]\d*$/,
                    message: '驾龄格式不正确'
                }
            }
        },
        idCard: {
            validators: {
                notEmpty: {
                    message: '身份证号不能为空'
                },
                regexp: {
                    regexp: /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/,
                    message: '身份证号格式不正确'
                }
            }
        },
        driverAddress: {
            validators: {
                notEmpty: {
                    message: '居住地址不能为空'
                }
            }
        },
        taxiAptitudeCard: {
            validators: {
                notEmpty: {
                    message: '出租车资格证号不能为空'
                }
            }
        },
       /* account: {
            validators: {
                notEmpty: {
@@ -74,6 +74,9 @@
        },*/
        password: {
            validators: {
                notEmpty: {
                    message: '密码不能为空'
                },
                regexp:{
                    regexp: /^.{6,18}$/,
                    message: '密码长度为6-18'
@@ -86,6 +89,9 @@
        },
        rePassword: {
            validators: {
                notEmpty: {
                    message: '密码不能为空'
                },
                regexp:{
                    regexp: /^.{6,18}$/,
                    message: '密码长度为6-18'
@@ -96,169 +102,169 @@
                },
            }
        },
        // remark: {
        //     validators: {
        //         notEmpty: {
        //             message: '操作备注不能为空'
        //         }
        //     }
        // }
        //
        // ,
        // driverNationality: {
        //     validators: {
        //         notEmpty: {
        //             message: '国籍不能为空'
        //         }
        //     }
        // },
        // driverNation: {
        //     validators: {
        //         notEmpty: {
        //             message: '民族不能为空'
        //         }
        //     }
        // },
        // driverLanguageLevel: {
        //     validators: {
        //         notEmpty: {
        //             message: '外语能力不能为空'
        //         }
        //     }
        // },
        // driverEducation: {
        //     validators: {
        //         notEmpty: {
        //             message: '学历不能为空'
        //         }
        //     }
        // },
        // driverCensus: {
        //     validators: {
        //         notEmpty: {
        //             message: '户口登记机关名称不能为空'
        //         }
        //     }
        // },
        // driverAddress: {
        //     validators: {
        //         notEmpty: {
        //             message: '户口地址不能为空'
        //         }
        //     }
        // },
        // driverContactAddress: {
        //     validators: {
        //         notEmpty: {
        //             message: '通信地址不能为空'
        //         }
        //     }
        // },
        // getDriverLicenseDate: {
        //     validators: {
        //         notEmpty: {
        //             message: '初次领取驾驶证日期不能为空'
        //         }
        //     }
        // },
        // driverLicenseOn: {
        //     validators: {
        //         notEmpty: {
        //             message: '驾驶证有效期限起不能为空'
        //         }
        //     }
        // },
        // driverLicenseOff: {
        //     validators: {
        //         notEmpty: {
        //             message: '驾驶证有效期限止不能为空'
        //         }
        //     }
        // },
        // networkCarlssueOrganization: {
        //     validators: {
        //         notEmpty: {
        //             message: '网络预约出租车驾驶员证发证机构不能为空'
        //         }
        //     }
        // },
        // networkCarlssueDate: {
        //     validators: {
        //         notEmpty: {
        //             message: '资格证发证日期不能为空'
        //         }
        //     }
        // },
        // getNetworkCarProofDate: {
        //     validators: {
        //         notEmpty: {
        //             message: '初次认领资格证日期不能为空'
        //         }
        //     }
        // },
        // networkCarProofOn: {
        //     validators: {
        //         notEmpty: {
        //             message: '资格证有效起始日期不能为空'
        //         }
        //     }
        // },
        // networkCarProofOff: {
        //     validators: {
        //         notEmpty: {
        //             message: '资格证有效截至日期不能为空'
        //         }
        //     }
        // },
        // registerDate: {
        //     validators: {
        //         notEmpty: {
        //             message: '报备日期不能为空'
        //         }
        //     }
        // },
        // contractCompany: {
        //     validators: {
        //         notEmpty: {
        //             message: '驾驶员合同签署公司不能为空'
        //         }
        //     }
        // },
        // contractOn: {
        //     validators: {
        //         notEmpty: {
        //             message: '合同有效期起不能为空'
        //         }
        //     }
        // },
        // contractOff: {
        //     validators: {
        //         notEmpty: {
        //             message: '合同有效期止不能为空'
        //         }
        //     }
        // },
        // emergencyContact: {
        //     validators: {
        //         notEmpty: {
        //             message: '紧急联系人不能为空'
        //         }
        //     }
        // },
        // emergencyContactPhone: {
        //     validators: {
        //         notEmpty: {
        //             message: '紧急联系电话不能为空'
        //         }
        //     }
        // },
        // emergencyContactAddress: {
        //     validators: {
        //         notEmpty: {
        //             message: '紧急联系地址不能为空'
        //         }
        //     }
        // }
        remark: {
            validators: {
                notEmpty: {
                    message: '操作备注不能为空'
                }
            }
        }
        ,
        driverNationality: {
            validators: {
                notEmpty: {
                    message: '国籍不能为空'
                }
            }
        },
        driverNation: {
            validators: {
                notEmpty: {
                    message: '民族不能为空'
                }
            }
        },
        driverLanguageLevel: {
            validators: {
                notEmpty: {
                    message: '外语能力不能为空'
                }
            }
        },
        driverEducation: {
            validators: {
                notEmpty: {
                    message: '学历不能为空'
                }
            }
        },
        driverCensus: {
            validators: {
                notEmpty: {
                    message: '户口登记机关名称不能为空'
                }
            }
        },
        driverAddress: {
            validators: {
                notEmpty: {
                    message: '户口地址不能为空'
                }
            }
        },
        driverContactAddress: {
            validators: {
                notEmpty: {
                    message: '通信地址不能为空'
                }
            }
        },
        getDriverLicenseDate: {
            validators: {
                notEmpty: {
                    message: '初次领取驾驶证日期不能为空'
                }
            }
        },
        driverLicenseOn: {
            validators: {
                notEmpty: {
                    message: '驾驶证有效期限起不能为空'
                }
            }
        },
        driverLicenseOff: {
            validators: {
                notEmpty: {
                    message: '驾驶证有效期限止不能为空'
                }
            }
        },
        networkCarlssueOrganization: {
            validators: {
                notEmpty: {
                    message: '网络预约出租车驾驶员证发证机构不能为空'
                }
            }
        },
        networkCarlssueDate: {
            validators: {
                notEmpty: {
                    message: '资格证发证日期不能为空'
                }
            }
        },
        getNetworkCarProofDate: {
            validators: {
                notEmpty: {
                    message: '初次认领资格证日期不能为空'
                }
            }
        },
        networkCarProofOn: {
            validators: {
                notEmpty: {
                    message: '资格证有效起始日期不能为空'
                }
            }
        },
        networkCarProofOff: {
            validators: {
                notEmpty: {
                    message: '资格证有效截至日期不能为空'
                }
            }
        },
        registerDate: {
            validators: {
                notEmpty: {
                    message: '报备日期不能为空'
                }
            }
        },
        contractCompany: {
            validators: {
                notEmpty: {
                    message: '驾驶员合同签署公司不能为空'
                }
            }
        },
        contractOn: {
            validators: {
                notEmpty: {
                    message: '合同有效期起不能为空'
                }
            }
        },
        contractOff: {
            validators: {
                notEmpty: {
                    message: '合同有效期止不能为空'
                }
            }
        },
        emergencyContact: {
            validators: {
                notEmpty: {
                    message: '紧急联系人不能为空'
                }
            }
        },
        emergencyContactPhone: {
            validators: {
                notEmpty: {
                    message: '紧急联系电话不能为空'
                }
            }
        },
        emergencyContactAddress: {
            validators: {
                notEmpty: {
                    message: '紧急联系地址不能为空'
                }
            }
        }
    }
};
@@ -286,10 +292,7 @@
 * @param val 数据的具体值
 */
YesDriverInfoDlg.set = function(key, val) {
    var v = $("#" + key).val();
    if('' != v){
        this.yesDriverInfoData[key] = (typeof val == "undefined") ? v : val;
    }
    this.yesDriverInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}
@@ -376,6 +379,7 @@
    .set('insertUser')
    .set('updateTime')
    .set('updateUser')
    .set('mchtNo')
    .set('addType');
}
@@ -388,10 +392,6 @@
    this.collectData();
    if(!this.validate()){
        return ;
    }
    if(this.yesDriverInfoData.password == ''){
        Feng.error("登录密码不能为空");
        return
    }
    var roleType = $("#roleType").val();  //1=平台  2=分公司 3=加盟商
    var companyType = $("input[name='companyType']:checked").val();
@@ -411,26 +411,16 @@
        Feng.info("请上传头像");
        return;
    }
    // var faceImgUrl = $("#faceImgUrl").val();
    // if ("" == faceImgUrl){
    //     Feng.info("请上传人脸识别照片");
    //     return;
    // }
    // var driveCardImgUrl = $("#driveCardImgUrl").val();
    // if ("" == driveCardImgUrl){
    //     Feng.info("请上传驾驶证照片");
    //     return;
    // }
    // var idCardImgUrl1 = $("#idCardImgUrl1").val();
    // if ("" == idCardImgUrl1){
    //     Feng.info("请上传身份证正面照片");
    //     return;
    // }
    // var idCardImgUrl2 = $("#idCardImgUrl2").val();
    // if ("" == idCardImgUrl2){
    //     Feng.info("请上传身份证背面照片");
    //     return;
    // }
    var faceImgUrl = $("#faceImgUrl").val();
    if ("" == faceImgUrl){
        Feng.info("请上传人脸识别照片");
        return;
    }
    var driveCardImgUrl = $("#driveCardImgUrl").val();
    if ("" == driveCardImgUrl){
        Feng.info("请上传驾驶证照片");
        return;
    }
    var serverBox =[];
    $('input[name="serverBox"]:checked').each(function(){
        serverBox.push($(this).val());
@@ -454,6 +444,11 @@
            return;
        }
    }
    this.yesDriverInfoData.idCard = encryptAES(this.yesDriverInfoData.idCard);
    this.yesDriverInfoData.phone = encryptAES(this.yesDriverInfoData.phone);
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tDriver/add", function(data){
        if ("error" == data) {
@@ -500,6 +495,10 @@
    if(!this.validate()){
        return ;
    }
    this.yesDriverInfoData.idCard = encryptAES(this.yesDriverInfoData.idCard);
    this.yesDriverInfoData.phone = encryptAES(this.yesDriverInfoData.phone);
    var roleType = $("#roleType").val();  //1=平台  2=分公司 3=加盟商
    var companyType = $("input[name='companyType']:checked").val();
    if (1 == roleType){
@@ -517,26 +516,16 @@
        Feng.info("请上传头像");
        return;
    }
    // var faceImgUrl = $("#faceImgUrl").val();
    // if ("" == faceImgUrl){
    //     Feng.info("请上传人脸识别照片");
    //     return;
    // }
    // var driveCardImgUrl = $("#driveCardImgUrl").val();
    // if ("" == driveCardImgUrl){
    //     Feng.info("请上传驾驶证照片");
    //     return;
    // }
    // var idCardImgUrl1 = $("#idCardImgUrl1").val();
    // if ("" == idCardImgUrl1){
    //     Feng.info("请上传身份证正面照片");
    //     return;
    // }
    // var idCardImgUrl2 = $("#idCardImgUrl2").val();
    // if ("" == idCardImgUrl2){
    //     Feng.info("请上传身份证背面照片");
    //     return;
    // }
    var faceImgUrl = $("#faceImgUrl").val();
    if ("" == faceImgUrl){
        Feng.info("请上传人脸识别照片");
        return;
    }
    var driveCardImgUrl = $("#driveCardImgUrl").val();
    if ("" == driveCardImgUrl){
        Feng.info("请上传驾驶证照片");
        return;
    }
    var serverBox =[];
    $('input[name="serverBox"]:checked').each(function(){
        serverBox.push($(this).val());
@@ -596,6 +585,44 @@
    ajax.start();
}
var key = CryptoJS.enc.Utf8.parse("xqT86jictTPpHMem");
var iv = CryptoJS.enc.Utf8.parse("xqT86jicxqT86jic");
//aes加密
function encryptAES(context) {
    if(null == context || '' == context){
        return context;
    }
    var encrypted = '';
    if (typeof(context) == 'string') {
    }else if(typeof(context) == 'object'){
        context = JSON.stringify(context);
    }
    var srcs = CryptoJS.enc.Utf8.parse(context);
    encrypted = CryptoJS.AES.encrypt(srcs, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    });
    return encrypted.toString();
}
// aes解密
function decryptAES(context) {
    if(null == context || '' == context){
        return context;
    }
    var decrypt = CryptoJS.AES.decrypt(context, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    });
    var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
    return decryptedStr.toString();
}
$(function() {
    Feng.initValidator("yesDriverInfoForm", YesDriverInfoDlg.validateFields);
    // 初始化图片上传
@@ -611,12 +638,6 @@
    var networkCarlssueImg = new $WebUpload("networkCarlssueImg");
    networkCarlssueImg.setUploadBarId("progressBar");
    networkCarlssueImg.init();
    var idCardImgUrl1 = new $WebUpload("idCardImgUrl1");
    idCardImgUrl1.setUploadBarId("progressBar");
    idCardImgUrl1.init();
    var idCardImgUrl2 = new $WebUpload("idCardImgUrl2");
    idCardImgUrl2.setUploadBarId("progressBar");
    idCardImgUrl2.init();
});
/**