legal_opinion_letter_create.lview 7.73 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  create by nyl  2014-12-3 
  for contract context create
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.function_code = ${/parameter/@function_code}" model="cus.CUS100.cus_default_function_name" rootPath="default_function_name"/>
        <a:model-query defaultWhereClause="t1.specify_code=&apos;AMC_APPROVER&apos;" model="cont.CON543.cus_hls_specify_define" rootPath="hls_specify_define_info"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con638_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="legal_letter_cancel_link_id" model="cont.CON610.leg_legal_letter_submit" modelaction="execute"/>
        <a:link id="legal_letter_submit_link_id" model="cont.CON610.leg_legal_letter_submit" modelaction="update"/>
        <a:link id="con543_prj_secify_approver_link" url="${/request/@context_path}/modules/prj/PRJ501N/cus_hls_specify_approver.lview"/>
        <script type="text/javascript"><![CDATA[
            function con610d_window_close() {
                $('${/parameter/@winid}').close();
            
            }
            function get_confirm_flag(){
                return 'N';
            }
            //提交审批
            
            function con610_submit() {
                var document_id = ${/parameter/@letter_hd_id};
                var document_table = 'LEG_LEGAL_LETTER_HD';
                var title = '${/model/hls_specify_define_info/record/@description}';
                var win = new Leaf.Window({
                    id: 'cus_prj_secify_approver_screen',
                    url: $('con543_prj_secify_approver_link').getUrl(),
                    params: {
                        document_id: document_id,
                        specify_code: 'AMC_APPROVER'
                    },
                    title: title,
                    width: 550,
                    heigh: 650
                });
                win.on('close', function() {
                    ajax_flag = 'Y';
              		var confirm_flag = get_confirm_flag();
              		if (confirm_flag=='Y'){
              		   window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
            		
                    Leaf.request({
                        url: $('legal_letter_submit_link_id').getUrl(),
                        para: {
                            letter_hd_id: '${/parameter/@letter_hd_id}'
                        },
                        success: function(res) {
                            window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                            Leaf.SideBar.show({
                                msg: '${l:HLS.SUBMIT_SUCCESS}',
                                duration: 2000
                            });
            
                            con610d_window_close();
            
                        },
                        failure: function() {
                            window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        error: function() {
                            window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        scope: this
                    });
              		}
                  });    
            }
            
            //提交审批
            window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
            
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'leg_legal_letter_tmp');
                var info = '';
                if (ds_id) {
                    if (!$(ds_id).validate(true)) {
                        return;
                    }
                    var records = $(ds_id).getAll();
                    for (var i = 0;i < records.length;i++) {
                        if (records[i].dirty == true) {
                            Leaf.showMessage('提示', '请先保存!', null, 350);
                            return;
                        }
                        if (records[i].get('send_count') >= 1) {
                            info = '合同号为' + records[i].get('search_term_1') + '发函次数为' + records[i].get('send_count') + ',';
                        }
            
            
                    }
                    if (info.length > 1) {
                        Leaf.showConfirm('${l:PROMPT}', info, function okFun() {
                            Leaf.showConfirm('${l:PROMPT}', '是否确认地址信息?', function okFun() {
                                con610_submit();
                            });
                        });
                    } else {
            
                        Leaf.showConfirm('${l:PROMPT}', '是否确认地址信息?', function okFun() {
                            con610_submit();
            
                        });
                    }
                }
            
            };
            
            //提交审批
            /*  window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
             window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
             Leaf.request({
             url: $('legal_letter_submit_link_id').getUrl(),
             para:  {
             letter_hd_id: '${/parameter/@letter_hd_id}'
             },
             success: function(res) {
             window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
             Leaf.SideBar.show({
             msg: '${l:HLS.SUBMIT_SUCCESS}',
             duration: 2000
             });
             con610d_window_close();
             },
             failure: function() {
             window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
             },
             error: function() {
             window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
             },
             scope: this
             });
             }; */
            
            //撤销
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            
            
                window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
                Leaf.request({
                    url: $('legal_letter_cancel_link_id').getUrl(),
                    para: {
                        letter_hd_id: '${/parameter/@letter_hd_id}'
                    },
                    success: function(res) {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
            
                        con610d_window_close();
                    },
                    failure: function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    error: function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });
            
            
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>