csh_agricultural_bank_check.lview 20 KB
Newer Older
陆正友's avatar
陆正友 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
<?xml version="1.0" encoding="UTF-8"?>

<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true"
          dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.role_id=${/session/@role_id}" fetchAll="true"
                       model="csh.CSH1400.csh_abc_query_role_code" rootPath="role_code"/>
    </a:init-procedure>

    <a:view>
        <a:link id="agricultural_bank_import_link"
                url="${/request/@context_path}/modules/csh/CSH1400/agricultural_bank_import.lview"/>
        <a:link id="csh_abc_import_save_link"
                url="${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_save.lsc"/>
        <a:link id="csh_abc_import_transaction_link"
                url="${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_transaction.lsc"/>
        <script type="text/javascript"><![CDATA[
        Leaf.onReady(function () {
            //只开放按钮权限给债权内勤
            var role_code = '${/model/role_code/record/@role_code}';
            if (role_code == '0009') {
                $('agricultural_bank_save_id').enable(); // 启用按钮
                $('agricultural_bank_import_id').enable(); // 启用按钮
                $('agricultural_bank_submit_id').enable(); // 启用按钮
            } else {
                $('agricultural_bank_save_id').disable(); // 禁用按钮
                $('agricultural_bank_import_id').disable(); // 禁用按钮
                $('agricultural_bank_submit_id').disable(); // 禁用按钮
            }
        });

        function returnAbc() {
            // 刷新页面
            $("OcrQueryDs").query();
            $("AbcBankDs").query();
        }
        function returnBack() {
            // 刷新页面
            top.refreshFrame();
        }

        //查询按钮
        function agricultural_bank_query() {
            $("OcrQueryDs").query();
            $("AbcBankDs").query();
        }
陆正友's avatar
陆正友 committed
47

48 49 50 51
        // var record = $('OcrQueryDs').getSelected();

        // var record = $('AbcBankDs').getSelected();

陆正友's avatar
陆正友 committed
52 53 54 55 56 57 58
        function change_background_color(record) {
            if (record.get('re_flag') == 'Y') {
                return 'background-color:#DC143C;'
            }
        }
        // 字段渲染农行回单
        function checkOcrRender(value, record, name) {
陆正友's avatar
陆正友 committed
59
            if (record.get('re_flag') == 'Y' && !Ext.isEmpty(value)) {
陆正友's avatar
陆正友 committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
                var name_r = name + '_r';
                var value_r = record.get(name_r);//OCR数据
                if (value != value_r) {
                    if (name == 'total_amount') {
                        return '<font color="yellow">' + Leaf.formatMoney(value) + '</font>'
                    } else if (name == 'bank_receipt_date') {
                        return '<font color="yellow">' + Leaf.formatDate(value) + '</font>'
                    } else {
                        return '<font color="yellow">' + value + '</font>'
                    }
                } else {
                    if (name == 'total_amount') {
                        return '<font color="black">' + Leaf.formatMoney(value) + '</font>'
                    } else if (name == 'bank_receipt_date') {
                        return '<font color="black">' + Leaf.formatDate(value) + '</font>'
                    } else {
                        return '<font color="black">' + value + '</font>'
                    }
                }
            } else {
陆正友's avatar
陆正友 committed
80 81 82 83 84 85 86 87
                if (!Ext.isEmpty(value)) {
                    if (name == 'total_amount') {
                        return '<font color="black">' + Leaf.formatMoney(value) + '</font>'
                    } else if (name == 'bank_receipt_date') {
                        return '<font color="black">' + Leaf.formatDate(value) + '</font>'
                    } else {
                        return '<font color="black">' + value + '</font>'
                    }
陆正友's avatar
陆正友 committed
88 89 90 91 92 93
                }
            }
        }

        // 保存按钮
        function agricultural_bank_save() {
94
            var orc_save = $('AbcBankDs').getAll();
陆正友's avatar
陆正友 committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
            var param = {};
            var saveOrc = [];
                for (var i = 0; i < orc_save.length; i++) {
                    var lineOrc = {};
                    lineOrc['receipt_no'] = orc_save[i].get('receipt_no');
                    lineOrc['import_itfc_id'] = orc_save[i].get('import_itfc_id');
                    lineOrc['paid_byother_flag_desc'] = orc_save[i].get('paid_byother_flag_desc');
                    lineOrc['payer_name'] = orc_save[i].get('payer_name');
                    lineOrc['collection_classes_desc'] = orc_save[i].get('collection_classes_desc');
                    lineOrc['guarantor_name_duty'] = orc_save[i].get('guarantor_name_duty');
                    lineOrc['bank_receipt_date'] = orc_save[i].get('bank_receipt_date');
                    lineOrc['bank_num'] = orc_save[i].get('bank_num');
                    lineOrc['payer_number'] = orc_save[i].get('payer_number');
                    lineOrc['bank_name'] = orc_save[i].get('bank_name');
                    lineOrc['beneficiary_name'] = orc_save[i].get('beneficiary_name');
                    lineOrc['total_amount'] = orc_save[i].get('total_amount');
111
                    lineOrc['bp_id'] = orc_save[i].get('bp_id');
陆正友's avatar
陆正友 committed
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
                    saveOrc.push(lineOrc);
                }
                param['AbcOrc'] = saveOrc;
                Leaf.request({
                    url: $('csh_abc_import_save_link').getUrl(),
                    para: {
                        param: param
                    },
                    success: function () {
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        returnAbc();
                    },
                    scope: this
                });
129
            // }
陆正友's avatar
陆正友 committed
130
        }
陆正友's avatar
陆正友 committed
131

陆正友's avatar
陆正友 committed
132 133

        // 提交按钮
134
        function agricultural_bank_submit() {
陆正友's avatar
陆正友 committed
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
            var orc_save = $('AbcBankDs').getSelected();
            var abc_save = $('OcrQueryDs').getSelected();
            var param = {};
            var saveOrc = [];
            if (orc_save.length <= 0) {
                Leaf.showMessage('提示', '请至少选择一条数据!');
            } else {
                for (var i = 0; i < orc_save.length; i++) {
                    var lineOrc = {};
                    lineOrc['write_off_flag'] = 'DISABLED';
                    lineOrc['exchange_rate'] = '1';
                    lineOrc['currency_code'] = 'CNY';
                    lineOrc['receipt_type'] = 'IMPORT';
                    lineOrc['_status'] = 'insert';
                    lineOrc['bank_account_num'] = orc_save[i].get('bank_num');//收款账号
                    lineOrc['bank_slip_num'] = orc_save[i].get('receipt_no');//银行流水号
                    lineOrc['transaction_amount'] = orc_save[i].get('total_amount');//交易金额
                    lineOrc['bank_receipt_date'] = orc_save[i].get('bank_receipt_date');//交易时间
                    lineOrc['bp_bank_account_num'] = orc_save[i].get('payer_number');//付款账号
                    lineOrc['bp_bank_account_name'] = orc_save[i].get('payer_name');//付款人
                    lineOrc['opposite_band_na'] = orc_save[i].get('bank_name');//付款开户银行
                    lineOrc['description'] = orc_save[i].get('zy');//摘要
                    lineOrc['ref_v05'] = orc_save[i].get('remark');//附言
                    lineOrc['bp_name'] = orc_save[i].get('beneficiary_name');//收款人
                    lineOrc['paid_byother_flag_desc'] = orc_save[i].get('paid_byother_flag_desc');//是否代付
                    lineOrc['guarantor_name_duty'] = orc_save[i].get('guarantor_name_duty');//担保人承担义务
                    lineOrc['collection_classes_desc'] = orc_save[i].get('collection_classes_desc');//款项分类
                    lineOrc['extra_nam'] = orc_save[i].get('extra_nam');//代理店简称
                    lineOrc['bank_account_id'] = orc_save[i].get('bank_account_id');//id
                    lineOrc['bp_id'] = orc_save[i].get('bp_id');//id
陆正友's avatar
陆正友 committed
165
                    lineOrc['bp_category'] = orc_save[i].get('bp_category');
陆正友's avatar
陆正友 committed
166
                    saveOrc.push(lineOrc);
陆正友's avatar
陆正友 committed
167
                    recode = orc_save[i];
陆正友's avatar
陆正友 committed
168 169
                }
                param['AbcOrc'] = saveOrc;
170 171
                if(recode.get('re_flag')=='N'){
                    Leaf.showConfirm('特别注意', '日志号, <font color="red">'+recode.get('receipt_no')+'</font>,的单据未匹配到对应回单数据,是否确认提交?', function () {
陆正友's avatar
陆正友 committed
172 173 174 175 176 177 178 179 180 181 182 183
                        Leaf.request({
                            url: $('csh_abc_import_transaction_link').getUrl(),
                            para: {
                                param: param
                            },
                            success: function () {
                                Leaf.SideBar.show({
                                    msg: '${l:HLS.SUBMIT_SUCCESS}',
                                    duration: 2000
                                });
                                $('AbcBankDs').query();
                                $("OcrQueryDs").query();
陆正友's avatar
陆正友 committed
184
                                returnBack();
陆正友's avatar
陆正友 committed
185 186
                            },
                            scope: this
陆正友's avatar
陆正友 committed
187
                        });
陆正友's avatar
陆正友 committed
188
                    });
189
                }else {
陆正友's avatar
陆正友 committed
190 191 192 193 194 195 196 197 198 199 200 201
                    Leaf.request({
                        url: $('csh_abc_import_transaction_link').getUrl(),
                        para: {
                            param: param
                        },
                        success: function () {
                            Leaf.SideBar.show({
                                msg: '${l:HLS.SUBMIT_SUCCESS}',
                                duration: 2000
                            });
                            $('AbcBankDs').query();
                            $("OcrQueryDs").query();
陆正友's avatar
陆正友 committed
202
                            returnBack();
陆正友's avatar
陆正友 committed
203 204 205 206
                        },
                        scope: this
                    });
                }
207

陆正友's avatar
陆正友 committed
208
            }
209

陆正友's avatar
陆正友 committed
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
            if (abc_save.length > 0) {
                Leaf.showMessage('提示', '农行回单OCR页面的单据无法提交!');
            }
        }

        //明细上传按钮
        function agricultural_bank_import() {
            new Leaf.Window({
                id: 'agricultural_bank_import_wind',
                params: {
                    winid: 'agricultural_bank_import_wind',
                },
                url: $('agricultural_bank_import_link').getUrl(),
                title: '农行回单',
                width: 430,
                height: 390
            });
227 228 229 230 231 232
            // win.on('close', function () {
            //     debugger
            //     var createWin = $('agricultural_bank_import');
            //     createWin.close();
            //     returnAbc();
            // });
陆正友's avatar
陆正友 committed
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
        }


        ]]></script>


        <a:dataSets>
            <!--                        是否代付、担保人履行担保义务下拉框-->
            <a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
            <!--                        款项分类下拉框-->
            <a:dataSet id="collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>

            <a:dataSet id="query_time">
            </a:dataSet>
            <a:dataSet id="OcrQueryDs" autoQuery="true" autoPageSize="true" queryDataSet="query_time"
                       model="csh.CSH1400.csh_ocr_abc_bank"
                       queryUrl="${/request/@context_path}/autocrud/csh.CSH1400.csh_ocr_abc_bank/query"
                       selectable="true">
            </a:dataSet>

            <a:dataSet id="AbcBankDs" autoQuery="true" autoPageSize="true" queryDataSet="query_time"
                       model="csh.CSH1400.csh_import_abc_bank"
                       queryUrl="${/request/@context_path}/autocrud/csh.CSH1400.csh_import_abc_bank/query"
                       selectable="true">
                <a:fields>
                    <!--                    是否代付-->
                    <a:field name="paid_byother_flag_desc" required="true" options="yes_no_ds"
                             returnField="paid_byother_flag" displayField="code_value_name" valueField="code_value"/>
                    <a:field name="paid_byother_flag" required="true"/>
                    <!--                    担保人履行担保义务-->
                    <a:field name="guarantor_name_duty" options="yes_no_ds"
                             returnField="paid_byother_flag" displayField="code_value_name" valueField="code_value"/>
                    <a:field name="paid_byother_flag"/>
                    <!--                    款项分类-->
                    <a:field name="collection_classes_desc" required="true" options="collection_classes_ds"
                             displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
                    <a:field name="collection_classes"/>

