hls_bp_relation_save.lview 6.75 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2014-9-28 下午2:02:27  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="relation_update_link_id" url="${/request/@context_path}/modules/hls/HLS1010/bp_master_relation.lsc"/>
        <script type="text/javascript"><![CDATA[

            function exp_1051_next() {
                history.go(1);
            }
            
            function exp_1051_back() {
                history.go(-1);
            }
            
            function exp_1051_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
            }
            
            function save_bp_relation() {
                var dept_ds = $('bp_master_com_ds1'); // 取得dataset对象
                var records = dept_ds.getSelected(); // 取得record数组
                var param = new Object();
                var datas = [];
                var data = {};
            
                if (records.length == 0) {
                    Leaf.showInfoMessage('信息', '请至少选择一行!', null, 200, 100);
                }
                for (var i = 0;i < records.length;i++) {
                    data = {};
                    data['bp_id'] = ${/parameter/@bp_id};
                    data['related_bp_id'] = records[i].get('bp_id');
                    data['relation_type'] = 'INSR';
                    data['relation_category'] = 'INSR';
                    data['enabled_flag'] = 'Y';
                    data['_status'] = 'insert';
            
                    datas.push(data);
                }
                param['details'] = datas;
                Leaf.request({
                    url: $('relation_update_link_id').getUrl(),
                    para: param,
                    success: function(args) {
            
                        $('bp_master_com_ds1').query();
                        $('bp_master_com_ds2').query();
            
                    },
                    scope: this
                });
            }
            
            function delete_bp_relation() {
                var dept_ds = $('bp_master_com_ds2'); // 取得dataset对象
                var records = dept_ds.getSelected(); // 取得record数组
                var param = new Object();
                var datas = [];
                var data = {};
            
                if (records.length == 0) {
                    Leaf.showInfoMessage('信息', '请至少选择一行!', null, 200, 100);
                }
                for (var i = 0;i < records.length;i++) {
                    data = {};
                    data['bp_id'] = ${/parameter/@bp_id};
                    data['related_bp_id'] = records[i].get('bp_id');
                    data['_status'] = 'execute';
                    datas.push(data);
                }
                param['details'] = datas;
                Leaf.request({
                    url: $('relation_update_link_id').getUrl(),
                    para: param,
                    success: function(args) {
            
                        $('bp_master_com_ds1').query();
                        $('bp_master_com_ds2').query();
            
                    },
                    scope: this
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="bp_master_query_ds1">
                <a:fields>
                    <a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
                    <a:field name="bp_type" defaultValue="LSHM"/>
                    <a:field name="not_exist_query" defaultValue="Y"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="bp_master_query_ds2">
                <a:fields>
                    <a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
                    <a:field name="bp_type" defaultValue="LSHM"/>
                    <a:field name="exist_query" defaultValue="Y"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="bp_master_com_ds1" autoQuery="true" model="hls.HLS1010.hls_bp_master_lv" pageSize="15" queryDataSet="bp_master_query_ds1" selectable="true"/>
            <a:dataSet id="bp_master_com_ds2" autoQuery="true" model="hls.HLS1010.hls_bp_master_lv" pageSize="15" queryDataSet="bp_master_query_ds2" selectable="true"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="exp_1051_back" text="HLS.BACK"/>
                <a:gridButton click="exp_1051_next" text="HLS.FORWARD"/>
                <a:gridButton click="exp_1051_quit" text="HLS.EXIT"/>
                <!--    <a:gridButton click="save_bp_relation_ds" text="分配"/> -->
            </a:screenTopToolbar>
            <a:hBox>
                <a:vBox>
                    <a:grid id="bp_master_com_ds_grid1" bindTarget="bp_master_com_ds1" marginHeight="200" navBar="true" width="600">
                        <a:columns>
                            <a:column name="bp_code" align="left" prompt="公司编码" width="100"/>
                            <a:column name="bp_name" align="left" prompt="公司名称" width="100"/>
                            <a:column name="bp_category_n" align="left" prompt="公司类别" width="80"/>
                            <a:column name="bp_type_n" align="left" prompt="公司类型" width="100"/>
                            <a:column name="bp_class_n" align="left" prompt="分类" width="90"/>
                        </a:columns>
                    </a:grid>
                </a:vBox>
                <a:vBox>
                    <a:button click="save_bp_relation" height="35" text="&gt;---" width="50"/>
                    <a:button click="delete_bp_relation" height="35" text="&lt;---" width="50"/>
                </a:vBox>
                <a:vBox>
                    <a:grid id="bp_master_com_ds_grid2" bindTarget="bp_master_com_ds2" marginHeight="200" navBar="true" width="600">
                        <a:columns>
                            <a:column name="bp_code" align="left" prompt="公司编码" width="65"/>
                            <a:column name="bp_name" align="left" prompt="公司名称" width="70"/>
                            <a:column name="bp_category_n" align="left" prompt="公司类别" width="75"/>
                            <a:column name="bp_type_n" align="left" prompt="公司类型" width="200"/>
                            <a:column name="bp_class_n" align="left" prompt="分类" width="90"/>
                        </a:columns>
                    </a:grid>
                </a:vBox>
            </a:hBox>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
     
        ]]></script>
    </a:view>
</a:screen>