Commit 7681ab27 authored by xiaochao's avatar xiaochao

【商业伙伴添加验证】

parent f500a28b
......@@ -32,7 +32,10 @@
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');
var bp_record = $(bp_ds_id).getCurrentRecord();
bp_record.set('bp_category', '${/parameter/@bp_category}');
bp_record.set('owner_user_id', '${/session/@user_id}');
bp_record.set('unit_id', unit_id);
......@@ -53,6 +56,7 @@
}
if (ds_id && '${/parameter/@default_value_dsid}') {
var head_record = $('${/parameter/@default_value_dsid}').getCurrentRecord();
var bp_master_role_ds = $(ds_id);
var record = new Leaf.Record({
'primary_flag': 'Y',
......@@ -69,10 +73,75 @@
'enabled_flag': 'Y'
});
bp_master_role_ds.add(record);
var address_ds_id_ds = $(address_ds_id);
var address_bp_record = $('${/parameter/@default_value_dsid}').getCurrentRecord();
if (address_bp_record.get('bp_class') == 'NP'){
//POSTAL_ADDRESS 通讯地址
var record1 = new Leaf.Record({
'address_type': 'HOUSEHOLD_ADDRESS',
'address_type_n': '户籍地址',
'country_id': 37,
'country_id_n': '中华人民共和国',
'province_id': 0,
'province_id_n': '',
'city_id': 0,
'city_id_n': '',
'district_id': 0,
'district_id_n': '',
'address': ' ',
'phone': ' '
});
var record2 = new Leaf.Record({
'address_type': 'POSTAL_ADDRESS',
'address_type_n': '通讯地址',
'country_id': 37,
'country_id_n': '中华人民共和国',
'province_id': 0,
'province_id_n': '',
'city_id': 0,
'city_id_n': '',
'district_id': 0,
'district_id_n': '',
'address': ' ',
'phone': ' '
});
address_ds_id_ds.add(record1);
address_ds_id_ds.add(record2);
var address_record = address_ds_id_ds.getAt(0);
address_record.getField('address_type_n').setReadOnly(true);
address_record.getField('country_id_n').setReadOnly(true);
var address_record1 = address_ds_id_ds.getAt(1);
address_record1.getField('address_type_n').setReadOnly(true);
address_record1.getField('country_id_n').setReadOnly(true);
}else if (address_bp_record.get('bp_class') == 'ORG'){
//法人
//POSTAL_ADDRESS 通讯地址
var record2 = new Leaf.Record({
'address_type': 'POSTAL_ADDRESS',
'address_type_n': '通讯地址',
'country_id': 37,
'country_id_n': '中华人民共和国',
'province_id': 0,
'province_id_n': '',
'city_id': 0,
'city_id_n': '',
'district_id': 0,
'district_id_n': '',
'address': ' ',
'phone': ' '
});
address_ds_id_ds.add(record2);
var address_record = address_ds_id_ds.getAt(0);
address_record.getField('address_type_n').setReadOnly(true);
address_record.getField('country_id_n').setReadOnly(true);
}
var current_record = bp_master_role_ds.getAt(0);
current_record.getField('bp_type_n').setReadOnly(true);
current_record.getField('enabled_flag').setReadOnly(true);
if (head_record.get('bp_category') == 'MANUFACTURER') {
bp_record.set('company_nature_n', '');
bp_record.getField('company_nature_n').setReadOnly(true);
......@@ -340,10 +409,66 @@
//
// };
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var head_record = $(ds_id).getCurrentRecord();
//验证是否有户籍地址,或者通讯地址
var address_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_address');
var records_addr = $(address_ds_id).getAll();``
if (head_record.get('bp_class') =='NP'){
//判断户籍地址
var flag = true;
if (records_addr.length <=0){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}else{
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'HOUSEHOLD_ADDRESS'){
flag = true;
break;
}else{
flag = false;
}
}
//判断通讯地址
var flag1 = true;
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag == false || flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}
}
}else if (head_record.get('bp_class') == 'ORG'){
//判断通讯地址
var flag1 = true;
if (records_addr.length <= 0){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}else {
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}
}
}
//=================
var check_flag = false;
if (head_record.get('marital_status') && (head_record.get('marital_status') !== '30' && head_record.get('marital_status') !== '40')) {
head_record.set('bp_name_sp', null);
......
......@@ -48,6 +48,62 @@
// }
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var bp_record = $(ds_id).getCurrentRecord();
var address_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_address');
var records_addr = $(address_ds_id).getAll();
if (bp_record.get('bp_class') == 'NP'){
//判断户籍地址
var flag = true;
if (records_addr.length <=0){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}else{
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'HOUSEHOLD_ADDRESS'){
flag = true;
break;
}else{
flag = false;
}
}
//判断通讯地址
var flag1 = true;
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag == false || flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}
}
}else if (bp_record.get('bp_class') == 'ORG'){
//判断通讯地址
var flag1 = true;
if (records_addr.length <= 0){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}else {
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}
}
}
if (old_id_card != new_id_card) {
bp_record.set('id_card_no_change_flag', 'Y');
} else {
......
......@@ -49,6 +49,61 @@
// }
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var bp_record = $(ds_id).getCurrentRecord();
var address_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_address_req');
var records_addr = $(address_ds_id).getAll();
if (bp_record.get('bp_class') == 'NP'){
//判断户籍地址
var flag = true;
if (records_addr.length <=0){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}else{
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'HOUSEHOLD_ADDRESS'){
flag = true;
break;
}else{
flag = false;
}
}
//判断通讯地址
var flag1 = true;
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag == false || flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '自然人必填[通讯地址]和[户籍地址],请在地址信息新增!');
return false;
}
}
}else if (bp_record.get('bp_class') == 'ORG'){
//判断通讯地址
var flag1 = true;
if (records_addr.length <= 0){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}else {
for(var i=0;i<records_addr.length;i++){
if (records_addr[i].get('address_type') == 'POSTAL_ADDRESS'){
flag1 = true;
break;
}else{
flag1 = false;
}
}
if (flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '法人必填[通讯地址],请在地址信息新增!');
return false;
}
}
}
if (old_id_card != new_id_card) {
bp_record.set('id_card_no_change_flag', 'Y');
} else {
......@@ -464,7 +519,6 @@
},
success: function (res) {
var number = res.result.num;
//alert(number);
if (number > 0) {
Leaf.showMessage('提示', '该银行账号在系统中已存在!');
}
......
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