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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Mouse Chow
$Date: 2012-12-23 上午10:29:43
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<a:link id="pageLink_chanceMaintain_chanceUpdate" url="${/request/@context_path}/modules/lch/LCH502/lease_chance_update.lview"/>
<a:link id="pageLink_chanceMaintain_chanceCreate" url="${/request/@context_path}/modules/lch/LCH501/lease_chance_create.lview"/>
<a:link id="pageLink_chanceMaintain_createProject" url="${/request/@context_path}/modules/lch/LCH502/lease_chance_create_project.lview"/>
<a:link id="bmLink_chanceMaintain_updateStatus" model="lch.LCH501.lch_lease_chance_hds" modelaction="execute"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<script type="text/javascript"><![CDATA[
function chanceMaintainScreen_forward() {
history.go(1);
}
function chanceMaintainScreen_back() {
history.go(-1);
}
function chanceMaintainScreen_quit() {
location.href = $('sys_service_welcome_link').getUrl();
}
function chanceMaintainDs_grid_query() {
$('chanceMaintainDs').query();
}
function chanceMaintainDs_grid_refresh() {
var ds=$('chanceMaintainDs');
ds.query(ds.currentPage);
}
function chanceMaintainScreen_add() {
window.location.href=$('pageLink_chanceMaintain_chanceCreate').getUrl();
}
function chanceMaintainDs_grid_clear() {
$('chanceMaintainDs_grid').clear();
}
function chanceMaintainDs_grid_update(lease_chance_id,status){
var maintain_type;
if(status=='CLOSED'||status=='CREATED')
{
maintain_type='READONLY';
}
else
{
maintain_type='UPDATE';
}
window.location.href=$('pageLink_chanceMaintain_chanceUpdate').getUrl()+'?lease_chance_id=' + lease_chance_id+'&maintain_type='+maintain_type;
}
function render_chanceMaintainDs_grid(value,record,name)
{
if(name=='lease_chance_code')
{
return '<a href="javascript:chanceMaintainDs_grid_update(' + record.get('lease_chance_id') + ',\''+ record.get('status') +'\');">' + value + '</a>';
}
else if(name=='creation_date')
{
if(!Ext.isEmpty(value))
{
return value.parseDate('yyyy-mm-dd').format('yyyy-mm-dd');
}
return '';
}
}
function chanceMaintainScreen_closeChance()
{
var record=$('chanceMaintainDs').getCurrentRecord();
if(Ext.isEmpty(record))
{
return ;
}
var status=record.get('status');
Leaf.request({
url: $('bmLink_chanceMaintain_updateStatus').getUrl(),
para: {
lease_chance_id:record.get('lease_chance_id'),
status:'CLOSED'
},
success: function(res) {
chanceMaintainDs_grid_refresh();
},
scope: this
});
}
function chanceMaintainScreen_createToProject()
{
var record=$('chanceMaintainDs').getCurrentRecord();
if(Ext.isEmpty(record))
{
return ;
}
var win = new Leaf.Window({
url: $('pageLink_chanceMaintain_createProject').getUrl(),
id: 'lease_chance_create_project',
params: {
document_type: record.get('document_type'),
lease_chance_id:record.get('lease_chance_id')
},
title: '${l:PRJ501.PRJ_HISTORY_VERSION}',
width: 600,
height: 350
});
win.on('close',function(){
chanceMaintainDs_grid_refresh();
});
}
]]></script>
<a:dataSets>
<a:dataSet id="chanceMaintain_organizationDs" loadData="true" model="basic.hls_lease_organization_for_lov"/>
<a:dataSet id="chanceMaintain_channelDs" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="chanceMaintain_divisionDs" loadData="true" model="basic.hls_division_for_lov"/>
<a:dataSet id="chanceMaintain_statusDs" lookupCode="LCH501_LEASE_CHANCE_STATUS"/>
<a:dataSet id="chanceMaintain_paraDs" autoCreate="true" model="lch.LCH501.lch_lease_chance_hds">
<a:fields>
<a:field name="status_desc" displayField="code_value_name" options="chanceMaintain_statusDs" returnField="status" valueField="code_value"/>
<a:field name="lease_organization_desc" displayField="description" options="chanceMaintain_organizationDs" returnField="lease_organization" valueField="lease_organization"/>
<a:field name="lease_channel_desc" displayField="description" options="chanceMaintain_channelDs" returnField="lease_channel" valueField="lease_channel"/>
<a:field name="division_desc" displayField="description" options="chanceMaintain_divisionDs" returnField="division" valueField="division"/>
<a:field name="lease_chance_code"/>
<a:field name="employee_id"/>
<a:field name="employee_name" lovGridHeight="300" lovHeight="450" lovService="basic.hls_salesman_assign_v_for_lov" lovWidth="500" title="PRJ501.PRJ_PROJECT.EMPLOYEE_NAME">
<a:mapping>
<a:map from="employee_id" to="employee_id"/>
<a:map from="employee_name" to="employee_name"/>
</a:mapping>
</a:field>
</a:fields>
</a:dataSet>
<a:dataSet id="chanceMaintainDs" autoQuery="true" model="lch.LCH501.lch_lease_chance_hds" queryDataSet="chanceMaintain_paraDs" selectable="true" selectionModel="single">
<a:fields>
<a:field name="lease_chance_id"/>
<a:field name="lease_chance_code"/>
<a:field name="employee_id"/>
<a:field name="employee_name" lovGridHeight="300" lovHeight="450" lovService="basic.hls_salesman_assign_v_for_lov" lovWidth="500" title="PRJ501.PRJ_PROJECT.EMPLOYEE_NAME">
<a:mapping>
<a:map from="employee_id" to="employee_id"/>
<a:map from="employee_name" to="employee_name"/>
</a:mapping>
</a:field>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="chanceMaintainScreen_forward" text="HLS.FORWARD"/>
<a:gridButton click="chanceMaintainScreen_back" text="HLS.BACK"/>
<a:gridButton click="chanceMaintainScreen_quit" text="HLS.EXIT"/>
<a:gridButton click="chanceMaintainDs_grid_query" text="HLS.QUERY"/>
<a:gridButton click="chanceMaintainScreen_add" text="HLS.NEW"/>
<a:gridButton click="chanceMaintainDs_grid_clear" text="HLS.CLEAR"/>
<a:gridButton click="chanceMaintainScreen_closeChance" text="关闭商机"/>
<a:gridButton click="chanceMaintainScreen_createToProject" text="商机创建至项目"/>
</a:screenTopToolbar>
<a:form column="4" labelWidth="120" marginWidth="30" title="HLS.QUERY_TITLE">
<a:textField name="lease_chance_code" bindTarget="chanceMaintain_paraDs"/>
<a:lov name="employee_name" bindTarget="chanceMaintain_paraDs"/>
<a:textField name="bp_name" bindTarget="chanceMaintain_paraDs"/>
<a:comboBox name="status_desc" bindTarget="chanceMaintain_paraDs"/>
<a:comboBox name="lease_organization_desc" bindTarget="chanceMaintain_paraDs"/>
<a:comboBox name="lease_channel_desc" bindTarget="chanceMaintain_paraDs"/>
<a:comboBox name="division_desc" bindTarget="chanceMaintain_paraDs"/>
<a:textField name="short_name" bindTarget="chanceMaintain_paraDs"/>
<a:datePicker name="creation_date_from" bindTarget="chanceMaintain_paraDs" prompt="LCH501.QUERY_FIELD.CREATION_DATE_FROM"/>
<a:datePicker name="creation_date_to" bindTarget="chanceMaintain_paraDs" prompt="LCH501.QUERY_FIELD.CREATION_DATE_TO"/>
</a:form>
<a:grid id="chanceMaintainDs_grid" bindTarget="chanceMaintainDs" marginHeight="250" marginWidth="30" navBar="true">
<a:columns>
<a:column name="lease_chance_code" renderer="render_chanceMaintainDs_grid" width="150"/>
<a:column name="employee_name"/>
<a:column name="lease_organization_desc" width="120"/>
<a:column name="lease_channel_desc" width="120"/>
<a:column name="division_desc" width="120"/>
<a:column name="bp_name" width="150"/>
<a:column name="short_name" width="150"/>
<a:column name="assets_amount" align="right"/>
<a:column name="creation_date" prompt="HLS.CREATION_DATE" renderer="render_chanceMaintainDs_grid" width="80"/>
<a:column name="status_desc"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>