Commit 8d576781 authored by Luochenglong's avatar Luochenglong Committed by 邓乾隆

证件类型校验

parent 0b53f655
......@@ -31,6 +31,7 @@
var employee_type_id = '${/model/modify_user/record/@employee_type_id}';
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_role');
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var address_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_address');
......@@ -52,11 +53,9 @@
bp_record.getField('unit_id_n').setRequired(true);
}
}
if ('${/parameter/@bp_type}' == 'AGENT') {
bp_record.getField('agent_type_n').setReadOnly(false);
// bp_record.getField('agent_type_n').setRequired(true);
} else {
bp_record.getField('agent_type_n').setReadOnly(true);
// bp_record.getField('agent_type_n').setRequired(false);
......@@ -196,7 +195,8 @@
}
};
//法人供应商经办人身份证号非必填 18083 2022/11/28
//法人供应商经办人身份证号非必填 18083 2022/12/1
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
var sign_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_SIGNER', 'hls_bp_master_signer');
......@@ -211,6 +211,7 @@
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
//第三方创建页面隐藏角色新增按钮
debugger;
......@@ -272,7 +273,6 @@
if (ds.fields.parent_id) {
record.getField('parent_id_n').setReadOnly(true);
}
if (record.get('bp_class') && record.get('bp_class') == 'ORG') {
if (record.get('invoice_method') == 'BILLING') {
record.getField('taxpayer_type').setRequired(true);
......@@ -317,6 +317,7 @@
//设置开票类型为纸质只读
record.set('invoice_type','PAPER');
record.set('invoice_type_n','纸质发票');
//取消开票类型为纸质只读 18083
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
record.getField('invoice_type').setRequired(false);
......@@ -794,20 +795,128 @@
var gird_ds_id = 'BP_NP_CREATE_BP_ASSETS01_hls_bp_assets_ds';
var gird_ds_id2 = 'BP_NP_CREATE_BP_ASSETS04_hls_bp_assets_ds';
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
//学历学位校验 add 20230710
if(name=='academic_background'||name=='degrees') {
var academic_background = record.get('academic_background');
var degrees = record.get('degrees');
if(!Ext.isEmpty(academic_background)&& !Ext.isEmpty(degrees)){
if ((academic_background == '1' && degrees != '1'&& degrees != '2'&& degrees != '3') ||
(academic_background == '2' && degrees != '4')||
((academic_background == '3'||academic_background == '4'||academic_background == '5'||academic_background == '6'||academic_background == '7'||academic_background == '8') && (degrees != '5'))){
Leaf.showMessage('提示', '请正确填写学位和学历');
setTimeout(function () {
if(name=='academic_background'){
record.set('degrees', '');
record.set('degrees_n', '');
}else if(name=='degrees'){
record.set('academic_background', '');
record.set('academic_background_n', '');
}
}, 20);
return false;
}
if(bank_flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
}
}
}
//新增校验,承租人(法人)和担保人(法人)商业伙伴的创建,银行账号信息都是要必填(为电子签约做准备)
if(head_record.get('bp_class')=='ORG'){
if(head_record.get('bp_type')=='TENANT' || head_record.get('bp_type')=='GUTA_ORG'){
var bank_flag=true;
if(bank_record.length==0){
bank_flag=false;
if(bank_flag==false){
Leaf.showErrorMessage('${l:PROMPT}','请在银行账户信息中维护[银行账号信息]!');
return false;
}
}
}
}
//许可证有效期校验
if (name == 'due_date') {
var lastday = new Date('2099-12-31');
if (value >lastday) {
Leaf.showMessage('${l:PROMPT}', '营业许可证到期日最大不得超过2099-12-31');
setTimeout(function () {
record.set('due_date', '');
}, 20);
}
}
if (name == 'due_box') {
if (value == 'Y') {
record.set('due_date', '2099-12-31');
}else if(value == 'N'){
record.set('due_date', '');
}
}
//邮编校验 add by 20230619
if(name=='zipcode'|| name=='work_unit_zip') {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
if (!(/^[0-9]{6}$/.test(value)) && value) {
Leaf.showMessage('提示', '请正确填写邮编', function () {
record.set(name, '');
});
}
}
//单位性质和职业校验 20230420
if (name == 'unit_properties' || name == 'occuption') {
debugger
var unit_properties = record.get('unit_properties');
var occuption = record.get('occuption');
if (unit_properties == '30' || unit_properties == '40' || unit_properties == '50') {
if (occuption == '0' || occuption == 'X') {
//当单位性质为“30-外资企业”、“40-个体、私营企业”、“50-其他“时,职业不能为“0-国家机关、党群组织、企业、事业单位负责人”、“X-军人”
Leaf.showMessage('提示', '当单位性质为“外资企业”、“个体、私营企业”、“其他“时,职业不能为“国家机关、党群组织、企业、事业单位负责人”、“军人”。', null, 500, 100);
if(name == 'unit_properties' ){
record.set('occuption','');
record.set('occuption_n','');
}
if(name == 'occuption' ){
record.set('unit_properties','');
record.set('unit_properties_n','');
}
}
}
}
//征信add start 中征码校验
if (record.get('bp_class') == 'ORG') {
if(record.get('bp_type') == 'TENANT'){
//if(record.get('bp_type') == 'TENANT'){
var credit_code = record.get('credit_code');
if (!Leaf.isEmpty(credit_code)) {
//去除空格
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
Leaf.showMessage('提示', '中征码首字母需要大写');
// if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
// Leaf.showMessage('提示', '中征码首字母需要大写');
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// setTimeout(function () {
// record.set('credit_code', '');
// }, 20);
// return false;
//
// }else {
// return true;
// }
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}else {
......@@ -816,10 +925,13 @@
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}
}
}
//}
}
if (name == 'org_type') {
......@@ -838,8 +950,8 @@
record.getField('enterprise_scale_n').setRequired(true);
}
}
//法人承租人添加 法人姓名和法人身份证号 时,更新企业关联信息的法人数据
var company_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_company_info');
//法人承租人company_ds_id添加 法人姓名和法人身份证号 时,更新企业关联信息的法人数据
var company_ds_id= get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_company_info');
if((name == 'legal_person'|| name == 'id_card_no_leg')){
var records_company = $(company_ds_id).getAll();
for(var i=0;i<records_company.length;i++){
......@@ -857,6 +969,193 @@
}
}
}
if(company_ds_id=ds.id){
if (name == 'id_type' && value) {
if (value == '110'&&record.get('associate_id_no')) {
var associate_id_no =record.get('associate_id_no');
if (!checkCard(associate_id_no)) {
Leaf.showMessage('提示', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else if (associate_id_no.length == 18) {
new_id_card = record.get('associate_id_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(associate_id_no.substr(6, 4) + '/' + associate_id_no.substr(10, 2) + '/' + associate_id_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - associate_id_no.substr(6, 4));
if (associate_id_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (associate_id_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == '140'&&record.get('associate_id_no')){
//护照
var associate_id_no =record.get('associate_id_no');
if (!Leaf.isEmpty(associate_id_no)) {
associate_id_no = associate_id_no.trim();
associate_id_no = associate_id_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=associate_id_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(associate_id_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(value == '210'&&record.get('associate_id_no')){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(value == '220'&&record.get('associate_id_no')){
//护照
var soc_code =record.get('associate_id_no');
if (soc_code) {
if (!CheckSocialCreditCode(soc_code)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
if (name == 'associate_id_no'&&value) {
if (record.get('id_type') == '110') {
if (!checkCard(value)) {
Leaf.showMessage('${l:HLS.PROMPT}', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else {
if (value.length == 18) {
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (value.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}
}else if(record.get('id_type') == '140'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(record.get('id_type') == '210'&&value){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
if (value.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < value.length && i < 16; i++) {
financeCode[i] = value.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(record.get('id_type') == '220'&&value){
//护照
var soc_code =record.get('associate_id_no');
if (value) {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
}
//出资人 出资比例必填
if(name == 'other_relationships'){
if(value == '2'){
......@@ -959,6 +1258,56 @@
record.getField('parent_id_n').setReadOnly(true);
}
}
if (name == 'id_type' && value) {
if (value == 'ID_CARD'&&record.get('id_card_no')) {
var id_card_no =record.get('id_card_no');
if (!checkCard(id_card_no)) {
Leaf.showMessage('提示', '个人身份证号错误!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
} else if (id_card_no.length == 18) {
new_id_card = record.get('id_card_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_card_no.substr(6, 4) + '/' + id_card_no.substr(10, 2) + '/' + id_card_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_card_no.substr(6, 4));
if (id_card_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_card_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_card_no')){
//护照
var id_card_no =record.get('id_card_no');
if (!Leaf.isEmpty(id_card_no)) {
id_card_no = id_card_no.trim();
id_card_no = id_card_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_card_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_card_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
}
if (name == 'id_card_no') {
// record = $(hls_bp_master_ds_id).getCurrentRecord();
// var id_num = record.get('id_card_no');
......@@ -988,11 +1337,84 @@
}
}
}else if(record.get('id_type') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
// ds.fields.id_card_no.pro.validator = id_card_no_validate;
//自动带出籍贯
// record.set('resident_addres', get_native_place(value))
}
if (name == 'card_type_sp' && value) {
if (value == 'ID_CARD'&&record.get('id_no_sp')) {
var id_no_sp =record.get('id_no_sp');
if (!checkCard(id_no_sp)) {
Leaf.showMessage('提示', '配偶信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
} else if (id_no_sp.length == 18) {
new_id_card = record.get('id_no_sp');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_no_sp.substr(6, 4) + '/' + id_no_sp.substr(10, 2) + '/' + id_no_sp.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_no_sp.substr(6, 4));
if (id_no_sp.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_no_sp.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_no_sp')){
//护照
var id_no_sp =record.get('id_no_sp');
if (!Leaf.isEmpty(id_no_sp)) {
id_no_sp = id_no_sp.trim();
id_no_sp = id_no_sp.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_no_sp.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_no_sp)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
}
if (name == 'id_no_sp' && value) {
if (!value) {
......@@ -1011,6 +1433,27 @@
record.set('date_of_birth_sp', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
}
}
}else if(record.get('card_type_sp') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '配偶护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
// ds.fields.id_no_sp.pro.validator = id_card_no_validate;
// record.set('resident_addres_sp', get_native_place(value))
......
......@@ -510,7 +510,8 @@
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds,line_record) {
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, line_record) {
var dsId = ds.id;
var base_table_temp = 'hls_bp_master_role_ds';
if (dsId.substring(dsId.length - base_table_temp.length, dsId.length) == base_table_temp) {
......@@ -533,7 +534,7 @@
}
}
}
//法人供应商非必填 18083 2022/11/25
//法人供应商非必填 18083 2022/12/01
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
var sign_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_SIGNER', 'hls_bp_master_signer');
var bp_record=$(bp_ds_id).getCurrentRecord();
......@@ -558,7 +559,7 @@
}
}
}
//法人供应商非必填 18083 2022/11/25
//法人供应商非必填 2022/12/1 18083
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
var sign_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_SIGNER', 'hls_bp_master_signer');
var bp_record=$(bp_ds_id).getCurrentRecord();
......@@ -648,20 +649,49 @@
}
}
}
debugger;
if('${/parameter/@function_usage}'=='QUERY'){
if(record.get('bp_type') == 'RENTER' || record.get('bp_type') == 'MAN_FACTURER' || record.get('bp_type')=='ASSET_REGULATOR'){
record.getField('phone').setRequired(false);
record.getField('cell_phone').setRequired(false);
record.getField('due_date').setRequired(false);
record.getField('registered_place').setRequired(false);
record.getField('org_unit_property').setRequired(false);
record.getField('org_unit_property_n').setRequired(false);
}
}
}
//中征码校验
if (record.get('bp_class') == 'ORG') {
if(record.get('bp_type') == 'TENANT' && name =='credit_code'){
//if(record.get('bp_type') == 'TENANT' && name =='credit_code'){
var credit_code = record.get('credit_code');
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
Leaf.showMessage('提示', '中征码首字母需要大写');
// if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
// Leaf.showMessage('提示', '中征码首字母需要大写');
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// setTimeout(function () {
// record.set('credit_code', '');
// }, 20);
// return false;
//
// }else {
// return true;
// }
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}else {
......@@ -670,10 +700,13 @@
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}
}
}
//}
}
if (gird_ds_id == ds.id || gird_ds_id2 == ds.id) {
......@@ -799,6 +832,255 @@
}
}
var company_ds_id= get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_company_info');
if(company_ds_id=ds.id){
if (name == 'id_type' && value) {
if (value == '110'&&record.get('associate_id_no')) {
var associate_id_no =record.get('associate_id_no');
if (!checkCard(associate_id_no)) {
Leaf.showMessage('提示', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else if (associate_id_no.length == 18) {
new_id_card = record.get('associate_id_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(associate_id_no.substr(6, 4) + '/' + associate_id_no.substr(10, 2) + '/' + associate_id_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - associate_id_no.substr(6, 4));
if (associate_id_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (associate_id_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == '140'&&record.get('associate_id_no')){
//护照
var associate_id_no =record.get('associate_id_no');
if (!Leaf.isEmpty(associate_id_no)) {
associate_id_no = associate_id_no.trim();
associate_id_no = associate_id_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=associate_id_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(associate_id_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(value == '210'&&record.get('associate_id_no')){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(value == '220'&&record.get('associate_id_no')){
//护照
var soc_code =record.get('associate_id_no');
if (soc_code) {
if (!CheckSocialCreditCode(soc_code)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
if (name == 'associate_id_no'&&value) {
if (record.get('id_type') == '110') {
if (!checkCard(value)) {
Leaf.showMessage('${l:HLS.PROMPT}', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else {
if (value.length == 18) {
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (value.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}
}else if(record.get('id_type') == '140'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(record.get('id_type') == '210'&&value){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
if (value.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < value.length && i < 16; i++) {
financeCode[i] = value.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(record.get('id_type') == '220'&&value){
//护照
var soc_code =record.get('associate_id_no');
if (value) {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
}
//法人身份证号校验
if (name == 'id_card_no_leg' && value){
var id_card_no_leg = record.get('id_card_no_leg');
if (!checkCard(id_card_no_leg)) {
Leaf.showMessage('${l:HLS.PROMPT}', '法人代表身份证号格式错误!');
setTimeout(function () {
record.set('id_card_no_leg', '');
}, 20);
return false;
}
}
if (name == 'id_type' && value) {
if (value == 'ID_CARD'&&record.get('id_card_no')) {
var id_card_no =record.get('id_card_no');
if (!checkCard(id_card_no)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
} else if (id_card_no.length == 18) {
new_id_card = record.get('id_card_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_card_no.substr(6, 4) + '/' + id_card_no.substr(10, 2) + '/' + id_card_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_card_no.substr(6, 4));
if (id_card_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_card_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_card_no')){
//护照
var id_card_no =record.get('id_card_no');
if (!Leaf.isEmpty(id_card_no)) {
id_card_no = id_card_no.trim();
id_card_no = id_card_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_card_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_card_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
}
if (name == 'id_card_no' && value) {
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
......@@ -822,6 +1104,77 @@
}
}
}else if(record.get('id_type') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
}
if (name == 'card_type_sp' && value) {
if (value == 'ID_CARD'&&record.get('id_no_sp')) {
var id_no_sp =record.get('id_no_sp');
if (!checkCard(id_no_sp)) {
Leaf.showMessage('提示', '配偶信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
} else if (id_no_sp.length == 18) {
new_id_card = record.get('id_no_sp');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_no_sp.substr(6, 4) + '/' + id_no_sp.substr(10, 2) + '/' + id_no_sp.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_no_sp.substr(6, 4));
if (id_no_sp.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_no_sp.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_no_sp')){
//护照
var id_no_sp =record.get('id_no_sp');
if (!Leaf.isEmpty(id_no_sp)) {
id_no_sp = id_no_sp.trim();
id_no_sp = id_no_sp.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_no_sp.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_no_sp)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
}
......@@ -851,6 +1204,27 @@
}*/
}
}else if(record.get('card_type_sp') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '配偶护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
}
......@@ -924,13 +1298,6 @@
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
if (ds.id == f_bp_create_ds_id) {
if (name == 'due_box') {
if (value == 'Y') {
record.set('due_date', '2099-12-31');
}else if(value == 'N'){
record.set('due_date', '');
}
}
var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
record = $(hd_ds).getCurrentRecord();
......
......@@ -688,15 +688,33 @@
//中征码校验
if (record.get('bp_class') == 'ORG') {
if(record.get('bp_type') == 'TENANT' && name =='credit_code'){
//if(record.get('bp_type') == 'TENANT' && name =='credit_code'){
var credit_code = record.get('credit_code');
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
Leaf.showMessage('提示', '中征码首字母需要大写');
// if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
// Leaf.showMessage('提示', '中征码首字母需要大写');
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// setTimeout(function () {
// record.set('credit_code', '');
// }, 20);
// return false;
//
// }else {
// return true;
// }
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}else {
......@@ -705,10 +723,13 @@
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('credit_code', '');
}, 20);
return false;
}
}
}
//}
}
if (gird_ds_id == ds.id || gird_ds_id2 == ds.id) {
if (name == 'relationship_with_bp') {
......@@ -858,6 +879,67 @@
}
}
//法人身份证号校验
if (name == 'id_card_no_leg' && value){
var id_card_no_leg = record.get('id_card_no_leg');
if (!checkCard(id_card_no_leg)) {
Leaf.showMessage('${l:HLS.PROMPT}', '法人代表身份证号格式错误!');
setTimeout(function () {
record.set('id_card_no_leg', '');
}, 20);
return false;
}
}
if (name == 'id_type' && value) {
if (value == 'ID_CARD'&&record.get('id_card_no')) {
var id_card_no =record.get('id_card_no');
if (!checkCard(id_card_no)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
} else if (id_card_no.length == 18) {
new_id_card = record.get('id_card_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_card_no.substr(6, 4) + '/' + id_card_no.substr(10, 2) + '/' + id_card_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_card_no.substr(6, 4));
if (id_card_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_card_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_card_no')){
//护照
var id_card_no =record.get('id_card_no');
if (!Leaf.isEmpty(id_card_no)) {
id_card_no = id_card_no.trim();
id_card_no = id_card_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_card_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_card_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
}
if (name == 'id_card_no' && value) {
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
......@@ -881,6 +963,77 @@
}
}
}else if(record.get('id_type') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
}
}
}
if (name == 'card_type_sp' && value) {
if (value == 'ID_CARD'&&record.get('id_no_sp')) {
var id_no_sp =record.get('id_no_sp');
if (!checkCard(id_no_sp)) {
Leaf.showMessage('提示', '配偶信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
} else if (id_no_sp.length == 18) {
new_id_card = record.get('id_no_sp');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(id_no_sp.substr(6, 4) + '/' + id_no_sp.substr(10, 2) + '/' + id_no_sp.substr(12, 2)));
record.set('age', new Date().getFullYear() - id_no_sp.substr(6, 4));
if (id_no_sp.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (id_no_sp.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == 'PASSPORT'&&record.get('id_no_sp')){
//护照
var id_no_sp =record.get('id_no_sp');
if (!Leaf.isEmpty(id_no_sp)) {
id_no_sp = id_no_sp.trim();
id_no_sp = id_no_sp.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=id_no_sp.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(id_no_sp)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
}
......@@ -910,8 +1063,214 @@
}*/
}
}else if(record.get('card_type_sp') == 'PASSPORT'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '配偶护照格式错误');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}
}
}
}
}
var company_ds_id= get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_com_req');
if(company_ds_id=ds.id){
if (name == 'id_type' && value) {
if (value == '110'&&record.get('associate_id_no')) {
var associate_id_no =record.get('associate_id_no');
if (!checkCard(associate_id_no)) {
Leaf.showMessage('提示', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else if (associate_id_no.length == 18) {
new_id_card = record.get('associate_id_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(associate_id_no.substr(6, 4) + '/' + associate_id_no.substr(10, 2) + '/' + associate_id_no.substr(12, 2)));
record.set('age', new Date().getFullYear() - associate_id_no.substr(6, 4));
if (associate_id_no.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (associate_id_no.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}else if(value == '140'&&record.get('associate_id_no')){
//护照
var associate_id_no =record.get('associate_id_no');
if (!Leaf.isEmpty(associate_id_no)) {
associate_id_no = associate_id_no.trim();
associate_id_no = associate_id_no.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=associate_id_no.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(associate_id_no)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(value == '210'&&record.get('associate_id_no')){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < credit_code.length && i < 16; i++) {
financeCode[i] = credit_code.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(value == '220'&&record.get('associate_id_no')){
//护照
var soc_code =record.get('associate_id_no');
if (soc_code) {
if (!CheckSocialCreditCode(soc_code)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
if (name == 'associate_id_no'&&value) {
if (record.get('id_type') == '110') {
if (!checkCard(value)) {
Leaf.showMessage('${l:HLS.PROMPT}', '个人身份证号错误!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
} else {
if (value.length == 18) {
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (value.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}
}else if(record.get('id_type') == '140'){
//护照
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
var sub_no=value.substring(0,3);
if(!(/^[A-Z]{3}/).test(sub_no)){
Leaf.showMessage('提示', '护照证件号码格式前三位需为国籍代码!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
if(!(/^[A-Z]{3}.{0,9}$/).test(value)){
Leaf.showMessage('提示', '护照格式错误');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
}else if(record.get('id_type') == '210'&&value){
//护照
var credit_code =record.get('associate_id_no');
if (!Leaf.isEmpty(value)) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
if (value.length == '16'){
let financeCode = new Array(16);
for (let i = 0; i < value.length && i < 16; i++) {
financeCode[i] = value.charCodeAt(i);
}
if(!checkDKK(financeCode)){
Leaf.showMessage('提示', '中征码错误');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
return false;
}
}
} else if(record.get('id_type') == '220'&&value){
//护照
var soc_code =record.get('associate_id_no');
if (value) {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('associate_id_no', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment