Commit 04f11195 authored by Darming's avatar Darming

[feat]商业伙伴评分

parent 45c3f50c
......@@ -26,7 +26,7 @@
from prj_project prj
where prj.project_id = sc.object_id),
'PD',
(select bp.bp_name
(select decode(bp.bp_class,'NP',bp.bp_name,'ORG',bp.legal_person)
from hls_bp_master bp
where bp.bp_id = sc.object_id),
'') object_name,
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT count(1) list_count
FROM bp_tenant_rate_detail_v t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="(rownum = 1)" />
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (
SELECT bp.*, fsr.object_id bp_id
FROM bp_tenant_rate_detail_v bp,
fnd_sc_score fss,
fnd_sc_score_result fsr,
fnd_score_template fst
WHERE bp.project_id = fss.project_id
AND fss.sc_score_id = fsr.sc_score_id
AND fsr.score_template_id = fst.score_template_id
AND fst.score_template_code = 'HL_CM_NP' order by bp.BP_DETAIL_ID desc) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="(rownum = 1)" />
</bm:data-filters>
</bm:model>
......@@ -15,6 +15,10 @@
$ctx.parameter.tomcat_source = con_print_path['tomcat_source'];
]]>
</s:server-script>
<a:model-query model="prj.PRJ500D.bp_tenant_detail_exists_query" defaultWhereClause="t1.project_id=${/parameter/@project_id}" rootPath="bp_tenant_detail_exists"/>
<a:model-query model="prj.PRJ500D.bp_tenant_old_r_query"
defaultWhereClause="t1.bp_id=${/parameter/@bp_id_tenant}"
rootPath="bp_tenant_detail_path"/>
</a:init-procedure>
<a:view>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}get_special_fields_link_id"
......@@ -614,15 +618,28 @@
});
}
if (name == 'bp_birth') {
debugger;
if(jsGetAge(value.format('yyyy-mm-dd').toString()) == -1){
Leaf.showInfoMessage("提示","出生日期不能大于当前日期");
setTimeout(function(){
record.set('bp_birth',old_value);
},0);
}else{
record.set('bp_age',jsGetAge(value.format('yyyy-mm-dd').toString()));
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (score_ds_id == ds.id) {
if (name == 'bp_birth') {
if (jsGetAge(value.format('yyyy-mm-dd').toString()) == -1) {
Leaf.showInfoMessage("提示", "出生日期不能大于当前日期");
setTimeout(function () {
record.set('bp_birth', old_value);
}, 0);
} else {
record.set('bp_age', jsGetAge(value.format('yyyy-mm-dd').toString()));
}
}
}
var device_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_DEVICE', 'bp_tenant_rate_item');
if (device_ds_id == ds.id) {
if (name == 'quantity') {
if (value <= 0) {
Leaf.showInfoMessage("提示", "数量必须大于等于0");
setTimeout(function () {
record.set('quantity', old_value);
}, 0);
}
}
}
};
......@@ -647,6 +664,16 @@
};
function arrToObject(arr) {
var strJs = '({';
for (var i = 0; i < arr.length; i += 1) {
var as = arr[i].split("=");
strJs = strJs + as[0] + ':' + '"' + as[1] + '"' + ',';
}
strJs = strJs.substr(0, strJs.length - 1) + '})';
return eval(strJs);
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
if (ds_id == ds.id && ds_id) {
......@@ -657,14 +684,30 @@
record.getField('bank_account_id_n').setRequired(false);
}
}
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (score_ds_id == ds.id){
if(!record.get('score_name')){
if($(ds_id).getCurrentRecord()){
var score_name = $(ds_id).getCurrentRecord().get('legal_person')||$(ds_id).getCurrentRecord().get('bp_id_tenant_n');
record.set('score_name',score_name);
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (score_ds_id == ds.id) {
if (!record.get('score_name')) {
if ($(ds_id).getCurrentRecord()) {
var score_name = $(ds_id).getCurrentRecord().get('legal_person') || $(ds_id).getCurrentRecord().get('bp_id_tenant_n');
record.set('score_name', score_name);
}
}
var str_r = String('${/model/bp_tenant_detail_path/record}').replace('{','').replace('}','');
if('${/model/bp_tenant_detail_exists/record/@list_count}' == 0){
var obj = JSON.parse('{' + str_r.replace(/(\w+)=/g, '"$1":').replace(/:([^,]*)/g,':"$1"') + '}');
for(var key in record.data){
if (key != 'bp_detail_id' && key != 'score_name') {
var vl = obj[key];
if(key == 'bp_birth'){
vl = new Date(obj[key].toString());
}
if(vl != "null"){
record.set(key,vl);
}
}
}
}
}
};
......@@ -723,6 +766,25 @@
record.set('lease_item_seq', rk_value);
}
var device_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_DEVICE', 'bp_tenant_rate_item');
var traffic_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_TRAFFIC', 'bp_tenant_rate_item');
if ((device_ds_id == ds.id && device_ds_id) || (traffic_ds_id == ds.id && traffic_ds_id)) {
//设置序号
var rs = ds.getAll(),
seq_num = 0;
if (rs.length) {
for (var j = 0; j < rs.length; j++) {
var r = rs[j],
rk = r.get('seq_num');
if (seq_num <= rk) {
seq_num = rk;
}
}
}
var rk_value = seq_num + 1;
record.set('seq_num', rk_value);
}
};
//indexchange事件(grid,attach,gridbox,table)
......@@ -743,37 +805,35 @@
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var record = $(ds_id).getCurrentRecord();
var param = record.data;
if (record.get('project_id')) {
// if(record.get('project_status')=='NEW'||record.get('project_status')=='APPROVE_RETURN'||record.get('project_status')=='REJECT'){
// param['function_code'] = 'PRJ501TENANT';
// param['function_usage'] = 'UPDATE';
// }else{
// param['function_code'] = 'PRJ501TENANT';
// param['function_usage'] = 'QUERY';
// }
//
param['project_id'] = record.get('project_id');
param['winid'] = 'hl_tenant_score_rate_win_id';
param['url_title'] = '客户评分明细';
// hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}_tenant_rate_query_link', '${/parameter/@layout_code}');
var win = new Leaf.Window({
id: param['winid'],
params: param,
url: $('${/parameter/@layout_code}_tenant_rate_query_link').getUrl(),
title: param['url_title'],
fullScreen: true,
draggable: true
});
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存');
return;
if (record) {
var param = record.data;
if (record.get('project_id')) {
param['project_id'] = record.get('project_id');
param['winid'] = 'hl_tenant_score_rate_win_id';
param['url_title'] = '客户评分明细';
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var r = $(score_ds_id).getCurrentRecord();
if (r.dirty) {
Leaf.showInfoMessage('提示', '评分数据发生修改,请先保存再进行评分');
return;
}
if ($(ds_id).validate()) {
var win = new Leaf.Window({
id: param['winid'],
params: param,
url: $('${/parameter/@layout_code}_tenant_rate_query_link').getUrl(),
title: param['url_title'],
fullScreen: true,
draggable: true
});
}
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存');
return;
}
}
}
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var lease_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item');
......
......@@ -48,6 +48,9 @@
if (record.get('summary_flag') == 'Y') {
return '';
}
if (value == 'DQ'){
return '<font color=red>'+ value + '</font>';
}
return value;
}
......@@ -298,7 +301,7 @@
<a:column name="target_value_name" prompt="指标值" width="250"/>
<!-- <a:column name="score_value" prompt="权重" renderer="fnd714_sc_score_result_dtl_render_score_value" width="80"/> -->
<!-- <a:column name="target_score" editorFunction="fnd714_sc_score_result_dtl_grid_editorFunc" prompt="FND714.TARGET_SCORE" renderer="fnd714_sc_score_result_dtl_render_target_score"/> -->
<a:column name="target_score" prompt="得分" renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/>
<a:column name="target_score" prompt="得分" align="right" renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/>
<a:placeHolder id="fnd714_dynamicColumns"/>
<a:column name="target_score_sum" prompt="小计" renderer="fnd714_sc_score_result_dtl_render_target_score_sum" width="80"/>
</a:columns>
......
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