1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version="1.0" encoding="UTF-8"?>
<!--
create by chengke 2015-7-14
for contract context create
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
<a:model-query model="cus.CUS100.cus_default_values" rootPath="cus_default_value"/>
</a:init-procedure>
<a:view>
<a:link id="con643_submit_link" model="cus.CUS312.cus_rpt_cus312_submit_rpt" modelaction="execute"/>
<a:link id="con643_get_control_id_link" model="db.rpt_report_control_pkg.checkin_rpt" modelaction="execute"/>
<a:link id="con643_refresh_link" model="db.rpt_report_control_pkg.refresh_rpt" modelaction="execute"/>
<a:link id="con620n_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
var g_control_id;
var g_calc_date;
function eg_rpt100_detail_query() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
$(ds_id).setQueryParameter('control_id', g_control_id);
$(ds_id).query();
}
function eg_rpt100_head_query() {
var rpt_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
$(rpt_ds_id).setQueryParameter('control_id', g_control_id);
$(rpt_ds_id).query();
// $(ds_id).query();
}
function eg_rpt100_status_find(control_id) {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('con643_refresh_link').getUrl(),
para: {
'control_id': control_id
},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
if (res.result.job_stauts == 'FINISH') {
eg_rpt100_head_query();
eg_rpt100_detail_query();
}
eg_rpt100_head_query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function eg_rpt100_submit(control_id) {
var rpt_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
var calc_date = $(rpt_ds_id).getAt(0).get('calc_date');
//var control_id = $('con643_head_ds').getAt(0).get('control_id');
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('con643_submit_link').getUrl(),
para: {
'control_id': control_id,
'calc_date': calc_date
},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
eg_rpt100_head_query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//计算
window['${/parameter/@layout_code}_quote_layout_dynamic_click'] = function() {
Leaf.showConfirm('${l:PROMPT}', '计算将清除上次运行结果,并且执行时间较长,是否确认提交?', function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
$(ds_id).removeAll();
eg_rpt100_submit(g_control_id);
}, function() {
});
};
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var rpt_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
if (ds.id == rpt_ds_id && name == 'calc_date') {
g_calc_date = record.get('calc_date');
}
};
//查询
window['${/parameter/@layout_code}_user_button8_layout_dynamic_click'] = function() {
var rpt_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
var status = $(rpt_ds_id).getAt(0).get('status');
var control_id = g_control_id;
if (status == 'FINISH') {
eg_rpt100_detail_query();
} else {
eg_rpt100_status_find(control_id);
}
// eg_rpt100_detail_query();
};
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number') {
return '<a href="javascript:con620n_open_contract_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
if (name == 'risk_flag_n' && value) {
//return '<font color="red" >'+value+'</font>';
return '<a style="color:red" href="#">' + value + '</a>';
}
if (name == 'status' && value) {
return '<a style="color:red;bold:true" href="#">' + value + '</a>';
}
if (name == 'last_submit_date' && value) {
return '<a style="color:red" href="#">' + value + '</a>';
}
if (name == 'last_submitted_by' && value) {
return '<a style="color:red" href="#">' + value + '</a>';
}
return value;
};
/* window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
var rpt_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
if (ds.id == rpt_ds_id) {
if (record.get('calc_date')) {
} else {
var calc_date;
if (!g_calc_date) {
g_calc_date = '${/model/cus_default_value/record/@sys_date}';
}
$(rpt_ds_id).getAt(0).set('calc_date', g_calc_date);
}
}
}; */
//导出
window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var grid_id = ds_id.replace('ds', 'layout_grid_id');
$(grid_id)._export('xls', '${/model/default_function_name/record/@function_name}');
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if (ds == $(ds_id)) {
aut_authority_list_validate_query(ds, qpara);
}
};
function cus312_update() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
var v_calc_date = $(ds_id).getAt(0).get('calc_date');
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('con643_get_control_id_link').getUrl(),
para: {
'report_name': '${/parameter/@function_code}',
'check_company_id': '${/session/@company_id}',
'check_date' : v_calc_date
},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
g_control_id = res.result.control_id;
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'rpt_report_control');
if (ds.id == ds_id && name == 'calc_date' && value) {
cus312_update();
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&function_code=CON630N"/>
</a:view>
</a:screen>