hn_project_side_detail.lview 19.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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Administrator  
    $Date: 2016-5-19 上午9:49:33  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="prj811d_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="prj811d_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
        <a:link id="bgfl_csh_payment_conditions_uploadfile_link_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="bgfl_csh_payment_conditions_downloadfile_link_id" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="prj811d_create_project_side_update_link_id" model="prj.PRJ811.hn_create_project_side" modelaction="update"/>
        <a:link id="prj811d_create_project_side_submit_link_id" model="prj.PRJ811.hn_create_project_side" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
            function prj811_side_detail_exit() {
                $('${/parameter/@winid}').close();
            }
            
            function open_project_info_win() {

                var record = $('prj_project_base_info_ds').getAt(0);
                var param = record.data;
                maintain_type = 'READONLY';
                function_usage = 'QUERY';
                function_code = 'PRJ505';
                param['document_id'] = record.get('project_id');
                param['function_code'] = function_code;
                param['function_usage'] = function_usage;
                param['maintain_type'] = maintain_type;
                param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
                //param['layout_debugger_flag']='Y';
                param['cond_para2'] = record.get('hn_industry_classification');
                param['wf_function_code'] = '${/parameter/@function_code}';
                hls_doc_get_layout_code('prj811d_project_get_layout_code_link_id', param, 'prj811d_project_modify_link');
            }
            
            function onSubmitSuccess_doc(dataSet, datas, rec) {
                $('prj811_detail_result_ds').query();
            }
            
            
            function bgfl_doc(record, name) {
                var query_flag = '${/parameter/@query_flag}';
                if (name === 'description' || name === 'note') {
                    if (record.isNew || (query_flag != 'Y' && !record.isNew)) {
                        return 'grid_ts_id';
                    }
                }
                return '';
            }
            
            function open_attachment_window(condiction_id, url) {
                new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    params: {
                        'table_name': 'PRJ_CDD_ITEM_CHECK',
                        'header_id': condiction_id
                    },
                    width: 850,
                    height: 400
                }).on('close',function (){
                	$('prj811_detail_result_ds').query();
                });
            }
            
            function bgfl_doc_render_func(value, record, name) {
                if (name === 'attachments') {

                    var query_flag = '${/parameter/@query_flag}';
                    var check_id = record.get('check_id');
                    var url;
                    var text;
                    //保存之后才能生成
                    if (query_flag != 'Y' && !record.isNew && check_id !== undefined) {
                        url = $('bgfl_csh_payment_conditions_uploadfile_link_id').getUrl();
            
                        text = '上传/删除';
                    } else if (!record.isNew && query_flag === 'Y') {
                        url = $('bgfl_csh_payment_conditions_downloadfile_link_id').getUrl();
                        text = '下载';
                    } else {
                        text = '';
                    }
                    return '<a href="javascript:open_attachment_window(' + record.get('check_id') + ',\'' + url + '\')">' + text + '</a>';
                }
                if (name=='attachment_name'){
                    var file_name=record.get('attachment_name');
                    if (file_name != null) {
                        var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                        var str = file_name.split(';');
                        var url = '';
                        for (var i = 0;i < str.length;i++) {
                            var temp = str[i].split('--');
                            if (!Leaf.isEmpty(temp[0])) {
                                url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
                            }
                        }
                        return url;
                    }
                }
            }
            
            // function prj811_project_control_select_func(record) {
            // var project_submit_flag = record.get('project_submit_flag');
            // if (record.isNew) {
            // return true;
            // } else if (!record.isNew && project_submit_flag === 'Y') {
            // return false;
            // } else {
            // return true;
            // }
            
            // }
            
            function onSubmitSuccess_copyDs(dataSet, datas, rec) {
                $('prj811_csh_payment_conditions_result_ds').query();
            }
            
            //保存
            
            function prj811_side_detail_save() {
            
                if ($('prj_project_base_info_ds').validate()) {
                    Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在执行...');
                    var record = $('prj_project_base_info_ds').getAt(0);
                    Leaf.request({
                        url: $('prj811d_create_project_side_update_link_id').getUrl(),
                        para: {
                            prj_side_id: '${/parameter/@prj_side_id}',
                            project_id: '${/parameter/@project_id}',
                            side_note: record.get('side_note'),
                            side_item: record.get('side_item')
                        },
                        success: function() {
                            $('prj811_detail_result_ds').submit();
            
                            Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
            
                        },
                        failure: function() {
                            Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
                        },
                        error: function() {
                            Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
                        },
                        scope: this
                    });
                }
            
            }
            //提交审批
            
            function prj811_side_detail_submit() {
                if ($('prj_project_base_info_ds').validate()) {
                    Leaf.showConfirm('${l:HLS.PROMPT}', '确认提交审批吗?', function() {
                        Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在执行');
                        $('prj811_detail_result_ds').submit();
                        var record = $('prj_project_base_info_ds').getAt(0);
                        Leaf.request({
                            url: $('prj811d_create_project_side_submit_link_id').getUrl(),
                            para: {
                                prj_side_id: '${/parameter/@prj_side_id}',
                                project_id: '${/parameter/@project_id}',
                                side_note: record.get('side_note'),
                                side_item: record.get('side_item')
                            },
                            success: function() {
                                Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
                                $('${/parameter/@winid}').close();
            
                            },
                            failure: function() {
                                Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
                            },
                            error: function() {
                                Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
                            },
                            scope: this
                        });
                    });
                }
            }
            
            
            function on_base_info_load_check(ds) {
                if ('${/parameter/@query_flag}' == 'Y') {
                    var record = ds.getCurrentRecord();
                    record.getField('side_note').setReadOnly(true);
                    record.getField('side_note').setRequired(false);
                    record.getField('side_item').setReadOnly(true);
                    record.getField('side_item').setRequired(false);
                }
                if ('${/parameter/@query_flag}' == 'W') {
                    var record = ds.getCurrentRecord();
                    record.getField('side_note').setReadOnly(true);
                    record.getField('side_note').setRequired(false);
                    record.getField('side_item').setReadOnly(true);
                    record.getField('side_item').setRequired(false);
                }
            };
        ]]></script>
        <a:dataSets>
            <a:dataSet id="prj_project_base_info_ds" autoQuery="true" model="prj.PRJ811.hn_create_project_side" queryUrl="${/request/@context_path}/autocrud/prj.PRJ811.hn_create_project_side/query?project_id=${/parameter/@project_id}&amp;prj_side_id=${/parameter/@prj_side_id}">
                <a:fields>
                    <a:field name="project_number" readOnly="true"/>
                    <a:field name="project_name" readOnly="true"/>
                    <a:field name="chance_source_n" readOnly="true"/>
                    <a:field name="employee_id_n" readOnly="true"/>
                    <a:field name="lease_organization_n" readOnly="true"/>
                    <a:field name="business_type_n" readOnly="true"/>
                    <a:field name="lease_form_n" readOnly="true"/>
                    <a:field name="division_n" readOnly="true"/>
                    <a:field name="pre_rental_business_n" readOnly="true"/>
                    <a:field name="lease_item_amount" readOnly="true"/>
                    <a:field name="lease_term" readOnly="true"/>
                    <a:field name="int_rate" readOnly="true"/>
                    <a:field name="int_rate_fixing_way_n" readOnly="true"/>
                    <a:field name="int_rate_fixing_range" readOnly="true"/>
                    <a:field name="side_item" required="true"/>
                    <a:field name="side_note" required="true"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="on_base_info_load_check"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="prj811_detail_result_ds" autoQuery="true" model="prj.PRJ811.hn_prj_project_doc_cdd_item" pageSize="11" queryUrl="${/request/@context_path}/autocrud/prj.PRJ811.hn_prj_project_doc_cdd_item/query?document_id=${/parameter/@prj_side_id}&amp;document_table=HN_PRJ_PROJECT_SIDE" selectable="true">
                <a:fields>
                    <a:field name="document_table" defaultValue="HN_PRJ_PROJECT_SIDE"/>
                    <a:field name="document_id" defaultValue="${/parameter/@prj_side_id}"/>
                    <a:field name="note"/>
                    <a:field name="description" required="true"/>
                </a:fields>
                <a:events>
                    <a:event name="submitSuccess" handler="onSubmitSuccess_doc"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:switch test="/parameter/@query_flag">
                <a:case value="N">
                    <a:screenTopToolbar>
                        <a:screenTitle/>
                        <a:gridButton click="prj811_side_detail_exit" text="HLS.EXIT"/>
                        <a:gridButton click="prj811_side_detail_save" text="保存"/>
                        <a:gridButton click="prj811_side_detail_submit" text="提交审批"/>
                    </a:screenTopToolbar>
                </a:case>
                <!--             <a:case value="N">
               
            </a:case> -->
            </a:switch>
            <a:tabPanel id="side" marginHeight="260" marginWidth="50">
                <a:tabs>
                    <a:tab id="project_base_info_tab_id" disabled="false" marginHeight="270" prompt="基本信息" selected="true" width="120">
                        <a:form column="4" labelWidth="120" style="margin-left:10px;margin-top:10px;" title="基本信息">
                            <a:textField name="project_number" bindTarget="prj_project_base_info_ds" prompt="项目编号"/>
                            <a:textField name="project_name" bindTarget="prj_project_base_info_ds" colspan="2" prompt="项目名称" width="428"/>
                            <a:textField name="chance_source_n" bindTarget="prj_project_base_info_ds" prompt="项目来源"/>
                            <a:textField name="employee_id_n" bindTarget="prj_project_base_info_ds" prompt="项目经理"/>
                            <a:textField name="lease_organization_n" bindTarget="prj_project_base_info_ds" prompt="业务部"/>
                            <a:textField name="business_type_n" bindTarget="prj_project_base_info_ds" prompt="租赁业务类型"/>
                            <a:textField name="lease_form_n" bindTarget="prj_project_base_info_ds" prompt="租赁形式"/>
                            <a:textField name="division_n" bindTarget="prj_project_base_info_ds" prompt="产品线"/>
                            <a:textField name="pre_rental_business_n" bindTarget="prj_project_base_info_ds" prompt="租前期项目"/>
                            <a:numberField name="lease_item_amount" allowFormat="true" bindTarget="prj_project_base_info_ds" decimalPrecision="2" prompt="融资金额"/>
                            <a:textField name="lease_term" bindTarget="prj_project_base_info_ds" prompt="租赁期限"/>
                            <a:percentField name="int_rate" bindTarget="prj_project_base_info_ds" prompt="租赁利率"/>
                            <a:textField name="int_rate_fixing_way_n" bindTarget="prj_project_base_info_ds" prompt="利率浮动方式"/>
                            <a:percentField name="int_rate_fixing_range" bindTarget="prj_project_base_info_ds" prompt="浮动幅度"/>
                            <a href="javascript:open_project_info_win()"><![CDATA[项目详细信息]]></a>
                            <a:textField name="side_item" bindTarget="prj_project_base_info_ds" colspan="4" prompt="审议事项" width="1000"/>
                            <a:textArea name="side_note" bindTarget="prj_project_base_info_ds" colspan="4" height="100" prompt="变更说明" width="1000"/>
                        </a:form>
                    </a:tab>
                    <a:tab id="project_app_attch_tab_id" prompt="支撑性文件" width="120">
                        <a:switch test="/parameter/@query_flag">
                            <a:case value="Y">
                                <a:grid bindTarget="prj811_detail_result_ds" marginHeight="400" marginWidth="100" navBar="true" style="margin-left:10px;margin-top:10px;">
                                    <a:columns>
                                        <a:column name="description" editorFunction="bgfl_doc" lock="true" prompt="HLS.DOCUMENT_NAME" width="300"/>
                                        <a:column name="attachments" align="center" prompt="附件上传" renderer="bgfl_doc_render_func" width="100"/>
                                        <a:column name="attachment_name" prompt="文件名" renderer="bgfl_doc_render_func" width="400"/>
                                        <a:column name="note" editor="con555_cdd_tf_id" editorFunction="bgfl_doc" prompt="备注" width="500"/>
                                    </a:columns>
                                    <a:editors>
                                        <a:textField id="grid_ts_id"/>
                                    </a:editors>
                                </a:grid>
                            </a:case>
                            <a:case value="N">
                                <a:grid bindTarget="prj811_detail_result_ds" marginHeight="400" marginWidth="100" navBar="true" style="margin-left:10px;margin-top:10px;">
                                    <a:toolBar>
                                        <a:button type="add"/>
                                        <a:button type="delete"/>
                                        <a:button type="save"/>
                                    </a:toolBar>
                                    <a:columns>
                                        <a:column name="description" editorFunction="bgfl_doc" lock="true" prompt="HLS.DOCUMENT_NAME" width="300"/>
                                        <a:column name="attachments" align="center" prompt="附件上传" renderer="bgfl_doc_render_func" width="100"/>
                                        <a:column name="attachment_name" prompt="文件名" renderer="bgfl_doc_render_func" width="400"/>
                                        <a:column name="note" editor="con555_cdd_tf_id" editorFunction="bgfl_doc" prompt="备注" width="500"/>
                                    </a:columns>
                                    <a:editors>
                                        <a:textField id="grid_ts_id"/>
                                    </a:editors>
                                </a:grid>
                            </a:case>
                            <a:case value="W">
                                <a:grid bindTarget="prj811_detail_result_ds" marginHeight="400" marginWidth="100" navBar="true" style="margin-left:10px;margin-top:10px;">
                                    <a:toolBar>
                                        <a:button type="add"/>
                                        <a:button type="delete"/>
                                        <a:button type="save"/>
                                    </a:toolBar>
                                    <a:columns>
                                        <a:column name="description" editorFunction="bgfl_doc" lock="true" prompt="HLS.DOCUMENT_NAME" width="300"/>
                                        <a:column name="attachments" align="center" prompt="附件上传" renderer="bgfl_doc_render_func" width="100"/>
                                        <a:column name="attachment_name" prompt="文件名" renderer="bgfl_doc_render_func" width="400"/>
                                        <a:column name="note" editor="con555_cdd_tf_id" editorFunction="bgfl_doc" prompt="备注" width="500"/>
                                    </a:columns>
                                    <a:editors>
                                        <a:textField id="grid_ts_id"/>
                                    </a:editors>
                                </a:grid>
                            </a:case>
                        </a:switch>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
            <script type="text/javascript"><![CDATA[
                
            ]]></script>
        </a:screenBody>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>