contract_sign_detail_wfl.lview 13.3 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
   create by xuls 
    for prj&con ata sign
    2014-10-15
 -->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="cont.CON544.prj_con_sign_lv" rootPath="con544_wfl_document_info"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con_contract_uploadfile" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="con544_contract_sign_save_date" model="cont.CON544.con_contract_sign_save_date" modelaction="execute"/>
        <a:link id="con544_batch_down_link" url="${/request/@context_path}/modules/batch_download/lease_atm_batch_dl.lsc"/>
        <a:link id="con544_submit_link" model="cont.CON544.lsh_prj_con_sign_submit" modelaction="execute"/>
        <a:link id="con544_cdd_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="wfl_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="wfl_con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON501N/con_contract_modify.lview"/>
        <a:link id="wfl_prj_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
        <script type="text/javascript"><![CDATA[
    		/*链接单据明细*/    
    		function wfl_open_project_modify_win(record_id, ds_id) {
                var record = $(ds_id).findById(record_id);
                var maintain_type = 'UPDATE';
                var param = record.data;
                param['declare_flag'] = 'Y';
                param['document_id'] = ${/parameter/@document_id};
                param['function_code'] = 'PRJ502';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = maintain_type;
                param['company_id'] = '${/session/@company_id}';
                param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
                hls_doc_get_layout_code('wfl_con_contract_get_layout_code_link_id', param, 'wfl_prj_project_modify_link');
            }
            
            function wfl_open_contract_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['document_id'] = ${/parameter/@document_id};
                param['function_code'] = 'CON301';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'UPDATE';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                hls_doc_get_layout_code('wfl_con_contract_get_layout_code_link_id', param, 'wfl_con_contract_modify_link', ds_id);
            }
    		
    		/**/
            
            function con544_detail_close() {
                $('con544_sign_detail_id').close();
            }
            
            function con544_detail_save() {
                if($('con544_sign_atm_header_ds').validate()) {
                    var url= $('con544_contract_sign_save_date').getUrl();
                    $('con544_sign_atm_header_ds').setSubmitUrl(url);
                    $('con544_sign_atm_header_ds').setSubmitParameter('signing_date',$('con544_sign_atm_header_ds').getCurrentRecord().get('signing_date'));
                    $('con544_sign_atm_header_ds').setSubmitParameter('document_id',${/parameter/@document_id});
                    $('con544_sign_atm_header_ds').submit();
                    $('con544_sign_atm_detail_ds').submit();
                }
                
            }
            
            function submit_confirm() {
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                var document_id=${/parameter/@document_id};
                var document_table='${/parameter/@document_table}';
                Leaf.request({
                    url: $('con544_submit_link').getUrl(),
                    para: {
                        document_id : document_id,
                        document_table:document_table
                    },
                    success: function(res) {
                        Leaf.Masker.unmask(Ext.getBody());
                        Leaf.showMessage('${l:HLS.PROMPT}','${l:HLS.SUBMIT_SUCCESS}',function(){
                          con544_detail_close();  
                        });
                        
                    },
                    failure: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
            }
            
            function con544_detail_submit(){
                Leaf.showConfirm('提示','确认提交审批?',submit_confirm,function(){});
            }
            
            function con544_sign_atm_detail_query(){
                $('con544_sign_atm_detail_ds').query();
            }
            
            /*
             附件批量下载
             */
            function con44_batch_down() {
                var document_id = ${/parameter/@document_id};
                var document_table = '${/parameter/@document_table}';
                var document_number ='${/parameter/@document_number}';
                var url = $('con544_batch_down_link').getUrl()+'?table_name='+document_table+'&table_pk_value=' + document_id + '&doc_code=' + document_number;
                window.open(url);
            }
            function con544_cdd_editorFunction(record, name) {
                if (record.get('sys_flag') == 'N') {
                    return 'con544_cdd_tf_id';
                }
                return '';
            }
            
           function con544_cdd_required_render(value, record, name) {
                var project_required_flag = record.get('project_required_flag');
                if (project_required_flag == 'Y') {
                    return '<pan style="color:red">' + value + '</pan>';
                } else {
                    return value;
                }
            }
            function con544_cdd_attachtment_upload(check_id, file_name, record_id) {
                //
                var url = $('con544_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + check_id;
                
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'con544_cdd_uploadFile_screen_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {
                	con544_sign_atm_detail_query();           
                });
            }
            function detail_upload_window(record_id) {
        	 
        	    var url = $('con_contract_uploadfile').getUrl() + '?table_name=CON_CONTRACT_CONTENT_SIGN&header_id=' + record_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'insurance_records_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {
                     $('con544_sign_atm_detail_ds').query();
                });
        	} 
            
           function attachment_upload(val,rec,name) {
        	    return '<a href=javascript:detail_upload_window('+rec.get('content_id')+')>附件查看</a>';
        	}
            
             function con544_link_render(value, record, name) {
                if (value != null) {
                    var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                    var str = value.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 con544_detail_add(){
                 $('con544_sign_detail_gd').showEditorByRecord($('con544_sign_atm_detail_ds').create());
            }
            function con544_detail_delete(){
                 $('con544_sign_detail_gd').remove();
            }
            function con544_cdd_selectFunc(record) {
                if (record.get('sys_flag') == 'Y') {
                    return false;
                }
                return true;
            }
            function con544_detail_document_link(value,record,name){
                var document_table = '${/parameter/@document_table}';

                if (document_table == 'CON_CONTRACT' && value) {
                    return '<a href="javascript:wfl_open_contract_win(\''+record.ds.id+'\',\''+record.id+'\')">'+value+'</a>';
                }else if(document_table=='PRJ_PROJECT' &&value){
                    return '<a href="javascript:wfl_open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
                }
                return value;
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="adjust_rate_type_ds" lookupCode="ADJUST_RATE_TYPE"/>
            <a:dataSet id="con544_sign_atm_header_ds">
                <a:datas dataSource="/model/con544_wfl_document_info"/>
                <a:fields>
                    <a:field name="document_number" defaultValue="${/parameter/@document_number}" readOnly="true"/>
                    <a:field name="contract_name" readOnly="true"/>
                    <a:field name="signing_date" datatype="java.util.Date" readOnly="true"/>
                    <a:field name="adjust_rate_type_desc" displayField="code_value_name" options="adjust_rate_type_ds" readOnly="true" returnField="adjust_rate_type" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con544_sign_atm_detail_ds" autoPageSize="true" autoQuery="true" model="cont.CON544.con_contract_sign_detail_for_nanshan" queryUrl="${/request/@context_path}/autocrud/cont.CON544.con_contract_sign_detail_for_nanshan/query?contract_id=${/parameter/@document_id}" selectFunction="con544_cdd_selectFunc" selectable="true">
                <a:fields>
                    <a:field name="document_table" defaultValue="${/parameter/@document_table}"/>
                    <a:field name="sys_flag" defaultValue="N"/>
                    <a:field name="document_id" defaultValue="${/parameter/@document_id}"/>
                    <a:field name="cdd_list_id" defaultValue="${/parameter/@cdd_list_id}"/>
                    <a:field name="send_date" datatype="java.util.Date"/>
                    <a:field name="receive_date" datatype="java.util.Date"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="3" marginWidth="30" title="附件信息">
                <a:label name="document_number" bindTarget="con544_sign_atm_header_ds" prompt="单据编号" renderer="con544_detail_document_link"/>
                <a:textField name="contract_name" bindTarget="con544_sign_atm_header_ds" prompt="合同名称"/>
                <a:numberField name="lease_item_amount" bindTarget="con544_sign_atm_detail_ds" prompt="租赁物金额" readOnly="true"/>
                <a:datePicker name="signing_date" bindTarget="con544_sign_atm_header_ds" prompt="签约日期"/>
                <a:comboBox name="adjust_rate_type_desc" bindTarget="con544_sign_atm_header_ds" prompt="调息类型"/>
            </a:form>
            <a:grid id="con544_sign_detail_gd" bindTarget="con544_sign_atm_detail_ds" marginHeight="250" marginWidth="38" navBar="true">
                <a:columns>
                    <a:column name="description" prompt="HLS.DOCUMENT_NAME" width="200"/>
                    <a:column name="tax_type_rate" align="right" prompt="印花税率" width="100"/>
                    <a:column name="stamp_tax" align="right" prompt="印花税" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="attachment" align="center" prompt="附件" renderer="attachment_upload" width="60"/>
                    <a:column name="file_name" align="center" prompt="附件名" renderer="con544_link_render" width="400"/>
                    <a:column name="ref_v01" prompt="备注" width="300"/>
                    <!-- <a:column name="note1" editor="con544_cdd_tf_id" prompt="初审意见" width="300"/>
                    <a:column name="note2" editor="con544_cdd_tf_id" prompt="复审意见" width="300"/>
                    <a:column name="express_number" editor="con544_cdd_tf_id" prompt="快递单号"/>
                    <a:column name="send_date" editor="con544_cdd_dated_id" prompt="寄送日期"/>
                    <a:column name="receive_date" editor="con544_cdd_dated_id" prompt="收到日期"/> -->
                </a:columns>
                <a:editors>
                    <a:datePicker id="con544_cdd_dated_id"/>
                    <a:checkBox id="con544_cdd_ck_id"/>
                    <a:textField id="con544_cdd_tf_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[

        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>