ccb_ebank_query.lview 10.9 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Eugene Song $
    $Date: 2018年11月2日10:19:17 $
    $Revision: 1.1 $
    $Purpose: 网银代扣管理
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="hls_ebank_create_link" model="ccb.CCB600.hls_ebank_batch" modelaction="execute"/>
11 12 13 14
        <a:link id="query_ebank_detail_link"
                url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail_query.lview"/>
        <a:link id="modify_ebank_detail_link"
                url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail.lview"/>
Spencer Chang's avatar
Spencer Chang committed
15 16 17 18 19 20
        <script type="text/javascript"><![CDATA[

        function return_batch() {
            $('${/parameter/@winid}').close();
        }

21 22
        function batch_detail_renderer(value, record, name) {
            if ('${/parameter/@status}' == 'NEW') {
Spencer Chang's avatar
Spencer Chang committed
23
                return '<a href="javascript:open_batch_detail_modify_window(' + record.get('hd_id') + ')">' + '${l:PROMPT.DETAIL}' + '</a>';
24
            } else {
Spencer Chang's avatar
Spencer Chang committed
25 26 27 28
                return '<a href="javascript:open_batch_detail_query_window(' + record.get('hd_id') + ')">' + '${l:PROMPT.DETAIL}' + '</a>';
            }
        }

29
        function hls_ccb_merge_result() {
30
            var batch_id = $('hls_ccb_grid_ln_ds').getAt(0).get('batch_id') || -1;
31
            if ('${/parameter/@status}' == 'NEW') {
32
                open_batch_detail_modify_window(batch_id);
33
            } else {
34
                open_batch_detail_query_window(batch_id);
35 36 37
            }
        }

38
        function open_batch_detail_query_window(batch_id) {
Spencer Chang's avatar
Spencer Chang committed
39 40 41 42
            var win = new Leaf.Window({
                id: 'batch_link_query_winId',
                url: $('query_ebank_detail_link').getUrl(),
                params: {
43
                    batch_id: batch_id,
Spencer Chang's avatar
Spencer Chang committed
44 45 46 47 48 49 50 51 52 53
                    winid: 'batch_link_query_winId'
                },
                title: '代扣指令明细',
                draggable: true,
                width: 1100,
                height: 680
            });
        }


54
        function open_batch_detail_modify_window(batch_id) {
Spencer Chang's avatar
Spencer Chang committed
55 56 57 58
            var win = new Leaf.Window({
                id: 'batch_modify_link_winId',
                url: $('modify_ebank_detail_link').getUrl(),
                params: {
59
                    batch_id: batch_id,
Spencer Chang's avatar
Spencer Chang committed
60 61 62 63 64 65 66 67 68
                    winid: 'batch_modify_link_winId'
                },
                title: '代扣指令明细',
                draggable: true,
                width: 900,
                height: 680
            });
        }

69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
        function colum_caculateTotal(data, name) {
            var total = 0;
            var length = data.length;
            var value = 0;
            for (var i = 0; i < length; i++) {
                if (Ext.isEmpty(data[i].get(name))) {
                    value = 0;
                } else {
                    value = data[i].get(name);
                }
                total = plus(total, value);
            }
            return '<font color=red>' + Leaf.formatMoney(total) + '</font>';
        }

        function sumAmount(record, name) {
            if (name == 'cf_item_desc') {
                return '<font color=red>合计:</font>';
            }
            if (name == 'due_amount' || name == 'manual_amount') {
                return '<font color=red>' + colum_caculateTotal(record, name) + '</font>';
            }
        }
Spencer Chang's avatar
Spencer Chang committed
92 93 94 95 96 97

        ]]></script>
        <a:dataSets>
            <a:dataSet id="rates_type_combobox_ds">
                <a:datas dataSource="/model/ratesType"/>
            </a:dataSet>
98 99
            <a:dataSet id="pay_methods_ds">
                <a:datas>
