con_contract_archive.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 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-4-25 下午5:26:16  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <!--    <a:link id="get_contranct_link_id" model="cont.CON555A.con_contract" modelaction="batch_update"/> -->
        <!--   <a:link id="submit_approval_link" model="cont.CON555A.contract_workflow_start" modelaction="batch_update"/> -->
        <script type="text/javascript"><![CDATA[
            // Leaf.onReady(init);
            // function init() {
            // alert('1');
            // var cons=${/parameter/@contracts};
            // alert(cons);
            // }
           // var lag='N';
            function application_submit() {
               // add_express_hd();
               // if(lag=='Y'){
                    // Leaf.showMessage('${l:HLS.PROMPT}', '未保存,不能提交!');
               // }
                var records = $('con_contract_v_for_query_result_ds').getSelected();
                var index1=0;
                // for (var i = 0;i < records.length;i++) {
                    // var contract_id=records[i].get('contract_id');
                    // Leaf.request({
                        // url: $('get_contranct_link_id').getUrl(),
                        // para: {
                            // contract_id: contract_id,
                            // status:'archive'
                        // },
                        // success: function(res) {
                           // index1+=1;
                        // },
                        // error: function() {
                           
                            // window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        // },
                        // failure: function() {
                            
                            // window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        // },
                        // sync: true,
                        // scope: this
                    // });
                  
                // }
                
                // if(index1==records.length){
                   // $('application_archive_mail_window').close();
               // }
               
               var prams=[];
                for(var i = 0;i < records.length;i++){
                    // var contract_id=records[i].get('contract_id');
                    // var data={'contract_id':contract_id,
                    // status:'archive'
                    // };
                    //prams.push(data);
                    var data={};
                    data['contract_id']=records[i].get('contract_id');
                    data['status']='archive';
                    data['_status'] = 'update';
                    prams[i]=data;
                }
               
                Leaf.request({
                        url: $('get_contranct_link_id').getUrl(),
                        para: prams,
                        success: function(res) {
                         $('application_archive_mail_window').close();
                        },
                        error: function() {
                           
                           
                        },
                        failure: function() {
                            
                           
                        },
                        sync: true,
                        scope: this
                    });
                    
                    
                     // Leaf.request({
                            // url: $('submit_approval_link').getUrl(),
                            // para: prams,
                            // success: function() {
                                
                               // $('application_archive_mail_window').close();
                                // Leaf.SideBar.show({
                                    // msg: '操作成功',
                                    // duration: 2000
                                // });
                            // },
                            // failure: function() {
                              
                            // },
                            // error: function() {
                                
                            // },
                            // scope: this
                        // });
            
               
            
            }
            
            function add_express_hd() {
               
                var hd_record = $('con_express_hd_result_ds').getCurrentRecord();
                if (hd_record.isNew) {
                    hd_record.set('_status', 'insert');
                } else {
                    hd_record.set('_status', 'update');
                }
                var records = $('reg_settlement_lv_result_ds').getSelected();
                var con_express_ln_result_ds = $('con_express_ln_result_ds');
                for (var i = 0;i < records.length;i++) {
                    //cons.push(recodes[i].get('contract_id'));
                    //cons[i] = recodes[i].get('contract_id');
                    var current_record = con_express_ln_result_ds.create(Ext.apply({}, records[i].data));
                    current_record.set('_status', 'insert');
                }
                $('con_express_hd_result_ds').submit();
                lag='Y';
            
            }
            
            function express_province_change(t,value,value2,rec){
               var express_province= $('con_express_hd_result_ds').getCurrentRecord().get('express_province');
                $('fnd_city_ds').setQueryParameter('express_province',express_province);
                $('fnd_city_ds').query();
            }
            
            
            function back_to(){
                $('application_archive_mail_window').close();
            }
            
            function submitsuccess_express_hd(ds,res){
                $('application_archive_mail_window').close();
            }
            function con_express_hd_add(ds,res,index){
                var date=new Date();
                var year=date.getFullYear();
                var month=date.getMonth()+1;
                var day=date.getDate();
                var dd=year+'-'+month+'-'+day;
                res.set('express_date',dd);
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_province_ds" autoQuery="true" fetchAll="true" model="cont.CON555A.fnd_province">
                <a:fields>
                    <a:field name="province_id"/>
                    <a:field name="description"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="fnd_city_ds" fetchAll="true" model="cont.CON555A.fnd_city" queryUrl="${/request/@context_path}/autocrud/cont.CON555A.fnd_city/query"/>
            <a:dataSet id="con_express_hd_result_ds" autoCreate="true" model="cont.CON558.con_express_hd" submitUrl="${/request/@context_path}/modules/cont/CON558/con_contract_archive.lsc">
                <a:fields>
                    <a:field name="invoice_agent_desc" defaultValue="${/parameter/@invoice_agent_desc}" readOnly="true"/>
                    <a:field name="invoice_agent" defaultValue="${/parameter/@invoice_agent}"/>
                    <a:field name="express_id"/>
                    <a:field name="express_number" required="true"/>
                    <a:field name="express_company" required="true"/>
                    <a:field name="express_province_n" displayField="description" options="fnd_province_ds" returnField="express_province" valueField="province_id"/>
                    <a:field name="express_province"/>
                    <a:field name="express_city_n" displayField="description" options="fnd_city_ds" returnField="express_city" valueField="city_id"/>
                    <a:field name="express_city"/>
                    <a:field name="express_address"/>
                    <a:field name="express_date" readOnly="true"/>
                    <a:field name="express_person" defaultValue="${/session/@user_id}" readOnly="true"/>
                    <a:field name="express_person_n" readOnly="true"/>
                    <a:field name="express_tel"/>
                    <a:field name="express_note"/>
                    <a:field name="express_type" defaultValue="REG"/>
                    <a:field name="recipient" required="true"/>
                    <a:field name="recipient_tel" required="true"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="submitsuccess_express_hd"/>
                    <a:event name="add" handler="con_express_hd_add"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="con_express_ln_result_ds" bindName="result_ds" bindTarget="con_express_hd_result_ds" model="cont.CON558.con_express_ln">
                <a:fields>
                    <a:field name="express_id"/>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number"/>
                    <a:field name="express_number"/>
                    <a:field name="express_company"/>
                    <a:field name="express_province"/>
                    <a:field name="express_city"/>
                    <a:field name="express_address"/>
                    <a:field name="express_date"/>
                    <a:field name="express_ln_id"/>
                    <a:field name="express_reg_flag" defaultValue="Y"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="back_to" text="退回"/>
                <!--  <a:gridButton click="add_express_hd" text="保存"/> -->
                <a:gridButton click="add_express_hd" text="确认邮寄"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="100" marginWidth="30" title="归档申请">
                <a:textField name="invoice_agent_desc" bindTarget="con_express_hd_result_ds" prompt="经销商"/>
                <a:textField name="express_company" bindTarget="con_express_hd_result_ds" prompt="快递公司"/>
                <a:textField name="express_number" bindTarget="con_express_hd_result_ds" prompt="快递单号"/>
                <a:datePicker name="express_date" bindTarget="con_express_hd_result_ds" prompt="寄出时间"/>
                <a:comboBox name="express_province_n" bindTarget="con_express_hd_result_ds" prompt="寄出省份">
                    <a:events>
                        <a:event name="select" handler="express_province_change"/>
                    </a:events>
                </a:comboBox>
                <a:comboBox name="express_city_n" bindTarget="con_express_hd_result_ds" prompt="寄出城市"/>
                <a:textField name="express_address" bindTarget="con_express_hd_result_ds" colspan="2" prompt="寄出地址" width="510"/>
                <a:textField name="express_person_n" bindTarget="con_express_hd_result_ds" prompt="寄送人"/>
                <a:textField name="express_tel" bindTarget="con_express_hd_result_ds" prompt="联系电话"/>
                <a:textField name="express_note" bindTarget="con_express_hd_result_ds" colspan="2" prompt="备注" width="510"/>
                <a:textField name="recipient" bindTarget="con_express_hd_result_ds" prompt="收件人"/>
                <a:textField name="recipient_tel" bindTarget="con_express_hd_result_ds" prompt="收件人联系方式"/>
            </a:form>
            <!--   <a:grid id="grid_head" bindTarget="con_express_hd_result_ds" height="300" width="800">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="save"/>
                    <a:button type="delete"/>
                    <a:button type="excel"/>
                    <a:button type="clear"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="express_number" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_NUMBER" width="100"/>
                    <a:column name="express_company" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_COMPANY" width="100"/>
                    <a:column name="express_province" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_PROVINCE" width="100"/>
                    <a:column name="express_city" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_CITY" width="100"/>
                    <a:column name="express_address" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_ADDRESS" width="100"/>
                    <a:column name="express_date" editor="grid_head_textField_id" prompt="CON_EXPRESS_HD.EXPRESS_DATE" width="100"/>
                </a:columns>
                <a:editors>
                    <a:textField id="grid_head_textField_id"/>
                </a:editors>
            </a:grid>
            <a:grid id="grid_detail" bindTarget="con_express_ln_result_ds" height="300" width="800">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="save"/>
                    <a:button type="delete"/>
                    <a:button type="excel"/>
                    <a:button type="clear"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="express_id" editor="grid_detail_numberField_id" prompt="CON_EXPRESS_LN.EXPRESS_ID" width="100"/>
                    <a:column name="contract_id" editor="grid_detail_numberField_id" prompt="CON_EXPRESS_LN.CONTRACT_ID" width="100"/>
                    <a:column name="contract_number" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.CONTRACT_NUMBER" width="100"/>
                    <a:column name="express_number" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_NUMBER" width="100"/>
                    <a:column name="express_company" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_COMPANY" width="100"/>
                    <a:column name="express_province" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_PROVINCE" width="100"/>
                    <a:column name="express_city" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_CITY" width="100"/>
                    <a:column name="express_address" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_ADDRESS" width="100"/>
                    <a:column name="express_date" editor="grid_detail_textField_id" prompt="CON_EXPRESS_LN.EXPRESS_DATE" width="100"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="grid_detail_numberField_id"/>
                    <a:textField id="grid_detail_textField_id"/>
                </a:editors>
            </a:grid>
            <a:hBox/> -->
        </a:screenBody>
    </a:view>
</a:screen>