Commit fafb9601 authored by 38823's avatar 38823

佣金政策测试问题修复二

parent 9f739558
......@@ -19,7 +19,7 @@
</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'
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 in ('APPROVED','APPROVING')
</bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -8,4 +8,9 @@ var override_queryfields = [
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')"
}
];
var add_datafilters=[{
name:'bp_id',
expression : "t1.bp_id= ${/parameter/@bp_id}"
}];
add_datafilter();
override();
\ No newline at end of file
......@@ -13,6 +13,12 @@
<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[
$L.onReady(function(){
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
$(ds_id).setQueryParameter('bp_id','${/parameter/@bp_id}');
$(ds_id).query();
});
//新建
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
debugger;
......
......@@ -37,21 +37,23 @@
});
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
debugger;
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(amountTo != undefined){
if(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].set('finance_amount_from',amountTo);
}
}
result_record[i+1].set('finance_amount_from',amountTo);
}
}
if(name == 'finance_amount_from'){
......@@ -59,7 +61,7 @@
var amountTo=result_record[i].get('finance_amount_to');
if(i+1<result_record.length && result_record[i+1].data.finance_amount_from !=undefined){
var amountFrom=result_record[i+1].get('finance_amount_from');
if(amountTo>amountFrom){
if(amountTo != amountFrom){
$L.showMessage('提示','当前佣金政策的融资额范围存在重叠/空缺,请先修改!');
return;
}
......@@ -86,10 +88,16 @@
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){
if(record.dirty==true){
Leaf.showMessage('${l:PROMPT}','${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
for(var i=0;i<re_record.length;i++){
if(re_record[i].dirty==true){
Leaf.showMessage('${l:PROMPT}','${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
}
if(re_record.length ==0){
Leaf.showErrorMessage('${l:PROMPT}','请先维护政策规则!');
return;
......@@ -154,7 +162,6 @@
}
/* 时间戳转换为时间 */
function timestampToTime(timestamp) {
debugger;
timestamp = timestamp ? timestamp : null;
var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear();
......@@ -167,9 +174,27 @@
};
/*保存前调用,生成编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
debugger
var check_flag = true;
var hd_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_hd');
var ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hlcm_comsn_policy_ln');
var record = $(hd_ds_id).getCurrentRecord();
var ln_record = $(ln_ds_id).getAll();
for(var i=0;i<ln_record.length;i++){
var amountTo = ln_record[ln_record.length-1].get('finance_amount_to');
if(amountTo != undefined){
$L.showErrorMessage('提示','当前佣金政策的融资额范围存在重叠/空缺,请先修改!');
return false;
}
if(i+1 < ln_record.length){
var amountTo2 = ln_record[i].get('finance_amount_to');
var amountFrom = ln_record[i+1].get('finance_amount_from');
if(amountTo2 != amountFrom){
$L.showErrorMessage('提示','当前佣金政策的融资额范围存在重叠/空缺,请先修改!');
return false;
}
}
}
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')));
......@@ -186,6 +211,7 @@
var record = $(ds_id).getAt(0);
if(record.get('finance_amount_from') ==undefined){
record.set('finance_amount_from',0);
record.getField('finance_amount_from').setReadOnly(true);
}
};
]]></script>
......
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