con_clause_templet.lview 11.5 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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure>
        <a:model-query model="basic.sys_session_info" rootPath="con202_session_info"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con202_clause_templet_link" url="${/request/@context_path}/modules/cont/CON202/con_clause_templet_line.lview"/>
        <a:link id="con_basic_clause_detail_id" url="${/request/@context_path}/modules/cont/CON202/con_basic_clause_detail.lview"/>
        <a:link id="doc_basic_clause_detail_id" url="${/request/@context_path}/modules/cont/CON202/doc_basic_clause_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function con202_clause_templet_query() {
                $('con202_clause_templet_result_ds').query();
            }
            
            function con202_clause_templet_submit() {
            
               }
            
            function windowopen_templet_line(id) {
                var record = $('con202_clause_templet_result_ds').findById(id);
                var templet_id = record.get('templet_id');
                var templet_usage = record.get('templet_usage');
                var language = record.get('language');
                new Leaf.Window({
                    id: 'con202_clause_templet_window',
                    url: $('con202_clause_templet_link').getUrl() + '?templet_id=' + templet_id + '&templet_usage=' + templet_usage + '&language=' + language,
                    params: null,
                    title: '${l:CON202.CON_CLAUSE_TEMPLET_ASSIGN}',
                    fullScreen: true
                });
            }
            
            function con202_clause_templet_grid_render(value, record, name) {
                if (name == 'company_short_name') {
                    return '${/model/con202_session_info/record/@company_short_name}';
                } else if (name == 'con202_edit') {
                    if (!record.isNew) {
                        return '<a href="javascript:windowopen_templet_line(\'' + record.id + '\');">${l:CON202.EDIT}</a>';
                    }
                    return '';
                }
            }
            
            function con202_clause_templet_functionTreeGrid_editor(record, name) {
                if (record.isNew) {
                    return 'con202_clause_templet_grid_cb';
                }
                return '';
            }
            
            function where_clause_detail(record_id, tmpt_id, tmpt_code, tmpt_desc, templet_usage) {
                var url;
                if (templet_usage == 'REG_SETTLE') {
                    url = $('doc_basic_clause_detail_id').getUrl();
                } else {
                    url = $('con_basic_clause_detail_id').getUrl();
                }
            
                new Leaf.Window({
                    id: 'where_clause_detail_win',
                    url: url,
                    params: {
                        tmpt_id: tmpt_id,
                        tmpt_code: tmpt_code,
                        tmpt_desc: tmpt_desc
                    },
                    width: 1150,
                    height: 430
                });
            }
            
            function where_caluse_renderer(value, record, name) { //
                var record_id = record.id;
                var tmpt_id = record.get('templet_id');
                var tmpt_code = record.get('templet_code');
                var tmpt_desc = record.get('description');
                var templet_usage = record.get('templet_usage');
            
                if (!record.isNew) {
                    return '<a href="javascript:where_clause_detail(' + record_id + ',\'' + tmpt_id + '\',\'' + tmpt_code + '\',\'' + tmpt_desc + '\',\'' + templet_usage + '\')">文本打印条件</a>';
                }
            }
            
            function edit_function(record, name) {
                if (record.isNew) {
                    if (name == 'templet_code') {
                        return 'con202_clause_templet_grid_tf';
                    }
                }
                return '';
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con202_clause_templet_tmplet_usage_ds" lookupCode="CON_TMPLET_USAGE"/>
            <a:dataSet id="con202_clause_templet_approval_status_ds" lookupCode="CON_TERMS_APPROVE_STATUS"/>
            <a:dataSet id="con202_clause_templet_enabled_status_ds" lookupCode="ENABLED_STATUS"/>
            <a:dataSet id="con202_clause_templet_con_language_ds" lookupCode="CON_LANGUAGE"/>
            <a:dataSet id="con202_clause_templet_query_ds">
                <a:fields>
                    <a:field name="templet_code"/>
                    <a:field name="description"/>
                    <a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" returnField="templet_usage" valueField="code_value"/>
                    <a:field name="approval_status_name" displayField="code_value_name" options="con202_clause_templet_approval_status_ds" returnField="approval_status" valueField="code_value"/>
                    <a:field name="enabled_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="enabled_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con202_clause_templet_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON202.con_clause_templet" queryDataSet="con202_clause_templet_query_ds" selectable="true">
                <a:fields>
                    <a:field name="templet_code" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="templet_usage" required="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="language" defaultValue="CHINESE"/>
                    <a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" required="true" returnField="templet_usage" valueField="code_value"/>
                    <a:field name="language_name" displayField="code_value_name" options="con202_clause_templet_con_language_ds" required="true" returnField="language" valueField="code_value"/>
                    <a:field name="approval_status" defaultValue="APPROVED"/>
                    <a:field name="tax_type_rate" lovHeight="500" lovService="cont.CON202.fnd_tax_type_codes" lovWidth="500" title="税率">
                        <a:mapping>
                            <a:map from="tax_type_rate" to="tax_type_rate"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="approval_status_name" defaultValue="${l:CON202.UNAPPROVED}"/>
                    <a:field name="doc_plugin_flag" checkedValue="Y" uncheckedValue="N"/>
                    <a:field name="doc_template_id_des" lovHeight="500" lovService="cont.CON202.hls_doc_file_templet_for_lov" lovWidth="500" title="文件模板">
                        <a:mapping>
                            <a:map from="templet_id" to="doc_template_id"/>
                            <a:map from="templet_name" to="doc_template_id_des"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="con202_clause_templet_query" text="HLS.QUERY"/>
                <a:gridButton bind="con202_clause_templet_functionTreeGrid" type="add"/>
                <a:gridButton bind="con202_clause_templet_functionTreeGrid" type="clear"/>
                <a:gridButton bind="con202_clause_templet_functionTreeGrid" type="save"/>
            </a:screenTopToolbar>
            <a:form labelSeparator=" " row="1">
                <a:textField name="templet_code" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_CODE"/>
                <a:textField name="description" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.DESCRIPTION"/>
                <a:comboBox name="templet_usage_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/>
                <a:comboBox name="approval_status_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.APPROVAL_STATUS_NAME"/>
                <a:comboBox name="enabled_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.ENABLED_FLAG_DES"/>
            </a:form>
            <a:grid id="con202_clause_templet_functionTreeGrid" bindTarget="con202_clause_templet_result_ds" marginHeight="130" marginWidth="50" navBar="true" width="800">
                <a:columns>
                    <a:column name="company_short_name" prompt="CON202.CON_CLAUSE_TEMPLET.COMPANY_SHORT_NAME" renderer="con202_clause_templet_grid_render" width="150"/>
                    <a:column name="templet_code" editorFunction="edit_function" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_CODE" width="250"/>
                    <a:column name="description" editor="con202_clause_templet_grid_tf" prompt="CON202.CON_CLAUSE_TEMPLET.DESCRIPTION" width="130"/>
                    <a:column name="templet_usage_name" editor="con202_clause_templet_grid_cb" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_USAGE" width="120"/>
                    <a:column name="approval_status_name" prompt="CON202.CON_CLAUSE_TEMPLET.APPROVAL_STATUS_NAME" width="80"/>
                    <a:column name="print_num" align="right" editor="con202_clause_templet_grid_nf" prompt="打印份数" width="50"/>
                    <a:column name="con202_edit" prompt="CON202.EDIT" renderer="con202_clause_templet_grid_render" width="60"/>
                    <a:column name="enabled_flag" editor="con202_clause_templet_grid_ck" prompt="HLS030.ENABLED_FLAG" width="40"/>
                    <a:column name="language_name" editor="con202_clause_templet_grid_cb" prompt="CON202.LANGUAGE" width="60"/>
                    <a:column name="where_caluse" prompt="文本打印条件" renderer="where_caluse_renderer" width="100"/>
                    <a:column name="version_date" editor="con202_clause_templet_grid_tf" prompt="版本号" width="100"/>
                    <a:column name="order_seq" align="center" editor="con202_clause_templet_grid_tf" prompt="序号" width="80"/>
                    <a:column name="tax_type_rate" align="right" editor="con202_clause_templet_grid_lv" prompt="税率" renderer="Leaf.formatNumber"/>
                    <a:column name="doc_plugin_flag" editor="con202_clause_templet_grid_ck" prompt="插件标志" width="50"/>
                    <a:column name="doc_template_id_des" editor="con202_clause_templet_grid_lv" prompt="文件模板" width="80"/>
                    <a:column name="note" editor="con202_clause_templet_grid_tf" prompt="备注" width="140"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="con202_clause_templet_grid_nf" allowDecimals="false" allowNegative="false"/>
                    <a:textField id="con202_clause_templet_grid_tf"/>
                    <a:checkBox id="con202_clause_templet_grid_ck"/>
                    <a:comboBox id="con202_clause_templet_grid_cb"/>
                    <a:datePicker id="con202_date_ed"/>
                    <a:lov id="con202_clause_templet_grid_lv"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>