csh_deduction_query.lview 20 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: xuls  
    $Date: 2014-9-23 上午11:30:53  
    $Revision: 1.0  
    $Purpose: create for payment deducate
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.document_category=&apos;CONTRACT&apos;" fetchAll="true" model="basic.hls_document_type_for_lov" rootPath="csh710_document_type_path"/>
        <a:model-query fetchAll="true" model="cont.CON301.con_contract_business_type_list" rootPath="csh710_business_type_list"/>
        <a:model-query defaultWhereClause="(exists(select 1 from hls_lease_org_assign ha where ha.unit_id=t1.unit_id))" fetchAll="true" model="basic.exp_org_unit_manager_lov" rootPath="csh710_exp_org_unit_manager_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="csh_deduction_detail_link" url="${/request/@context_path}/modules/csh/CSH710/csh_deduction_detail.lview"/>
        <script type="text/javascript"><![CDATA[
		
			function csh710_switch_update(ds,record,name,value,oldValue){
				if (name=='switch_model'){
				    if(value=='CONTRACT'){
				        /* Ext.get("csh710_bp_form_id").setStyle({display: "none"});
				        Ext.get("csh710_bp_grid_gd").setStyle({display: "none"});
				        Ext.get("chs710_con_form_id").setStyle({display: "block"});
				        Ext.get("con501_con_contract_grid_ds").setStyle({display: "block"}); */
				        Ext.get("csh710_bp_screen").setStyle({display: "none"});
				        Ext.get("csh710_con_screen").setStyle({display: "block"});
				        
				    }else if(value=='BP_MASTER'){
				        /* Ext.get("csh710_bp_form_id").setStyle({display: "block"});
				        Ext.get("csh710_bp_grid_gd").setStyle({display: "block"});
				        Ext.get("chs710_con_form_id").setStyle({display: "none"});
				        Ext.get("con501_con_contract_grid_ds").setStyle({display: "none"}); */
				        Ext.get("csh710_bp_screen").setStyle({display: "block"});
				        Ext.get("csh710_con_screen").setStyle({display: "none"});
				        
				    }
				}
			}
			
			function csh710_contract_return() {
                history.go(-1);
            }
            function csh710_contract_query(){
               var switch_model = $('csh710_switch_ds').getAt(0).get('switch_model');
               if (switch_model=='CONTRACT'){
               	 $('csh710_contract_result_ds').query(); 
               }else{
                 $('csh710_bp_result_ds').query();   
               }
            }
            function csh710_contract_reset(){
                $('csh710_contract_query_ds').reset();
                $('csh710_bp_query_ds').reset();
            }
            /*合同跳转*/
            function csh710_decuate_openWindow(contract_id) {
                new Leaf.Window({
                    id: 'csh710_deducate_detail_link',
                    params: {
                        contract_id: contract_id
                    },
                    url: $('csh_deduction_detail_link').getUrl(),
                    title: '${l:CSH710.PAYMENT_DECUCATE}',
                    fullScreen: true
                });
            }
            
            function csh710_render_deducate(value, record, name) {
                var contract_id = record.get('contract_id');
                return '<a href="javascript:csh710_decuate_openWindow(' + contract_id + ');">' + value + '</a>';
            }
            
            function csh710_deducate_jump(){
               var rs = $('csh710_contract_result_ds').getSelected();
                if (rs.length < 1) {
                    Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
                    return;
                }
                var contract_id = rs[0].get('contract_id');
                csh710_decuate_openWindow(contract_id);
            }
            /*bp跳转*/
            function csh710_decuate_openWindow_bp(bp_id){
               new Leaf.Window({
                    id: 'csh710_deducate_detail_link',
                    params: {
                        bp_id: bp_id
                    },
                    url: $('csh_deduction_detail_link').getUrl(),
                    title: '${l:CSH710.PAYMENT_DECUCATE}',
                    fullScreen: true
                });
            } 
            
            function csh710_render_deducate_bp(value,record,name){
              var bp_id = record.get('bp_id');
              return '<a href="javascript:csh710_decuate_openWindow_bp(' + bp_id + ');">' + value + '</a>';  
            }
            
            
		
		]]></script>
        <a:dataSets>
            <a:dataSet id="csh710_switch_source_ds" lookupCode="CSH710_SWITCH_MODEL"/>
            <a:dataSet id="csh710_switch_ds" autoCreate="true">
                <a:fields>
                    <a:field name="switch_model" defaultValue="CONTRACT"/>
                    <a:field name="switch_model_desc" defaultValue="合同" displayField="code_value_name" options="csh710_switch_source_ds" required="true" returnField="switch_model" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="csh710_switch_update"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="csh710_employee_name_of_manager_ds">
                <a:datas dataSource="/model/csh710_exp_org_unit_manager_path"/>
            </a:dataSet>
            <a:dataSet id="csh710_unit_name_ds" loadData="true" model="basic.exp_org_unit_name_lov"/>
            <a:dataSet id="csh710_lease_organization_name_ds" loadData="true" model="basic.hls_lease_organization_for_lov"/>
            <a:dataSet id="csh710_division_name_ds" loadData="true" model="basic.hls_division_for_lov"/>
            <a:dataSet id="csh710_lease_channel_name_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
            <a:dataSet id="csh710_status_name_ds" lookupCode="CON500_CONTRACT_STATUS"/>
            <a:dataSet id="csh710_document_type_name_ds">
                <a:datas dataSource="/model/csh710_document_type_path"/>
            </a:dataSet>
            <a:dataSet id="csh710_business_type_ds">
                <a:datas dataSource="/model/csh710_business_type_list"/>
            </a:dataSet>
            <a:dataSet id="csh710_contract_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="bp_code" autoComplete="true" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code"/>
                            <a:map from="bp_id" to="bp_id_tenant"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_id_tenant"/>
                    <a:field name="project_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500" title="HLS.PROJECT_NUMBER">
                        <a:mapping>
                            <a:map from="project_number" to="project_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="project_employee_name" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.hls_exp_employees_for_lov?sales_flag=Y" lovWidth="500" title="HLS.SALES_EMPLOYEE">
                        <a:mapping>
                            <a:map from="name" to="project_employee_name"/>
                            <a:map from="employee_id" to="employee_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON500.con_contract_number_lov" lovWidth="500" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="employee_id"/>
                    <a:field name="employee_name_of_manager" displayField="mgr_employee_name" options="csh710_employee_name_of_manager_ds" returnField="employee_id_of_manager" valueField="mgr_employee_id"/>
                    <a:field name="unit_name" displayField="unit_name" options="csh710_unit_name_ds" returnField="unit_id" valueField="unit_id"/>
                    <a:field name="lease_organization_name" displayField="description" options="csh710_lease_organization_name_ds" returnField="lease_organization" valueField="lease_organization"/>
                    <a:field name="division_desc" displayField="description" options="csh710_division_name_ds" returnField="division" valueField="division"/>
                    <a:field name="lease_channel_desc" displayField="description" options="csh710_lease_channel_name_ds" returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="document_type_desc" displayField="description" options="csh710_document_type_name_ds" returnField="document_type" valueField="document_type"/>
                    <a:field name="business_type_desc" displayField="business_type_desc" options="csh710_business_type_ds" returnField="business_type" valueField="business_type"/>
                    <a:field name="contract_status_desc" displayField="code_value_name" options="csh710_status_name_ds" returnField="contract_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh710_contract_result_ds" model="csh.CSH710.csh_con_contract_v" queryDataSet="csh710_contract_query_ds" selectable="true" selectionModel="single"/>
            <a:dataSet id="enabled_flag_ds" lookupCode="ENABLED_STATUS"/>
            <a:dataSet id="bpClassDs" lookupCode="HLS211_BP_CLASS"/>
            <a:dataSet id="csh710_bp_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="bp_class_desc" displayField="code_value_name" options="bpClassDs" returnField="bp_class" valueField="code_value"/>
                    <a:field name="bp_class"/>
                    <a:field name="bp_type_desc" readOnly="true"/>
                    <a:field name="bp_type" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_type_v_for_lov?enabled_flag=Y" lovWidth="500" prompt="HLS_BP_TYPE.BP_TYPE" title="HLS_BP_TYPE.BP_TYPE">
                        <a:mapping>
                            <a:map from="description" to="bp_type_desc"/>
                            <a:map from="bp_type" to="bp_type"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_name"/>
                    <a:field name="bp_project_number" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="600">
                        <a:mapping>
                            <a:map from="project_id" to="bp_project_id"/>
                            <a:map from="project_number" to="bp_project_number"/>
                            <a:map from="project_name" to="bp_project_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_project_id"/>
                    <a:field name="bp_project_name"/>
                    <a:field name="enabled_flag" defaultValue="Y"/>
                    <a:field name="enabled_flag_desc" displayField="code_value_name" options="enabled_flag_ds" prompt="HLS.ENABLED_FLAG" returnField="enabled_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh710_bp_result_ds" model="csh.CSH710.csh_deduction_bp_master" queryDataSet="csh710_bp_query_ds" selectable="true" selectionModel="single"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="csh710_contract_return" text="HLS.RETURN"/>
                <a:gridButton click="csh710_contract_query" text="HLS.QUERY"/>
                <a:gridButton click="csh710_contract_reset" text="HLS.RESET"/>
                <!-- <a:gridButton click="csh710_deducate_jump" text="CSH710.PAYMENT_DECUCATE"/> -->
                <a:comboBox name="switch_model_desc" bindTarget="csh710_switch_ds" prompt="方式" style="margin-top:11px;margin-left:5px"/>
            </a:screenTopToolbar>
            <div id="csh710_bp_screen">
                <a:form id="csh710_bp_form_id" column="4" labelWidth="100" marginWidth="30" title="HLS.QUERY_TITLE">
                    <a:lov name="bp_code_from" bindTarget="csh710_bp_query_ds" prompt="HLS.BP_CODE_FROM"/>
                    <a:lov name="bp_code_to" bindTarget="csh710_bp_query_ds" prompt="HLS.BP_CODE_TO"/>
                    <a:textField name="bp_name" bindTarget="csh710_bp_query_ds" prompt="HLS.BP_NAME"/>
                    <a:textField name="extra_nam" bindTarget="csh710_bp_query_ds" prompt="HLS.SHORT_NAME"/>
                    <a:lov name="bp_type" bindTarget="csh710_bp_query_ds" prompt="HLS.BP_TYPE"/>
                    <a:textField name="bp_type_desc" bindTarget="csh710_bp_query_ds" prompt="HLS212.BP_TYPE_DESC"/>
                    <a:textField name="bp_project_name" bindTarget="csh710_bp_query_ds" prompt="HLS.PROJECT_NAME"/>
                    <a:textField name="bp_contract_name" bindTarget="csh710_bp_query_ds" prompt="HLS.CONTRACT_NAME"/>
                    <a:comboBox name="bp_class_desc" bindTarget="csh710_bp_query_ds" prompt="HLS_BP_MASTER.BP_CLASS"/>
                    <a:comboBox name="enabled_flag_desc" bindTarget="csh710_bp_query_ds"/>
                </a:form>
                <a:grid id="csh710_bp_grid_gd" bindTarget="csh710_bp_result_ds" marginHeight="250" marginWidth="30" navBar="true">
                    <a:columns>
                        <a:column name="bp_code" prompt="HLS.BP_CODE" renderer="csh710_render_deducate_bp" width="180"/>
                        <a:column name="bp_name" prompt="HLS.BP_NAME" width="250"/>
                        <a:column name="extra_nam" prompt="HLS.SHORT_NAME" width="150"/>
                        <a:column name="bp_class_desc" prompt="HLS_BP_MASTER.BP_CLASS" width="120"/>
                        <a:column name="bp_type_desc" prompt="HLS_BP_TYPE.BP_TYPE" width="120"/>
                        <a:column name="bp_category_desc" prompt="HLS_BP_TYPE.BP_CATEGORY" width="120"/>
                        <a:column name="license_terms" prompt="执照日期" renderer="Leaf.formatDate" width="80"/>
                    </a:columns>
                </a:grid>
            </div>
            <div id="csh710_con_screen">
                <a:form id="chs710_con_form_id" column="4" labelWidth="100" marginWidth="30" title="CON301.CONTRACT_QUERY">
                    <a:lov name="bp_code" bindTarget="csh710_contract_query_ds" prompt="HLS.TENANT_CODE"/>
                    <a:textField name="bp_name" bindTarget="csh710_contract_query_ds" prompt="HLS.TENANT_NAME"/>
                    <a:datePicker name="lease_start_date_from" bindTarget="csh710_contract_query_ds" prompt="HLS.LEASE_START_DATE_FROM"/>
                    <a:datePicker name="lease_start_date_to" bindTarget="csh710_contract_query_ds" prompt="HLS.LEASE_START_DATE_TO"/>
                    <a:lov name="project_number" bindTarget="csh710_contract_query_ds" prompt="HLS.PROJECT_NUMBER"/>
                    <a:textField name="project_name" bindTarget="csh710_contract_query_ds" prompt="HLS.PROJECT_NAME"/>
                    <a:lov name="project_employee_name" bindTarget="csh710_contract_query_ds" prompt="HLS.SALES_EMPLOYEE"/>
                    <a:comboBox name="lease_organization_name" bindTarget="csh710_contract_query_ds" prompt="HLS.LEASE_ORGANIZATION"/>
                    <a:lov name="contract_number" bindTarget="csh710_contract_query_ds" prompt="HLS.CONTRACT_NUMBER"/>
                    <a:textField name="contract_name" bindTarget="csh710_contract_query_ds" prompt="HLS.CONTRACT_NAME"/>
                    <a:comboBox name="employee_name_of_manager" bindTarget="csh710_contract_query_ds" prompt="HLS.EMPLOYEE_OF_MANAGER"/>
                    <a:comboBox name="lease_channel_desc" bindTarget="csh710_contract_query_ds" prompt="HLS.LEASE_CHANNEL_NAME"/>
                    <a:textField name="prj_search_term_1" bindTarget="csh710_contract_query_ds" prompt="CON301.CON_CONTRACT_V.PRJ_SEARCH_TERM_1"/>
                    <a:textField name="prj_search_term_2" bindTarget="csh710_contract_query_ds" prompt="CON301.CON_CONTRACT_V.PRJ_SEARCH_TERM_2"/>
                    <a:comboBox name="division_desc" bindTarget="csh710_contract_query_ds" prompt="HLS.DIVISION_NAME"/>
                    <a:textField name="con_search_term_1" bindTarget="csh710_contract_query_ds" prompt="CON301.CON_CONTRACT_V.CON_SEARCH_TERM_1"/>
                    <a:textField name="con_search_term_2" bindTarget="csh710_contract_query_ds" prompt="CON301.CON_CONTRACT_V.CON_SEARCH_TERM_2"/>
                    <a:comboBox name="document_type_desc" bindTarget="csh710_contract_query_ds" prompt="HLS.CONTRACT_TYPE"/>
                    <a:comboBox name="business_type_desc" bindTarget="csh710_contract_query_ds" prompt="HLS.BUSINESS_TYPE_DESC"/>
                </a:form>
                <a:grid id="con501_con_contract_grid_ds" bindTarget="csh710_contract_result_ds" marginHeight="280" marginWidth="30" navBar="true">
                    <a:columns>
                        <a:column name="contract_number" lock="true" prompt="HLS.CONTRACT_NUMBER" renderer="csh710_render_deducate" width="120"/>
                        <a:column name="contract_name" prompt="HLS.CONTRACT_NAME" width="200"/>
                        <a:column name="lease_start_date" prompt="HLS.LEASE_START_DATE" renderer="Leaf.formatDate" width="80"/>
                        <a:column name="bp_name" prompt="HLS.TENANT_NAME" width="200"/>
                        <a:column name="project_number" prompt="HLS.PROJECT_NUMBER"/>
                        <a:column name="project_name" prompt="HLS.PROJECT_NAME" width="200"/>
                        <a:column name="employee_name" prompt="HLS.SALES_EMPLOYEE" width="70"/>
                        <a:column name="employee_name_of_manager" prompt="HLS.EMPLOYEE_OF_MANAGER" width="70"/>
                        <a:column name="lease_organization_desc" prompt="HLS.LEASE_ORGANIZATION"/>
                        <a:column name="division_desc" prompt="HLS.DIVISION_NAME" width="70"/>
                        <a:column name="lease_channel_desc" prompt="HLS.LEASE_CHANNEL_NAME" width="70"/>
                        <a:column name="document_type_desc" prompt="HLS.CONTRACT_TYPE" width="90"/>
                        <a:column name="contract_status_desc" prompt="HLS.CONTRACT_STATUS" width="60"/>
                        <a:column name="prj_search_term_1"/>
                        <a:column name="prj_search_term_2"/>
                        <a:column name="con_search_term_1"/>
                        <a:column name="con_search_term_2"/>
                    </a:columns>
                </a:grid>
            </div>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
          function init(){
            			/* Ext.get("csh710_bp_form_id").setStyle({display: "none"});
				        Ext.get("csh710_bp_grid_gd").setStyle({display: "none"});
				        Ext.get("chs710_con_form_id").setStyle({display: "block"});
				        Ext.get("con501_con_contract_grid_ds").setStyle({display: "block"}); */
				        Ext.get("csh710_bp_screen").setStyle({display: "none"});
            	}
           init(); 	
            	
        ]]></script>
    </a:view>
</a:screen>