Commit 3282bda5 authored by 38823's avatar 38823

代理店(佣金政策开发)

parent 1008da97
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 38823
$Date: 2024-03-22
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hlcm_com_policy_wfl_pkg.policy_wfl_start(
p_policy_hd_id =>${@policy_hd_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql>
select hd.calc_start_date,hd.calc_end_date from hlcm_comsn_policy_hd hd where hd.bp_id=${@bp_id} and hd.division=${@division} and hd.wfl_status='APPROVED'
</bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
var override_queryfields = [
{
name:'calc_start_date',
queryexpression:"t1.calc_start_date between to_date(${@calc_start_date},'yyyy-mm-dd') and nvl(to_date(${@calc_end_date},'yyyy-mm-dd'),t1.calc_start_date)"
},
{
name:'calc_end_date',
queryexpression:"t1.calc_end_date between nvl(to_date(${@calc_start_date},'yyyy-mm-dd'),t1.calc_end_date) and to_date(${@calc_end_date},'yyyy-mm-dd')"
}
];
override();
\ No newline at end of file
......@@ -339,7 +339,6 @@ var enableLayoutConfig = {
'modules/csh/CSH531F/csh_bank_recoi_processing.lview':true,
'modules/csh/CSH531F/csh_bank_recoi_processing_workflow.lview':true,
'modules/csh/CSH531F/csh_bank_recoi_margin_check.lview':true,
'modules/hsbc/HSBC130/pingan_account_hisbalance_query.lview':true,
'modules/prj/PRJ500N/prj_project_constru_create.lview':true,
'modules/prj/PRJ501N/prj_project_maintain_constru.lview':true,
'modules/prj/PRJ501N/prj_project_maintain_constru_wfl.lview':true,
......@@ -348,8 +347,9 @@ var enableLayoutConfig = {
'modules/inv/INV100/inv_payment_wfl_detail.lview':true,
'modules/hls/HLS303/bp_asset_create.lview':true,
'modules/csh/CSH1500/csh_asset_reconciliation.lview':true,
'modules/csh/CSH501C/csh_payment_asset_create_entrance.lview': true,
'modules/csh/CSH501C/csh_payment_asset_req.lview': true,
'modules/csh/CSH501R/csh_payment_comm_create_entrance.lview':true,
'modules/csh/CSH501R/csh_payment_comm_req.lview':true
'modules/csh/CSH501C/csh_payment_asset_create_entrance.lview':true,
'modules/csh/CSH501C/csh_payment_asset_req.lview':true,
'modules/cont/CON1370/con_asset_fee_detail.lview':true,
'modules/hls/HLS303/bp_agent_bounty_create.lview':true,
'modules/hls/HLS303/bp_agent_bounty_detail.lview':true
};
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 38823
$Date: 2024-03-19
$Revision: 1.0
$purpose: 佣金政策
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script"
customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="${/parameter/@layout_code}commission_detail_link"
url="${/request/@context_path}/modules/hls/HLS303/bp_agent_bounty_detail.lview"/>
<script type="text/javascript"><![CDATA[
//新建
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
var param={};
param['bp_id'] = '${/parameter/@bp_id}';
param['bp_name'] = '${/parameter/@bp_name}';
param['extra_nam'] = '${/parameter/@extra_nam}';
param['function_code'] = 'HLS303_BD';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'CREATE';
param['winid'] = 'open_commission_detail_window';
param['url_title'] = '佣金政策维护';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}commission_detail_link',ds_id);
};
function policy_detail(id, name, query_only){
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var policy_hd_id=record.get('policy_hd_id');
var wflStatus=record.get('wfl_status');
var bpId=record.get('bp_id');
var param = {};
if(wflStatus=='NEW' || wflStatus=='APPROVED_RETURN'){
param['function_code'] = 'HLS303_BD';
param['function_usage'] = 'MODIFY';
param['url_title'] = '佣金政策维护';
param['policy_hd_id'] = policy_hd_id;
param['bp_id'] = bpId;
}
if(wflStatus=='APPROVING' || wflStatus=='APPROVED'){
param['function_code'] = 'HLS303_BD';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY'
param['url_title'] = '佣金政策维护';
param['policy_hd_id'] = policy_hd_id;
param['bp_id'] = bpId;
}
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}commission_detail_link', ds_id, '${/parameter/@layout_code}');
}
//删除
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
Leaf.showConfirm('提示', '是否确认删除', function() {
debugger;
var records = $(ds_id).getSelected();
if(records.length ==0){
$L.showMessage('提示','请至少选择一条数据!');
return;
}
for(var i=0;i<records.length;i++){
if(records[i].data.wfl_status == 'APPROVED' || records[i].data.wfl_status == 'APPROVING'){
$L.showMessage('提示',' 请选择审批状态为新建/审批退回的单据!');
return;
}
$(ds_id).remove(records[i]);
}
});
};
//超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'policy_name') {
link_function = 'policy_detail';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' +value + '</a>';
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 38823
$Date: 2024-03-21
$Revision: 1.0
$purpose: 佣金政策维护页面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script"
customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="policy_approval_link_id" model="hls.HLS303.hlcm_com_policy_wfl" modelaction="update"/>
<a:link id="policy_query_link_id" model="hls.HLS303.hlcm_com_policy_wfl" modelaction="query"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<script type="text/javascript"><![CDATA[
$L.onReady(function(){
debugger;
if('${/parameter/@maintain_type}'=='CREATE'){
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
var record = $(ds_id).getCurrentRecord();
var bpId = '${/parameter/@bp_id}';
record.set('bp_id',bpId);
record.set('agent_name','${/parameter/@bp_name}');
}
if('${/parameter/@function_usage}'=='QUERY'){
if(document.getElementById('${/parameter/@layout_code}_exit')){
$jq('#${/parameter/@layout_code}_exit').hide();
}
if(document.getElementById('${/parameter/@layout_code}_submit_approval')){
$jq('#${/parameter/@layout_code}_submit_approval').hide();
}
if(document.getElementById('${/parameter/@layout_code}_save')){
$jq('#${/parameter/@layout_code}_save').hide();
}
}
});
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_ln');
var result_record = $(ds_id).getAll();
for(var i=0;i<result_record.length;i++){
if(name=='finance_amount_to'){
var amountTo=result_record[i].get('finance_amount_to');
if(amountTo != undefined && i == result_record.length-1){
if(result_record[i].get('finance_amount_from')>amountTo){
Leaf.showMessage('提示','当前佣金政策的融资额范围存在重叠/空缺,请先修改!');
return;
}else {
$(ds_id).create();
result_record[i+1].getField('finance_amount_from').setRequired(false);
result_record[i+1].set('finance_amount_from',amountTo);
result_record[i+1].getField('finance_amount_from').setReadOnly(true);
}
}
}
if(name == 'comsn_rate'){
if(result_record[i].get('comsn_rate') == 0){
$L.showMessage('提示','佣金比例不能为0!');
return;;
}
}
}
};
//提交审批
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
debugger;
var ds_id=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'hlcm_comsn_policy_hd');
var re_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'hlcm_comsn_policy_ln');
var record=$(ds_id).getCurrentRecord();
var re_record=$(re_ds_id).getAll();
var policyHdId=record.get('policy_hd_id');
var bpId=record.get('bp_id');
var division=record.get('division');
var calcStartDate = timestampToTime(Date.parse(record.get('calc_start_date')));
var calcEndDate = timestampToTime(Date.parse(record.get('calc_end_date')));
if(record.dirty==true || re_record.dirty==true){
Leaf.showMessage('${l:PROMPT}','${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
if(re_record.length ==0){
Leaf.showErrorMessage('${l:PROMPT}','请先维护政策规则!');
return;
}
if($(ds_id).validate()){
Leaf.request({
url: $('policy_query_link_id').getUrl(),
para:{
bp_id:bpId,
division:division
},
scope:this,
success: function(res) {
if(res.result.record !=undefined){
if(res.result.record.length ==undefined){
var resStartDate=timestampToTime(Date.parse(res.result.record.calc_start_date));
var resEndDate=timestampToTime(Date.parse(res.result.record.calc_end_date));
if(resStartDate<calcStartDate<resEndDate || resStartDate<calcEndDate<resEndDate){
$L.showErrorMessage('提示','该代理店项下存在重叠的政策时间,请先检查!');
return;
}
}else {
for(var i=0;i<res.result.record.length;i++){
var resStartDate=timestampToTime(Date.parse(res.result.record[i].calc_start_date));
var resEndDate=timestampToTime(Date.parse(res.result.record[i].calc_end_date));
if(resStartDate<calcStartDate<resEndDate || resStartDate<calcEndDate<resEndDate){
$L.showErrorMessage('提示','该代理店项下存在重叠的政策时间,请先检查!');
return;
}
}
}
}
Leaf.showConfirm('${HLS.PROMPT}','确认要提交工作流吗?',function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('policy_approval_link_id').getUrl(),
para:{
policy_hd_id:policyHdId
},
scope:this,
success: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
}
}
/* 时间戳转换为时间 */
function timestampToTime(timestamp) {
timestamp = timestamp ? timestamp : null;
var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear();
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
// var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
// var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
// var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Y + M + D;
};
/*保存前调用,生成编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
var check_flag = true;
var hd_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
var record = $(hd_ds_id).getCurrentRecord();
var division = record.get('division_n');
if(record.isNew==true && record.get('wfl_status') !='APPROVING' && record.get('policy_name') == undefined){
var calcStartDate = timestampToTime(Date.parse(record.get('calc_start_date')));
var calcEndDate = timestampToTime(Date.parse(record.get('calc_end_date')));
record.set('policy_name','${/parameter/@extra_nam}'+'-'+division +' '+calcStartDate+'-'+calcEndDate);
return check_flag;
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
......@@ -18,6 +18,8 @@
<a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="${/parameter/@layout_code}asset_management_link"
url="${/request/@context_path}/modules/hls/HLS303/bp_asset_create.lview"/>
<a:link id="${/parameter/@layout_code}commission_link"
url="${/request/@context_path}/modules/hls/HLS303/bp_agent_bounty_create.lview"/>
<a:link id="import_upload_link" url="${/request/@context_path}/modules/hls/HLS303/bp_agent_import_upload.lview"/>
<!--<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js" type="text/javascript"/>-->
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
......@@ -382,8 +384,32 @@
param['url_title'] = '资产管理费组合利率定义';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}asset_management_link',ds_id);
}
//佣金政策
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_agent_division');
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var record = $(ds_id).getAll();
var bp_record = $(bp_ds_id).getCurrentRecord();
if(bp_record.get('bp_id') == undefined){
$L.showMessage('提示','请先保存!');
return;
}
if(record.length == 0){
$L.showErrorMessage('提示','请先维护租赁物信息!');
return;;
}
var param = {};
param['bp_id'] = bp_record.get('bp_id');
param['bp_name'] = bp_record.get('bp_name');
param['extra_nam'] = bp_record.get('extra_nam');
param['function_code'] = 'HLS303_BO';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
param['winid'] = 'open_commission_window';
param['url_title'] = '佣金政策';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}commission_link');
};
//超链接渲染
......
......@@ -5,6 +5,8 @@
<a:link id="prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="asset_management_link_id"
url="${/request/@context_path}/modules/hls/HLS303/bp_asset_create.lview"/>
<a:link id="${/parameter/@layout_code}commission_link"
url="${/request/@context_path}/modules/hls/HLS303/bp_agent_bounty_create.lview"/>
<a:link id="hls303_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>
<a:link id="hls303_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js" type="text/javascript"/>
......@@ -330,6 +332,29 @@
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'asset_management_link_id',ds_id);
}
//佣金政策
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_agent_division');
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var record = $(ds_id).getAll();
var bp_record = $(bp_ds_id).getCurrentRecord();
if(record.length == 0){
$L.showErrorMessage('提示','请先维护租赁物信息!');
return;
}
var param = {};
param['bp_id'] = record[0].data.bp_id;
param['bp_name'] = bp_record.get('bp_name');
param['extra_nam'] = bp_record.get('extra_nam');
param['function_code'] = 'HLS303_BO';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
param['winid'] = 'open_commission_window';
param['url_title'] = '佣金政策';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}commission_link');
};
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
......
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