acp_invoice_entrance.lview 3.55 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2018年7月25日 下午3:35:07  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
    <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}${/parameter/@pre_layout}_invoice_cdd_uploadFile_id"
                url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="acp_invoice_confirm_link" model="acp.ACP520.acp_invoice_confirm"
                modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
        //确认签收
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {

            var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
            var records = $(acp_ds_id).getSelected();
            if (records.length == 0) {
                Leaf.showMessage('${l:PROMPT}', '请至少选择一条数据!');
                return;
            }
            var param_list = [];
            var param = {};
            for (var i = 0; i < records.length; i++) {
                param = {};
                param['invoice_line_id'] = records[i].get('invoice_line_id');
                param['_status'] = 'update';
                param_list.push(param);
            }
            window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
            Leaf.request({
                url: $('acp_invoice_confirm_link').getUrl(),
                para: param_list,
                success: function (res) {
                    $(acp_ds_id).query();
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                },
                error: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                },
                failure: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                },
                sync: true,
                scope: this
            });

        }
        //超链接渲染
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) {
            //
            var link_function = '';
            var invoice_line_id = record.get('invoice_line_id');
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
            if (name == 'attachment') {
                return '<a href="javascript:attachment_window_open(\'' + invoice_line_id + '\',\'' + record.id + '\',\'' + record.ds.id + '\');">' + '上传' + '</a>';
            }
        };

        function attachment_window_open(invoice_line_id, record_id, ds_id) {
            url = $('${/parameter/@layout_code}${/parameter/@pre_layout}_invoice_cdd_uploadFile_id').getUrl() + '?table_name=ACP_INVOICE_LN&header_id=' + invoice_line_id;
            wd = new Leaf.Window({
                id: 'open_attachment_window',
                url: url,
                title: '附件上传',
                height: 350,
                width: 850
            });
        }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>