Commit d614bfdb authored by 38823's avatar 38823

佣金政策报表开发

parent a2b52f64
......@@ -46,9 +46,11 @@
if(wflStatus=='NEW' || wflStatus=='APPROVED_RETURN'){
param['function_code'] = 'HLS303_BD';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'MODIFY';
param['url_title'] = '佣金政策维护';
param['policy_hd_id'] = policy_hd_id;
param['bp_id'] = bpId;
param['extra_nam'] = record.get('extra_nam');
}
if(wflStatus=='APPROVING' || wflStatus=='APPROVED'){
param['function_code'] = 'HLS303_BD';
......
......@@ -76,6 +76,18 @@
}
}
};
/* 时间戳转换为时间 */
function RetimestampToTime(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) : String(date.getMonth() + 1)) + '-';
var D = (date.getDate() < 10 ? '0' + date.getDate() : String(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}_submit_approval_layout_dynamic_click'] = function() {
debugger;
......@@ -86,8 +98,8 @@
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')));
var calcStartDate = RetimestampToTime(Date.parse(record.get('calc_start_date')));
var calcEndDate = RetimestampToTime(Date.parse(record.get('calc_end_date')));
if(record.dirty==true){
Leaf.showMessage('${l:PROMPT}','${l:HLS.EXECUTE_AFTER_SAVE}');
return;
......@@ -113,16 +125,16 @@
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));
var resStartDate=RetimestampToTime(Date.parse(res.result.record.calc_start_date));
var resEndDate=RetimestampToTime(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));
var resStartDate=RetimestampToTime(Date.parse(res.result.record[i].calc_start_date));
var resEndDate=RetimestampToTime(Date.parse(res.result.record[i].calc_end_date));
if(resStartDate<calcStartDate<resEndDate || resStartDate<calcEndDate<resEndDate){
$L.showErrorMessage('提示','该代理店项下存在重叠的政策时间,请先检查!');
return;
......@@ -196,7 +208,7 @@
}
}
var division = record.get('division_n');
if(record.isNew==true && record.get('wfl_status') !='APPROVING' && record.get('policy_name') == undefined){
if(record.get('wfl_status') !='APPROVING'){
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);
......
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