hls_fnd_pawn_add.lview 11.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2013-1-8 上午09:42:18  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="fnd.fnd_uom_codes_vl" rootPath="uom_codes"/>
        <a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="currency"/>
    </a:init-procedure>
    <a:view>
        <a:link id="pawn_upload_tab_link" url="${/request/@context_path}/modules/fnd/HLS201/hls_pawn_upload_tab.lview"/>
        <script type="text/javascript"><![CDATA[
            function back() {

                history.go(-1);
            }
            function enAbleTab(){
                var tab=$('main_tab');
                var record = $('pawn_ds').getCurrentRecord();
                var pawn_id = record.get('pawn_id');
                tab.items[1].ref =$('pawn_upload_tab_link').getUrl()+'?pawn_id='+pawn_id;
            }
            
            function add_pawn() {
                $('pawn_ds').submit();
            }
            
            function attachment_link(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;
            
                }
            }
            var wd;
            
            function saveFile() {
                $('file_result_ds').submit();
            }
            
            function reload() {
                $('file_result_ds').query();
            }
            
            function submitMSG() {
                Leaf.showMessage('提示信息', '保存成功!');
            }
            
            function attachmentLink(value, record, name) {
                //var pkvalue = record.get('cus_upload_id');
                //var url = '<img src="../../images/upload.png" alt="附件上传" onclick="url_link('+pkvalue+')"/>&nbsp;&nbsp;&nbsp;';
            
                if (typeof(value) == 'undefined' && Ext.isEmpty(value)) {
                    //return url;
                    return '';
                } else {
                    //return url + value;
                    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 url_link(pkvalue) {
                var url = '${/request/@context_path}/hls_upload_for_attachment_view.lview?sourcetype=hls_pawn_upload&pkvalue=' + pkvalue;
                wd = new Leaf.Window({
                    id: 'attachment_up_window',
                    url: url,
                    title: '附件上传',
                    height: 350,
                    width: 850
                });
            }
            
            function attachmentUpload(value, record, name) {
                var p_pkvalue = record.get('pawn_upload_id');
            
                return "<A href='javascript:url_link(" + p_pkvalue + ")'>附件上传</A>";
            }
            
            function dateValidator(record, name, value) {
                if (name == 'start_date' || name == 'end_date') {
                    var start_date = record.get('start_date');
                    var end_date = record.get('end_date');
                    if (typeof(end_date) != 'undefined' && !Ext.isEmpty(end_date)) {
                        if (!compareDate(start_date, end_date)) {
                            return '开始时间不能大于结束时间';
                        }
                    }
                    return true;
                }
            }
            
            function compareDate(start, end) {
                if (start.getTime() > end.getTime()) {
                    return false;
                }
                return true;
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="file_result_ds" autoQuery="true" fetchAll="true" model="fnd.fnd_atm_attachment" queryUrl="${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query?table_name=hls_pawn">
                <a:fields>
                    <a:field name="submit_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="submitMSG"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="pawn_stat_ds" lookupCode="HLS_PAWN_STATUS"><![CDATA[
            ]]></a:dataSet>
            <a:dataSet id="uom_codes_ds">
                <a:datas dataSource="/model/uom_codes"/>
            </a:dataSet>
            <a:dataSet id="currency_ds">
                <a:datas dataSource="/model/currency"/>
            </a:dataSet>
            <a:dataSet id="pawn_ds" autoCreate="true" model="hls.HLS209.hls_pawns" submitUrl="${/request/@context_path}/modules/fnd/HLS201/hls_pawn.lsc?update">
                <a:fields>
                    <a:field name="uom_name" displayField="description_text" options="uom_codes_ds" returnField="uom" valueField="uom_code"/>
                    <a:field name="customer_id"/>
                    <a:field name="currency_name" displayField="currency_name" options="currency_ds" returnField="currency" valueField="currency_code"/>
                    <a:field name="customer_name" lovHeight="600" lovService="hls.HLS209.hls_partner_lov" lovWidth="500" title="抵押人查询">
                        <a:mapping>
                            <a:map from="customer_id" to="customer_id"/>
                            <a:map from="customer_name" to="customer_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="start_date" validator="dateValidator"/>
                    <a:field name="end_date" validator="dateValidator"/>
                    <a:field name="lease_contract_id"/>
                    <a:field name="lease_contract_code" lovHeight="600" lovService="hls_prj.hls_prj_contract_hds_for_lov" lovWidth="500" title="租赁合同查询">
                        <a:mapping>
                            <a:map from="contract_hds_id" to="lease_contract_id"/>
                            <a:map from="contract_number" to="lease_contract_code"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="pawn_status_des" displayField="code_value_name" options="pawn_stat_ds" returnField="pawn_status" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="enAbleTab"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:tabPanel id="main_tab" height="600" width="1000">
                <a:tabs width="990">
                    <a:tab prompt="抵押物信息" width="110">
                        <a:form title="基本信息" width="990">
                            <a:hBox labelWidth="100">
                                <a:textField name="pawn_name" bindTarget="pawn_ds" prompt="抵押物名称"/>
                                <a:textField name="pawn_contract_no" bindTarget="pawn_ds" prompt="抵押合同编号"/>
                                <a:lov name="lease_contract_code" bindTarget="pawn_ds" prompt="租赁合同编号"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:lov name="customer_name" bindTarget="pawn_ds" prompt="抵押人"/>
                                <a:textField name="pawn_register_no" bindTarget="pawn_ds" prompt="抵押登记证号"/>
                                <a:textField name="pawn_registed_dept" bindTarget="pawn_ds" prompt="登记部门"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:numberField name="quantity" allowDecimals="false" bindTarget="pawn_ds" prompt="抵押物数量"/>
                                <a:comboBox name="uom_name" bindTarget="pawn_ds" prompt="单位"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:numberField name="pawn_value" allowFormat="true" bindTarget="pawn_ds" prompt="价值"/>
                                <a:comboBox name="currency_name" bindTarget="pawn_ds" prompt="币种"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="estate_license_code" bindTarget="pawn_ds" prompt="房产证号"/>
                                <a:hBox labelWidth="97">
                                    <a:numberField name="housing_area" bindTarget="pawn_ds" prompt="房屋面积" width="100"/>
                                    <span><![CDATA[平方米]]></span>
                                </a:hBox>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="land_certificate_code" bindTarget="pawn_ds" prompt="土地证号"/>
                                <a:hBox labelWidth="97">
                                    <a:numberField name="land_area" bindTarget="pawn_ds" prompt="土地面积" width="100"/>
                                    <span><![CDATA[平方米]]></span>
                                </a:hBox>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:datePicker name="start_date" bindTarget="pawn_ds" prompt="抵押日期从"/>
                                <a:datePicker name="end_date" bindTarget="pawn_ds" prompt="抵押日期到"/>
                                <a:comboBox name="pawn_status_des" bindTarget="pawn_ds" prompt="抵押物状态"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="pawn_location" bindTarget="pawn_ds" prompt="房屋坐落" width="410"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="pawn_ownership" bindTarget="pawn_ds" prompt="物权所属" width="410"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="pawn_occupied" bindTarget="pawn_ds" prompt="占管状况" width="410"/>
                            </a:hBox>
                            <a:hBox labelWidth="100">
                                <a:textField name="note" bindTarget="pawn_ds" prompt="备注" width="410"/>
                            </a:hBox>
                        </a:form>
                        <a:hBox>
                            <a:button click="add_pawn" text="保存"/>
                            <a:button click="back" text="返回"/>
                        </a:hBox>
                    </a:tab>
                    <a:tab prompt="附件" ref="" width="110"><![CDATA[
                    ]]></a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
    </a:view>
</a:screen>