con_contract_execution.lview 26 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 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author: chenlingfeng7543
$Date: 2018/7/26 15:02
$Revision: 1.0 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.business_type in (&apos;LEASE&apos;,&apos;LEASEBACK&apos;)"
                       fetchAll="true" model="basic.hls_business_type_for_lov" rootPath="business_type_path"/>
        <a:model-query fetchAll="true" model="basic.hls_lease_channel_for_lov" rootPath="lease_channel_path"/>
        <a:model-query fetchAll="true" model="basic.hls_division_for_lov" rootPath="hls_division_path"/>
        <a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="default_date"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con1100_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
                modelaction="update"/>
        <a:link id="con1100_contract_modify_link"
                url="${/request/@context_path}/modules/cont/CON302N/con_contract_modify.lview"/>
        <a:link id="contract_cancel_link" model="cont.CON1100.con_contract_excuted"
                modelaction="insert"/>
        <script type="text/javascript"><![CDATA[
        function con1100_detail_renderer(value, record, name) {
            if (name == 'con1100_detail') {
                return '<a href="javascript:con1100_open_modify_win(' + record.id + ')">明细</a>';
            }

            return '';
        }

        function con1100_detail_renderer2(value, record, name) {
            if (name == 'con1100_detail') {
                return '<a href="javascript:con1100_open_modify_win2(' + record.id + ')">明细</a>';
            }

            return '';
        }

        function con1100_detail_renderer3(value, record, name) {
            if (name == 'con1100_detail') {
                return '<a href="javascript:con1100_open_read_win(' + record.id + ')">明细</a>';
            }

            return '';
        }

        function con1100_open_modify_win(id) {
            var ds_id = 'con1100_con_contract_for_excute_ds';
            var record = $(ds_id).findById(id);
            var param = record.data;
            if (record.get('lease_execution_flag') == 'C') {
                param['function_code'] = 'CON1100R';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'READONLY';
            } else {
                param['function_code'] = 'CON480_MODIFY';
                /* param['function_usage'] = 'QUERY'; */
                param['maintain_type'] = 'UPDATE';
            }
            param['bp_class'] = 'NP';
            param['winid'] = 'con_contract_modify_link_winid';
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
            hls_doc_get_layout_code('con1100_contract_get_layout_code_link_id', param, 'con1100_contract_modify_link', ds_id);

        }

        function con1100_open_read_win(id) {
            var ds_id = 'con1100_con_contract_excuted_ds';
            var record = $(ds_id).findById(id);
            var param = record.data;
            param['function_code'] = 'CON1100R';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'READONLY';
            param['bp_class'] = 'NP';
            param['winid'] = 'con_contract_modify_link_winid';
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
            hls_doc_get_layout_code('con1100_contract_get_layout_code_link_id', param, 'con1100_contract_modify_link', ds_id);

        }

        function con1100_open_modify_win2(id) {

            var ds_id = 'con1100_con_contract_not_passed_ds';
            var record = $(ds_id).findById(id);
            var param = record.data;
            param['function_code'] = 'CON480_MODIFY';
            param['maintain_type'] = 'UPDATE';
            param['winid'] = 'con_contract_modify_link_winid';
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
            hls_doc_get_layout_code('con1100_contract_get_layout_code_link_id', param, 'con1100_contract_modify_link', ds_id);

        }

        function con1100_calcConfigScreen_getTabType() {
            var config = {
                0: 'H',
                1: 'L',
                2: 'M'
            };
            return config[$('con1100_calcConfigScreen_tab').selectedIndex];

        }

        function con1100_calcConfigScreen_getDs() {
            var config = {
                'H': 'con1100_con_contract_for_excute_ds',
                'L': 'con1100_con_contract_not_passed_ds',
                'M': 'con1100_con_contract_excuted_ds'
            };
            return config[con1100_calcConfigScreen_getTabType()];
        }

        function con1100_query() {
            var dsName = con1100_calcConfigScreen_getDs();
            $(dsName).query();
        }

        function con1100_return() {
            history.go(-1);
        }

        function con1100_reset() {
            $('con1100_con_contract_for_excute_query_ds').reset();
        }

        function con1100_notice_call() {
            var records = $('con1100_con_contract_not_passed_ds').selected;
            var header = $jq('meta[name=_csrf_header]').attr('content');
            var token = $jq('meta[name=_csrf]').attr('content');
            $jq(document).ajaxSend(function (e, xhr, options) {
                xhr.setRequestHeader(header, token);
            });
            var data = [];

            records.forEach(function (value) {
                data.push(
                    {
                        noticeUserId: value.get('user_id'),
                        msgTitle: '回访',
                        msgBody: value.get('contract_number') + '该合同需要回访',
                        noticeType: 'NONE',
                        priority: 2,
                        noticeUrl: 'call/call_return_visit.lview',
                        sourceId: value.get('contract_id')
                    })
            });
            $jq.ajax({
                url: '${/request/@context_path}/sys/notice/msg/notice',
                type: 'post',
                contentType: 'application/json; charset=utf-8',
                data: JSON.stringify(data),
                success: function (res) {
                    if (res.success) {
                        Leaf.SideBar.show({
                            msg: '保存成功',
                            duration: 2000
                        });
                    }
                }
            })
        }


        function con1100_cancel() {
            var record = $('con1100_con_contract_excuted_ds').getCurrentRecord();
            if (record.length == 0) {
                Leaf.showMessage('${l:HLS.PROMPT}', '至少选择一条数据!');
                return;
            } else {
                var contract_id = record.get("contract_id");
                Leaf.showConfirm('${HLS.PROMPT}', '你确定取消合同吗?', function () {
                    Leaf.request({
                        url: $('contract_cancel_link').getUrl(),
                        para: {
                            contract_id: contract_id
                        },
                        success: function () {
                            $('con1100_con_contract_excuted_ds').query();
                            Leaf.SideBar.show({
                                msg: '操作成功',
                                duration: 2000
                            });
                        },
                        scope: this
                    });

                }, null);

            }
        }

        ]]></script>
        <a:dataSets>
            <a:dataSet id="con1100_business_type_ds">
                <a:datas dataSource="/model/business_type_path"/>
            </a:dataSet>
            <a:dataSet id="con1100_lease_channel_ds">
                <a:datas dataSource="/model/lease_channel_path"/>
            </a:dataSet>
            <a:dataSet id="con1100_hls_division_ds">
                <a:datas dataSource="/model/hls_division_path"/>
            </a:dataSet>
            <a:dataSet id="con1100_contract_status_ds" lookupCode="CON500_CONTRACT_STATUS"/>
            <a:dataSet id="con1100_execution_status_ds" lookupCode="EXECUTION_STATUS_DS"/>
            <a:dataSet id="con1100_yes_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="con1100_down_payment_status_ds" lookupCode="DOWN_PAYMENT_STATUS"/>
            <a:dataSet id="con1100_con_contract_for_excute_query_ds">
                <a:fields>
                    <a:field name="contract_status_n" displayField="code_value_name"
                             options="con1100_contract_status_ds"
                             returnField="contract_status" valueField="code_value"/>
                    <a:field name="business_type_n" displayField="description" options="con1100_business_type_ds"
                             returnField="business_type" valueField="business_type"/>
                    <a:field name="lease_channel_n" displayField="description" options="con1100_lease_channel_ds"
                             returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="division_n" displayField="description" options="con1100_hls_division_ds"
                             returnField="division" valueField="division"/>
                    <a:field name="execution_status_desc" displayField="code_value_name"
                             options="con1100_execution_status_ds"
                             returnField="execution_status" valueField="code_value"/>
                    <a:field name="bp_id_agent_level1_n" lovGridHeight="400" lovHeight="550"
                             lovService="basic.hls_bp_agent_for_lov" lovWidth="500" title="代理商">
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id_agent_level1"/>
                            <a:map from="bp_name" to="bp_id_agent_level1_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="information_completed_desc" displayField="code_value_name"
                             options="con1100_yes_no_ds"
                             returnField="information_completed" valueField="code_value"/>
                    <a:field name="lease_execution_date_from" datatype="date"
                             defaultValue="${/model/default_date/record/@month_first_day}"/>
                    <a:field name="lease_execution_date_to" datatype="date"
                             defaultValue="${/model/default_date/record/@month_last_day}"/>
                    <a:field name="down_payment_status_n" displayField="code_value_name"
                             options="con1100_down_payment_status_ds"
                             returnField="down_payment_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>

            <a:dataSet id="con1100_con_contract_for_excute_ds" selectable="true" selectionModel="single"
                       queryDataSet="con1100_con_contract_for_excute_query_ds"
                       autoQuery="true" autoPageSize="true"
                       model="cont.CON1100.con_contract_for_excute"/>
            <a:dataSet id="con1100_con_contract_not_passed_ds" selectable="true" selectionModel="single"
                       queryDataSet="con1100_con_contract_for_excute_query_ds"
                       autoQuery="true" autoPageSize="true"
                       model="cont.CON1100.con_contract_not_passed"/>
            <a:dataSet id="con1100_con_contract_excuted_ds" selectable="true" selectionModel="single"
                       queryDataSet="con1100_con_contract_for_excute_query_ds"
                       autoQuery="true" autoPageSize="true"
                       model="cont.CON1100.con_contract_excuted"/>
        </a:dataSets>
        <a:screenBody>
            <a:tabPanel labelWidth="150" marginHeight="30" marginWidth="30">
                <a:tabs>
                    <a:tab width="300" prompt="合同执行">
                        <a:screenTopToolbar>
                            <!--<a:gridButton click="con1100_return" text="HLS.RETURN"/>-->
                            <a:gridButton click="con1100_query" text="HLS.QUERY"/>
                            <a:gridButton click="con1100_reset" text="HLS.RESET"/>

                            <a:gridButton click="con1100_cancel" text="合同取消" style="margin-left:100px"/>
                        </a:screenTopToolbar>
                        <a:form title="查询条件" labelWidth="120" column="4" marginWidth="50">
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="合同类型"
                                        name="business_type_n"/>
                            <a:lov bindTarget="con1100_con_contract_for_excute_query_ds" prompt="代理商"
                                   name="bp_id_agent_level1_n"/>
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="执行状态标注"
                                        name="execution_status_desc"/>
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="合同状态"
                                        name="contract_status_n"/>
                            <a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="承租人名称"
                                         name="bp_name"/>
                            <a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="代理商简称"
                                         name="agent_extra_nam"/>
                            <a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="call担当"
                                         name="user_name"/>
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="产品线"
                                        name="division_n"/>
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="商业模式"
                                        name="lease_channel_n"/>
                            <!--<a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="合同编号" name="contract_number"/>-->
                            <a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="合同编号"
                                         name="contract_number"/>
                            <!--<a:textField bindTarget="con1100_con_contract_for_excute_query_ds" prompt="承租人编号" name="bp_code"/>-->
                            <a:comboBox bindTarget="con1100_con_contract_for_excute_query_ds" prompt="信息录入是否完成"
                                        name="information_completed_desc"/>
                            <a:datePicker name="lease_execution_date_from"
                                          bindTarget="con1100_con_contract_for_excute_query_ds" prompt="执行日期从"/>
                            <a:datePicker name="lease_execution_date_to"
                                          bindTarget="con1100_con_contract_for_excute_query_ds" prompt="执行日期到"/>
                            <a:comboBox name="down_payment_status_n" prompt="首付状态"
                                        bindTarget="con1100_con_contract_for_excute_query_ds"/>

                        </a:form>
                        <a:tabPanel id="con1100_calcConfigScreen_tab" labelWidth="150" marginWidth="50"
                                    marginHeight="240">
                            <a:tabs>
                                <a:tab width="300" prompt="待执行合同清单">
                                    <a:grid id="con1100_grid_id" marginWidth="80" marginHeight="300"
                                            bindTarget="con1100_con_contract_for_excute_ds" navBar="true">
                                        <a:toolBar>
                                            <a:button type="excel" text="导出"/>
                                        </a:toolBar>
                                        <a:columns>
                                            <a:column name="con1100_detail" align="center" prompt="明细"
                                                      renderer="con1100_detail_renderer"/>
                                            <a:column name="contract_status_desc" prompt="合同状态"/>
                                            <a:column name="contract_number" prompt="合同编号"/>
                                            <a:column name="bp_name" prompt="客户名称"/>
                                            <a:column name="bp_class_n" prompt="客户类型"/>
                                            <a:column name="agent_extra_nam" prompt="代理商简称"/>
                                            <a:column name="pattern" prompt="机型"/>
                                            <a:column name="machine_number" prompt="机号"/>
                                            <a:column name="execution_status_desc" prompt="执行状态标注"/>
                                            <a:column name="factory_date" prompt="wholesale date"/>
                                            <a:column name="business_type_desc" prompt="业务类型"/>
                                            <a:column name="lease_channel_desc" prompt="商业模式"/>
                                            <a:column name="down_payment_write_off" prompt="前期款状态"/>
                                            <a:column name="lease_execution_flag_desc" prompt="执行状态"/>
                                            <a:column name="down_payment_status_n" prompt="首付状态"/>
                                            <a:column name="case_interface_name" prompt="起案类型"/>
                                            <a:column name="case_status" prompt="起案状态"/>
                                            <a:column name="agent_name" prompt="代理商"/>
                                            <a:column name="division_desc" prompt="产品线"/>
                                            <a:column name="finance_amount" prompt="融资额"/>
                                            <a:column name="user_name" prompt="call担当"/>
                                            <a:column name="area_distinguish" prompt="备注"/>
                                        </a:columns>
                                    </a:grid>
                                </a:tab>
                                <a:tab width="300" prompt="事前确认未通过">
                                    <a:grid id="con1100_grid2_id" marginWidth="80" marginHeight="300"
                                            bindTarget="con1100_con_contract_not_passed_ds" navBar="true">
                                        <a:toolBar>
                                            <a:button type="excel" text="导出"/>
                                            <a:button text="通知call担当" click="con1100_notice_call"/>
                                        </a:toolBar>
                                        <a:columns>
                                            <a:column name="con1100_detail" align="center" prompt="明细"
                                                      renderer="con1100_detail_renderer2"/>
                                            <a:column name="contract_number" prompt="合同编号"/>
                                            <a:column name="bp_name" prompt="客户姓名"/>
                                            <a:column name="pattern" prompt="机型"/>
                                            <a:column name="machine_number" prompt="机号"/>
                                            <a:column name="bp_id_agent_level1_n" prompt="代理商"/>
                                            <a:column name="agent_extra_nam" prompt="代理商简称"/>
                                            <a:column name="information_completed" prompt="信息录入是否完成" width="140"/>
                                            <a:column name="execution_status_desc" prompt="执行状态标注"/>
                                            <a:column name="down_payment_status_n" prompt="首付状态"/>
                                            <a:column name="call_status" prompt="外呼状态"/>
                                            <a:column name="tenant_verify_result" prompt="电话确认情况"/>
                                            <a:column name="tenant_class" prompt="未通过原因"/>
                                            <a:column name="description" prompt="备注"/>
                                            <a:column name="guarantor_1_name" prompt="担保人1名称"/>
                                            <a:column name="guarantor_1_verify_result" prompt="担保人1核实结果"/>
                                            <a:column name="guarantor_1_class" prompt="担保人1未通过原因"/>
                                            <a:column name="guarantor_2_name" prompt="担保人2名称"/>
                                            <a:column name="guarantor_2_verify_result" prompt="担保人2核实结果"/>
                                            <a:column name="guarantor_2_class" prompt="担保人2未通过原因"/>
                                            <a:column name="user_name" prompt="call担当"/>
                                            <a:column name="pattern" prompt="机型"/>
                                            <a:column name="machine_number" prompt="机号"/>
                                            <a:column name="factory_date" prompt="wholesale date"/>
                                            <a:column name="area_distinguish" prompt="备注"/>
                                            <a:column name="last_call_time" prompt="最后一次通话时间"/>
                                            <a:column name="record_times" prompt="通话次数"/>
                                        </a:columns>
                                    </a:grid>
                                </a:tab>
                                <a:tab width="300" prompt="已执行合同清单">
                                    <a:grid id="con1100_grid3_id" marginWidth="80" marginHeight="300"
                                            bindTarget="con1100_con_contract_excuted_ds" navBar="true">
                                        <a:toolBar>
                                            <a:button type="excel" text="导出"/>
                                        </a:toolBar>
                                        <a:columns>
                                            <a:column name="con1100_detail" align="center" prompt="明细"
                                                      renderer="con1100_detail_renderer3"/>
                                            <a:column name="contract_status_desc" prompt="合同状态"/>
                                            <a:column name="contract_number" prompt="合同编号"/>
                                            <a:column name="bp_name" prompt="客户名称"/>
                                            <a:column name="bp_class_n" prompt="客户类型"/>
                                            <a:column name="agent_extra_nam" prompt="代理商简称"/>
                                            <a:column name="pattern" prompt="机型"/>
                                            <a:column name="machine_number" prompt="机号"/>
                                            <a:column name="execution_status_desc" prompt="执行状态标注"/>
                                            <a:column name="lease_execution_date" prompt="执行日期"/>
                                            <a:column name="factory_date" prompt="wholesale date"/>
                                            <a:column name="business_type_desc" prompt="业务类型"/>
                                            <a:column name="lease_channel_desc" prompt="商业模式"/>
                                            <a:column name="down_payment_write_off" prompt="前期款状态"/>
                                            <a:column name="lease_execution_flag_desc" prompt="执行状态"/>
                                            <a:column name="down_payment_status_n" prompt="首付状态"/>
                                            <a:column name="case_interface_name" prompt="起案类型"/>
                                            <a:column name="case_status" prompt="起案状态"/>
                                            <a:column name="agent_name" prompt="代理商"/>
                                            <a:column name="division_desc" prompt="产品线"/>
                                            <a:column name="finance_amount" prompt="融资额"/>
                                            <a:column name="user_name" prompt="call担当"/>
                                            <a:column name="area_distinguish" prompt="备注"/>
                                        </a:columns>
                                    </a:grid>
                                </a:tab>

                            </a:tabs>
                        </a:tabPanel>
                    </a:tab>
                    <a:tab width="300" prompt="前期款下账"
                           ref="${/request/@context_path}/modules/csh/CSH531N/csh_bank_transfer_processing.lview">

                    </a:tab>
                    <a:tab width="300" prompt="放款申请"
                           ref="${/request/@context_path}/modules/csh/CSH501/csh_payment_create_entrance.lview?layout_code=CSH_CREATE_ENTRANCE&amp;function_code=CSH501">
                    </a:tab>
                    <a:tab width="300" prompt="客户信息管理"
                           ref="${/request/@context_path}/modules/hls/HLS214N/hls_bp_master_modify_entrance.lview?layout_code=BP_MODIFY_ENTRANCE&amp;function_code=HLS214N">
                    </a:tab>
                </a:tabs>
            </a:tabPanel>

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