271
                    <a:field name="beneficiary_name"  lovGridHeight="350" lovHeight="500" lovLabelWidth="90"
陆正友's avatar
陆正友 committed
272 273 274
                             lovService="basic.hls_bp_master_v_for_agent_lov" lovWidth="550" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_name" to="beneficiary_name"/>
275 276
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="extra_nam" to="extra_nam"/>
38823's avatar
38823 committed
277
                            <a:map from="bp_category" to="bp_category"/>
陆正友's avatar
陆正友 committed
278 279
                        </a:mapping>
                    </a:field>
陆正友's avatar
陆正友 committed
280

281

陆正友's avatar
陆正友 committed
282 283 284 285 286 287 288 289 290 291 292
                </a:fields>

            </a:dataSet>

        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton id="Ocr_Bank_Query" click="agricultural_bank_query" text="HLS.QUERY"/>
                <a:gridButton id="agricultural_bank_save_id" click="agricultural_bank_save" text="保存"/>
陆正友's avatar
陆正友 committed
293
                <a:gridButton id="agricultural_bank_import_id" click="agricultural_bank_import" text="收款导入"/>
陆正友's avatar
陆正友 committed
294 295 296
                <a:gridButton id="agricultural_bank_submit_id" click="agricultural_bank_submit" text="提交"/>
            </a:screenTopToolbar>

