Commit dd2d4f71 authored by 邓乾隆's avatar 邓乾隆

添加报价页面、商业伙伴法人、个人页面除去空格通用方法

parent 410f22ee
...@@ -143,6 +143,111 @@ ...@@ -143,6 +143,111 @@
} }
} }
//去除数据空格
function remove_space(table_name,field_name,aurora_bm_field){
//租赁项目信息,客户类型,催收手机号,交货地址,租赁物安置地点,合同签订地
if(table_name.toUpperCase()=='PRJ_PROJECT'){
if(field_name.toUpperCase()=='BP_CLASS' || field_name.toUpperCase()=='CELL_PHONE'
|| field_name.toUpperCase()=='DELIVERY_ADDRESS' || field_name.toUpperCase()=='LEASE_ITEM_LOCATION'
|| field_name.toUpperCase()=='SIGNING_CITY'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//项目报告_租赁物信息,序号,品牌名称,租赁物,机型,机号,使用小时,留购价,二手机评估价,台数
if(table_name.toUpperCase()=='PRJ_PROJECT_LEASE_ITEM'){
if(field_name.toUpperCase()=='LEASE_ITEM_SEQ' || field_name.toUpperCase()=='BRAND_VALUE' ||
field_name.toUpperCase()=='LEASE_ITEM_ID' || field_name.toUpperCase()=='MODELCD' ||
field_name.toUpperCase()=='MACHINE_NUMBER' || field_name.toUpperCase()=='MACHINE_NUMBER_70' ||
field_name.toUpperCase()=='USING_HOUR' || field_name.toUpperCase()=='DETENTION_AMOUNT' ||
field_name.toUpperCase()=='DETENTION_AMOUNT' || field_name.toUpperCase()=='SET_NUMBER'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//承租人评分明细表,房产价值,家庭平均月收入,工程平均月收入,工程合同金额,第三方担保附件份数,年龄,铁甲评分
if(table_name.toUpperCase()=='BP_TENANT_RATE_DETAIL'){
if(field_name.toUpperCase()=='HOUSE_VALUE' || field_name.toUpperCase()=='FAMILY_AVG_INCOME' ||
field_name.toUpperCase()=='WORK_AVG_MONTH_INCOME' || field_name.toUpperCase()=='E_CONTRACT_AMOUNT' ||
field_name.toUpperCase()=='THIRD_GUAR_SCORE' || field_name.toUpperCase()=='BP_AGE' ||
field_name.toUpperCase()=='TJ_SCORE'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//hls_bp_master和hls_bp_master_req,商业伙伴名称,简称,统一社会信用代码,中征码,注册资本,法人代表姓名,主营业务,法人代表身份证号,电话,手机,注册地址,邮政编码,证件号码,电话(住宅),电话
//职业信息,入职年份,单位名称,单位详细地址,单位电话,单位邮编
//配偶信息,配偶姓名,证件号码,联系电话,单位电话,工作单位,单位地址
if(table_name.toUpperCase()=='HLS_BP_MASTER' || table_name.toUpperCase()=='HLS_BP_MASTER_REQ'){
if(field_name.toUpperCase()=='BP_NAME' || field_name.toUpperCase()=='EXTRA_NAM'
|| field_name.toUpperCase()=='SOCIAL_CODE' || field_name.toUpperCase()=='CREDIT_CODE'
|| field_name.toUpperCase()=='REGISTERED_CAPITAL' || field_name.toUpperCase()=='LEGAL_PERSON'
|| field_name.toUpperCase()=='MAIN_BUSINESS' || field_name.toUpperCase()=='ID_CARD_NO_LEG'
|| field_name.toUpperCase()=='PHONE' || field_name.toUpperCase()=='CELL_PHONE'
|| field_name.toUpperCase()=='REGISTERED_PLACE' || field_name.toUpperCase()=='ZIPCODE'
|| field_name.toUpperCase()=='ID_CARD_NO' || field_name.toUpperCase()=='HOME_PHONE'
|| field_name.toUpperCase()=='EMAIL' || field_name.toUpperCase()=='FAX'
|| field_name.toUpperCase()=='LIVING_ADDRESS' || field_name.toUpperCase()=='ENTRY_DATE'
|| field_name.toUpperCase()=='WORK_UNIT' || field_name.toUpperCase()=='WORK_UNIT_ADDRESS'
|| field_name.toUpperCase()=='WORK_UNIT_PHONE' || field_name.toUpperCase()=='WORK_UNIT_ZIP'
|| field_name.toUpperCase()=='BP_NAME_SP' || field_name.toUpperCase()=='ID_NO_SP'
|| field_name.toUpperCase()=='CELL_PHONE_SP' || field_name.toUpperCase()=='WORK_UNIT_PHONE_SP'
|| field_name.toUpperCase()=='WORK_UNIT_NAME_SP' || field_name.toUpperCase()=='WORK_UNIT_ADDRESS_SP'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//经办人信息,姓名,身份证号,手机号
if(table_name.toUpperCase()=='HLS_BP_MASTER_SIGNER' || table_name.toUpperCase()=='HLS_BP_MASTER_SIGNER_REQ'){
if(field_name.toUpperCase()=='NAME' || field_name.toUpperCase()=='ID_CARD'
|| field_name.toUpperCase()=='CELL_PHONE'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//银行信息,账户名称,银行账号,银行全称,支行名称
if(table_name.toUpperCase()=='HLS_BP_MASTER_BANK_ACCOUNT'){
if(field_name.toUpperCase()=='BANK_ACCOUNT_NAME' || field_name.toUpperCase()=='BANK_ACCOUNT_NUM'
|| field_name.toUpperCase()=='BANK_FULL_NAME' || field_name.toUpperCase()=='BANK_BRANCH_NAME'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//地址信息,详细地址,邮政编码,电话
if(table_name.toUpperCase()=='HLS_BP_MASTER_ADDRESS' || table_name.toUpperCase()=='HLS_BP_MASTER_ADDRESS_REQ'){
if(field_name.toUpperCase()=='ADDRESS' || field_name.toUpperCase()=='ZIPCODE'
|| field_name.toUpperCase()=='PHONE'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//联系人信息,联系人名称,职位,电话,传真,E-mail,地址,邮政编码,支付负责人
if(table_name.toUpperCase()=='HLS_BP_MASTER_CONTACT_INFO'){
if(field_name.toUpperCase()=='CONTACT_PERSON' || field_name.toUpperCase()=='POSITION'
|| field_name.toUpperCase()=='PHONE' || field_name.toUpperCase()=='FAX'
|| field_name.toUpperCase()=='EMAIL' || field_name.toUpperCase()=='CONTACT_INFO'
|| field_name.toUpperCase()=='REF_V01' || field_name.toUpperCase()=='PAYMENT_OWNER'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
//企业关联信息,身份类型,名称,证件号码,出资比例
if(table_name.toUpperCase()=='HLS_BP_MASTER_COMPANY_INFO'){
if(field_name.toUpperCase()=='IDENTITY_TYPE' || field_name.toUpperCase()=='PERSON_NAME'
|| field_name.toUpperCase()=='ASSOCIATE_ID_NO' || field_name.toUpperCase()=='CAPITAL_KEY'){
f.setInsertExpression('hlc_remove_space(${@'+field_name+'})');
f.setUpdateExpression('hlc_remove_space(${@'+field_name+'})');
}
}
}
var table_name = $ctx.dynamic_base_table; var table_name = $ctx.dynamic_base_table;
// println("table_name:"+table_name); // println("table_name:"+table_name);
...@@ -178,6 +283,7 @@ ...@@ -178,6 +283,7 @@
} }
} }
f.setDatabaseType(r.dbtype); f.setDatabaseType(r.dbtype);
remove_space(tableName,r.name.toLowerCase(),f);
f.setPrompt(r.prompt); f.setPrompt(r.prompt);
$this.addField(f); $this.addField(f);
if (r.ispk) { if (r.ispk) {
......
...@@ -391,6 +391,9 @@ ...@@ -391,6 +391,9 @@
var patrn = /^[0-9A-Z]+$/; var patrn = /^[0-9A-Z]+$/;
//18位校验及大写校验 //18位校验及大写校验
//去除空格
Code = Code.trim();
Code = Code.replace(/[\t\r\f\n\s]*/g,"");
if ((Code.length != 18) || (patrn.test(Code) == false)) { if ((Code.length != 18) || (patrn.test(Code) == false)) {
return false; return false;
} else { } else {
...@@ -726,6 +729,8 @@ ...@@ -726,6 +729,8 @@
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow'); var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
//邮编校验 add by 20230619 //邮编校验 add by 20230619
if(name=='zipcode'|| name=='work_unit_zip') { 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) { if (!(/^[0-9]{6}$/.test(value)) && value) {
Leaf.showMessage('提示', '请正确填写邮编', function () { Leaf.showMessage('提示', '请正确填写邮编', function () {
record.set(name, ''); record.set(name, '');
...@@ -763,6 +768,8 @@ ...@@ -763,6 +768,8 @@
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,"");
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('提示', '中征码首字母需要大写');
......
...@@ -176,6 +176,9 @@ ...@@ -176,6 +176,9 @@
function CheckSocialCreditCode(Code) { function CheckSocialCreditCode(Code) {
var patrn = /^[0-9A-Z]+$/; var patrn = /^[0-9A-Z]+$/;
//18位校验及大写校验 //18位校验及大写校验
//去除空格
Code = Code.trim();
Code = Code.replace(/[\t\r\f\n\s]*/g,"");
if ((Code.length != 18) || (patrn.test(Code) == false)) { if ((Code.length != 18) || (patrn.test(Code) == false)) {
return false; return false;
} else { } else {
...@@ -534,6 +537,8 @@ ...@@ -534,6 +537,8 @@
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow'); var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
//邮编校验 add by 20230619 //邮编校验 add by 20230619
if(name=='zipcode'|| name=='work_unit_zip') { 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) { if (!(/^[0-9]{6}$/.test(value)) && value) {
Leaf.showMessage('提示', '请正确填写邮编', function () { Leaf.showMessage('提示', '请正确填写邮编', function () {
record.set(name, ''); record.set(name, '');
...@@ -568,6 +573,8 @@ ...@@ -568,6 +573,8 @@
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.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('提示', '中征码首字母需要大写');
......
...@@ -211,6 +211,9 @@ ...@@ -211,6 +211,9 @@
function CheckSocialCreditCode(Code) { function CheckSocialCreditCode(Code) {
var patrn = /^[0-9A-Z]+$/; var patrn = /^[0-9A-Z]+$/;
//18位校验及大写校验 //18位校验及大写校验
//去除空格
Code = Code.trim();
Code = Code.replace(/[\t\r\f\n\s]*/g,"");
if ((Code.length != 18) || (patrn.test(Code) == false)) { if ((Code.length != 18) || (patrn.test(Code) == false)) {
return false; return false;
} else { } else {
...@@ -574,6 +577,8 @@ ...@@ -574,6 +577,8 @@
//邮编校验 add by 20230619 //邮编校验 add by 20230619
if(name=='zipcode'|| name=='work_unit_zip') { if(name=='zipcode'|| name=='work_unit_zip') {
if (!(/^[0-9]{6}$/.test(value)) && value) { if (!(/^[0-9]{6}$/.test(value)) && value) {
value = value.trim();
value = value.replace(/[\t\r\f\n\s]*/g,"");
Leaf.showMessage('提示', '请正确填写邮编', function () { Leaf.showMessage('提示', '请正确填写邮编', function () {
record.set(name, ''); record.set(name, '');
}); });
...@@ -607,6 +612,8 @@ ...@@ -607,6 +612,8 @@
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.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('提示', '中征码首字母需要大写');
......
...@@ -40,6 +40,9 @@ checkCard = function(card) { ...@@ -40,6 +40,9 @@ checkCard = function(card) {
if(Ext.isEmpty(card)){ if(Ext.isEmpty(card)){
return true; return true;
} }
//去除空格
card = card.trim();
card = card.replace(/[\t\r\f\n\s]*/g,"");
if (isCardNo(card) === false) { if (isCardNo(card) === false) {
return false; return false;
} }
...@@ -174,6 +177,8 @@ changeFivteenToEighteen = function(card) { ...@@ -174,6 +177,8 @@ changeFivteenToEighteen = function(card) {
function checkMobile(str) { function checkMobile(str) {
// var re = /^1\d{10}$/; // var re = /^1\d{10}$/;
//var re=/^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$|(^(13[0-9]|15[0|3|6|7|8|9]|18[8|9])\d{8}$)/; //var re=/^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$|(^(13[0-9]|15[0|3|6|7|8|9]|18[8|9])\d{8}$)/;
str = str.trim();
str = str.replace(/[\t\r\f\n\s]*/g,"");
var re=/^((0\d{2,3}-\d{7,8})|(1[3584769]\d{9}))$/; var re=/^((0\d{2,3}-\d{7,8})|(1[3584769]\d{9}))$/;
if (re.test(str)) { if (re.test(str)) {
return true; return true;
......
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