csh_receipt_detail.lview 14.7 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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query model="csh.CSH531N.sys_user_emp_email" rootPath="csh531_default_email"/>
    </a:init-procedure>
    <a:view>
        <a:link id="csh_transaction_detail_link" url="${/request/@context_path}/modules/csh/CSH533N/csh_receipt_write_off.lview"/>
        <a:link id="csh533_send_mail_link" model="csh.CSH531N.csh_mail_send" modelaction="execute"/>
        <a:link id="csh533_check_write_off" model="csh.CSH531N.csh_mail_send" modelaction="update"/>
        <a:link id="csh_write_off_upload_link" url="${/request/@context_path}/modules/csh/CSH533N/csh_write_off_import.lview"/>
        <a:link id="csh_create_receipt_link" url="${/request/@context_path}/modules/csh/CSH533N/csh_create_receipt_trx.lview"/>
        <a:link id="csh_calc_write_off_flag_link" model="csh.CSH531N.csh_transaction_interface" modelaction="execute"/>
        <a:link id="csh531_send_mail_to_col_link" model="csh.CSH531N.send_mail_to_collector" modelaction="execute"/>
        <a:link id="csh531_send_to_mail_to_link" model="csh.CSH531N.send_mail_to" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
            var g_batch_id = ${/parameter/@batch_id};
            
            function cshReceiptDetail(value, record, name) {
                var batch_id = record.get('batch_id');
                var trx_interface_id = record.get('trx_interface_id');
                var csh_bank_slip_num = record.get('csh_bank_slip_num');
                var company_id = record.get('company_id');
                var csh_trx_date = Leaf.formatDate(record.get('csh_trx_date'));
                var csh_trx_period_name = record.get('csh_trx_period_name');
                var csh_trx_period_num = record.get('csh_trx_period_num');
                var csh_bp_bank_account_num = record.get('csh_bp_bank_account_num');
                return '<a href="javascript:csh_detail_fun(' + batch_id + ',' + trx_interface_id + ',\'' + csh_bank_slip_num + '\',' + company_id + ',\'' + csh_trx_date + '\',\'' + csh_trx_period_name + '\',' + csh_trx_period_num + ',\'' + csh_bp_bank_account_num + '\')">${l:CSH533.WRITE_OFF_DETAIL}</a>';
            }
            
            function csh_detail_fun(batch_id, trx_interface_id, csh_bank_slip_num, company_id, csh_trx_date, csh_trx_period_name, csh_trx_period_num, csh_bp_bank_account_num) {
                //
                var win = new Leaf.Window({
                    id: 'csh_transaction_detail_window',
                    url: $('csh_transaction_detail_link').getUrl(),
                    params: {
                        batch_id: batch_id,
                        trx_interface_id: trx_interface_id,
                        batch_status: '${/parameter/@batch_status}',
                        csh_bank_slip_num: csh_bank_slip_num,
                        company_id: company_id,
                        csh_trx_date: csh_trx_date,
                        csh_trx_period_name: csh_trx_period_name,
                        csh_trx_period_num: csh_trx_period_num,
                        csh_bp_bank_account_num: csh_bp_bank_account_num
                    },
                    title: '${l:CSH531.WRITE_OFF_DETAIL}',
                    width: 1000,
                    height: 430
                });
                win.on('close', function() {
                    Leaf.request({
                        url: $('csh533_check_write_off').getUrl(),
                        para: {
                            batch_id: g_batch_id
                        },
                        success: function() {},
                        scope: this
                    });
                    $('csh_transaction_interface_ds').query();
                });
            }
            
            function csh_close_window() {
                // $('csh_receipt_detail_window').close();
            
                // if($('csh_receipt_detail_window')){
                // $('csh_receipt_detail_window').close();
                // }else{
                location.href = $('csh_create_receipt_link').getUrl();
                // }
            }
            
            function csh533_receipt_save() {
                Leaf.request({
                    url: $('csh_calc_write_off_flag_link').getUrl(),
                    para: {
                        batch_id: ${/parameter/@batch_id}
                    },
                    success: function() {},
                    scope: this
                });
                $('csh_transaction_interface_ds').submit();
            }
            
            function send_mail() {
                Leaf.request({
                    url: $('csh533_send_mail_link').getUrl(),
                    para: {
                        batch_id: '${/parameter/@batch_id}'
                    },
                    success: function() {
                        Leaf.showMessage('${l:PROMPT}', '发送成功!');
                    },
                    scope: this
                });
            }
            
            function csh533_send_mail() {
                Leaf.showConfirm('${l:PROMPT}', '是否将分配结果邮件发送到催款员?', function() {
                    send_mail();
                }, function() {});
            }
            
            function do_import() {
                new Leaf.Window({
                    id: 'csh_write_off_upload_window',
                    params: {
                        winid: 'csh_write_off_upload_window'
                    },
                    url: $('csh_write_off_upload_link').getUrl() + '?batch_id=${/parameter/@batch_id}',
                    title: '${l:HLS.IMPORT}',
                    width: 420,
                    height: 275
                });
            }
            
            function csh533_import_write_off() {
                Leaf.showConfirm('${l:PROMPT}', '导入分配将覆盖自动分配的数据,是否继续?', function() {
                    do_import();
                }, function() {});
            }
            
            function csh533_query() {
                $('csh_transaction_interface_ds').query();
            }
            
            function csh531_mail_send_to_col() {
                Leaf.showConfirm('${l:PROMPT}', '是否将分配结果邮件发送到催款员?', function() {
                    Leaf.request({
                        url: $('csh531_send_mail_to_col_link').getUrl(),
                        para: {
                            batch_id: '${/parameter/@batch_id}'
                        },
                        success: function() {
                            Leaf.showMessage('${l:PROMPT}', '发送成功!');
                        },
                        scope: this
                    });
                }, function() {});
            }
            
            function csh531_mail_send_mail_to() {
                if ($('csh_transaction_interface_mail_to_ds').validate()) {
                    Leaf.showConfirm('${l:PROMPT}', '是否将分配结果邮件发送到指定人员?', function() {
                        Leaf.request({
                            url: $('csh531_send_to_mail_to_link').getUrl(),
                            para: {
                                batch_id: '${/parameter/@batch_id}',
                                mail_to: $('csh_transaction_interface_mail_to_ds').getAt(0).get('mail_to')
                            },
                            success: function() {
                                Leaf.showMessage('${l:PROMPT}', '发送成功!');
                            },
                            scope: this
                        });
                    }, function() {});
                }
            }
            
            function summaryRenderer(datas, name) {
                var sum = 0;
                var sum_2 = 0;
                if (name == "write_off_amount") {
                    for (var i = 0;i < datas.length;i++) {
                        record = datas[i];
                        var t_1 = record.get("write_off_amount");
                        var t_2 = parseFloat(t_1);
                        if (!isNaN(t_2)) {
                            sum += t_2;
                        }
                    }
                }
                if (name == "ebank_result_success_amt") {
                    for (var j = 0;j < datas.length;j++) {
                        record = datas[j];
                        var n_1 = record.get("ebank_result_success_amt");
                        var n_2 = parseFloat(n_1);
                        if (!isNaN(n_2)) {
                            sum_2 += n_2;
                        }
                    }
                }
                if (name == "csh_bank_account_num") {
                    return '<div align="right">合计:</div>';
                }
                if (name == "ebank_result_success_amt") {
                    return '<font color="red">' + Leaf.formatNumber(sum_2, 2) + '</font>';
                }
                if (name == "write_off_amount") {
                    return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
                }
            }
            
            function csh533_remove_write() {
                $('csh533_transaction_interface_gd').remove();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="write_off_flag_ds" lookupCode="CSH531_CSH_INTERFACE_WRITE_OFF_FLAG"/>
            <a:dataSet id="lock_flag_ds" lookupCode="CSH531_LOCK_FLAG"/>
            <a:dataSet id="csh_transaction_interface_mail_to_ds" autoCreate="true">
                <a:fields>
                    <a:field name="mail_to" defaultValue="${/model/csh531_default_email/record/@email}" fetchRemote="false" lovGridHeight="320" lovHeight="500" lovService="csh.CSH531N.csh_mail_to_list" lovWidth="500" required="true">
                        <a:mapping>
                            <a:map from="email" to="mail_to"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh_receipt_detail_query" autoCreate="true">
                <a:fields>
                    <a:field name="csh_bank_slip_num"/>
                    <a:field name="csh_bank_account_num"/>
                    <a:field name="csh_trx_date"/>
                    <a:field name="csh_bp_bank_account_num"/>
                    <a:field name="csh_bp_bank_account_name"/>
                    <a:field name="batch_id" defaultValue="${/parameter/@batch_id}"/>
                    <a:field name="csh_description"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh_transaction_interface_ds" autoPageSize="true" autoQuery="true" model="csh.CSH531N.csh_transaction_interface" queryDataSet="csh_receipt_detail_query" selectable="true">
                <a:fields>
                    <a:field name="lock_flag"/>
                    <a:field name="lock_flag_desc" displayField="code_value_name" options="lock_flag_ds" returnField="lock_flag" valueField="code_value"/>
                    <a:field name="write_off_flag"/>
                    <a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds" returnField="write_off_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="csh_close_window" text="HLS.RETURN"/>
                <a:gridButton click="csh533_import_write_off" text="CSH531.IMPORT_WRITE_OFF"/>
                <a:gridButton click="csh533_receipt_save" text="HLS.SAVE"/>
                <a:gridButton click="csh533_remove_write" text="HLS.REMOVE"/>
                <a:gridButton click="csh533_query" text="HLS.QUERY"/>
                <a:gridButton click="csh531_mail_send_to_col" text="邮件发送催款员"/>
                <a:gridButton click="csh531_mail_send_mail_to" text="邮件发送到"/>
                <a:lov name="mail_to" bindTarget="csh_transaction_interface_mail_to_ds" prompt="接收人" style="margin-top:10px"/>
            </a:screenTopToolbar>
            <a:form column="2" title="查询条件">
                <a:textField name="csh_description" bindTarget="csh_receipt_detail_query" prompt="合同序号"/>
            </a:form>
            <a:grid id="csh533_transaction_interface_gd" bindTarget="csh_transaction_interface_ds" marginHeight="190" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="csh_bank_account_num" footerRenderer="summaryRenderer" prompt="CSH531.ACCOUNT_NUM" width="150"/>
                    <a:column name="csh_trx_date" prompt="CSH531.TRX_DATE" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="csh_bp_bank_account_num" prompt="CSH531.BANK_ACCOUNT_NUM" width="150"/>
                    <a:column name="csh_bp_bank_account_name" prompt="CSH531.BANK_ACCOUNT_NAME"/>
                    <a:column name="csh_trx_amount" align="right" editor="csh533_receipt_grid_nf" prompt="CSH531.TRX_AMOUNT" renderer="Leaf.formatMoney"/>
                    <a:column name="csh_currency_code" align="center" prompt="CSH531.CURRENCY_CODE" width="60"/>
                    <a:column name="csh_description" prompt="CSH531.DESCRIPTION" width="200"/>
                    <!--    <a:column name="lock_flag_desc" editor="csh_transfer_grid_cb" prompt="CSH531.LOCK_FLAG" width="80"/>
                    <a:column name="post_flag" align="center" prompt="CSH531.POST_FLAG" width="60"/> -->
                    <a:column name="ebank_success_status" align="center" prompt="CSH5313.EBANK_SUCCESS_STATUS" width="55"/>
                    <a:column name="ebank_result_status_desc" prompt="CSH533.EBANK_RESULT_STATUS" width="55"/>
                    <a:column name="ebank_result_acc_balance" align="right" prompt="CSH533.EBANK_RESULT_ACC_BALANCE" renderer="Leaf.formatMoney"/>
                    <a:column name="ebank_result_success_amt" align="right" footerRenderer="summaryRenderer" prompt="CSH533.EBANK_RESULT_SUCCESS_AMT" renderer="Leaf.formatMoney"/>
                    <a:column name="write_off_amount" align="right" footerRenderer="summaryRenderer" prompt="分配金额" renderer="Leaf.formatMoney"/>
                    <a:column name="lock_flag_desc" editor="csh_transfer_grid_cb" prompt="CSH531.LOCK_FLAG" width="60"/>
                    <a:column name="write_off_flag_desc" align="center" prompt="CSH531.WRITE_OFF_FLAG" width="60"/>
                    <a:column align="center" prompt="CSH533.WRITE_OFF_DETAIL" renderer="cshReceiptDetail" width="60"/>
                </a:columns>
                <a:editors>
                    <a:comboBox id="csh_transfer_grid_cb"/>
                    <a:numberField id="csh533_receipt_grid_nf"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>