csh_bank_transfer_processing.lview 7.98 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query model="csh.CSH531.csh_batch_status_default" rootPath="batch_status_default"/>
    </a:init-procedure>
    <a:view>
        <a:link id="general_import_upload_link" url="${/request/@context_path}/modules/csh/CSH531/csh_gathering_import.lview"/>
        <a:link id="batch_detail_link" url="${/request/@context_path}/modules/csh/CSH531/csh_transaction_interface.lview"/>
        <!-- <a:link id="csh_error_message" url="${/request/@context_path}/modules/csh/CSH531/csh_error_message.lview"/> -->
        <a:link id="csh_confirm_data_link" model="csh.CSH531.csh_data_confirm" modelaction="execute"/>
        <a:link id="csh_data_confirm_check_link" model="csh.CSH531.csh_data_confirm_check" modelaction="execute"/>
        <a:link id="csh_modify_info_window_link" url="${/request/@context_path}/modules/csh/CSH531/csh_modify_info.lview"/>
        <a:link id="csh_bank_transfer_processing_link" url="${/request/@context_path}/modules/csh/CSH531/csh_bank_transfer_processing.lview"/>
        <script type="text/javascript"><![CDATA[
    	
    	    function csh_detail_link(batch_id,batch_status){
    	        // new Leaf.Window({
                    // id: 'csh_transfer_detail_window',
                    // url: $('batch_detail_link').getUrl(),
                    // params:{batch_id:batch_id,
                    		// batch_status:batch_status},
                    // title: '${l:CSH531.TRX_DETAIL}',
                    // fullScreen:true
                // });
                Leaf.go($('batch_detail_link').getUrl() + '?batch_id=' + batch_id + '&batch_status=' + batch_status);
    	    }
    	    
    	    function cshBatchDetail(value, record, name){
    	        var batch_id = record.get('batch_id');
    	        var batch_status = record.get('batch_status');
                return '<a href="javascript:csh_detail_link(' + batch_id + ',\''+ batch_status +'\')">${l:TRE502.DETAILS}</a>';
    	    }
    	    
    	    
    	    function csh531_import_gathering(){
    	        new Leaf.Window({
                    id: 'csh_upload_window',
                    url: $('general_import_upload_link').getUrl(),
                    title: '${l:HLS.IMPORT}',
                    width: 420,
                    height: 275
                });
    	    }
    	    
    	    function do_data_confirm(){
    	        var records = $('csh_trx_batch_interface_ds').getSelected();
    	        var record = records[0];
	    	    var batch_id = record.get('batch_id');
		         Leaf.request({
	    	            url:$('csh_confirm_data_link').getUrl(),
	    	            para:{batch_id :batch_id},
	    	            success: function(){
	    	                Leaf.showMessage('${l:PROMPT}','数据已确认!');
	    	                $('csh_trx_batch_interface_ds').query();
	    	            },
	    	            scope: this
	    	        });
	    	   
    	    }
    	    
    	    function csh_show_message(){
    	        //
    	        Leaf.showConfirm('${l:PROMPT}','存在未完全核销的收款,您确认吗?',function(){
                    do_data_confirm();
        	    },function(){});
    	    }
    	    
    	    function csh531_data_confirm(){
    	        var records = $('csh_trx_batch_interface_ds').getSelected();
    	        if(records.length == 0){
    	            Leaf.showMessage('${l:PROMPT}','请选择一条记录!');
    	            return;
    	        }else if(records.length > 1){
    	            Leaf.showMessage('${l:PROMPT}','请勿选择多条记录!');
    	            $('csh_trx_batch_interface_ds').unSelectAll();
    	            return;
    	        }else{
    	            var record = records[0];
	    	        var batch_id = record.get('batch_id');
	    	        
	    	         Leaf.request({
	                        url:$('csh_data_confirm_check_link').getUrl(),
	                        para:{batch_id:batch_id},
	                        success:function(res){
	                            // alert(res.result.count);
	                            if(res.result.count != 0){
					        	    csh_show_message();
	                            }else{
	                                do_data_confirm();
	                            }
	                        },
	                        sync:true,
	                        scope:this
	                    });
    	        }
    	    }
    	    
    	    function csh531_query(){
    	       $('csh_trx_batch_interface_ds').query();
    	    }
    	    
    	    function csh_edit_function(batch_id){
    	        new Leaf.Window({
                    id: 'csh_modify_info_window',
                    url: $('csh_modify_info_window_link').getUrl(),
                    params:{batch_id:batch_id},
                    title: '${l:CSH531.BASIC_INFO}',
                    width: 420,
                    height: 275
                });
    	    }
    	    
    	    function cshEditFun(value,record, name){
    	        var batch_id = record.get('batch_id');
                return '<a href="javascript:csh_edit_function('+ batch_id +')">${l:EDIT}</a>';
    	    }
    	    
    	    function csh531_delete(){
    	        $('csh_transfer_grid').remove();
    	    }
    	    
    	]]></script>
        <a:dataSets>
            <a:dataSet id="batch_status_ds" lookupCode="CSH531_BATCH_STATUS"/>
            <a:dataSet id="csh_trx_batch_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="batch_status" defaultValue="NEW"/>
                    <a:field name="batch_status_desc" defaultValue="${/model/batch_status_default/record/@code_value_name}" displayField="code_value_name" options="batch_status_ds" returnField="batch_status" valueField="code_value"/>
                    <a:field name="transaction_date"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh_trx_batch_interface_ds" autoPageSize="true" autoQuery="true" model="csh.CSH531.csh_trx_batch_interface" queryDataSet="csh_trx_batch_query_ds" selectable="true">
                <a:fields>
                    <a:field name="batch_status"/>
                    <a:field name="batch_status_desc" displayField="code_value_name" options="batch_status_ds" returnField="batch_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="csh531_import_gathering" text="CSH531.TRX_IMPORT"/>
                <a:gridButton click="csh531_data_confirm" text="CSH531.DATA_VALIDATION"/>
                <!-- <a:gridButton click="csh531_error_info" text="CSH531.SHOW_ERROR"/> -->
                <a:gridButton click="csh531_query" text="HLS.QUERY"/>
                <a:gridButton click="csh531_delete" text="HLS.REMOVE"/>
            </a:screenTopToolbar>
            <a:form column="2" title="HLS.QUERY_TITLE">
                <a:comboBox name="batch_status_desc" bindTarget="csh_trx_batch_query_ds" prompt="HLS.STATUS"/>
                <a:datePicker name="transaction_date" bindTarget="csh_trx_batch_query_ds" prompt="CSH531.TRANSACTION_DATE"/>
            </a:form>
            <a:grid id="csh_transfer_grid" bindTarget="csh_trx_batch_interface_ds" marginHeight="180" marginWidth="50" navBar="true">
                <a:columns>
                    <a:column name="transaction_date" prompt="CSH531.TRANSACTION_DATE" renderer="Leaf.formatDate"/>
                    <a:column name="file_name" prompt="CSH531.FILE_NAME" width="250"/>
                    <a:column name="description" prompt="EXP_EMPLOYEES.NOTES" width="300"/>
                    <a:column name="batch_status_desc" align="center" prompt="HLS.STATUS" width="60"/>
                    <a:column align="center" prompt="HAP_DETAIL" renderer="cshBatchDetail" width="60"/>
                    <a:column align="center" prompt="EDIT" renderer="cshEditFun" width="60"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>