Commit 31bf50ad authored by panhong18943's avatar panhong18943

合同佣金

parent 601557c4
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2014-12-8 上午11:04:41
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hlcm_comsn_reconcilia_pkg.insert_comsn_reconcilia_temp(p_session_id => ${/session/@session_id},
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><![CDATA[
select count(1) count
from hlcm_comsn_reconcilia_temp t
where t.session_id = ${/session/@session_id}
and not exists
(select 1
from hlcm_comsn_reconcilia r
where r.contract_id = t.contract_id
and r.wfl_status in ('NEW', 'APPROVING', 'APPROVED'))
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="count"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2014-12-8 上午11:04:41
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
delete from hlcm_comsn_reconcilia_wfl_temp t where t.session_id = ${/session/@session_id};
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hlcm_comsn_reconcilia_pkg.create_comsn_wfl_temp(p_session_id => ${/session/@session_id},
p_contract_id => ${@contract_id},
p_user_id => ${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hlcm_comsn_reconcilia_pkg.comsn_submit(p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>

var add_datafilters = [{
name : 'wfl_status',
expression : "t1.wfl_status in ('APPROVING','APPROVED')"
}];
add_datafilter();
var override_queryfields = [
{
name : 'overdue_max_days_f',
queryexpression : "t1.overdue_max_days >= ${@overdue_max_days_f}"
},
{
name : 'overdue_max_days_t',
queryexpression : "t1.overdue_max_days <= ${@overdue_max_days_t}"
}
];
override();
......@@ -12,7 +12,7 @@
var add_datafilters = [
{
name : 'init_filter',
expression : "t1.status in ('NEW','ERROR','FINISHED','SEND_MID','CONFIRM1_ERROR','CONFIRM2_FULL_ERROR') and t1.cf_item = '40'"
expression : "t1.status in ('NEW','ERROR','FINISHED','SEND_MID','CONFIRM1_ERROR','CONFIRM2_FULL_ERROR') and t1.cf_item in ('40','911')"
}
];
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangxing5129
$Date: 2014-8-1 下午02:44:52
$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>
<s:server-script><![CDATA[
var config = $config();
var ds = CompositeUtil.findChild(config,'dataSet','id','CSH551_G_N_RESULT_hlcm_comsn_reconcilia_temp_ds');
ds.put('fetchall',false);
ds.put('autopagesize',false);
ds.put('pagesize','100');
ds.put('maxpagesize','2000');
]]></s:server-script>
</a:init-procedure>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_insert_comsn_reconcilia_temp_link_id" model="csh.CSH551.insert_comsn_reconcilia_temp" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}_query_comsn_reconcilia_temp_link_id" model="csh.CSH551.insert_comsn_reconcilia_temp" modelaction="query"/>
<a:link id="${/parameter/@layout_code}_submit_comsn_selected_link_id" url="${/request/@context_path}/modules/csh/CSH551/submit_comsn_selected.lsc"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_op_query_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_op_modify.lview"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
var temp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia_temp');
$(temp_ds_id).setQueryParameter('session_id', -1);
$(temp_ds_id).query();
});
//加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
var n_ds = '${/parameter/@layout_code}_F_N_QUERY__ds';
var n_record = $(n_ds).getCurrentRecord();
if (n_ds == ds.id) {
if (Ext.isEmpty(record.get('policy_hd_id'))) {
record.set('session_id',-1);
}
}
};
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var n_ds = '${/parameter/@layout_code}_F_N_QUERY__ds';
var n_record = $(n_ds).getCurrentRecord();
if (ds.id == n_ds) {
if (name == 'policy_hd_id') {
record.set('division', '');
record.set('division_n', '');
record.set('total_finance_amount', '');
record.set('rent_recovery_time', '');
record.set('calc_start_date', '');
record.set('calc_end_date', '');
}
}
};
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
var division=param.division;
if(division!='95'){
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
var url = '${/parameter/@layout_code}con_contract_query_link';
}else {
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q_OP';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
var url = '${/parameter/@layout_code}con_contract_op_query_link';
}
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, url, ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var n_ds = '${/parameter/@layout_code}_F_N_QUERY__ds';
var f_ds = '${/parameter/@layout_code}_F_F_QUERY__ds';
var temp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia_temp');
var comsn_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia');
var n_record = $(n_ds).getCurrentRecord();
var f_record = $(f_ds).getCurrentRecord();
var temp_ds = $(temp_ds_id);
var comsn_ds = $(comsn_ds_id);
var temp_records = temp_ds.getAll();
let a = document.querySelectorAll("div.strip");
// 页面展示 未发起计提
if(a[0].classList.contains('active')){
if (!Ext.isEmpty(n_record.get('bp_id')) && !Ext.isEmpty(n_record.get('policy_hd_id'))) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_insert_comsn_reconcilia_temp_link_id').getUrl(),
para: {
policy_hd_id: n_record.get('policy_hd_id')
},
success: function() {
Leaf.request({
url: $('${/parameter/@layout_code}_query_comsn_reconcilia_temp_link_id').getUrl(),
success: function(res) {
var count = res.result.record.count;
n_record.set('count',count);
},
sync: true,
scope: this
});
temp_ds.setQueryParameter('session_id', '${/session/@session_id}');
temp_ds.query();
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']();
},
sync: true,
scope: this
});
}else{
Leaf.showMessage('${l:PROMPT}', '请选择代理店和佣金政策!');
return;
}
}
// 页面展示 已发起计提
if(a[1].classList.contains('active')){
comsn_ds.query();
}
}
// 提交审批
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var n_ds = '${/parameter/@layout_code}_F_N_QUERY__ds';
var temp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia_temp');
var n_record = $(n_ds).getCurrentRecord();
var records = $(temp_ds_id).getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条未计提的记录');
return;
}
if (records.length > 100) {
Leaf.showMessage('${l:PROMPT}', '选择未计提的记录不可超过100条');
return;
}
var bp_id = n_record.get('bp_id');
var policy_hd_id = n_record.get('policy_hd_id');
if (Ext.isEmpty(bp_id) || Ext.isEmpty(policy_hd_id)) {
Leaf.showMessage('${l:PROMPT}', '请选择代理店和佣金政策!');
return;
}
var param = [];
for (var i = 0; i < records.length;i++) {
// 合同佣金为0 不可提交
if(Ext.isEmpty(records[i].get('comsn_amount')) || records[i].get('comsn_amount') == 0){
Leaf.showMessage('${l:PROMPT}', '合同' + records[i].get('contract_number') + '佣金为0,不可提交审批');
return;
}
// 校验代理店、佣金政策和合同是否一致
if (bp_id != records[i].get('bp_id_agent_level1') || policy_hd_id != records[i].get('policy_hd_id')){
Leaf.showMessage('${l:PROMPT}', '代理店或佣金政策与所选合同不匹配,请重新查询后再选择数据提交审批');
return;
}
param.push({
'contract_id': records[i].get('contract_id')
});
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function() {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_submit_comsn_selected_link_id').getUrl(),
para: param,
success: function(res) {
Leaf.request({
url: $('${/parameter/@layout_code}_query_comsn_reconcilia_temp_link_id').getUrl(),
success: function(res) {
var count = res.result.record.count;
n_record.set('count',count);
if (count > 0){
Leaf.showMessage('${l:PROMPT}', '当前页面待提交的数量为' + count + '条');
}
},
sync: true,
scope: this
});
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$(temp_ds_id).query();
},
failure: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
}
]]></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: zhangxing5129
$Date: 2014-8-1 下午02:44:52
$Revision: 1.0
$Purpose: 合同维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:view>
<a:link id="wfl_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
var batch_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia_batch');
var comsn_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_reconcilia');
$(batch_ds_id).setQueryParameter('batch_id', '${/parameter/@batch_id}');
$(comsn_ds_id).setQueryParameter('batch_id', '${/parameter/@batch_id}');
$(batch_ds_id).query();
$(comsn_ds_id).query();
});
if ('${/parameter/@layout_code}' == 'CSH551WFL_M') {
zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function(type) {
var root_ds = $('${/parameter/@layout_code}_virtual_ds');
if (type == 'agree') {
if (root_ds.validate()) {
//提交先保存
root_ds.submit();
return true;
} else {
return false;
}
}else{
return true;
}
});
}
]]></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"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-delete model="csh.CSH551.submit_comsn_selected"/>
<batch-apply sourcepath="/parameter">
<a:model-execute model="csh.CSH551.submit_comsn_selected"/>
</batch-apply>
<a:model-update model="csh.CSH551.submit_comsn_selected"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
\ No newline at end of file
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