inv_payment_wfl.lview 3.87 KB
Newer Older
38823's avatar
38823 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: 38823
    $Date: 2023-12-20
    $Revision: 1.0
    $purpose: 付款凭证审批
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script"
          customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
    </a:init-procedure>
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="${/parameter/@layout_code}journal_detail_link"
                url="${/request/@context_path}/modules/inv/INV100/inv_payment_detail.lview"/>
        <a:link id="payment_wfl_link_id"
                url="${/request/@context_path}/modules/inv/INV100/inv_payment_batch.lsc"/>
        <script type="text/javascript"><![CDATA[
        
        function open_journal_detail(record_id, ds_id) {
            debugger;
            var record = $(ds_id).findById(record_id);
            var param = {};
            param['payment_journal_id'] = record.get('payment_journal_id');
            param['journal_header_id'] = record.get('journal_header_id');
            param['function_code'] = 'INV110';
38823's avatar
38823 committed
27 28 29 30 31 32 33
            if(record.get('wfl_status')=='NEW' || record.get('wfl_status')=='REJECT'){
                param['function_usage'] = 'MODIFY';
                param['maintain_type'] = 'MODIFY';
            }else {
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'QUERY';
            }
38823's avatar
38823 committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
            param['url_title'] = '付款凭证审批明细';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}journal_detail_link',ds_id);
        }
        //超链接渲染
        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
            var link_function = '';
            window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
            if(name == 'journal_num'){
                link_function = 'open_journal_detail';
                return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
            }
        };

        //提交审批
        window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
            debugger;
38823's avatar
38823 committed
50
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hl_cm_payment_journal');
38823's avatar
38823 committed
51 52
            var records = $(ds_id).getSelected();
            var ParaData = [];
38823's avatar
38823 committed
53 54 55 56
            if(records.length ==0){
                $L.showMessage("提示",'请至少选择一条数据!');
                return;
            }
38823's avatar
38823 committed
57
            for(var i=0; i<records.length;i++){
38823's avatar
38823 committed
58 59 60 61
                if(records[i].data.wfl_status == 'APPROVING' || records[i].data.wfl_status == 'APPROVED'){
                  $L.showMessage("提示",'请选择新建或者审批拒绝的单据!');
                  return;;
                }
38823's avatar
38823 committed
62 63 64 65 66 67 68 69 70 71 72 73
                records[i].set('_status','execute');
                ParaData.push(records[i].data);
            }
            Leaf.showConfirm('${l:PROMPT}', '确认提交付款凭证工作流?', function () {
                Leaf.request({
                    url: $('payment_wfl_link_id').getUrl(),
                    para: ParaData,
                    success: function () {
                        Leaf.SideBar.show({
                            msg: '提交成功',
                            duration: 2000
                        });
38823's avatar
38823 committed
74
                        $(ds_id).query();
38823's avatar
38823 committed
75 76 77 78 79 80 81 82 83 84 85
                    },
                    scope: this
                });
            }, function () {
            }, null, null);
        };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>