| | |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item |
| | | label="身份证号" |
| | | label="身份证号" prop="idCard" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | > |
| | | <el-input |
| | |
| | | updateDbTableStatus, |
| | | } from "@/api/baseLibrary"; |
| | | import { getCameraFaceData } from "@/api/es"; |
| | | // import { checkIDCard } from "@/api/utils"; |
| | | import { isIDCard } from "../../../scripts/validate"; |
| | | |
| | | import axios from "axios"; |
| | | import UploadBtn from "./upload"; |
| | | import fTemplate from "@/components/fTemplate"; |
| | |
| | | ); |
| | | return fmt; |
| | | }; |
| | | |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | }, |
| | | rules: { |
| | | picDesc: [ |
| | | { required: true, message: "请输入照片标识", trigger: "change" }, |
| | | { required: true, message: "请输入照片标识", trigger: "change" } |
| | | ], |
| | | sex: [{ required: true, message: "请勾选性别", trigger: "change" }], |
| | | idCard:[{ validator: isIDCard, trigger: 'blur' }], |
| | | monitorLevel: [ |
| | | { required: true, message: "请选择人员等级", trigger: "change" }, |
| | | ], |
| | |
| | | }
|
| | | });
|
| | | const url = this.curUser.backgroundpic;
|
| | | this.activeIcons = this.curUser.useIconType
|
| | | this.activeIcons = this.curUser.useIconType-1
|
| | | if (url) {
|
| | | // const arr = url.split("/");
|
| | | this.activeBg = this.tableBGList.findIndex((x) => {
|
| | |
| | | }).then((res) => {
|
| | | if (res.success) {
|
| | | sessionStorage.setItem("userInfo", JSON.stringify(res.data))
|
| | | debugger
|
| | | this.$message.success(res.msg);
|
| | | }
|
| | | });
|
| | |
| | | if (res.success) {
|
| | | window.parent.postMessage({ msg: "AppUpdate" }, "*");
|
| | | sessionStorage.setItem("userInfo", JSON.stringify(res.data))
|
| | | debugger
|
| | | this.$message.success(res.msg);
|
| | | }
|
| | | });
|
| | |
| | | return callback(new Error('输入的手机号错误')) |
| | | } |
| | | |
| | | export function isIDCard(rule, idcode, callback) { |
| | | // if (!value) { |
| | | // return callback(new Error('输入不可以为空')); |
| | | // } |
| | | var weight_factor = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]; |
| | | var check_code = ['1', '0', 'X' , '9', '8', '7', '6', '5', '4', '3', '2']; |
| | | |
| | | var code = idcode + ""; |
| | | var last = idcode[17];//最后一位 |
| | | |
| | | var seventeen = code.substring(0,17); |
| | | |
| | | var arr = seventeen.split(""); |
| | | var len = arr.length; |
| | | var num = 0; |
| | | for(var i = 0; i < len; i++){ |
| | | num = num + +arr[i] * weight_factor[i]; |
| | | } |
| | | |
| | | var resisue = num%11; |
| | | var last_no = check_code[resisue]; |
| | | |
| | | var idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/; |
| | | |
| | | var format = idcard_patter.test(idcode); |
| | | return last === last_no && format ? callback() : callback(new Error('身份证号格式错误')); |
| | | } |
| | | |
| | | export function isIPv4(rule, value, callback) { |
| | | if (!value) { |
| | | return callback(new Error('输入不可以为空')); |