import_trans_upload.lview 4.2 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="cont.CON114.get_sys_import_head_id" rootPath="header"/>
        <a:import-excel header_id="${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="WH_IMPORT" user_id="${/session/@user_id}"/>
        <a:model-query defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;WH_IMPORT&apos;" model="cont.CON114.get_import_status" rootPath="status"/>
    </a:init-procedure>
    <a:view>
        <a:link id="import_link" url="${/request/@context_path}/modules/cont/CON114/con_contract_adj_detail.lview"/>
        <a:link id="import_save_data_link" url="${/request/@context_path}/modules/cont/CON114/import_save_data.lsc"/>
        <script type="text/javascript"><![CDATA[
            function view() {
                window.location.href = $('import_link').getUrl() + '?contract_id=${/parameter/@contract_id}';
                window.close();
            }
            
            function success() {
            
                Leaf.showInfoMessage('${l:HLS.PROMPT}', '导入成功', function callback() {
                    window.location.href = $('import_link').getUrl() + '?contract_id=${/parameter/@contract_id}';
                });
            
            }
            
            function back() {
             	window.location.href = $('import_link').getUrl() + '?contract_id=${/parameter/@contract_id}';
            }
            
            function loadComplete() {
                if ('${/model/status/record/@status}' == 'NEW') {
                    var param = {};
                    param['batch_id'] = '${/parameter/@batch_id}';
                    param['adj_start_times'] = '${/parameter/@adj_start_times}';
                    param['header_id'] = '${/model/header/record/@header_id}';
                    param['contract_id'] = '${/parameter/@contract_id}';
            
                    Leaf.request({
                        url: $('import_save_data_link').getUrl(),
                        para: param,
                        success: function() {
                            Leaf.SideBar.show({
                                msg: '导入成功!',
                                duration: 2000
                            });
                            success();
                        },
                        failure: function() {
                            
                        },
                        error: function() {
                            
                        },
                        scope: this
                    });
            
                } else {
                    Ext.get('success_form').setStyle('display', 'none');
                    Ext.get('failure_form').setStyle('visibility', 'visible');
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="error_ds">
                <a:fields>
                    <a:field name="import_field_1" prompt="import_field_1"/>
                    <a:field name="import_field_2" prompt="import_field_2"/>
                    <a:field name="import_field_3" prompt="import_field_3"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form id="success_form" style="visibility:hidden" title="IMPORT_SUCCESS" width="400">
                <a:button click="view" text="PROMPT.VIEW"/>
            </a:form>
            <a:hBox>
                <a:button click="back" text="HAP_BACK"/>
            </a:hBox>
            <a:form id="failure_form" height="400" style="visibility:hidden" title="ERROR_MESSAGE" width="980">
                <a:grid bindTarget="error_ds" height="340" navBar="true" width="980">
                    <a:columns>
                        <a:column name="import_field_1"/>
                        <a:column name="import_field_2"/>
                        <a:column name="import_field_3"/>
                    </a:columns>
                </a:grid>
            </a:form>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
	  		loadComplete();
	  	]]></script>
    </a:view>
</a:screen>