陆正友's avatar
陆正友 committed
297
            <a:form column="4" title="查询条件">
陆正友's avatar
陆正友 committed
298 299 300 301
                <a:datePicker name="exchange_hour_from" bindTarget="query_time" prompt="交易时间从"
                              renderer="Leaf.formatDate"/>
                <a:datePicker name="exchange_hour_to" bindTarget="query_time" prompt="交易时间到"
                              renderer="Leaf.formatDate"/>
陆正友's avatar
陆正友 committed
302
                <a:numberField name="money_from" bindTarget="query_time" prompt="交易金额从"
陆正友's avatar
陆正友 committed
303
                               renderer="Leaf.formatMoney"/>
陆正友's avatar
陆正友 committed
304
                <a:numberField name="money_to" bindTarget="query_time" prompt="交易金额到"
陆正友's avatar
陆正友 committed
305
                               renderer="Leaf.formatMoney"/>
陆正友's avatar
陆正友 committed
306 307 308 309 310 311
            </a:form>

            <a:tabPanel marginHeight="220" marginWidth="50">
                <a:tabs>

                    <a:tab prompt="OCR数据" width="110">
312
                        <a:grid id="ocr" bindTarget="OcrQueryDs" marginHeight="200" marginWidth="80" navBar="true" rowRenderer="change_background_color">