Darming's avatar
Darming committed
100
<!--                    <a:record code_value="AGRI_THREE" code_value_name="农行扣款(三方)"/>-->
101
                    <a:record code_value="CCB_THREE" code_value_name="建行扣款(三方)"/>
Darming's avatar
Darming committed
102
<!--                    <a:record code_value="AGRI_TWO" code_value_name="农行扣款(两方)"/>-->
103 104
                </a:datas>
            </a:dataSet>
Spencer Chang's avatar
Spencer Chang committed
105 106 107 108 109 110 111 112 113 114 115 116 117 118
            <a:dataSet id="hls_ccb_form_create_ds" autoQuery="true" model="ccb.CCB600.hls_ebank_batch"
                       queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.hls_ebank_batch/query?batch_id=${/parameter/@batch_id}">
                <a:fields>
                    <a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550"
                             lovService="ccb.CCB600.hls_ebank_bank" lovWidth="1000" readOnly="true"
                             title="银行账户" prompt="银行账户">
                        <a:mapping>
                            <a:map from="bank_account_name" to="bank_account_name"/>
                            <a:map from="bank_account_num" to="bank_account_num"/>
                            <a:map from="bank_short_name" to="bank_name"/>
                            <a:map from="bank_account_id" to="bank_account_id"/>
                            <a:map from="currency_code" to="currency"/>
                        </a:mapping>
                    </a:field>
119
                    <a:field name="currency_name" readOnly="true"/>
Spencer Chang's avatar
Spencer Chang committed
120 121
                    <a:field name="bank_account_name" readOnly="true"/>
                    <a:field name="bank_name" readOnly="true"/>
122 123
                    <a:field name="pay_method_desc" readOnly="true" prompt="支付方式" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
                    <a:field name="pay_method"/>
Spencer Chang's avatar
Spencer Chang committed
124
                    <a:field name="currency" readOnly="true"/>
125
                    <a:field name="due_date" prompt="应收日期" readOnly="true"/>
Spencer Chang's avatar
Spencer Chang committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
                    <a:field name="merger_rules" defaultValue="NONE" prompt="" readOnly="true"/>
                    <a:field name="payment_amount_from" readOnly="true"/>
                    <a:field name="payment_amount_to" readOnly="true"/>
                </a:fields>
            </a:dataSet>

            <a:dataSet id="hls_ccb_grid_create_ds" autoCount="true" autoQuery="true" fetchAll="false"
                       model="ccb.CCB600.hls_ebank_batch_hd" pageSize="15"
                       queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.hls_ebank_batch_hd/query?batch_id=${/parameter/@batch_id}"
                       selectable="true">
                <a:fields>
                    <a:field name="num" readOnly="true"/>
                </a:fields>
            </a:dataSet>

        </a:dataSets>
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

        <a:dataSet id="hls_ccb_grid_ln_ds" fetchAll="true" autoQuery="true" model="ccb.CCB600.hls_ebank_batch_ln"
                   queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.hls_ebank_batch_ln/query?batch_id=${/parameter/@batch_id}">
            <a:fields>
                <a:field name="cashflow_id"/>
                <a:field name="bp_tenant_name" readOnly="true"/>
                <a:field name="contract_id"/>
                <a:field name="contract_number" readOnly="true"/>
                <a:field name="times" readOnly="true"/>
                <a:field name="cf_item" readOnly="true"/>
                <a:field name="due_amount" readOnly="true"/>
                <a:field name="manual_amount" required="true" prompt="扣款金额"/>
                <a:field name="description"/>
            </a:fields>
        </a:dataSet>

Spencer Chang's avatar
Spencer Chang committed
158 159 160 161 162
        <a:screenBody>
            <a:screenTopToolbar height="29">
                <a:gridButton click="return_batch" text="返回"/>
            </a:screenTopToolbar>

163
            <a:fieldSet title="本方账户" column="3">
