con_collection_detail.lview 14.8 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Calvin  
    $Date: 2017年11月22日18:21:48
    $Revision: 1.0  
    $Purpose:德融动态页面通用页面 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>
        <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="col_detail_link" url="${/request/@context_path}/modules/cont/CON632/con_collection_phone_detail.lview"/>
        <script src="${/request/@context_path}/javascripts/jquery-1.6.4.min.js" type="text/javascript"/>
        <script type="text/javascript"><![CDATA[
            jQuery.noConflict();
            
            //锁屏
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window'] = function() {
                var detail_mask;
                if ('${/parameter/@winid}') {
                    if (parent.$L.CmpManager.get('${/parameter/@winid}')) {
                        detail_mask = parent.$('${/parameter/@winid}').wrap;
                        parent.Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                    } else {
                        detail_mask = $('${/parameter/@winid}').wrap;
                        Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                    }
                } else {
                    detail_mask = Ext.getBody();
                    Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                }
            };
            //解屏
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'] = function() {
                var detail_mask;
                if ('${/parameter/@winid}') {
                    if (parent.$L.CmpManager.get('${/parameter/@winid}')) {
                        detail_mask = parent.$('${/parameter/@winid}').wrap;
                        parent.Leaf.Masker.unmask(detail_mask);
                    } else {
                        detail_mask = $('${/parameter/@winid}').wrap;
                        Leaf.Masker.unmask(detail_mask);
                    }
                } else {
                    detail_mask = Ext.getBody();
                    Leaf.Masker.unmask(detail_mask);
                }
                if (Ext.get(document.documentElement)) {
                    $L.Masker.unmask(Ext.get(document.documentElement));
                }
            };
            
            function check_releated_layout(releated_table) {
                var str = '${/parameter/@layout_code}';
                //商机
                if (str.indexOf(releated_table) >= 0) {
                    return true;
                } else {
                    return false;
                }
            }
            
            //关闭
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var root_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_collection');
                var record = $(root_ds).getCurrentRecord();
                if ($(root_ds).validate()) {
                    Leaf.showConfirm('提示', '确定要关闭该催收单据吗?', function() {
                        window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
                        Leaf.request({
                            url: '${/request/@context_path}/autocrud/cont.CON632.con_collection/update',
                            para: {
                                col_id: '${/parameter/@col_id}',
                                closed_reason: record.get('closed_reason')
                            },
                            success: function(res) {
                                Leaf.SideBar.show({
                                    msg: '操作成功',
                                    duration: 2000
                                });
                                window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                                $('${/parameter/@winid}').close();
                            },
                            failure: function() {
                                window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                            },
                            error: function() {
                                window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                            },
                            sync: true,
                            scope: this
                        });
                    });
                }
            };
            
//            //查询时调用(grid,table,gridBox)
//            window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
//                var ds_check_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
//                if (ds_check_id == ds.id && ds_check_id) {
//                    $(ds_check_id).setQueryParameter('bp_id', '${/parameter/@bp_id}');
//                }
//            };
            
