csh_payment_create_entrance.lview 16.9 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1
<?xml version="1.0" encoding="UTF-8"?>
niminmin's avatar
niminmin committed
2 3
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
stone's avatar
stone committed
4 5 6
    <a:init-procedure>
        <a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
    </a:init-procedure>
Spencer Chang's avatar
Spencer Chang committed
7
    <a:view>
gzj34291's avatar
gzj34291 committed
8 9 10
        <a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
        <a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
       <a:link id="csh_payment_req_history_word_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_word_print.lsc"/>
Spencer Chang's avatar
Spencer Chang committed
11
        <a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
niminmin's avatar
niminmin committed
12 13 14 15
        <a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel"
                modelaction="update"/>
        <a:link id="csh501_csh_payment_req_link1_id"
                url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
18083's avatar
18083 committed
16 17
		<a:link id="csh501_csh_payment_req_op_link1_id"
				url="${/request/@context_path}/modules/csh/CSH501/csh_payment_op_req.lview"/>
Spencer Chang's avatar
Spencer Chang committed
18 19
        <a:link id="delete_payment_req_link_id" model="csh.CSH501.delete_payment_req" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
niminmin's avatar
niminmin committed
20
        Leaf.onReady(function () {
stone's avatar
stone committed
21
            //付款打印按钮只有会计担当和会计部长可见
gzj34291's avatar
gzj34291 committed
22
            if ("${/model/role_info/record/@role_code}" != "0013" && "${/model/role_info/record/@role_code}" != "0014" && "${/model/role_info/record/@role_code}" != "0010"&& "${/model/role_info/record/@role_code}" != "0006") {
stone's avatar
stone committed
23
                //$('${/parameter/@layout_code}_user_button5').style.display='none';
niminmin's avatar
niminmin committed
24 25
                Ext.fly('${/parameter/@layout_code}_user_button5').dom.style.display = "none";
            } else {
stone's avatar
stone committed
26
                //$('${/parameter/@layout_code}_user_button1').style.display='none';
niminmin's avatar
niminmin committed
27
                Ext.fly('${/parameter/@layout_code}_user_button1').dom.style.display = "none";
stone's avatar
stone committed
28 29

            }
niminmin's avatar
niminmin committed
30 31
        });
        window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function () {
stone's avatar
stone committed
32 33
            var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
            var records = $(ds_id).getSelected();
niminmin's avatar
niminmin committed
34 35
            if (records.length != 1) {
                $L.showInfoMessage("提示", '只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
stone's avatar
stone committed
36 37 38
                return;
            }
            //获取该付款申请的头id
niminmin's avatar
niminmin committed
39 40
            var payment_req_id = records[0].get('payment_req_id');
            var payment_status = records[0].get('approval_status');
gzj34291's avatar
gzj34291 committed
41 42
            var  division   = records[0].get('con_division');

niminmin's avatar
niminmin committed
43 44
            if (payment_status != "APPROVED") {
                $L.showInfoMessage("提示", '只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
stone's avatar
stone committed
45 46
                return;
            }
gzj34291's avatar
gzj34291 committed
47 48 49 50 51 52 53 54 55 56

            // var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
            // window.open(href = url_l, target = "_self");

            if(division == '30' || division == '50'){
                var url_l = $('csh_payment_req_history_word_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';

             }else{
                var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
            }
niminmin's avatar
niminmin committed
57
            window.open(href = url_l, target = "_self");
gzj34291's avatar
gzj34291 committed
58

niminmin's avatar
niminmin committed
59
        };
stone's avatar
stone committed
60

niminmin's avatar
niminmin committed
61 62
        //新增
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
Spencer Chang's avatar
Spencer Chang committed
63 64 65 66 67
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
            var url = $('csh_payment_req_create_link').getUrl();
            var win = new Leaf.Window({
                url: url,
                params: {
68 69
                    winid: 'csh_payment_req_create_win_id',
                    ds_id: ds_id
Spencer Chang's avatar
Spencer Chang committed
70 71 72 73 74
                },
                title: '付款申请页面',
                id: 'csh_payment_req_create_win_id',
                fullScreen: true
            });
niminmin's avatar
niminmin committed
75
            win.on('close', function () {
Spencer Chang's avatar
Spencer Chang committed
76 77 78 79
                $(ds_id).query();
            });
        };
        //待申请清单删除
niminmin's avatar
niminmin committed
80
        window['${/parameter/@layout_code}_G_CSH_REQ_1_USER_BUTTON1_layout_dynamic_tab_click'] = function () {
Spencer Chang's avatar
Spencer Chang committed
81 82 83 84
            var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_1_csh_payment_req_hd_ds';
            var records = $(ds_id).getSelected();
            var param = {};
            var datas = [];
niminmin's avatar
niminmin committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
            if (!records.length) {
                Leaf.showMessage('提示', '请至少选择一条数据!');
                return;
            }
            Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
                for (var i = 0; i < records.length; i++) {
                    if (records[i].get('payment_req_id')) {
                        // if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
                        //     Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
                        //     return;
                        // }
                        data = {};
                        data['payment_req_id'] = records[i].get('payment_req_id');
                        data['_status'] = 'update';
                        datas.push(data);
Spencer Chang's avatar
Spencer Chang committed
100 101 102

                    }
                }
niminmin's avatar
niminmin committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
                param['details'] = datas;
                var url_l = $('delete_payment_req_link_id').getUrl();
                Leaf.request({
                    url: url_l,
                    para: datas,
                    success: function () {

                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        $(ds_id).query();
                    },
                    error: function () {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    failure: function () {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });
Spencer Chang's avatar
Spencer Chang committed
121 122 123 124 125

            }, function cancelFun() {
                Leaf.SideBar.enable = true;
                window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
            });
niminmin's avatar
niminmin committed
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
        };
        // //已申请清单删除
        // window['${/parameter/@layout_code}_G_CSH_REQ_2_USER_BUTTON1_layout_dynamic_tab_click'] = function() {
        //     var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
        //     var records = $(ds_id).getSelected();
        //     var param = {};
        //     var datas = [];
        //     var win = Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
        //         if (!records.length) {
        //             Leaf.showMessage('提示', '请至少选择一条数据!');
        //         } else {
        //             for (var i = 0;i < records.length;i++) {
        //                 if (records[i].get('payment_req_id')) {
        //                     if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
        //                         Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
        //                         return;
        //                     }
        //                     data = {};
        //                     data['payment_req_id'] = records[i].get('payment_req_id');
        //                     data['_status'] = 'update';
        //                     datas.push(data);
        //
        //                 }
        //             }
        //             param['details'] = datas;
        //             var url_l = $('delete_payment_req_link_id').getUrl();
        //             Leaf.request({
        //                 url: url_l,
        //                 para: datas,
        //                 success: function() {
        //                     window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                     $(ds_id).query();
        //                 },
        //                 error: function() {
        //                     window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                 },
        //                 failure: function() {
        //                     window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                 },
        //                 scope: this
        //             });
        //         }
        //     }, function cancelFun() {
        //         Leaf.SideBar.enable = true;
        //         window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //     });
        //     win.on('close', function() {
        //         Leaf.SideBar.enable = true;
        //     });
        // }
Spencer Chang's avatar
Spencer Chang committed
176

niminmin's avatar
niminmin committed
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
        // //删除
        // window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
        //     var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
        //     var records = $(ds_id).getSelected();
        //     var param = {};
        //     var datas = [];
        //     var win = Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.DELETE_CONFIRM}', function okFun() {
        //         if (!records.length) {
        //             Leaf.showMessage('提示', '请至少选择一条数据!');
        //         } else {
        //             for (var i = 0; i < records.length; i++) {
        //                 if (records[i].get('payment_req_id')) {
        //                     if (records[i].get('approval_status') != 'NEW'&& records[i].get('approval_status') != 'RETURN') {
        //                         Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态不是新建或退回,不能删除!');
        //                         return;
        //                     }
        //                     data = {};
        //                     data['payment_req_id'] = records[i].get('payment_req_id');
        //                     data['_status'] = 'update';
        //                     datas.push(data);
        //
        //                 }
        //             }
        //             param['details'] = datas;
        //             var url_l = $('delete_payment_req_link_id').getUrl();
        //                 Leaf.request({
        //                     url: url_l,
        //                     para: datas,
        //                     success: function () {
        //                         window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                         $(ds_id).query();
        //                     },
        //                     error: function () {
        //                         window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                     },
        //                     failure: function () {
        //                         window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //                     },
        //                     scope: this
        //                 });
        //         }
        //     }, function cancelFun() {
        //         Leaf.SideBar.enable = true;
        //         window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        //     });
        //     win.on('close', function () {
        //         Leaf.SideBar.enable = true;
        //     });
        //
        // };
Spencer Chang's avatar
Spencer Chang committed
227 228 229 230


        function detail_link(id, name, query_only) {
            var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
231
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
18083's avatar
18083 committed
232 233
            //跳转根据产品线区分经营性租赁  18083 2023/10/10
            var division_diff = record.get('division_diff');
18083's avatar
18083 committed
234
             var param = {};
Spencer Chang's avatar
Spencer Chang committed
235 236 237 238 239 240 241 242 243
            param['payment_req_id'] = record.get('payment_req_id');
            param['document_category'] = record.get('document_category');
            param['business_type'] = record.get('business_type');
            param['contract_id'] = record.get('contract_id');
            param['contract_number'] = record.get('contract_number');
            param['division_n'] = record.get('division_n');
            param['contract_name'] = record.get('contract_name');
            param['division'] = record.get('division');
            param['approval_status'] = record.get('approval_status');
niminmin's avatar
niminmin committed
244
            param['con_business_type'] = record.get('con_business_type');
gzj34291's avatar
gzj34291 committed
245
            param['division'] = record.get('division');
246 247
            //add by 18938
            param['is_constru_unit'] = record.get('is_constru_unit');
Spencer Chang's avatar
Spencer Chang committed
248 249 250 251 252
            if (record.get('business_type') == 'PAYMENT') {
                param['function_code'] = 'CSH501D';
            } else if (record.get('business_type') == 'PREPAYMENT') {
                param['function_code'] = 'CSH501_PRE_D';
            }
18083's avatar
18083 committed
253 254 255 256 257 258 259 260 261 262
            if(division_diff=='95'){
                if (record.get('approval_status') == 'NEW' || record.get('approval_status') == 'RETURN' || record.get('approval_status') == 'REJECT') {
                    param['function_usage'] = 'UPDATE';
                    param['function_code'] = 'CSH501H_OP';
                } else {
                    param['function_usage'] = 'QUERY';
                    param['function_code'] = 'CSH501Q_OP';
                    param['download'] = 'Y';
                }
            }else{
Spencer Chang's avatar
Spencer Chang committed
263 264 265 266 267 268 269 270
            if (record.get('approval_status') == 'NEW' || record.get('approval_status') == 'RETURN' || record.get('approval_status') == 'REJECT') {
                param['function_usage'] = 'UPDATE';
                param['function_code'] = 'CSH501D';
            } else {
                param['function_usage'] = 'QUERY';
                param['function_code'] = 'CSH501Q';
                param['download'] = 'Y';
            }
18083's avatar
18083 committed
271
		        }
Spencer Chang's avatar
Spencer Chang committed
272 273 274 275 276 277 278
            param['winid'] = 'csh_payment_update_window';
            param['url_title'] = '付款申请';
            if (record.get('ln_cf_item') == 0) {
                param['cond_para1'] = 'PAYMENT';
            } else {
                param['cond_para1'] = 'OTHER';
            }
18083's avatar
18083 committed
279 280 281
			if(division_diff=='95'){
            hls_doc_get_layout_code('get_layout_code_link_id', param, 'csh501_csh_payment_req_op_link1_id', ds_id, '${/parameter/@layout_code}');
           }else{
niminmin's avatar
niminmin committed
282
            hls_doc_get_layout_code('get_layout_code_link_id', param, 'csh501_csh_payment_req_link1_id', ds_id, '${/parameter/@layout_code}');
18083's avatar
18083 committed
283
                     }
Spencer Chang's avatar
Spencer Chang committed
284 285
        }

niminmin's avatar
niminmin committed
286
        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
Spencer Chang's avatar
Spencer Chang committed
287 288 289 290 291 292 293 294 295 296
            window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
            if (name == 'detail') {
                link_function = 'detail_link';
                if (record.get('contract_id')) {
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                } else {
                    return '';
                }
            }
        };
niminmin's avatar
niminmin committed
297 298 299 300 301 302 303
        window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
            //  var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            //   var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_1_csh_payment_req_hd_ds';
            //   var ds_id_2= '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
            //
            //   if (ds.id == ds_id) {
            aut_authority_list_validate_query(ds, qpara);
stone's avatar
stone committed
304 305 306 307
            // }
            // if (ds.id == ds_id_2) {
            //     aut_authority_list_validate_query(ds, qpara);
            // }
308
        };
Spencer Chang's avatar
Spencer Chang committed
309 310
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
niminmin's avatar
niminmin committed
311 312
        <a:screen-include
                screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PAYMENT_REQ&amp;function_code=CSH501"/>
313

Spencer Chang's avatar
Spencer Chang committed
314 315
    </a:view>
</a:screen>