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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: wangwei
$Date: 2015-12-26 上午11:25:45
$Revision: 1.0
$Purpose:国投项目提款明细
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:view>
<a:link id="tre_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<!--<a:link id="tre505_get_special_fields_link" model="cont.CON500.con_contract_get_special_fields"-->
<!--modelaction="update"/>-->
<a:link id="tre505_get_withdrawal_number_link" model="tre.TRE505.get_withdraw_number"
modelaction="update"/>
<a:link id="get_loan_contract_quotation_info_link_id" model="tre.TRE503N.loan_contract_quotation"
modelaction="query"/>
<!--<a:link id="tre_loan_contact_quotation_submit_link_id" model="tre.TRE505.submit_withdraw_wfl" modelaction="update"/>-->
<a:link id="tre_loan_contact_quotation_submit_link_id"
url="${/request/@context_path}/modules/tre/TRE505/tre_loan_contract_withdraw_save.lsc"/>
<a:link id="tre_loan_contact_quotation_delete_link_id" model="tre.TRE503N.loan_contract_quotation"
modelaction="delete"/>
<a:link id="hls_fin_calculator_update_link_id"
url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_update_n.lview"/>
<a:link id="hls_fin_doc_quotation_link_id"
url="${/request/@context_path}/modules/hls/HLS500/hls_fin_doc_quotation.lsc"/>
<a:link id="hls_fin_calc_quotation_header_link_id"
url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calc_quotation_header.lview"/>
<a:link id="hls_fin_calculator_query_link_id"
url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calculator_readonly.lview"/>
<a:link id="hls_fin_check_calculator_link_id" model="prj.PRJ505.prj_project_quotation" modelaction="execute"/>
<a:link id="tre_factoring_contract_detail_screen_id"
url="${/request/@context_path}/modules/tre/TRE505/tre_loan_con_export_detail.lview"/>
<a:link id="tre_loan_situation_link_id"
url="${/request/@context_path}/modules/tre/TRE505/tre_loan_contract_situation.lview"/>
<script type="text/javascript"><![CDATA[
//保存前调用,生成单据编号
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var head_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_withdrawal_plan');
//var record_ds = $(head_ds).getAt(0);
var record_ds = $(head_ds).getCurrentRecord();
var check_flag = false;
if (record_ds.get('withdrawal_number')) {
return true;
}
Leaf.request({
url: $('tre505_get_withdrawal_number_link').getUrl(),
para: {
loan_contract_id:record_ds.get('loan_contract_id')
},
success: function (res) {
var document_number = res.result.document_number;
record_ds.set('withdrawal_number', document_number);
check_flag = true;
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
sync: true,
scope: this
});
return check_flag;
};
//还款情况按钮
window['${/parameter/@layout_code}_G_WITHDRAWL_USER_BUTTON1_layout_dynamic_tab_click'] = function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_withdrawal_plan');
var record = $(ds_id).getCurrentRecord();
var widthdrawal_plan_id = record.get('widthdrawal_plan_id');
if (!Ext.isEmpty(widthdrawal_plan_id)) {
var param = {};
var widthdrawal_wfl_status = record.get('widthdrawal_wfl_status');
if(widthdrawal_wfl_status=='NEW'){
param['function_usage'] = 'MODIFY';
}else{
param['function_usage'] = 'QUERY';
}
param['function_code'] = 'TRE505_SITUATION';
param['winid'] = 'tre505_situation_link_win_id';
param['url_title'] = '还款情况';
param['widthdrawal_plan_id'] = widthdrawal_plan_id;
hls_doc_get_layout_code('tre_con_contract_get_layout_code_link_id', param, 'tre_loan_situation_link_id',ds_id, '${/parameter/@layout_code}');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
} else {
Leaf.showMessage('提示', '请先保存!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
};
//确认
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var prj_quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_withdrawal_plan');
var record = $(prj_quotation_ds_id).getCurrentRecord();
if (record.get('widthdrawal_plan_id')) {
var saveData = [];
record.set('_status', 'update');
saveData.push(record.data);
var param = {};
param['details'] = saveData;
param['widthdrawal_plan_id'] = record.get('widthdrawal_plan_id');
Leaf.showConfirm('提示', '是否已导入还款计划,请确认?', function () {
Leaf.request({
url: $('tre_loan_contact_quotation_submit_link_id').getUrl(),
para: param,
success: function (res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
$('${/parameter/@winid}').close();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}, function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
};
//加载时调用(grid,table,gridBox)
window['${/parameter/@layout_code}_on_layout_dynamic_form_query'] = function(ds, qpara, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_withdrawal_plan');
var record = $(ds_id).getCurrentRecord();
if('${/parameter/@widthdrawal_plan_id}'){
qpara['widthdrawal_plan_id'] = '${/parameter/@widthdrawal_plan_id}';
}else{
qpara['widthdrawal_plan_id'] = record.get('widthdrawal_plan_id');
}
};
//更新时调用
window['${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_valuess) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_withdrawal_plan');
if (ds.id == ds_id) {
if (name == 'deposit_deduction'|| name == 'deposit_deduction_n') {
if (record.get('deposit_deduction') == 'Y') {
record.getField('margin_deduction').setReadOnly(false);
record.getField('margin_deduction_n').setReadOnly(false);
}else{
record.getField('margin_deduction').setReadOnly(true);
record.getField('margin_deduction_n').setReadOnly(true);
record.set('margin_deduction','');
record.set('margin_deduction_n','');
}
}
}
};
// //保存后查询
// 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'], 'tre_loan_con_withdrawal_plan');
// var record1 =$(ds_id).getCurrentRecord();
//
// if (ds_id) {
// $(ds_id).setQueryParameter('widthdrawal_plan_id',record1.get('widthdrawal_plan_id'));
// $(ds_id).query();
// }
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
//
// };
]]></script>
</a:view>
</a:screen>