ds_abc_transaction_detail.lview 10.4 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2017年8月18日 上午10:05:22
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="basic.get_sys_default_time" rootPath="ds_abc_create_date_path"/>

    </a:init-procedure>
    <a:view>
        <a:link id="ccb503_temp_delete_link" model="ccb.CCB503.ds_abc_trans_update" modelaction="execute"/>
        <a:link id="update_abc_inteface_link" model="ccb.CCB503.ds_abc_trans_update" modelaction="update"/>
        <a:link id="create_abc_document_link"
                url="${/request/@context_path}/modules/ccb/CCB503/ds_abc_interface_export_txt.lsc"/>
        <a:link id="ccb503_err_message_link" model="ccb.CCB503.ds_abc_import_li" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
        function ds_abc_query() {
            $('ds_abc_detail_result_ds').query();
        }

        function ds_abc_trans_confirm() {
            $('ds_abc_trans_id').disable();
            var date_ds = $('trans_date_ds').getAt(0);
           /* var create_date = date_ds.get('create_date');*/
            var create_date_to = date_ds.get('create_date_to');
            Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('update_abc_inteface_link').getUrl(),
                para: {
                    // 'session_id': '${/session/@session_id}',
                    // 'user_id': '${/session/@user_id}',
                   /* 'create_date': create_date,*/
                    'create_date_to': create_date_to
                },
                success: function () {
                    $('ds_abc_trans_id').enable();
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                    ds_abc_query();
                },
                failure: function () {
                    $('ds_abc_trans_id').enable();
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                },
                error: function () {
                    $('ds_abc_trans_id').enable();
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                },
                scope: this
            });
        }


        function ds_abc_trans_create() {

            var records = $('ds_abc_detail_result_ds').getAll();
            if (records.length == 0) {
                Leaf.showMessage('${l:PROMPT}', '不存在待生成的数据!');
                return;
            }
            var param;
            $('create_id').disable();
            $('ds_abc_trans_id').disable();
            $('ds_abc_trans_save').disable();
            $('ds_abc_delete_id').disable();

            //ds_abc_trans_save();    //保存数据
            Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('ccb503_err_message_link').getUrl(),
                para: param,
                success: function (res) {
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                    var url = $('create_abc_document_link').getUrl();
                    window.open(url, '_self');
                   /* window.setTimeout(function () {
                        $('ds_abc_trans_link_winId').close();
                    }, 2000);*/
                },
                failure: function () {
                    $('create_id').enable();
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                },
                error: function () {
                    $('create_id').enable();
                    Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                },
                scope: this
            });

        }

        function ds_abc_trans_delete() {
            var ds = $('ds_abc_detail_result_ds');
            var records = ds.getSelected();
            if (records.length == 0) {
                Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350);
                return;
            }
            var param;
            for (var i = 0; i < records.length; i++) {
                param = {
                    'record_id': records[i].get('record_id')
                };
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: $('ccb503_temp_delete_link').getUrl(),
                    para: param,
                    success: function (res) {
                        Leaf.SideBar.show({
                            msg: '删除成功',
                            duration: 2000
                        });
                        Leaf.Masker.unmask(Ext.getBody());
                        ds_abc_query();
                    },
                    scope: this
                });
            }
        }

        //保存
        function ds_abc_trans_save() {

            var ds = $('ds_abc_detail_result_ds');
            var records = ds.getSelected();
            if (records.length == 0) {
                Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350);
                return;
            }
            var param;
            for (var i = 0; i < records.length; i++) {
                param = {
                    'contract_id': records[i].get('contract_id'),
                    'record_id':records[i].get('record_id'),
                    'cdd_list_id': records[i].get('cdd_list_id'),
                    'withhold_amount': records[i].get('withhold_amount')
                };
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/ccb.CCB503.ds_abc_trans_confirm/update',
                    para: param,
                    success: function (res) {
                        Leaf.SideBar.show({
                            msg: '修改成功',
                            duration: 2000
                        });
                        Leaf.Masker.unmask(Ext.getBody());
                        ds_abc_query();
                    },
                    scope: this
                });
            }
        }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="ds_abc_detail_result_ds" autoPageSize="true" autoQuery="true"
                       model="ccb.CCB503.ds_abc_trans_update" selectable="true">
                <a:fields>
                    <a:field name="error_message" readOnly="true"/>
                    <a:field name="withhold_amount" required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="trans_date_ds" autoCreate="true">
                <a:fields>
                    <a:field name="create_date" datatype="date"  defaultValue="${/model/ds_abc_create_date_path/record/@now_date}"
                             required="true"/>
                    <a:field name="create_date_to" datatype="date" defaultValue="${/model/ds_abc_create_date_path/record/@now_date}"
                             required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <!--  <a:gridButton click="ds_abc_query" text="HLS.QUERY"/> -->
                <a:gridButton id="ds_abc_delete_id" click="ds_abc_trans_delete" text="HLS.REMOVE"/>
                <a:gridButton id="ds_abc_trans_id" click="ds_abc_trans_confirm" text="重新生成"/>
                <a:gridButton id="ds_abc_trans_save" click="ds_abc_trans_save" text="保存"/>
                <a:gridButton id="create_id" click="ds_abc_trans_create" text="生成农行扣款文件"/>
            </a:screenTopToolbar>
            <!-- <a:form column="" title="HAP_QUERY_TITLE">
                <a:hBox labelWidth="100">
                    <a:textField name="" bindTarget="ds_abc_detail_query_ds" prompt="合同编号"/>
                    <a:textField name="" bindTarget="ds_abc_detail_query_ds" prompt="商业伙伴"/>
                </a:hBox>
            </a:form> -->
            <!--  <a:fieldSet column="1" height="60" title="代扣日期选择" width="500">
                <a:datePicker name="create_date" bindTarget="trans_date_ds" prompt="预定支付日到"/>
                <a:datePicker name="create_date_to" bindTarget="trans_date_ds" prompt="预定支付日到"/>
            </a:fieldSet> -->
            <a:form column="" title="扣款日期">
                <a:hBox labelWidth="100">
                   <!-- <a:datePicker name="create_date"  bindTarget="trans_date_ds"
                                  prompt="预定支付日从"/>-->
                    <a:datePicker name="create_date_to"  bindTarget="trans_date_ds"
                                  prompt="预定支付日到"/>
                </a:hBox>
            </a:form>
            <a:grid bindTarget="ds_abc_detail_result_ds" marginHeight="270" marginWidth="70" navBar="true">
                <a:columns>
                    <a:column name="error_message" editor="textAreaEditor" prompt="错误信息" width="180"/>
                    <a:column name="contract_number" align="left" prompt="合同编号"/>
                    <a:column name="bp_name" align="left" prompt="商业伙伴名称" width="150"/>
                    <a:column name="times" align="center" prompt="期数" width="80"/>
                    <a:column name="cf_item_n" align="left" prompt="代扣项目" width="80"/>
                    <a:column name="due_amount" align="right" prompt="应代扣金额" renderer="Leaf.formatMoney" width="130"/>
                    <a:column name="withhold_amount" align="right" prompt="本次代扣金额" editor="grid_nf"
                              renderer="Leaf.formatMoney" width="130"/>
                    <a:column name="currency_code" align="center" prompt="币种" width="80"/>
                    <a:column name="due_date" align="center" prompt="应收日期" width="120"/>
                    <a:column name="bank_account_num" align="left" prompt="银行账号" width="170"/>
                    <a:column name="bank_account_name" align="left" prompt="账号名称" width="170"/>
                </a:columns>
                <a:editors>
                    <a:textArea id="textAreaEditor" height="40" width="180"/>
                    <a:numberField id="grid_nf" allowDecimals="true" allowNegative="false" decimalPrecision ="2"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>