rsc_five_class_wfl.lview 11.3 KB
Newer Older
gzj34291's avatar
gzj34291 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: 34291 gzj
    $Date: 2022年9月5日
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query model="rsc.RSC510.workflow_info" defaultWhereClause="instance_id=${/parameter/@instance_id}" rootPath="wolkflow_path"></a:model-query>
    </a:init-procedure>
    <a:view>
        <a:link id="update_final_sort_id" model="rsc.RSC510.rsc_contract_query" modelaction="update"/>
        <a:link id="update_five_class_link" model="rsc.RSC510.update_five_class" modelaction="update"/>
        <a:link id="update_text_link" url="${/request/@context_path}/modules/rsc/RSC510/rsc_update_text.lview" />
        <script><![CDATA[

        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
            if('${/model/wolkflow_path/record/@current_seq}' == '10'){
                var ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_five_classification');
                var records = $(ds_id).getCurrentRecord();
                if(ds.id==ds_id){
                    if(name=='final_sort') {
                        debugger
                        var presorting_result = records.get('presorting_result');
                        var final_sort = records.get('final_sort');
                        if(presorting_result != final_sort){
                            records.getField('text').setRequired(true);
                        }
                        if(presorting_result == final_sort){
                            records.getField('text').setRequired(false);
                        }
                    }
                }
            }else{
                var ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var ds_id_s=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT_SAME', 'con_five_classification');
                // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_five_classification');
                var records = $(ds_id).getCurrentRecord();
                var records_s = $(ds_id_s).getCurrentRecord();
                if(ds.id==ds_id){
                    if(name=='final_sort') {
                        debugger
                        var presorting_result = records.get('presorting_result');
                        var final_sort = records.get('final_sort');
                        if(presorting_result != final_sort){
                            records.getField('text').setRequired(true);
                        }
                        if(presorting_result == final_sort){
                            records.getField('text').setRequired(false);
                        }
                    }
                }
                if(ds.id==ds_id_s){
                    if(name=='final_sort') {
                        debugger
                        var presorting_result = records_s.get('presorting_result');
                        var final_sort = records_s.get('final_sort');
                        if(presorting_result != final_sort){
                            records_s.getField('text').setRequired(true);
                        }
                        if(presorting_result == final_sort){
                            records_s.getField('text').setRequired(false);
                        }
                    }
                }
            }

        }
        //加载时调用(grid,table,gridBox)
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
            if ('${/model/wolkflow_path/record/@current_seq}' == '30') {
                document.getElementById("RSC_FIVE_CLASS_WFL_query").style.display = "none";
                document.getElementById("RSC_FIVE_CLASS_WFL_user_button1").style.display = "none";
                document.getElementById("RSC_FIVE_CLASS_WFL_user_button2").style.display = "none";
            }
            if('${/model/wolkflow_path/record/@current_seq}' == '20'){
                document.getElementById("RSC_FIVE_CLASS_WFL_user_button1").style.display = "none";
                document.getElementById("RSC_FIVE_CLASS_WFL_user_button2").style.display = "none";
                document.getElementById("RSC_FIVE_CLASS_WFL_RESULT_SAVE_layout_dynamic_button_id").style.display = "none";
                document.getElementById("RSC_FIVE_CLASS_WFL_RESULT_ADD_layout_dynamic_button_id").style.display = "none";

            }
            var estimate_num = '${/parameter/@estimate_num}';
            if('${/model/wolkflow_path/record/@current_seq}' == '10'){
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var records = $(ds_id).getAll();
                for (var i = 0;i < records.length;i++) {
                    records[i].getField('contract_number').setReadOnly(true);
                    records[i].getField('contract_number_n').setReadOnly(true);
                }
            }else{
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var ds_id_s=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT_SAME', 'con_five_classification');
                var records = $(ds_id).getAll();
                var records_s = $(ds_id_s).getAll();

                    for (var i = 0;i < records.length;i++) {
                        records[i].getField('contract_number').setReadOnly(true);
                        records[i].getField('contract_number_n').setReadOnly(true);
                        records[i].getField('text').setReadOnly(true);
                        records[i].getField('final_sort').setReadOnly(true);
                        records[i].getField('final_sort_n').setReadOnly(true);
                    }
                    for (var i = 0;i < records_s.length;i++) {
                        records_s[i].getField('contract_number').setReadOnly(true);
                        records_s[i].getField('contract_number_n').setReadOnly(true);
                        records_s[i].getField('text').setReadOnly(true);
                        records_s[i].getField('final_sort').setReadOnly(true);
                        records_s[i].getField('final_sort_n').setReadOnly(true);
                    }
                }

                Leaf.request({
                    url: $('update_final_sort_id').getUrl(),
                    para: {
                        estimate_num: estimate_num
                    },
                    success: function () {
                        // $(ds_id).query();
                        // $(ds_id_s).query();
                    },
                    error: function () {
                    },
                    failure: function () {
                    },
                    scope: this

                })

        }
        //刷新
        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
            var estimate_num = '${/parameter/@estimate_num}';
            if('${/model/wolkflow_path/record/@current_seq}' == '10'){
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                Leaf.request({
                    url: $('update_five_class_link').getUrl(),
                    para: {
                        estimate_num: estimate_num
                    },
                    success: function() {
                        $(ds_id).query();
                        Leaf.SideBar.show({
                            msg:'刷新成功',
                            duration: 2000
                        });
                    },
                    failure: function() {

                    },
                    error: function() {

                    },
                    scope: this
                });
            }else{
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var ds_id_s=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT_SAME', 'con_five_classification');
                Leaf.request({
                    url: $('update_five_class_link').getUrl(),
                    para: {
                        estimate_num: estimate_num
                    },
                    success: function() {
                        $(ds_id).query();
                        $(ds_id_s).query();
                        Leaf.SideBar.show({
                            msg:'刷新成功',
                            duration: 2000
                        });
                    },
                    failure: function() {

                    },
                    error: function() {

                    },
                    scope: this
                });
            }


        }
        //批量录入说明
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            if('${/model/wolkflow_path/record/@current_seq}' == '10'){
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var  record = $(ds_id).getSelected();
                if(record.length<1){
                    Leaf.showMessage('${l:HLS.PROMPT}', '请至少选择一条数据!');
                    return;
                }
                var win = new Leaf.Window({
                    id: 'update_text_winid',
                    url: $('update_text_link').getUrl(),
                    title: '批量录入说明',
                    height: 400,
                    width: 450,
                });
            }else{
                var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT', 'con_five_classification');
                var ds_id_s=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'RESULT_SAME', 'con_five_classification');
                var  record = $(ds_id).getSelected();
                var  record_s = $(ds_id_s).getSelected();
                if((record.length<1)&&(record_s.length<1)){
                    Leaf.showMessage('${l:HLS.PROMPT}', '请至少选择一条数据!');
                    return;
                }
                var win = new Leaf.Window({
                    id: 'update_text_winid',
                    url: $('update_text_link').getUrl(),
                    title: '批量录入说明',
                    height: 400,
                    width: 450,
                });
            }


        }

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