Commit 0999b034 authored by 陆正友's avatar 陆正友

Merge remote-tracking branch 'origin/master'

parents 88a7238f b4359d7d
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 18083
$Date:
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
t.bank_account_num vender_bank_account_number,
t.bank_account_name vender_bank_account_name,
bank_account_id vender_bank_account_id,
t.bank_full_name vender_bank_full_name,
(select bp_name from hls_bp_master hbm where hbm.bp_id=t.bp_id) vender_name
from hls_bp_master_bank_account_v t
where t.bp_id = (
select hli.vender_id
from hls_lease_item hli,con_contract_lease_item ccli
where hli.lease_item_id=ccli.lease_item_id
and ccli.contract_id=${/parameter/@contract_id}
)
and t.enabled_flag = 'Y'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -62,7 +62,7 @@
param['req_status'] = req_status;
param['url_title'] = '合同回购';
if (req_status == 'APPROVED' || req_status == 'APPROVING' || req_status == 'CANCEL') {
if (req_status == 'APPROVED' || req_status == 'APPROVING' || req_status == 'CANCEL'|| req_status == 'REJECT') {
param['maintain_type'] = 'READONLY';
param['function_code'] = 'CON_REPO001D_Q';
} else {
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.util.zip);
importPackage(java.io); /*可以传入参数*/
function writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
zos.putNextEntry(ze);
var fis = new FileInputStream(fp);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
zos.write(b, 0, len);
}
fis.close();
}
function transfer(file, os) {
var fis = new FileInputStream(file);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function getdate() {
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
d = now.getDate()
m = m < 10 ? "0" + m : m
d = d < 10 ? "0" + d : d
return y + "" + m + "" + d
}
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
var date_str = getdate();
var doc_code = '付款请求书'
var zip_filename = doc_code + '-' + date_str + ".zip";
var file_path;
var fnd_atm_flag = $ctx.parameter.fnd_atm_flag;
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
try {
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var arr = result.getChildren();
if (arr.length == 1) {
//单个下载
file_name = arr[0].download_file_name;
if (fnd_atm_flag == 'Y') {
file_path = arr[0].download_file_path;
} else {
file_path = arr[0].download_file_path + file_name;
}
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'utf-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
} else if (arr.length > 1) {
//打包下载
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(zip_filename));
var zos = new ZipOutputStream(resp.getOutputStream());
var file_exist_list = {};
for (var i = 0;i < arr.length;i++) {
var f = arr[i];
if (f.download_file_path && !file_exist_list[f.download_file_name]) {
writeFile(zos, f.download_file_name, f.download_file_path);
file_exist_list[f.download_file_name] = 1;
} else {
file_exist_list[f.download_file_name] = file_exist_list[f.download_file_name] * 1 + 1;
var last_index = f.download_file_name.lastIndexOf(".");
var temp_exists_file_name = f.download_file_name.substr(0, last_index);
var temp_exists_file_type = f.download_file_name.substr(last_index, f.download_file_name.length);
temp_exists_file_name = temp_exists_file_name + '-' + file_exist_list[f.download_file_name] + temp_exists_file_type;
writeFile(zos, temp_exists_file_name, f.download_file_name);
}
}
zos.close();
}
} catch (e) {
println(e);
var logger = $logger("server-script");
logger.severe(e.message);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-update model="hls.HLS811.hls_doc_file_templet_get_atm"/>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.hls.plugin.docx4j);
importPackage(java.io);
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
function transfer(file_path, os) {
println(file_path);
var fis = new FileInputStream(file_path);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function download_file(file_name, file_path) {
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'UTF-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
}
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var from_file_data = result.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
var to_file_name = record_data.to_file_name;
var from_file_path = record_data.file_path;
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
to_file_path = to_file_path + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
$bm('hls.HLS811.hls_file_content_copy_update').update({
table_name: 'HLS_DOC_FILE_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: $ctx.parameter.source_type
});
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id.toString(), 'COMMON');
//download_file(to_file_name, to_file_path);
} catch (e) {
raise_app_error(e);
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
......@@ -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);
......@@ -516,7 +517,7 @@
//校验银行账户必须与商业伙伴名称一致 18083 2023/9/5
var bp_name=head_record.get('bp_name');
var bank_flag1=true;
if(bank_record.length>0){
if(bank_record.length>0){
var flag = true;
for(var i=0;i<bank_record.length;i++){
var full_name=bank_record[i].get('bank_full_name');
......@@ -528,16 +529,16 @@
}
}
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
var bank_flag1 = false;
}
if(flag == false){
var bank_flag1 = false;
}
if(flag == false){
Leaf.showErrorMessage('${l:PROMPT}', '请填写支行全称(例如:上海浦东发展银行外高桥保税区支行)');
return false;
}
if(bank_flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
}
if(bank_flag1 == false){
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
}
}
}
......@@ -554,7 +555,7 @@
}
}
}
//若选择开票类型为“纸质发票”,则系统校验无法选择“是否全电发票”为“是” 18083 2022/11/30
//若选择开票类型为“纸质发票”,则系统校验无法选择“是否全电发票”为“是” 18083 2022/11/30
if (head_record.get('invoice_type')=='PAPER'){
if(head_record.get('full_elec_invoice_flag')=='Y'){
Leaf.showErrorMessage('${l:PROMPT}', '开票类型为纸质发票,不能选择【是否全电发票】为是');
......@@ -794,32 +795,143 @@
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'){
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('提示', '中征码首字母需要大写');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
//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('提示', '中征码首字母需要大写');
// 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 {
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') {
......@@ -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))
......@@ -1180,7 +1623,7 @@
//设置开票类型为纸质只读
record.set('invoice_type','PAPER');
record.set('invoice_type_n','纸质发票');
//取消开票类型为纸质只读 18083 2022/11/30
//取消开票类型为纸质只读 18083 2022/11/30
//record.getField('invoice_type').setReadOnly(true);
//record.getField('invoice_type_n').setReadOnly(true);
record.getField('invoice_type').setRequired(false);
......@@ -1212,14 +1655,14 @@
}
}
if(name == 'invoice_type'){
//设置是否全电发票默认值 18083
//设置是否全电发票默认值 18083
if(value == 'PAPER'){
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','否');
}else{
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','是');
}
}
......
......@@ -90,21 +90,21 @@
var address_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_address');
var records_addr = $(address_ds_id).getAll();
//校验银行账户名必须与商业伙伴名称一致 18083 2023/9/5
var bp_name=bp_record.get('bp_name');
var bank_flag =true;
if(bank_record.length>0){
var bp_name=bp_record.get('bp_name');
var bank_flag =true;
if(bank_record.length>0){
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){
bank_flag = false;
}
if(!Leaf.isEmpty(bank_record[i].get('bank_account_name'))&&bank_record[i].get('bank_account_name')!=bp_name){
bank_flag = false;
}
}
}
if(bank_flag == false){
if(bank_flag == false){
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
}
//新增校验,承租人(法人)和担保人(法人)商业伙伴的创建,银行账号信息都是要必填(为电子签约做准备)
//新增校验,承租人(法人)和担保人(法人)商业伙伴的创建,银行账号信息都是要必填(为电子签约做准备)
if(bp_record.get('bp_class') == 'ORG'){
if(bp_record.get('bp_type')=='TENANT' || bp_record.get('bp_type')=='GUTA_ORG'){
if(bank_record.length==0){
......@@ -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,32 +649,64 @@
}
}
}
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'){
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('提示', '中征码首字母需要大写');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
//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('提示', '中征码首字母需要大写');
// 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 {
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) {
......@@ -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();
......@@ -1219,4 +1586,4 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
</a:screen>
......@@ -123,8 +123,8 @@
}
}
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){
......@@ -132,10 +132,10 @@
return false;
}
if(bank_flag == false){
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
Leaf.showErrorMessage('${l:PROMPT}', '银行账户户名必须与商业伙伴名称一致');
return false;
}
if(bp_record.get('bp_type')=='THIRD_PARTY'){
if(bp_record.get('bp_type')=='THIRD_PARTY'){
var flag = true;
if (bank_record.length <=0){
Leaf.showErrorMessage('${l:PROMPT}', '第三方必填[银行帐户信息],请在银行帐户信息新增!');
......@@ -688,27 +688,48 @@
//中征码校验
if (record.get('bp_class') == 'ORG') {
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('提示', '中征码首字母需要大写');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else {
return true;
}
}else {
Leaf.showMessage('提示', '请输入16位中征码');
//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('提示', '中征码首字母需要大写');
// 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 {
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 (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;
}
}
}
}
}
......
......@@ -8,14 +8,14 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
</a:init-procedure>
<a:view>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check" url="${/request/@context_path}/modules/zjwfl/zj_wfl_approve_history_check.lview"/>
<a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="prj_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
<a:link id="prj_project_bp_parameter_link" url="${/request/@context_path}/modules/prj/PRJ501/prj_project_bp_parameter.lview"/>
<!-- <a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>-->
<!-- <a:link id="car_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>-->
<a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="car_modify_link_readonly_c" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_constru.lview"/>
<a:link id="car_modify_mananger_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_manager.lview"/>
......@@ -23,6 +23,7 @@
<a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/>
<a:link id="document_history_query_link_id" url="${/request/@context_path}/modules/prj/PRJ502N/prj_document_history_query.lview"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<a:link id="car_modify_operat_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_opreat.lview"/>
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_PROJECT_RESULT', 'prj_project');
function open_project_modify_win(record_id, ds_id) {
......@@ -31,11 +32,11 @@
var url;
//项目类layout_code
maintain_type = 'QUERY';
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_usage'] = 'MODIFY';
param['function_usage'] = 'QUERY';
param['bp_class'] = 'NP';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
......@@ -51,11 +52,30 @@
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, url, ds_id);
}
function on_business_type_leaseoperat_win(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
var url;
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_usage'] = 'QUERY';
param['bp_class'] = 'NP';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
param['function_code'] = 'PRJ501_OPERAT_WFL';
url = 'car_modify_operat_link';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, url, ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'project_number' && value) {
return '<a href="javascript:open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
if(record.get('business_type')=='LEASE'||record.get('business_type')=='LEASEBACK'){
return '<a href="javascript:open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}else if(record.get('business_type')=='LEASEOPERAT'){
return '<a href="javascript:on_business_type_leaseoperat_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
}
return value;
};
......@@ -136,7 +156,7 @@
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
if (ds == $(ds_id)) {
aut_authority_list_validate_query(ds, qpara);
......@@ -156,8 +176,7 @@
document.getElementById("PROJECT_QUERY_ENTRANCE_F_QUERY_NULL_INVOICE_AGENT_ID_prompt").style.display = "none";
document.getElementById("PROJECT_QUERY_ENTRANCE_F_QUERY_NULL_INVOICE_AGENT_ID").style.display = "none";
}
//深圳美鹏和hcs显示分公司,其他隐藏
//深圳美鹏和hcs显示分公司,其他隐藏
var bp_code = '${/model/user_agent_description/record/@bp_code}';
if (!Ext.isEmpty(bp_code) && bp_code !== 'D00010001' && bp_code !== 'D00000009') {
$('${/parameter/@layout_code}_G_PROJECT_RESULT_prj_project_layout_grid_id').hideColumn('branch_code');
......
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