Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
1a449a86
Commit
1a449a86
authored
Apr 18, 2024
by
Luochenglong
Committed by
邓乾隆
Apr 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
证件类型校验
parent
580903cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1250 additions
and
176 deletions
+1250
-176
hls_bp_master_create.lview
...ain/webapp/modules/hls/HLS213N/hls_bp_master_create.lview
+421
-68
hls_bp_master_modify.lview
...ain/webapp/modules/hls/HLS214N/hls_bp_master_modify.lview
+443
-81
hls_bp_master_req_modify.lview
...webapp/modules/hls/HLS214N/hls_bp_master_req_modify.lview
+386
-27
No files found.
src/main/webapp/modules/hls/HLS213N/hls_bp_master_create.lview
View file @
1a449a86
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
} else if (head_record.get('bp_category') == 'VENDER') {
} else if (head_record.get('bp_category') == 'VENDER') {
bp_record.getField('unit_id_n').setReadOnly(true);
bp_record.getField('unit_id_n').setReadOnly(true);
bp_record.getField('unit_id_n').setRequired(false);
bp_record.getField('unit_id_n').setRequired(false);
bp_record.getField('unit_id').setRequired(false);
bp_record.getField('unit_id').setRequired(false);
} else {
} else {
current_record.getField('bp_type_n').setReadOnly(true);
current_record.getField('bp_type_n').setReadOnly(true);
current_record.getField('enabled_flag').setReadOnly(true);
current_record.getField('enabled_flag').setReadOnly(true);
...
@@ -194,23 +194,23 @@
...
@@ -194,23 +194,23 @@
}
}
}
}
};
};
//法人供应商经办人身份证号非必填 18083 2022/12/1
//法人供应商经办人身份证号非必填 18083 2022/12/1
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
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 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 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();
var bp_record=$(bp_ds_id).getCurrentRecord();
if(bp_record.get('bp_class') == 'ORG' && bp_record.get("bp_type") == 'VENDER'){
if(bp_record.get('bp_class') == 'ORG' && bp_record.get("bp_type") == 'VENDER'){
if(sign_ds_id == ds.id &&sign_ds_id){
if(sign_ds_id == ds.id &&sign_ds_id){
var records = $(sign_ds_id).getAll();
var records = $(sign_ds_id).getAll();
for (i = 0; i < records.length; i++) {
for (i = 0; i < records.length; i++) {
records[i].getField('id_card').setRequired(false);
records[i].getField('id_card').setRequired(false);
}
}
}
}
}
}
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
//第三方创建页面隐藏角色新增按钮
//第三方创建页面隐藏角色新增按钮
...
@@ -260,9 +260,9 @@
...
@@ -260,9 +260,9 @@
// record.getField('cell_phone').setRequired(true);
// record.getField('cell_phone').setRequired(true);
//record.getField('cell_phone').setRequired(true);
//record.getField('cell_phone').setRequired(true);
//法人供应商非必填 18083 2022/11/25
//法人供应商非必填 18083 2022/11/25
if(record.get('bp_class') == 'ORG' && record.get("bp_type") == 'VENDER'){
if(record.get('bp_class') == 'ORG' && record.get("bp_type") == 'VENDER'){
record.getField('id_card_no_leg').setRequired(false);
record.getField('id_card_no_leg').setRequired(false);
}
}
//身份证验证
//身份证验证
if (ds.fields.id_card_no) {
if (ds.fields.id_card_no) {
...
@@ -275,14 +275,14 @@
...
@@ -275,14 +275,14 @@
}
}
if (record.get('bp_class') && record.get('bp_class') == 'ORG') {
if (record.get('bp_class') && record.get('bp_class') == 'ORG') {
if (record.get('invoice_method') == 'BILLING') {
if (record.get('invoice_method') == 'BILLING') {
record.getField('taxpayer_type').setRequired(true);
record.getField('taxpayer_type').setRequired(true);
record.getField('taxpayer_type_n').setRequired(true);
record.getField('taxpayer_type_n').setRequired(true);
record.getField('tax_registry_num').setRequired(true);
record.getField('tax_registry_num').setRequired(true);
record.getField('invoice_title').setRequired(true);
record.getField('invoice_title').setRequired(true);
record.getField('invoice_bp_address').setRequired(true);
record.getField('invoice_bp_address').setRequired(true);
record.getField('invoice_bp_phone_num').setRequired(true);
record.getField('invoice_bp_phone_num').setRequired(true);
record.getField('invoice_bp_bank').setRequired(true);
record.getField('invoice_bp_bank').setRequired(true);
record.getField('invoice_bp_bank_account').setRequired(true);
record.getField('invoice_bp_bank_account').setRequired(true);
}
}
if (record.get('invoice_method') == 'NO_BILLING') {
if (record.get('invoice_method') == 'NO_BILLING') {
record.getField('taxpayer_type').setRequired(true);
record.getField('taxpayer_type').setRequired(true);
...
@@ -317,7 +317,7 @@
...
@@ -317,7 +317,7 @@
//设置开票类型为纸质只读
//设置开票类型为纸质只读
record.set('invoice_type','PAPER');
record.set('invoice_type','PAPER');
record.set('invoice_type_n','纸质发票');
record.set('invoice_type_n','纸质发票');
//取消开票类型为纸质只读 18083
//取消开票类型为纸质只读 18083
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
record.getField('invoice_type').setRequired(false);
record.getField('invoice_type').setRequired(false);
...
@@ -517,7 +517,7 @@
...
@@ -517,7 +517,7 @@
//校验银行账户必须与商业伙伴名称一致 18083 2023/9/5
//校验银行账户必须与商业伙伴名称一致 18083 2023/9/5
var bp_name=head_record.get('bp_name');
var bp_name=head_record.get('bp_name');
var bank_flag1=true;
var bank_flag1=true;
if(bank_record.length>
0){
if(bank_record.length>
0){
var flag = true;
var flag = true;
for(var i=0;i
<bank_record.length
;i++){
for(var i=0;i
<bank_record.length
;i++){
var
full_name=
bank_record[i].get('bank_full_name');
var
full_name=
bank_record[i].get('bank_full_name');
...
@@ -529,16 +529,16 @@
...
@@ -529,16 +529,16 @@
}
}
}
}
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
var
bank_flag1 =
false;
var
bank_flag1 =
false;
}
}
if(
flag =
=
false){
if(
flag =
=
false){
Leaf.showErrorMessage('${l:PROMPT}',
'请填写支行全称(例如:上海浦东发展银行外高桥保税区支行)');
Leaf.showErrorMessage('${l:PROMPT}',
'请填写支行全称(例如:上海浦东发展银行外高桥保税区支行)');
return
false;
return
false;
}
}
if(
bank_flag1 =
=
false){
if(
bank_flag1 =
=
false){
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
return
false;
return
false;
}
}
}
}
}
}
...
@@ -555,12 +555,12 @@
...
@@ -555,12 +555,12 @@
}
}
}
}
}
}
//若选择开票类型为“纸质发票”,则系统校验无法选择“是否全电发票”为“是”
18083
2022/11/30
//若选择开票类型为“纸质发票”,则系统校验无法选择“是否全电发票”为“是”
18083
2022/11/30
if
(head_record.get('invoice_type')=='PAPER'){
if
(head_record.get('invoice_type')=='PAPER'){
if(head_record.get('full_elec_invoice_flag')=='Y'){
if(head_record.get('full_elec_invoice_flag')=='Y'){
Leaf.showErrorMessage('${l:PROMPT}',
'开票类型为纸质发票,不能选择【是否全电发票】为是');
Leaf.showErrorMessage('${l:PROMPT}',
'开票类型为纸质发票,不能选择【是否全电发票】为是');
return
false;
return
false;
}
}
}
}
var
role_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_role');
var
role_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_role');
var
role_records =
$(role_ds_id).getAll();
var
role_records =
$(role_ds_id).getAll();
...
@@ -577,7 +577,7 @@
...
@@ -577,7 +577,7 @@
return
false;
return
false;
}
}
if(head_record.get('bp_type')=='THIRD_PARTY'){
if(head_record.get('bp_type')=='THIRD_PARTY'){
var
flag =
true;
var
flag =
true;
if
(bank_record.length
<=0){
if
(bank_record.length
<=0){
Leaf.showErrorMessage('${l:PROMPT}',
'第三方必填[银行帐户信息],请在银行帐户信息新增!');
Leaf.showErrorMessage('${l:PROMPT}',
'第三方必填[银行帐户信息],请在银行帐户信息新增!');
...
@@ -593,15 +593,15 @@
...
@@ -593,15 +593,15 @@
else{
else{
flag =
true;
flag =
true;
}
}
}
}
if(
flag =
=
false){
if(
flag =
=
false){
Leaf.showErrorMessage('${l:PROMPT}',
'请将银行账户信息填写完整');
Leaf.showErrorMessage('${l:PROMPT}',
'请将银行账户信息填写完整');
return
false;
return
false;
}
}
}
}
}
}
//验证是否有户籍地址,或者通讯地址
//验证是否有户籍地址,或者通讯地址
var
address_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_address');
var
address_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_address');
...
@@ -800,27 +800,49 @@
...
@@ -800,27 +800,49 @@
if(record.get('bp_type') == 'TENANT'){
//if(record.get('bp_type') == 'TENANT'){
var credit_code = record.get('credit_code');
var credit_code = record.get('credit_code');
if (!Leaf.isEmpty(credit_code)) {
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
//去除空格
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
credit_code = credit_code.trim();
if (credit_code.length == '16'){
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
if (credit_code.length == '16'){
Leaf.showMessage('提示', '中征码首字母需要大写');
// if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// Leaf.showMessage('提示', '中征码首字母需要大写');
return false;
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// setTimeout(function () {
}else {
// record.set('credit_code', '');
return true;
// }, 20);
}
// return false;
}else {
//
Leaf.showMessage('提示', '请输入16位中征码');
// }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']();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function
()
{
record.set('credit_code',
'');
},
20);
return
false;
return
false;
}else
{
return
true;
}
}
}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')
{
if
(
name =
=
'org_type')
{
...
@@ -839,8 +861,8 @@
...
@@ -839,8 +861,8 @@
record.getField('enterprise_scale_n').setRequired(true);
record.getField('enterprise_scale_n').setRequired(true);
}
}
}
}
//法人承租人添加 法人姓名和法人身份证号 时,更新企业关联信息的法人数据
//法人承租人
company_ds_id
添加
法人姓名和法人身份证号
时,更新企业关联信息的法人数据
var
company_ds_id
= get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_company_info');
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')){
if((
name =
=
'legal_person'||
name =
=
'id_card_no_leg')){
var
records_company =
$(company_ds_id).getAll();
var
records_company =
$(company_ds_id).getAll();
for(var
i=
0;i<records_company.length;i++){
for(var
i=
0;i<records_company.length;i++){
...
@@ -858,6 +880,193 @@
...
@@ -858,6 +880,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(
name =
=
'other_relationships'){
if(
value =
=
'2'){
if(
value =
=
'2'){
...
@@ -960,6 +1169,56 @@
...
@@ -960,6 +1169,56 @@
record.getField('parent_id_n').setReadOnly(true);
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')
{
if
(
name =
=
'id_card_no')
{
//
record =
$(hls_bp_master_ds_id).getCurrentRecord();
//
record =
$(hls_bp_master_ds_id).getCurrentRecord();
//
var
id_num =
record.get('id_card_no');
//
var
id_num =
record.get('id_card_no');
...
@@ -989,11 +1248,84 @@
...
@@ -989,11 +1248,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;
//
ds.fields.id_card_no.pro.validator =
id_card_no_validate;
//自动带出籍贯
//自动带出籍贯
//
record.set('resident_addres',
get_native_place(value))
//
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
(
name =
=
'id_no_sp'
&&
value)
{
if
(!value)
{
if
(!value)
{
...
@@ -1012,6 +1344,27 @@
...
@@ -1012,6 +1344,27 @@
record.set('date_of_birth_sp',
new
Date(value.substr(6,
4)
+
'/'
+
value.substr(10,
2)
+
'/'
+
value.substr(12,
2)));
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;
//
ds.fields.id_no_sp.pro.validator =
id_card_no_validate;
//
record.set('resident_addres_sp',
get_native_place(value))
//
record.set('resident_addres_sp',
get_native_place(value))
...
@@ -1181,7 +1534,7 @@
...
@@ -1181,7 +1534,7 @@
//设置开票类型为纸质只读
//设置开票类型为纸质只读
record.set('invoice_type','PAPER');
record.set('invoice_type','PAPER');
record.set('invoice_type_n','纸质发票');
record.set('invoice_type_n','纸质发票');
//取消开票类型为纸质只读
18083
2022/11/30
//取消开票类型为纸质只读
18083
2022/11/30
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
record.getField('invoice_type').setRequired(false);
record.getField('invoice_type').setRequired(false);
...
@@ -1213,14 +1566,14 @@
...
@@ -1213,14 +1566,14 @@
}
}
}
}
if(
name =
=
'invoice_type'){
if(
name =
=
'invoice_type'){
//设置是否全电发票默认值
18083
//设置是否全电发票默认值
18083
if(
value =
=
'PAPER'){
if(
value =
=
'PAPER'){
record.getField('reception_maile').setRequired(false);
record.getField('reception_maile').setRequired(false);
record.set('full_elec_invoice_flag','N');
record.set('full_elec_invoice_flag','N');
record.set('full_elec_invoice_flag_n','否');
record.set('full_elec_invoice_flag_n','否');
}else{
}else{
record.getField('reception_maile').setRequired(true);
record.getField('reception_maile').setRequired(true);
record.set('full_elec_invoice_flag','Y');
record.set('full_elec_invoice_flag','Y');
record.set('full_elec_invoice_flag_n','是');
record.set('full_elec_invoice_flag_n','是');
}
}
}
}
...
...
src/main/webapp/modules/hls/HLS214N/hls_bp_master_modify.lview
View file @
1a449a86
...
@@ -90,21 +90,21 @@
...
@@ -90,21 +90,21 @@
var
address_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_address');
var
address_ds_id =
get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'hls_bp_master_address');
var
records_addr =
$(address_ds_id).getAll();
var
records_addr =
$(address_ds_id).getAll();
//校验银行账户名必须与商业伙伴名称一致
18083
2023/9/5
//校验银行账户名必须与商业伙伴名称一致
18083
2023/9/5
var
bp_name=
bp_record.get('bp_name');
var
bp_name=
bp_record.get('bp_name');
var
bank_flag =
true;
var
bank_flag =
true;
if(bank_record.length
>
0){
if(bank_record.length
>
0){
for(var i=0;i
<bank_record.length
;i++){
for(var i=0;i
<bank_record.length
;i++){
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
bank_flag =
false;
bank_flag =
false;
}
}
}
}
}
}
if(
bank_flag =
=
false){
if(
bank_flag =
=
false){
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
return
false;
return
false;
}
}
//新增校验,承租人(法人)和担保人(法人)商业伙伴的创建,银行账号信息都是要必填(为电子签约做准备)
//新增校验,承租人(法人)和担保人(法人)商业伙伴的创建,银行账号信息都是要必填(为电子签约做准备)
if(bp_record.get('bp_class')
==
'ORG'){
if(bp_record.get('bp_class')
==
'ORG'){
if(bp_record.get('bp_type')=='TENANT'
||
bp_record.get('bp_type')=='GUTA_ORG'){
if(bp_record.get('bp_type')=='TENANT'
||
bp_record.get('bp_type')=='GUTA_ORG'){
if(
bank_record.length=
=0){
if(
bank_record.length=
=0){
...
@@ -431,7 +431,7 @@
...
@@ -431,7 +431,7 @@
//
}
//
}
//
}
//
}
if
((ds.id).indexOf('hls_bp_master')
!=
-1
&&
(ds.id).indexOf('F_BASIC')
!=
-1)
{
if
((ds.id).indexOf('hls_bp_master')
!=
-1
&&
(ds.id).indexOf('F_BASIC')
!=
-1)
{
if(record.get('bp_class')
&&
record.get('bp_class')
==
'ORG'){
if(record.get('bp_class')
&&
record.get('bp_class')
==
'ORG'){
if(record.get('bp_type')
==
'TENANT'){
if(record.get('bp_type')
==
'TENANT'){
record.getField('etp_sts').setRequired(true);
record.getField('etp_sts').setRequired(true);
...
@@ -462,7 +462,7 @@
...
@@ -462,7 +462,7 @@
}
}
//法人供应商非必填
18083
2022/11/25
//法人供应商非必填
18083
2022/11/25
if(record.get('bp_class')
==
'ORG'
&&
record.get("bp_type")
==
'VENDER'){
if(record.get('bp_class')
==
'ORG'
&&
record.get("bp_type")
==
'VENDER'){
record.getField('id_card_no_leg').setRequired(false);
record.getField('id_card_no_leg').setRequired(false);
}
}
//第三方
证件号非必填
2022年12月29日09:41:15
//第三方
证件号非必填
2022年12月29日09:41:15
...
@@ -483,7 +483,7 @@
...
@@ -483,7 +483,7 @@
if
(record.get('bp_category')
==
'VENDER')
{
if
(record.get('bp_category')
==
'VENDER')
{
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
record.getField('unit_id_n').setRequired(false);
record.getField('unit_id').setRequired(false);
record.getField('unit_id').setRequired(false);
}
else
{
}
else
{
if
(
employee_type_id =
=
'64')
{
if
(
employee_type_id =
=
'64')
{
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setReadOnly(true);
...
@@ -494,16 +494,16 @@
...
@@ -494,16 +494,16 @@
}
}
}
}
if(record.get('bp_class')&&record.get('bp_class')=='NP'){
if(record.get('bp_class')&&record.get('bp_class')=='NP'){
if
(record.get('marital_status')
&&
(record.get('marital_status')
==
'30'
||
record.get('marital_status')
==
'40'))
{
if
(record.get('marital_status')
&&
(record.get('marital_status')
==
'30'
||
record.get('marital_status')
==
'40'))
{
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'block'
;
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'block'
;
record.getField('bp_name_sp').setRequired(true);
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
record.getField('id_no_sp').setRequired(true);
}
else
{
}
else
{
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'none'
;
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'none'
;
}
}
}
}
}
}
...
@@ -533,18 +533,18 @@
...
@@ -533,18 +533,18 @@
}
}
}
}
}
}
//法人供应商非必填
18083
2022/12/01
//法人供应商非必填
18083
2022/12/01
var
bp_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master');
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
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();
var
bp_record=
$(bp_ds_id).getCurrentRecord();
if(bp_record.get('bp_class')
==
'ORG'
&&
bp_record.get("bp_type")
==
'VENDER'){
if(bp_record.get('bp_class')
==
'ORG'
&&
bp_record.get("bp_type")
==
'VENDER'){
if(
sign_ds_id =
=
ds.id
&&sign_ds_id){
if(
sign_ds_id =
=
ds.id
&&sign_ds_id){
var
records =
$(sign_ds_id).getAll();
var
records =
$(sign_ds_id).getAll();
for
(
i =
0;
i
<
records.length;
i++)
{
for
(
i =
0;
i
<
records.length;
i++)
{
records[i].getField('id_card').setRequired(false);
records[i].getField('id_card').setRequired(false);
}
}
}
}
}
}
};
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add']
=
function(ds,
record,
config_records,
bp_seq)
{
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add']
=
function(ds,
record,
config_records,
bp_seq)
{
...
@@ -558,18 +558,18 @@
...
@@ -558,18 +558,18 @@
}
}
}
}
}
}
//法人供应商非必填
2022/12/1
18083
//法人供应商非必填
2022/12/1
18083
var
bp_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master');
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
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();
var
bp_record=
$(bp_ds_id).getCurrentRecord();
if(bp_record.get('bp_class')
==
'ORG'
&&
bp_record.get("bp_type")
==
'VENDER'){
if(bp_record.get('bp_class')
==
'ORG'
&&
bp_record.get("bp_type")
==
'VENDER'){
if(
sign_ds_id =
=
ds.id
&&sign_ds_id){
if(
sign_ds_id =
=
ds.id
&&sign_ds_id){
var
records =
$(sign_ds_id).getAll();
var
records =
$(sign_ds_id).getAll();
for
(
i =
0;
i
<
records.length;
i++)
{
for
(
i =
0;
i
<
records.length;
i++)
{
records[i].getField('id_card').setRequired(false);
records[i].getField('id_card').setRequired(false);
}
}
}
}
}
}
}
}
//更新时调用
add
by
liukang
//更新时调用
add
by
liukang
...
@@ -583,27 +583,48 @@
...
@@ -583,27 +583,48 @@
//中征码校验
//中征码校验
if
(record.get('bp_class')
==
'ORG')
{
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');
var
credit_code =
record.get('credit_code');
if
(!Leaf.isEmpty(credit_code))
{
if
(!Leaf.isEmpty(credit_code))
{
credit_code =
credit_code.trim();
credit_code =
credit_code.trim();
credit_code =
credit_code.replace(/[\t\r\f\n\s]*/g,"");
credit_code =
credit_code.replace(/[\t\r\f\n\s]*/g,"");
if
(
credit_code.length =
=
'16'){
if
(
credit_code.length =
=
'16'){
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
//
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
Leaf.showMessage('提示',
'中征码首字母需要大写');
//
Leaf.showMessage('提示',
'中征码首字母需要大写');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
//
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return
false;
//
setTimeout(function
()
{
//
record.set('credit_code',
'');
}else
{
//
},
20);
return
true;
//
return
false;
}
//
}else
{
//
}else
{
Leaf.showMessage('提示',
'请输入16位中征码');
//
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']();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function
()
{
record.set('credit_code',
'');
},
20);
return
false;
return
false;
}else
{
return
true;
}
}
}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
(
gird_ds_id =
=
ds.id
||
gird_ds_id2 =
=
ds.id)
{
...
@@ -729,6 +750,255 @@
...
@@ -729,6 +750,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
(
name =
=
'id_card_no'
&&
value)
{
if
(record.get('id_type')
==
'ID_CARD')
{
if
(record.get('id_type')
==
'ID_CARD')
{
if
(!checkCard(value))
{
if
(!checkCard(value))
{
...
@@ -752,6 +1022,77 @@
...
@@ -752,6 +1022,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;
}
}
}
}
}
}
...
@@ -781,6 +1122,27 @@
...
@@ -781,6 +1122,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;
}
}
}
}
}
}
...
@@ -858,37 +1220,37 @@
...
@@ -858,37 +1220,37 @@
var
hd_ds =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master');
var
hd_ds =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master');
record =
$(hd_ds).getCurrentRecord();
record =
$(hd_ds).getCurrentRecord();
if(record.get('bp_class')=='NP'){
if(record.get('bp_class')=='NP'){
if (name == 'marital_status'
&&
value) {
if
(
name =
=
'marital_status'
&&
value)
{
if
(
value =
=
'30'
||
value =
=
'40')
{
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'block'
;
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
if
(!record.get('card_type_sp'))
{
record.set('card_type_sp',
'ID_CARD');
record.set('card_type_sp_n',
'身份证');
}
if (value == '30' || value == '40') {
}
else
{
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id')
.style.display =
'none'
;
record.getField('bp_name_sp').setRequired(true);
record.getField('bp_name_sp').setRequired(false);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp').setRequired(false);
record.getField('card_type_sp_n').setRequired(true);
record.getField('card_type_sp_n').setRequired(false);
record.getField('id_no_sp').setRequired(true);
record.getField('id_no_sp').setRequired(false);
if (!record.get('card_type_sp')) {
//
record.set('bp_name_sp',
null);
record.set('card_type_sp', 'ID_CARD');
//
record.set('card_type_sp',
null);
record.set('card_type_sp_n', '身份证');
//
record.set('card_type_sp_n',
null);
//
record.set('id_no_sp',
null);
//
record.set('date_of_birth_sp',
null);
//
record.set('cell_phone_sp',
null);
//
record.set('work_unit_phone_sp',
null);
//
record.set('work_unit_name_sp',
null);
//
record.set('work_unit_address_sp',
null);
}
}
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
record.getField('bp_name_sp').setRequired(false);
record.getField('card_type_sp').setRequired(false);
record.getField('card_type_sp_n').setRequired(false);
record.getField('id_no_sp').setRequired(false);
// record.set('bp_name_sp', null);
// record.set('card_type_sp', null);
// record.set('card_type_sp_n', null);
// record.set('id_no_sp', null);
// record.set('date_of_birth_sp', null);
// record.set('cell_phone_sp', null);
// record.set('work_unit_phone_sp', null);
// record.set('work_unit_name_sp', null);
// record.set('work_unit_address_sp', null);
}
}
}
}
}
if
(
name =
=
'bp_name'){
if
(
name =
=
'bp_name'){
//
alert(record.get('bp_name')+'2222');
//
alert(record.get('bp_name')+'2222');
record.set('invoice_title',record.get('bp_name'));
record.set('invoice_title',record.get('bp_name'));
...
...
src/main/webapp/modules/hls/HLS214N/hls_bp_master_req_modify.lview
View file @
1a449a86
...
@@ -57,11 +57,11 @@
...
@@ -57,11 +57,11 @@
v_primary_flag_count=v_primary_flag_count+1;
v_primary_flag_count=v_primary_flag_count+1;
}
}
}
}
if(v_primary_flag_count!=1){
if(v_primary_flag_count!=1){
Leaf.showErrorMessage('错误', '一个商业伙伴有且仅有一个主角色!');
Leaf.showErrorMessage('错误', '一个商业伙伴有且仅有一个主角色!');
return false;
return false;
}
}
if(role_records.length>
1){
if(role_records.length>
1){
for (var i = 0;i
< role_records.length
;i++)
{
for (var i = 0;i
< role_records.length
;i++)
{
if(role_records[i].get('bp_type')=='THIRD_PARTY'){
if(role_records[i].get('bp_type')=='THIRD_PARTY'){
...
@@ -123,8 +123,8 @@
...
@@ -123,8 +123,8 @@
}
}
}
}
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
var
bank_flag =
false;
var
bank_flag =
false;
}
}
}
}
}
}
if(
flag =
=
false){
if(
flag =
=
false){
...
@@ -132,10 +132,10 @@
...
@@ -132,10 +132,10 @@
return
false;
return
false;
}
}
if(
bank_flag =
=
false){
if(
bank_flag =
=
false){
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
Leaf.showErrorMessage('${l:PROMPT}',
'银行账户户名必须与商业伙伴名称一致');
return
false;
return
false;
}
}
if(bp_record.get('bp_type')=='THIRD_PARTY'){
if(bp_record.get('bp_type')=='THIRD_PARTY'){
var
flag =
true;
var
flag =
true;
if
(bank_record.length
<=0){
if
(bank_record.length
<=0){
Leaf.showErrorMessage('${l:PROMPT}',
'第三方必填[银行帐户信息],请在银行帐户信息新增!');
Leaf.showErrorMessage('${l:PROMPT}',
'第三方必填[银行帐户信息],请在银行帐户信息新增!');
...
@@ -540,7 +540,7 @@
...
@@ -540,7 +540,7 @@
var
role_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'G_ROLE',
'hls_bp_master_role_req');
var
role_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'G_ROLE',
'hls_bp_master_role_req');
if("${/model/role_info/record/@role_code}"!="0017"&&"${/model/role_info/record/@role_code}"!="HAND"){
if("${/model/role_info/record/@role_code}"!="0017"&&"${/model/role_info/record/@role_code}"!="HAND"){
if(
role_ds_id =
=
ds.id){
if(
role_ds_id =
=
ds.id){
var
records =
$(ds.id).getAll();
var
records =
$(ds.id).getAll();
for
(var
i =
0;i
<
records.length;i++)
{
for
(var
i =
0;i
<
records.length;i++)
{
records[i].getField('primary_flag').setReadOnly(true);
records[i].getField('primary_flag').setReadOnly(true);
...
@@ -615,27 +615,48 @@
...
@@ -615,27 +615,48 @@
//中征码校验
//中征码校验
if (record.get('bp_class') == 'ORG') {
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');
var credit_code = record.get('credit_code');
if (!Leaf.isEmpty(credit_code)) {
if (!Leaf.isEmpty(credit_code)) {
credit_code = credit_code.trim();
credit_code = credit_code.trim();
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
credit_code = credit_code.replace(/[\t\r\f\n\s]*/g,"");
if (credit_code.length == '16'){
if (credit_code.length == '16'){
if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
// if(!(/^[A-Z][A-z0-9]*$/).test(credit_code)){
Leaf.showMessage('提示', '中征码首字母需要大写');
// Leaf.showMessage('提示', '中征码首字母需要大写');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
// setTimeout(function () {
// record.set('credit_code', '');
}else {
// }, 20);
return true;
// return false;
}
//
}else {
// }else {
Leaf.showMessage('提示', '请输入16位中征码');
// 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']();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function
()
{
record.set('credit_code',
'');
},
20);
return
false;
return
false;
}else
{
return
true;
}
}
}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
(
gird_ds_id =
=
ds.id
||
gird_ds_id2 =
=
ds.id)
{
if
(
name =
=
'relationship_with_bp')
{
if
(
name =
=
'relationship_with_bp')
{
...
@@ -785,6 +806,67 @@
...
@@ -785,6 +806,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 (name == 'id_card_no'
&&
value) {
if (record.get('id_type') == 'ID_CARD') {
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
if (!checkCard(value)) {
...
@@ -808,6 +890,77 @@
...
@@ -808,6 +890,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;
}
}
}
}
}
}
...
@@ -837,10 +990,216 @@
...
@@ -837,10 +990,216 @@
}*/
}*/
}
}
}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;
}
}
}
}
}
var
test_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master_req');
var
test_ds_id =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_BASIC',
'hls_bp_master_req');
var
test_ds_id1 =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_SPOUSE_1',
'hls_bp_master_req');
var
test_ds_id1 =
get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],
'F_SPOUSE_1',
'hls_bp_master_req');
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment