cus_hls_specify_approver.lview 4.23 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.specify_code=${/parameter/@specify_code}" fetchAll="true" model="cus_wfl.cus_hls_specify_define" rootPath="cus_define_path"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        	var load_flag = 'Y';
        	var confirm_flag = 'N';
			function cus_specify_add(){
			     $('cus_specify_grid').showEditorByRecord($('cus_specify_approvers').create());
			}
			function cus_specify_clear(){
			    $('cus_specify_grid').clear();
			}
			function cus_specify_save(){
			    $('cus_specify_approvers').submitSelected();
			}
			function prj501n_specify_approver_load(ds){
			    var rs = ds.getAll();
			    for (var i=0;i<rs.length;i++){
			        var checked = rs[i].get('checked');
			        if (checked =='Y'){
			            ds.select(rs[i]);
			            ds.locate(i);
			        }
			    }
			    load_flag = 'N';
			}
			function prj501n_specify_select(ds,record){
			    if (load_flag=='N'){
			        record.dirty = true;
			        record.set('checked','Y');
			    }
			}
			function prj501n_specify_unselect(ds,record){
			    record.dirty = true;
			    record.set('checked','N');
			}
			function prj501n_specify_submit_sucess(ds,res){
			    confirm_flag = 'Y';
			    $('cus_prj_secify_approver_screen').close();
			}
			function get_confirm_flag(){
			    return confirm_flag;
			}
			function cus_specify_query(){
			    $('cus_specify_approvers').query();
			}
		]]></script>
        <a:dataSets>
            <a:dataSet id="cus_specify_query" autoCreate="true"/>
            <a:dataSet id="cus_specify_approvers" autoQuery="true" fetchAll="true" model="cus_wfl.cus_hls_specify_approver" queryDataSet="cus_specify_query" queryUrl="${/request/@context_path}/autocrud/cus_wfl.cus_hls_specify_approver/query?document_id=${/parameter/@document_id}&amp;specify_id=${/model/cus_define_path/record/@specify_id}&amp;lov_statement=${/model/cus_define_path/record/@lov_sql}" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="specify_id" defaultValue="${/model/cus_define_path/record/@specify_id}"/>
                    <a:field name="document_id" defaultValue="${/parameter/@document_id}"/>
                    <a:field name="approver_user_name" autoComplete="true" lovGridHeight="320" lovHeight="500" lovService="cus_wfl.cus_hls_specify_lov" lovWidth="500" required="true">
                        <a:mapping>
                            <a:map from="user_name" to="approver_user_name"/>
                            <a:map from="description" to="approver_user_desc"/>
                            <a:map from="user_id" to="approver_user_id"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="prj501n_specify_approver_load"/>
                    <a:event name="select" handler="prj501n_specify_select"/>
                    <a:event name="unselect" handler="prj501n_specify_unselect"/>
                    <a:event name="submitsuccess" handler="prj501n_specify_submit_sucess"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <!-- <a:gridButton click="cus_specify_add" text="HLS.NEW"/> -->
                <a:gridButton click="cus_specify_query" text="HLS.QUERY"/>
                <a:gridButton click="cus_specify_save" text="HLS.CONFIRM"/>
                <a:hBox>
                    <a:textField name="user_name" bindTarget="cus_specify_query" prompt="名称"/>
                </a:hBox>
            </a:screenTopToolbar>
            <!-- <a:textField name="user_name" prompt="名称" bindTarget="cus_specify_query" /> -->
            <a:grid id="cus_specify_grid" bindTarget="cus_specify_approvers" height="320" width="450">
                <a:columns>
                    <a:column name="approver_user_name" prompt="用户代码" width="120"/>
                    <a:column name="approver_user_desc" prompt="名称" width="180"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>