陆正友's avatar
陆正友 committed
313
                            <a:columns>
314
                                <a:column name="bank_num" prompt="收款账号" width="150" align="center" renderer="checkOcrRender"/>
陆正友's avatar
陆正友 committed
315 316 317
                                <a:column name="bank_receipt_date" prompt="交易时间" width="100" align="center"
                                          renderer="checkOcrRender"/>
                                <a:column name="receipt_no" prompt="回单编号" width="80" align="left"/>
318 319
                                <a:column name="payer_number" prompt="付款方账号" width="100" align="center" renderer="checkOcrRender"/>
                                <a:column name="payer_name" prompt="付款方户名" width="100" align="left" renderer="checkOcrRender"/>
38823's avatar
38823 committed
320
                                <a:column name="payer_bank" prompt="付款方开户行" width="100" align="left"/>
陆正友's avatar
陆正友 committed
321 322
                                <a:column name="bp_name" prompt="收款对象" width="100" align="left"/>
                                <a:column name="paid_byother_flag_desc" prompt="是否代付" width="70" align="center"/>
323
                                <a:column name="total_amount" prompt="金额" width="100" align="right" renderer="checkOcrRender"/>
陆正友's avatar
陆正友 committed
324 325 326 327 328 329 330 331 332
                                <a:column name="zy" prompt="摘要" width="80" align="center"/>
                                <a:column name="collection_classes_desc" prompt="款项分类" width="90" align="center"/>
                                <a:column name="remark" prompt="附言" width="80" align="center"/>
                                <a:column name="extra_nam" prompt="代理店简称" width="100" align="center"/>
                                <a:column name="guarantor_name_duty" prompt="担保人履行担保义务" width="145"
                                          align="center"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>
