Commit 81460466 authored by lijingjing's avatar lijingjing

商机维护修改-ljj

parent 6497b2c6
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LIJINGJING
$Date: 2019-09-10 下午4:38:18
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select tt.* from ( SELECT t1.project_number,
t1.contract_number,
t1.bp_code,
t1.bp_name,
t1.overdue_max_days,
t1.overdue_max_amount,
t1.bp_type,
t1.bp_class,
t1.bp_id,
t1.description,
t1.project_id,
t1.contract_id
FROM prj_project_history_lv t1
WHERE t1.bp_id = ${@bp_id}
and t1.project_id <> ${@project_id}) tt
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -64,8 +64,8 @@ var override_queryfields = [
// queryoperator : "="
//},
{
name:'status_not_in',
queryexpression : "((t1.project_status in('NEW','PRE_APPROVING','APPROVED_RETURN')) Or (t1.project_status in('PRE_APPROVED','APPROVED_RETURN') and t1.pjd_instance_status in ('PRE_APPROVING','APPROVED'))) and t1.document_type='CARLS'"
name:'project_status',
queryexpression : "(t1.project_status in ('NEW','PRE_APPROVING','APPROVED_RETURN')"
}
......
......@@ -269,6 +269,7 @@
var lease_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item');
var project_record = $(project_ds_id).getCurrentRecord();
if (prj_record.get('project_number')) {
return true;
}
......@@ -285,6 +286,7 @@
ka_prj_id: prj_record.get('ka_prj_id')
},
success: function (res) {
debugger;
var document_number = res.result.document_number;
prj_record.set('project_number', document_number);
check_flag = true;
......@@ -350,14 +352,17 @@
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_INFO_1','prj_project');
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP','prj_project_bp');
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_TENANT_INFO', 'prj_project_bp');
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master');
var cdd_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
var virtual_ds_id = '${/parameter/@layout_code}_virtual_ds';
if (ds_id==ds.id || virtual_ds_id==ds.id) {
$(cdd_item_ds_id).query();
$(tenant_ds_id).query();
$(bp_ds_id).query();
$(tenant_ds_id).query();
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......@@ -422,8 +427,8 @@
//加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
debugger;
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_BP', 'prj_project_bp');
if (bp_ds_id == ds.id && bp_ds_id) {
if (record.get('bp_category') == 'TENANT') {
record.getField('bp_category_n').setReadOnly(true);
......@@ -435,7 +440,12 @@
}
}
};
/* Leaf.onReady(function(){
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master');
var url='${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query?project_id=${/parameter/@project_id}&bp_id=${/parameter/@bp_id}';
$(bp_ds_id).setQueryUrl(url);
$(bp_ds_id).query();
})*/
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
......@@ -36,7 +36,8 @@
<a:link id="${/parameter/@layout_code}hls_bp_master_query_link"
url="${/request/@context_path}/modules/hls/HLS215N/hls_bp_master_query.lview"/>
<a:link id="${/parameter/@layout_code}contract_number_query_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="${/parameter/@layout_code}_hls_fin_calc_get_base_rate_link_id"
model="hls.HLS500.hls_fin_calc_get_base_rate" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
......@@ -50,7 +51,6 @@
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>-->
<script type="text/javascript"><![CDATA[
window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function () {
Leaf.showConfirm('提示', '是否确认生成合同?', function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
......@@ -312,7 +312,30 @@
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}');
}
function prj501n_project_number_renderer(id, name, query_only){
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {};
param['bp_id'] = record.get('project_id');
param['bp_class'] = record.get('bp_class');
param['function_code'] = 'PRJ501D';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
param['winid'] = '${/parameter/@layout_code}_project_number_win_id';
param['prj_bp_id'] = record.get('prj_bp_id');
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}project_number_query_link', record.ds.id, '${/parameter/@layout_code}');
}
function prj501n_contract_number_renderer(id, name, query_only){
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {};
param['contract_id'] = record.get('contract_id');
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['winid'] = '${/parameter/@layout_code}_project_number_win_id';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}contract_number_query_link', record.ds.id, '${/parameter/@layout_code}');
}
//超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
......@@ -345,7 +368,7 @@
return url;
}*/
if (value != null) {
if (value != null ) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
......@@ -369,10 +392,17 @@
return url;
}
} else if (name = 'bp_link') {
} else if (name == 'bp_link' && !record.isNew) {
link_function = 'prj501n_bp_code_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
}else if(name=='project_number'){
link_function = 'prj501n_project_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value+ '</a>';
}else if(name =='contract_number'){
link_function = 'prj501n_contract_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value+ '</a>';
}
};
......@@ -380,14 +410,17 @@
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_INFO_1','prj_project');
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP','prj_project_bp');
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_TENANT_INFO', 'prj_project_bp');
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master');
var cdd_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
var virtual_ds_id = '${/parameter/@layout_code}_virtual_ds';
if (ds_id==ds.id || virtual_ds_id==ds.id) {
$(cdd_item_ds_id).query();
$(tenant_ds_id).query();
$(bp_ds_id).query();
$(tenant_ds_id).query();
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......@@ -419,7 +452,9 @@
//加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_BP', 'prj_project_bp');
/* var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_HISTORY_INFO_1', 'prj_project_bp');
$(bp_ds_ids).setQueryParameter('bp_id','${/parameter/@bp_id_tenant}');
$(bp_ds_ids).query();*/
if (bp_ds_id == ds.id && bp_ds_id) {
if (record.get('bp_category') == 'TENANT') {
record.getField('bp_category_n').setReadOnly(true);
......@@ -430,6 +465,8 @@
record.getField('bp_id_n').setReadOnly(true);
}
}
};
//pdf预览 add by zhuxianfei
......@@ -450,6 +487,41 @@
});
}
Leaf.onReady(function(){
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master');
var url='${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query?project_id=${/parameter/@project_id}&bp_id=${/parameter/@bp_id}';
$(bp_ds_id).setQueryUrl(url);
$(bp_ds_id).query();
})
//序号自增 add by lijingjing
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
//租赁物序号
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item');
if (ds_id == ds.id && ds_id) {
//设置序号
var measure_records = ds.getAll(),
seq_num = 0;
if (measure_records.length) {
for (var j = 0;j < measure_records.length;j++) {
var measure_record = measure_records[j],
rk = measure_record.get('lease_item_seq');
if (seq_num <= rk) {
seq_num = rk;
}
}
}
var rk_value = seq_num + 1;
record.set('lease_item_seq', rk_value);
}
};
//客户评分
window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function() {
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
......@@ -28,7 +28,6 @@
function open_project_modify_win(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
var project_status = record.get('project_status');
//项目类layout_code
if (record.get('document_type') == 'PRJ') {
......@@ -42,12 +41,9 @@
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
param['layout_debugger_flag'] = 'Y';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'prj_project_modify_link', ds_id);
} else if (record.get('document_type') == 'CARLS') {
if (record.get('project_status') != 'PRE_APPROVING') {
maintain_type = 'UPDATE';
param = record.data;
param['document_id'] = record.get('project_id');
......@@ -55,15 +51,15 @@
param['function_usage'] = 'MODIFY';
param['bp_class'] = 'NP';
param['maintain_type'] = maintain_type;
param['bp_id'] = record.get('bp_id');
param['prj_bp_id'] = record.get('prj_bp_id');
param['bp_id_tenant'] = record.get('bp_id_tenant');
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'car_modify_link', ds_id);
} else {
maintain_type = 'READONLY';
param = record.data;
param['bp_id_tenant'] = record.get('bp_id_tenant');
param['document_id'] = record.get('project_id');
param['function_code'] = 'PRJ501D';
param['function_usage'] = 'QUERY';
......@@ -72,14 +68,11 @@
param['prj_bp_id'] = record.get('prj_bp_id');
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'car_modify_link', ds_id);
}
}
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
if (name == 'project_number' && value) {
return '<a href="javascript:open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
......
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