<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="${/parameter/@layout_code}_hls214n_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="${/parameter/@layout_code}_hls214n_submit_tax_req_link" model="hls.HLS223.submit_bp_taxpayer_request" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var bp_id = '${/parameter/@bp_id}';
                if (!bp_id) {
                    return;
                }
                var url = $('${/parameter/@layout_code}_hls214n_uploadFile_id').getUrl() + '?table_name=HLS_BP_MASTER&header_id=' + bp_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:ATM.UPLOAD_ATTACHMENT}',
                    id: '${/parameter/@layout_code}_hls214n_uploadFile_screen_id',
                    width: 850,
                    height: 400
                });
            };
            window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {

                var bp_id = '${/parameter/@bp_id}';
                if (!bp_id) {
                    return;
                }
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/hls.HLS223.submit_bp_taxpayer_request/update',
                    para: {
                        bp_id: '${/parameter/@bp_id}'
                    },
                    success: function(res) {
                        Leaf.Masker.unmask(Ext.getBody());
                        parent.Leaf.SideBar.enable = true;
                        parent.Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        $('${/parameter/@query_ds}').query();
                        $('${/parameter/@winid}').close();
                    },
                    failure: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
            };
            //更新时调用
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
            	var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
            	if (ds.id==ds_id){
            	    record.set('billing_status','NEW');
            	}
               };
        ]]></script>
    </a:view>
</a:screen>