//            var load_count = 0;
//            //加载时调用(grid,table,gridBox)
//            window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record) {
//                window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
//                //全选框有bug 隐藏
//                jQuery("[atype='grid.headcheck']").removeClass("grid-ckb item-ckb-u");
//                jQuery("div").hover(function() {
//                    var ds_call_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_collection_call_hd');
//                    if (ds_call_id) {
//                        var records = $(ds_call_id).getAll();
//                        for (var i = 0;i < records.length;i++) {
//                            var id = "#${/parameter/@layout_code}_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id__" + records[i].id;
//                            if (records[i].get('col_type') != 'VISIT' && '${/parameter/@function_type}' == 'VISIT' && !records[i].isNew) {
//                                // var id = "#CON_COLLECTION_DETAIL_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id__" + records[i].id;
//                                jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
//                            } else if ('${/parameter/@function_type}' == 'PHONE' && records[i].get('col_type') == 'VISIT') {
//                                jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
//                            }
//                            jQuery("div").unbind(); //移除所有
//                        }
//                    }
//                });
//                // jQuery("div").unbind(); //移除所有
//                var ds_check_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
//                var ds_call_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_collection_call_hd');
//                if (ds.id == ds_check_id) {
//                    $(ds_check_id).setQueryParameter('bp_id', '${/parameter/@bp_id}');
//                } else if (ds.id == ds_call_id) {
//                    if (load_count <= 1) {
//                        jQuery("#${/parameter/@layout_code}_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id_wrap .nav-refresh").click();
//                        jQuery("div").unbind(); //移除所有
//                        load_count++;
//                    }
//
//                    var col_number = '${/parameter/@col_number}';
//                    col_number = col_number.replace('CC', '');
//                    $(ds_call_id).setQueryParameter('col_id', col_number);
//                    var records = $(ds_call_id).getAll();
//                    for (var i = 0;i < records.length;i++) {
//                        var id = "#${/parameter/@layout_code}_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id__" + records[i].id;
//                        if (records[i].get('col_type') != 'VISIT' && '${/parameter/@function_type}' == 'VISIT') {
//                            // var id = "#CON_COLLECTION_DETAIL_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id__" + records[i].id;
//                            jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
//                            records[i].getField('bp_id').setReadOnly(true);
//                            records[i].getField('bp_id_n').setReadOnly(true);
//                            records[i].getField('col_type').setReadOnly(true);
//                            records[i].getField('col_type_n').setReadOnly(true);
//                            records[i].getField('col_time').setReadOnly(true);
//                            records[i].getField('col_person').setReadOnly(true);
//                            records[i].getField('col_person_n').setReadOnly(true);
//                        } else if ('${/parameter/@function_type}' == 'PHONE' && records[i].get('col_type') == 'VISIT') {
//                            // var id = "#CON_COLLECTION_DETAIL_G_PHONE_COLLECTION_con_collection_call_hd_layout_grid_id__" + records[i].id;
//                            jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
//                            records[i].getField('bp_id').setReadOnly(true);
//                            records[i].getField('bp_id_n').setReadOnly(true);
//                            records[i].getField('col_type').setReadOnly(true);
//                            records[i].getField('col_type_n').setReadOnly(true);
//                            records[i].getField('col_time').setReadOnly(true);
//                            records[i].getField('col_person').setReadOnly(true);
//                            records[i].getField('col_person_n').setReadOnly(true);
//                        }
//
//                        if (records[i].get('col_type') == 'RETURN_VISIT' || !records[i].get('col_type')) {
//                            jQuery(id).removeClass("grid-ckb item-ckb-readonly-u").addClass('grid-ckb item-ckb-u');
//                            records[i].getField('bp_id').setReadOnly(false);
//                            records[i].getField('bp_id_n').setReadOnly(false);
//                            records[i].getField('col_type').setReadOnly(false);
//                            records[i].getField('col_type_n').setReadOnly(false);
//                            records[i].getField('col_time').setReadOnly(false);
//                            records[i].getField('col_person').setReadOnly(false);
//                            records[i].getField('col_person_n').setReadOnly(false);
//                        }
//                    }
//                }
//                window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
//            };
            
//            function open_contract_win(ds_id, record_id) {
//                var record = $(ds_id).findById(record_id);
//                var param = record.data;
//                param['function_code'] = 'CON301'; /* param['function_usage'] = 'QUERY'; */
//                param['maintain_type'] = 'UPDATE';
//                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
//                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id, '${/parameter/@layout_code}');
//            }
//
//            function open_project_Window(ds_id, record_id) {
//                var record = $(ds_id).findById(record_id);
//                var param = {};
//                param['company_id'] = record.get('company_id');
//                param['project_id'] = record.get('project_id');
//                param['function_code'] = 'PRJ502D';
//                param['function_usage'] = 'QUERY';
//                param['bp_class'] = record.get('bp_class');
//                param['maintain_type'] = 'QUERY';
//                /*  param['window_open_flag'] = 'Y';
//                 param['show_history_flag'] = 'Y'; */
//                param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
//                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_special_link', ds_id, '${/parameter/@layout_code}');
//            }
            
            function open_col_detail_win(ds_id, record_id) {

                var record = $(ds_id).findById(record_id);
                var param = record.data;
                if (record.get('col_type') == 'VISIT') {
                    param['function_code'] = 'CON632_VT';
                    param['function_usage'] = 'UPDATE';
                    param['maintain_type'] = 'MODIFY';
                } else if (record.get('col_type') == 'PHONE') {
                    param['function_code'] = 'CON632_PD';
                    param['function_usage'] = 'UPDATE';
                    param['maintain_type'] = 'MODIFY';
                }
//                else {
//                    param['function_code'] = 'CON632_PDQ';
//                    param['function_usage'] = 'QUERY';
//                    param['maintain_type'] = 'READONLY';
//                }
                // param['function_code'] = 'CON632_PD';
                // param['function_usage'] = 'UPDATE';
                // param['maintain_type'] = 'MODIFY';
                param['url_title'] = '催收详情';
                param['winid'] = 'col_detail_id';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'col_detail_link', ds_id, '${/parameter/@layout_code}');
            }
            //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
//                if (name == 'project_number' && value) {
//                    return '<a href="javascript:open_project_Window(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
//                } else if (name == 'contract_number' && value) {
//                    return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
//                } else
                if (name == 'col_detail' && !record.isNew) {
                    return '<a href="javascript:open_col_detail_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + config_record.get('prompt') + '</a>';
                }
                return value;
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>