cashflow_req.lview 7.42 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lpc 9874
    $Date: 2017/11/20 14:35:56 $
    $Revision: 1.0 $
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[     
    ]]></a:init-procedure>
    <a:view>
        <a:link id="insert_cashflow_req_link" model="cont.CON355.cashflow_req" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
            function cashflow_req_add() {
                $('cashflow_req_grid').showEditorByRecord($('cashflow_req_ds').create());
            }
            
            function cashflow_req_close() {
                $('cashflow_req_id').close();
            }
            
            function cashflow_req_submit() {
                $('cashflow_req_ds').submit();
            }
            
            function cashflow_req_delete() {
               var ds = $('cashflow_req_ds');
                var records = ds.getSelected();
                if (records.length == 0) {
                    Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                    return;
                }
                Leaf.showConfirm('${l:HLS.PROMPT}', '是否删除现金流?', function() {
                    var datas = [];
                    for (var i = 0;i < records.length;i++) {
                        var obj = {};
                        obj['contract_id'] = records[i].get('contract_id');
                        obj['cashflow_id'] = records[i].get('cashflow_id');
                        obj['_status'] = 'delete';
                        datas[i] = obj;
                    }
                    Leaf.request({
                        url: $('insert_cashflow_req_link').getUrl(),
                        para: datas,
                        success: function() {
                            Leaf.SideBar.show({
                                msg: '操作成功',
                                duration: 2000
                            });
                            $('cashflow_req_ds').query();
                        },
                        scope: this
                    });
                });
            }
            
            function cashflow_req_cashflow() {
                var ds = $('cashflow_req_ds');
                var records = ds.getSelected();
                if (records.length == 0) {
                    Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                    return;
                }
                Leaf.showConfirm('${l:HLS.PROMPT}', '是否确定同步至现金流表?', function() {
                    var datas = [];
                    for (var i = 0;i < records.length;i++) {
                        var obj = {};
                        obj['contract_id'] = records[i].get('contract_id');
                        obj['cashflow_id'] = records[i].get('cashflow_id');
                        obj['_status'] = 'update';
                        datas[i] = obj;
                    }
                    Leaf.request({
                        url: $('insert_cashflow_req_link').getUrl(),
                        para: datas,
                        success: function() {
                            Leaf.SideBar.show({
                                msg: '操作成功',
                                duration: 2000
                            });
                            $('cashflow_req_ds').query();
                        },
                        scope: this
                    });
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="cf_direction_ds" lookupCode="CF_DIRECTION"/>
            <a:dataSet id="cf_status_ds" lookupCode="HLS005_CF_STATUS"/>
            <a:dataSet id="cashflow_req_ds" autoQuery="true" fetchAll="false" model="cont.CON355.con_contract_cashflow_req" pageSize="15" queryUrl="${/request/@context_path}/autocrud/cont.CON355.con_contract_cashflow_req/query?contract_id=${/parameter/@contract_id}" selectable="true" selectionModel="multiple">
                <a:fields>
                    <a:field name="contract_id" defaultValue="${/parameter/@contract_id}"/>
                    <a:field name="cf_direction" defaultValue="INFLOW"/>
                    <a:field name="cf_direction_n" defaultValue="收" displayField="code_value_name" options="cf_direction_ds" required="true" returnField="cf_direction" valueField="code_value"/>
                    <a:field name="cf_status" defaultValue="RELEASE"/>
                    <a:field name="cf_status_n" defaultValue="下达" displayField="code_value_name" options="cf_status_ds" returnField="cf_status" valueField="code_value"/>
                    <a:field name="cf_item_n" lovHeight="500" lovService="cont.CON355.hls_billing_method_cf_for_lov" lovWidth="550" prompt="现金流项目" required="true" title="现金流项目">
                        <a:mapping>
                            <a:map from="cf_item" to="cf_item"/>
                            <a:map from="description" to="cf_item_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="due_date"/>
                    <a:field name="due_amount"/>
                    <a:field name="write_off_flag" defaultValue="NOT"/>
                    <a:field name="write_off_flag_n" defaultValue="未核销"/>
                    <a:field name="insert_flag" defaultValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="cashflow_req_close" text="HLS.EXIT"/>
                <a:gridButton click="cashflow_req_add" text="HLS.NEW"/>
                <a:gridButton click="cashflow_req_delete" text="HLS.DELETE"/>
                <a:gridButton click="cashflow_req_submit" text="HLS.SAVE"/>
                <a:gridButton click="cashflow_req_cashflow" text="费用确认"/>
            </a:screenTopToolbar>
            <a:grid id="cashflow_req_grid" bindTarget="cashflow_req_ds" height="450" marginWidth="100" navBar="true">
                <!-- <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="save"/>
                </a:toolBar> -->
                <a:columns>
                    <a:column name="cf_direction_n" align="center" prompt="收/付" width="150"/>
                    <a:column name="cf_status_n" align="center" prompt="现金流状态" width="150"/>
                    <a:column name="cf_item_n" align="center" editor="cashflow_req_lov" prompt="现金流项目" width="200"/>
                    <a:column name="due_date" align="center" editor="cashflow_req_dp" prompt="支付日" renderer="Leaf.formatDate" width="150"/>
                    <a:column name="due_amount" align="center" editor="cashflow_req_nf" prompt="应收金额" renderer="Leaf.formatMoney" width="200"/>
                    <a:column name="write_off_flag_n" align="center" prompt="核销标志" width="200"/>
                </a:columns>
                <a:editors>
                    <a:lov id="cashflow_req_lov"/>
                    <a:datePicker id="cashflow_req_dp"/>
                    <a:numberField id="cashflow_req_nf"/>
                    <a:textField id="cashflow_req_tf"/>
                    <a:checkBox id="cashflow_req_cb"/>
                    <a:comboBox id="cashflow_req_combox"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>