333
                    <a:tab prompt="农行导入" width="110">
陆正友's avatar
陆正友 committed
334 335 336
                        <a:grid id="abc_bank" bindTarget="AbcBankDs" marginHeight="200" marginWidth="80"
                                rowRenderer="change_background_color" navBar="true">
                            <a:columns>
337
                                <a:column name="bank_num" prompt="账号" width="150"  align="center"
陆正友's avatar
陆正友 committed
338
                                          renderer="checkOcrRender"/>
陆正友's avatar
陆正友 committed
339
                                <a:column name="bank_receipt_date" prompt="交易时间" width="100"
陆正友's avatar
陆正友 committed
340
                                          renderer="checkOcrRender" align="center"/>
341 342 343
                                <a:column name="receipt_no" prompt="日志号" width="80"  align="left"/>
                                <a:column name="payer_number" prompt="对方账号" width="100"  align="center" renderer="checkOcrRender"/>
                                <a:column name="payer_name" prompt="对方账号户名" width="100"  align="left"
陆正友's avatar
陆正友 committed
344
                                          renderer="checkOcrRender"/>
38823's avatar
38823 committed
345
                                <a:column name="bank_name" prompt="对方银行名称" width="100"  align="left"/>
346
                                <a:column name="beneficiary_name" prompt="收款对象" width="100" editor="grid_lov" align="left" required="true"/>
陆正友's avatar
陆正友 committed
347 348 349
                                <a:column name="paid_byother_flag_desc" prompt="是否代付" width="70" editor="grid_cb"
                                          required="true"
                                          align="center"/>
350
                                <a:column name="total_amount" prompt="收款金额" width="100"  align="right"
陆正友's avatar
陆正友 committed
351
                                          renderer="checkOcrRender"/>
352
                                <a:column name="zy" prompt="摘要" width="80"  align="center"/>
陆正友's avatar
陆正友 committed
353 354 355 356 357
                                <a:column name="collection_classes_desc" prompt="款项分类" width="90" editor="grid_cb"
                                          required="true"
                                          align="center"/>
                                <a:column name="remark" prompt="附言" width="80" align="center" readonly="true"/>
                                <a:column name="extra_nam" prompt="代理店简称" width="100" align="center" readonly="true"/>
陆正友's avatar
陆正友 committed
358
                                <a:column name="guarantor_name_duty" prompt="担保人履行担保义务" width="145"
陆正友's avatar
陆正友 committed
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
                                          align="center"/>
                            </a:columns>
                            <a:editors>
                                <a:textField id="txt"/>
                                <a:comboBox id="grid_cb"/>
                                <a:lov id="grid_lov"/>
                                <a:datePicker id="grid_date"/>
                            </a:editors>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
    </a:view>
</a:screen>