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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: caizhenggan
$Date: 2017-1-19 上午10:03:40
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure/>
<a:view>
<a:link id="tre317_submit_repayment_link_id" url="${/request/@context_path}/modules/tre/TRE317/tre_loan_contract_repayment_save.lsc"/>
<a:link id="tre_batch_import_upload_id" url="${/request/@context_path}/modules/tre/TRE317/tre_batch_repay_import_upload.lview"/>
<script type="text/javascript"><![CDATA[
function click_back() {
$('tre_batch_repayment_winid').close();
}
function tre_batch_repayment_import() {
var win = new Leaf.Window({
id: 'tre_batch_import_upload_winid',
url: $('tre_batch_import_upload_id').getUrl(),
params: {
batch_id: '${/session/@session_id}',
win_id: 'tre_batch_import_upload_winid',
parent_ds_id: 'tre_batch_query_ds'
},
title: '导入',
width: 420,
height: 275
});
win.on('close', function() {
$('tre_batch_query_ds').query();
});
}
//数据导入错误,更改行颜色
function change_background_color(record) {
var flag = record.get('import_flag');
if (record.get('import_flag') == 'N') {
return 'background-color:#F09192;';
}
}
//提交工作流
function tre_repayment_submit() {
var records = $('tre_batch_query_ds').getSelected();
if (records.length == 0) {
Leaf.showMessage('提示', '请选择要提交的单据!');
return;
}
var saveData = [];
for (var i = 0;i < records.length;i++) {
var repayment_record;
repayment_record = records[i];
if (records[i].get('import_flag') == 'N') {
Leaf.showMessage('提示', '只有数据完成匹配的单据才能提交审批!');
return;
}
repayment_record.set('_status', 'update');
saveData.push(repayment_record.data);
}
var param = {};
param['details'] = saveData;
Leaf.showConfirm('提示', '确认提交吗?', function() {
Leaf.Masker.mask(Ext.getBody(), '正在提交......');
Leaf.request({
url: $('tre317_submit_repayment_link_id').getUrl(),
para: param,
success: function(args) {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
});
}
]]></script>
<a:dataSets>
<a:dataSet id="tre_batch_query_ds" autoQuery="true" model="tre.TRE317.tre_batch_import_query" selectable="true"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="click_back" text="退出"/>
<a:gridButton click="tre_batch_repayment_import" text="批量还款导入"/>
<a:gridButton click="tre_repayment_submit" text="提交审批"/>
</a:screenTopToolbar>
<a:grid bindTarget="tre_batch_query_ds" marginHeight="200" marginWidth="100" navBar="true" rowRenderer="change_background_color">
<a:columns>
<a:column name="loan_contract_number" align="left" prompt="借款合同号" width="160"/>
<a:column name="loan_contract_name" align="left" prompt="借款合同名称" width="160"/>
<a:column name="withdrawal_num" align="center" prompt="提款编号"/>
<a:column name="ref_v01" align="center" prompt="项目编号"/>
<a:column name="times" align="center" prompt="期数"/>
<a:column name="attribute_1" align="center" prompt="提款编号"/>
<a:column name="attribute_2" align="center" prompt="资金方名称"/>
<a:column name="attribute_3" align="center" prompt="客户名称"/>
<a:column name="attribute_4" align="center" prompt="还款日期" renderer="Leaf.formatDate"/>
<a:column name="attribute_5" align="center" prompt="当期租金" renderer="Leaf.formatMoney"/>
<a:column name="attribute_6" align="center" prompt="当期本金" renderer="Leaf.formatMoney"/>
<a:column name="attribute_7" align="center" prompt="当前利息" renderer="Leaf.formatMoney"/>
<a:column name="attribute_8" align="center" prompt="还款类型"/>
<a:column name="logs" align="left" prompt="导入日志" width="180"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>