bgfl_csh_payment_conditions.lview 10.8 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 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qianming  
    $Date: 2015-7-15 下午1:58:12  
    $Revision: 1.0  
    $Purpose: 国资-付款先决条件
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="bgfl_csh_payment_conditions_uploadfile_link_id1" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="bgfl_csh_payment_conditions_downloadfile_link_id1" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="prj506_project_side_query_id" url="${/request/@context_path}/modules/prj/PRJ811/hn_project_side_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function bgfl_csh_payment_conditions_select_func(record) {
                if (record.get('confirm_flag') !== 'Y') {
                    return true;
                }
                return false;
            }
            
            function bgfl_csh_payment_conditions_confirm() {

                var records = $('bgfl_csh_payment_conditions_result_ds').getSelected();
                if (records.length < 1) {
                    Leaf.showErrorMessage('提示', '请至少选择一数据!');
                } else {
                    Leaf.showConfirm('提示', '您确定继续?', function() {
                        Leaf.Masker.mask($('bgfl_csh_payment_conditions_win_id').wrap, '正在执行......');
                        var params = {};
                        var param = [];
                        for (i = 0;i < records.length;i++) {
                            var attr = {};
                            attr['_status'] = 'update';
                            //attr['note'] = records[i].get('note');
                            // attr['original_flag'] = records[i].get('original_flag');
                            //attr['hard_copy_flag'] = records[i].get('hard_copy_flag');
                            attr['condition_id'] = records[i].get('condition_id');
                            attr['note'] = records[i].get('note');
                            param.push(attr);
                        }
                        params['details'] = param;
                        Leaf.request({
                            url: '${/request/@context_path}/modules/csh/CSH501/bgfl_csh_payment_conditions.lsc',
                            para: params,
                            success: function() {
                                $('bgfl_csh_payment_conditions_result_ds').query();
                                Leaf.Masker.unmask($('bgfl_csh_payment_conditions_win_id').wrap);
                            },
                            failure: function() {
                                Leaf.Masker.unmask($('bgfl_csh_payment_conditions_win_id').wrap);
                            },
                            error: function() {
                                Leaf.Masker.unmask($('bgfl_csh_payment_conditions_win_id').wrap);
                            },
                            scope: this
                        });
                    });
                }
            }
            
            function bgfl_csh_payment_conditions_exit() {
                $('${/parameter/@win_id}').close();
            }
            
            function bgfl_csh_payment_conditions_edit_func(record, name) {
                // if(record.get('confirm_flag') !== 'Y'){
                // if(name === 'note'){
                // return 'grid_tf_id';
                // }else if(name === 'original_flag_n' || name === 'hard_copy_flag_n'){
                // return 'grid_cb_id';
                // }
                // }
                return '';
            }
            
            function open_attachment_window(condiction_id, url) {
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    params: {
                        'table_name': 'BGFL_CSH_PAYMENT_CONDITIONS',
                        'header_id': condiction_id
                    },
                    width: 850,
                    height: 400
                }).on('close',function(){
                    $('bgfl_csh_payment_conditions_result_ds').query();
                });
            }
            
            function bgfl_csh_payment_conditions_render_func(value, record, name) {
                if (name === 'attachments') {
                    var url;
                    var text;
                    url = $('bgfl_csh_payment_conditions_uploadfile_link_id1').getUrl();
                    text = '上传/下载';
                    return '<a href="javascript:open_attachment_window(' + record.get('condition_id') + ',\'' + url + '\')">' + text + '</a>';
                }
                if (name=='attachment_name'){
                    var file_name=record.get('file_name');
                    if (file_name != null) {
                        var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                        var str = file_name.split(';');
                        var url = '';
                        for (var i = 0;i < str.length;i++) {
                            var temp = str[i].split('--');
                            if (!Leaf.isEmpty(temp[0])) {
                                url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
                            }
                        }
                        return url;
                    }
                }
               
            }
            function bgfl_csh_payment_conditions_render_func2(value, record, name) {
             if (name === 'side_detail_n') {
                    var url;
                    var text;
                    url = $('prj506_project_side_query_id').getUrl();
                    text = '明细';
                    return '<a href="javascript:side_detail(' + record.get('ref_project_id') + ',' + record.get('prj_side_id') + ',\'' + url + '\')">' + text + '</a>';
                }
            }                
              function side_detail(ref_project_id,prj_side_id, url) {
           


                var win = new Leaf.Window({
                    url: url,
                    params: {
                         project_id: ref_project_id,
                         prj_side_id: prj_side_id,
                        query_flag: 'Y'
                    },
                    title: '项目补充明细',
                    id: 'prj506_project_side_query_win_id',
                    fullScreen: true
                });
            
                win.on('close', function() {
                    record.ds.query();
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="bgfl_csh_payment_conditions_result_ds" autoQuery="true" fetchAll="true" model="csh.CSH501.bgfl_csh_payment_conditions" queryUrl="${/request/@context_path}/autocrud/csh.CSH501.bgfl_csh_payment_conditions/query?project_id=${/parameter/@project_id}" selectFunction="bgfl_csh_payment_conditions_select_func" selectable="true">
                <a:fields>
                    <a:field name="original_flag"/>
                    <!-- <a:field name="original_flag_n" displayField="code_value_name" options="yes_no_ds" required="true" returnField="original_flag" valueField="code_value"/> -->
                    <!-- <a:field name="hard_copy_flag" required="true"/> -->
                    <!-- <a:field name="hard_copy_flag_n" displayField="code_value_name" options="yes_no_ds" required="true" returnField="hard_copy_flag" valueField="code_value"/> -->
                    <a:field name="confirm_flag_desc" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="project_supplement_detail_ds" autoQuery="true" model="csh.CSH501.project_supplement_detail" queryUrl="${/request/@context_path}/autocrud/csh.CSH501.project_supplement_detail/query?project_id=${/parameter/@project_id}">
                <a:fields>
                    <a:field name="side_item"/>
                    <a:field name="side_note"/>
                    <a:field name="side_detail_n"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="bgfl_csh_payment_conditions_exit" text="HLS.EXIT"/>
                <a:gridButton bind="grid_id" type="save"/>
                <a:gridButton click="bgfl_csh_payment_conditions_confirm" text="落实"/>
            </a:screenTopToolbar>
            <a:grid id="grid_id" bindTarget="bgfl_csh_payment_conditions_result_ds" marginHeight="240" marginWidth="35" navBar="true">
                <a:toolBar>
                    <a:button type="excel"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="description" prompt="描述" showTitle="true" width="400"/>
                    <!-- <a:column name="attachment_number" align="center" prompt="附件数量" width="80"/> -->
                    <a:column name="attachments" align="center" prompt="附件" renderer="bgfl_csh_payment_conditions_render_func" width="80"/>
                    <a:column name="attachment_name" prompt="文件名" renderer="bgfl_csh_payment_conditions_render_func" width="400"/>
                    <!--      <a:column name="original_flag_n" align="center" editorFunction="bgfl_csh_payment_conditions_edit_func" prompt="附件含原件" width="80"/>
                    <a:column name="hard_copy_flag_n" align="center" editorFunction="bgfl_csh_payment_conditions_edit_func" prompt="附件含复印件" width="80"/> -->
                    <a:column name="note" editor="grid_tf_id" prompt="备注" showTitle="true" width="300"/>
                    <a:column name="confirm_flag_desc" align="center" prompt="是否落实" width="70"/>
                    <!--   <a:column name="confirm_user_name" prompt="落实人" width="120"/>
                    <a:column name="confirm_date" align="center" prompt="落实时间" renderer="Leaf.formatDate" width="80"/> -->
                </a:columns>
                <a:editors>
                    <a:textField id="grid_tf_id"/>
                    <a:comboBox id="grid_cb_id"/>
                    <a:checkBox id="grid_check_id" checkedValue="Y" uncheckedValue="N"/>
                </a:editors>
            </a:grid>
            <a:grid id="grid_id2" bindTarget="project_supplement_detail_ds" marginHeight="500" marginWidth="35" navBar="true">
                <a:columns>
                    <a:column name="side_item" prompt="项目补充事项" width="600"/>
                    <a:column name="side_detail_n" align="center" prompt="明细" renderer="bgfl_csh_payment_conditions_render_func2" width="100"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>