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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-5-30 下午03:38:34
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure/>
<a:view>
<a:link id="prj_project_lease_item_list_delete_link_id" model="prj.PRJ500.prj_project_lease_item_list_delete" modelaction="delete"/>
<script type="text/javascript"><![CDATA[
function prj_prj501_detail_back() {
$('${/parameter/@winid}').close();
}
function prj_prj501_detail_export() {
$('prj_lease_item_detail_grid_ds')._export();
}
function on_prj_lease_item_list_load(ds) {
var records = ds.getAll();
var show_flag = 'N';
if (records.length) {
for (var i = 0;i < records.length;i++) {
var record = records[i];
for (var name in record.data) {
if (!record.get(name) && show_flag == 'N') {
$('prj_lease_item_detail_grid_ds').hideColumn(name);
show_flag = 'N';
} else {
$('prj_lease_item_detail_grid_ds').showColumn(name);
show_flag = 'Y';
}
}
}
}
var li_list_type = '${/parameter/@li_list_type}';
if (li_list_type == 'LEASE') {
$('prj_lease_item_detail_grid_ds').hideColumn('uom');
$('prj_lease_item_detail_grid_ds').hideColumn('asset_num');
$('prj_lease_item_detail_grid_ds').hideColumn('manufacturer');
$('prj_lease_item_detail_grid_ds').hideColumn('posted_date');
$('prj_lease_item_detail_grid_ds').hideColumn('net_asset_value');
$('prj_lease_item_detail_grid_ds').hideColumn('invoice_amt');
$('prj_lease_item_detail_grid_ds').hideColumn('invoice_num');
$('prj_lease_item_detail_grid_ds').hideColumn('invoice_date');
} else if (li_list_type == 'LEASE_BACK') {
$('prj_lease_item_detail_grid_ds').hideColumn('price');
$('prj_lease_item_detail_grid_ds').hideColumn('total_amount');
$('prj_lease_item_detail_grid_ds').hideColumn('vender');
}
}
function prj_prj501_detail_btn(flag) {
if (flag) {
$('prj_prj501_detail_delete_id').enable();
} else {
$('prj_prj501_detail_delete_id').disable();
}
}
function prj_prj501_detail_delete() {
Leaf.showConfirm('${l:PROMPT}', '${l:HLS.IS_REMOVE_ALL}', function() {
prj_prj501_detail_btn();
Leaf.request({
url: $('prj_project_lease_item_list_delete_link_id').getUrl(),
para: {
project_lease_item_id: '${/parameter/@project_lease_item_id}'
},
success: function() {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
$('prj_lease_item_detail_result_ds').query();
prj_prj501_detail_btn(true);
},
error: function() {
prj_prj501_detail_btn(true);
},
failure: function() {
prj_prj501_detail_btn(true);
},
scope: this
});
}, function() {
return;
}, null, null);
}
]]></script>
<a:dataSets>
<a:dataSet id="prj_lease_item_detail_result_ds" autoQuery="true" model="prj.PRJ500.prj_project_lease_item_list" queryUrl="${/request/@context_path}/autocrud/prj.PRJ500.prj_project_lease_item_list/query?project_lease_item_id=${/parameter/@project_lease_item_id}" selectable="true">
<a:events>
<a:event name="load" handler="on_prj_lease_item_list_load"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:grid id="prj_lease_item_detail_grid_ds" bindTarget="prj_lease_item_detail_result_ds" height="400" navBar="true" width="850">
<a:columns>
<a:column name="seq"/>
<a:column name="asset_num"/>
<a:column name="asset_name"/>
<a:column name="specification"/>
<a:column name="manufacturer"/>
<a:column name="vender"/>
<a:column name="installation_site"/>
<a:column name="quantity"/>
<a:column name="price" renderer="Leaf.formatMoney"/>
<a:column name="total_amount" renderer="Leaf.formatMoney"/>
<a:column name="uom"/>
<a:column name="posted_date" renderer="Leaf.formatDate"/>
<a:column name="net_asset_value" renderer="Leaf.formatMoney"/>
<a:column name="invoice_amt" renderer="Leaf.formatMoney"/>
<a:column name="invoice_num"/>
<a:column name="invoice_date" renderer="Leaf.formatDate"/>
</a:columns>
</a:grid>
<a:screenTopToolbar>
<a:gridButton click="prj_prj501_detail_back" text="HLS.BACK"/>
<a:gridButton click="prj_prj501_detail_export" text="HLS.EXPORT"/>
<a:gridButton id="prj_prj501_detail_delete_id" click="prj_prj501_detail_delete" text="HLS.REMOVE_ALL"/>
</a:screenTopToolbar>
</a:screenBody>
</a:view>
</a:screen>