<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: xuls  
    $Date: 2017-4-24 下午2:38:58  
    $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="hls_bpm_query_link" model="csh.CSH508.bpm_pay_query" modelaction="batch_update"/>
        <a:link id="hls_bpm_resend_link" model="csh.CSH508.bpm_pay_resend" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
    window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
        var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bpm_interface');
        var process_ds = $(ds_id);
        var records = process_ds.getSelected();
        if (records.length < 1) {
            Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
            return;
        }
        var process_list = [];
        for (i = 0;i < records.length;i++) {
            var payment_req_id = records[i].get('payment_req_id');
            process_list.push({
                'payment_req_id': payment_req_id,
                '_status': 'update'
            });
        }
        Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
        Leaf.request({
            url: $('hls_bpm_query_link').getUrl(),
            para: process_list,
            success: function() {
                process_ds.query();
                Leaf.Masker.unmask(Ext.getBody());
            },
            failure: function() {
                Leaf.Masker.unmask(Ext.getBody());
            },
            error: function() {
                Leaf.Masker.unmask(Ext.getBody());
            },
            scope: this
        });
    };
    
    window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
        var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bpm_interface');
        var process_ds = $(ds_id);
        var records = process_ds.getSelected();
        if (records.length < 1) {
            Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
            return;
        }
        var process_list = [];
        for (i = 0;i < records.length;i++) {
            var payment_req_id = records[i].get('payment_req_id');
            process_list.push({
                'payment_req_id': payment_req_id,
                '_status': 'update'
            });
        }
        Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
        Leaf.request({
            url: $('hls_bpm_resend_link').getUrl(),
            para: process_list,
            success: function() {
                process_ds.query();
                Leaf.Masker.unmask(Ext.getBody());
            },
            failure: function() {
                Leaf.Masker.unmask(Ext.getBody());
            },
            error: function() {
                Leaf.Masker.unmask(Ext.getBody());
            },
            scope: this
        });
    };
]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>