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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure/>
<a:view>
<a:link id="csh710n_deduction_detail_link" url="${/request/@context_path}/modules/csh/CSH710N/csh_deduction_detail_n.lview"/>
<a:link id="csh_payment_req_cashflow_id_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_cashflow_id.lsc"/>
<a:link id="csh_payment_req_check_link" model="csh.CSH501.del_csh_pay_cashflow_id_temp" modelaction="execute"/>
<a:link id="csh501_csh_payment_req_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_bond.lview"/>
<a:link id="csh501_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
function open_dection_by_bp(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
var bp_id = record.get('bp_id_tenant');
var contract_number = record.get('contract_number');
var cashflow_id = record.get('cashflow_id');
var write_off_flag = record.get('write_off_flag');
// if (write_off_flag == 'FULL') {
// Leaf.showMessage('${l:PROMPT}', '该单据已经完全核销,不能继续抵扣或支付!');
// return;
// }
Leaf.request({
url: $('csh_payment_req_check_link').getUrl(),
para: param,
success: function() {
var win = new Leaf.Window({
id: 'csh710n_deducate_detail_link',
params: {
bp_id: bp_id,
contract_number: contract_number,
cashflow_id: cashflow_id,
winid: 'csh710n_deducate_detail_link'
},
url: $('csh710n_deduction_detail_link').getUrl(),
title: '${l:CSH710.PAYMENT_DECUCATE}',
fullScreen: true
});
win.on('close', function() {
$(ds_id).query();
});
},
failure: function() {
return;
},
error: function() {
return;
},
scope: this
});
}
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var ca_ds = $(ds_id);
var a = ca_ds.getSelected();
var record = a[0];
var cashflow_id_list = [];
var param = {};
var write_off_flag = record.get('write_off_flag');
if (write_off_flag == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '该合同客户保证金完全核销,不能继续抵扣或支付!');
return;
}
if (a.length < 1) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
} else {
for (i = 0;i < a.length;i++) {
cashflow_id = a[i].get('cashflow_id');
var arr = {};
arr['_status'] = 'insert';
arr['cashflow_id'] = cashflow_id;
arr['contract_id'] = a[i].get('contract_id');
arr['session_id'] = ${/session/@session_id};
cashflow_id_list.push(arr);
}
param['details'] = cashflow_id_list;
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
Leaf.request({
url: $('csh_payment_req_cashflow_id_link').getUrl(),
para: param,
success: function() {
if (cashflow_id != '') {
Leaf.Masker.unmask(Ext.getBody());
var param = {};
param['function_code'] = 'CSH501N';
param['function_usage'] = 'CREATE';
param['document_category'] = 'PAYMENT_REQ';
param['business_type'] = 'PAYMENT';
param['business_type_n'] = '预付款申请';
param['winid'] = 'csh501_csh_payment_req_link_winid';
param['url_title'] = '付款申请';
hls_doc_get_layout_code('csh501_get_layout_code_link_id', param, 'csh501_csh_payment_req_link_id', ds_id);
}
},
failure: function() {
Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
};
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_dection_by_bp(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
};
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
$('CSH_DEDUCTION_ENTRANCE_CA_RESULT_con_contract_cashflow_layout_grid_id')._export('xls', '客户保证金明细表');
};
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var records = $(ds_id).getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
}
var record = records[0];
var param = record.data;
var bp_id = record.get('bp_id_tenant');
var contract_number = record.get('contract_number');
var cashflow_id = record.get('cashflow_id');
var write_off_flag = record.get('write_off_flag');
// if (write_off_flag == 'FULL') {
// Leaf.showMessage('${l:PROMPT}', '该单据已经完全核销,不能继续抵扣或支付!');
// return;
// }
Leaf.request({
url: $('csh_payment_req_check_link').getUrl(),
para: param,
success: function() {
var win = new Leaf.Window({
id: 'csh710n_deducate_detail_link',
params: {
bp_id: bp_id,
contract_number: contract_number,
cashflow_id: cashflow_id,
winid: 'csh710n_deducate_detail_link'
},
url: $('csh710n_deduction_detail_link').getUrl(),
title: '${l:CSH710.PAYMENT_DECUCATE}',
fullScreen: true
});
win.on('close', function() {
$(ds_id).query();
});
},
failure: function() {
return;
},
error: function() {
return;
},
scope: this
});
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>