Spencer Chang's avatar
Spencer Chang committed
164 165 166
                <a:lov name="bank_account_num" bindTarget="hls_ccb_form_create_ds" prompt="银行账户"/>
                <a:textField name="bank_account_name" bindTarget="hls_ccb_form_create_ds" prompt="账户名"/>
                <a:textField name="bank_name" bindTarget="hls_ccb_form_create_ds" prompt="银行"/>
167 168
                <a:textField name="currency_name" bindTarget="hls_ccb_form_create_ds" prompt="币种"/>
                <a:comboBox name="pay_method_desc" bindTarget="hls_ccb_form_create_ds" prompt="支付方式"/>
Spencer Chang's avatar
Spencer Chang committed
169 170 171 172
            </a:fieldSet>
            <a:fieldSet title="合并规则" column="2">
                <a:radio name="merger_rules" bindTarget="hls_ccb_form_create_ds" layout="horizontal" width="600">
                    <a:items>
Darming's avatar
Darming committed
173 174 175 176 177
<!--                        <a:item label="按合同" value="CONTRACT"/>-->
<!--                        <a:item label="按期数" value="TIMES"/>-->
<!--                        <a:item label="不合并" value="NONE"/>-->
<!--                        <a:item label="不合并" value="NONE"/>-->
                        <a:item label="按客户" value="CUSTOMER"/>
Spencer Chang's avatar
Spencer Chang committed
178 179 180
                    </a:items>
                </a:radio>
            </a:fieldSet>
181 182 183 184
            <!--            <a:fieldSet title="筛选条件" column="2">-->
            <!--                <a:numberField name="payment_amount_from" bindTarget="hls_ccb_form_create_ds" prompt="付款金额从"/>-->
            <!--                <a:numberField name="payment_amount_to" bindTarget="hls_ccb_form_create_ds" prompt="付款金额到"/>-->
            <!--            </a:fieldSet>-->
Spencer Chang's avatar
Spencer Chang committed
185

186 187 188 189 190 191
            <!--            <a:grid id="hls_ccb_create_grid" bindTarget="hls_ccb_grid_create_ds" height="200" width="800" navBar="true">-->
            <!--                <a:columns>-->
            <!--                    <a:column name="num" align="left" prompt="序号" width="80"/>-->
            <!--                    <a:column name="detail" align="center" prompt="明细" renderer="batch_detail_renderer" width="100"/>-->
            <!--                </a:columns>-->
            <!--            </a:grid>-->
192
            <a:grid id="hls_ccb_ln_grid" bindTarget="hls_ccb_grid_ln_ds" height="420" width="880" navBar="true">
193 194 195
                <a:toolBar>
                    <a:button click="hls_ccb_merge_result" text="合并结果"/>
                </a:toolBar>
Spencer Chang's avatar
Spencer Chang committed
196
                <a:columns>
197 198 199 200 201 202 203 204 205 206
                    <a:column name="bp_tenant_name" prompt="客户名称" align="center"/>
                    <a:column name="contract_number" prompt="合同号" align="center"/>
                    <a:column name="times" prompt="期数" align="center"/>
                    <a:column name="due_date" prompt="应付日期" align="center" renderer="Leaf.formatDate"/>
                    <a:column name="cf_item_desc" prompt="现金流类型" align="center" footerRenderer="sumAmount"/>
                    <a:column name="due_amount" prompt="应收金额" align="right" renderer="Leaf.formatMoney"
                              footerRenderer="sumAmount"/>
                    <a:column name="manual_amount" prompt="扣款金额" align="right" renderer="Leaf.formatMoney"
                              footerRenderer="sumAmount"/>
                    <a:column name="description" prompt="备注" width="200"/>
Spencer Chang's avatar
Spencer Chang committed
207 208
                </a:columns>
            </a:grid>
209

210 211 212
<!--            <a:fieldSet title="应收日期" column="2">-->
<!--                <a:datePicker name="due_date" bindTarget="hls_ccb_form_create_ds" prompt="应收日期"/>-->
<!--            </a:fieldSet>-->
Spencer Chang's avatar
Spencer Chang committed
213 214 215
        </a:screenBody>
    </a:view>
</a:screen>