con_contract_query_entrance.lview 7.03 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng
    $Date: 2019-04-17 14:40:55
    $Revision: 1.0  
    $Purpose: 合同维护入口界面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
    <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="con_contract_modify_link"
                url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <!-- <a:link id="prj_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/> -->
        <a:link id="car_modify_special_link2"
                url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/>
        <a:link id="car_modify_mananger_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_manager.lview"/>
        <a:link id="car_modify_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>
        <a:link id="car_modify_special_link"
                url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>


        <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
        <script type="text/javascript"><![CDATA[


        function open_contract_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'CON301';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'QUERY';
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
        }

        function open_project_Window(record_id, ds_id) {
            var record = $(ds_id).findById(record_id);
            //项目类layout_code
            maintain_type = 'QUERY';
            param = record.data;
            param['document_id'] = record.get('project_id');
            param['function_code'] = 'PRJ501Q';
            param['function_usage'] = 'MODIFY';
            param['maintain_type'] = maintain_type;
            param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_link', ds_id);


        }

        function open_bs_Window(record_id, ds_id) {

            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'CON301BS';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'QUERY';
            param['contract_id'] = record.get('contract_id');
            param['url_title'] = 'BS明细';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
        }


        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
            if (name == 'contract_number' && value) {
                return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
            }
            if (name == 'project_id_c' && value) {
                return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
            }
            if (name == 'bs_link') {
                return '<a href="javascript:open_bs_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">明细</a>';
            }
            return value;
        };
        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');

            if (ds == $(ds_id)) {
                aut_authority_list_validate_query(ds, qpara);

            }
        };

        // window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
        //     var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
        //     var grid_id = ds_id.replace('ds', 'layout_grid_id');
        //     $(grid_id)._export();
        // };
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var ds = $(ds_id);
            var records = ds.getSelected();
            var param_list = [];
            window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
            if (!records.length||records.length==0) {
                Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
                return;
            }

            for (var i = 0; i < records.length; i++) {
                if(records[i].get('signature')=='10'){
                    Leaf.showMessage('${l:PROMPT}', '选择记录中包含完全盖章');
                    return;
                }
                param_list[i] = records[i].get('contract_id');
            }
            $jq.ajax({
                url: '${/request/@context_path}/contract/signature/batchds',
                data: JSON.stringify(param_list),
                type: 'post',
                method: 'post',
                dataType: "json",
                contentType: 'application/json;charset=UTF-8',
                success: function (datas) {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    if (datas.success) {
                        Leaf.SideBar.show({
                            msg: '操作成功',
                            duration: 2000
                        });
                        ds.query(ds.currentPage);
                    } else {
                        Leaf.showErrorMessage('提示', '操作失败' + datas.message);
                    }
                },
                failure: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    Leaf.SideBar.show({
                        msg: '操作失败',
                        duration: 2000
                    });
                },
                error: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    Leaf.SideBar.show({
                        msg: '操作失败',
                        duration: 2000
                    });
                },
            })
        };


        ]]></script>
        <a:screen-include
                screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON312"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>