acr_invoice_apply_query.lview 9.68 KB
Newer Older
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-7-15 下午04:39:15  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:view>
10 11 12 13 14 15 16 17
        <a:link id="acr_invoice_apply_detail_link"
                url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_apply_detail.lview"/>
        <a:link id="acr_invoice_apply_detail_readonly_link"
                url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_apply_detail_wfl.lview"/>
        <a:link id="acr610_invoice_apply_status_change" model="acr.ACR610.acr_invoice_apply_query"
                modelaction="delete"/>
        <a:link id="acr_invoice_finish_print_link_id"
                url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
18 19 20 21 22 23 24
        <script><![CDATA[

        function lock_current_window() {
            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
        }

        function unlock_current_window() {
liyuan.chen's avatar
liyuan.chen committed
25
            Leaf.Masker.unmask(Ext.getBody(), '${l:HLS.EXECUTING}');
26 27
        }

liyuan.chen's avatar
liyuan.chen committed
28 29
        function acr610_invoice_query() {
            $('acr610_invoice_result_ds').query();
30 31
        }

liyuan.chen's avatar
liyuan.chen committed
32 33
        function acr610_invoice_reset() {
            $('acr610_invoice_apply_query_ds').reset();
34 35
        }

liyuan.chen's avatar
liyuan.chen committed
36 37 38 39 40 41 42 43 44 45
        function acr610_grid_update(url) {
            var win = new Leaf.Window({
                id: 'acr_invoice_apply_detail_link_winid',
                params: {
                    winId: 'acr_invoice_apply_detail_link_winid'
                },
                url: url,
                title: '申请明细',
                fullScreen: true
            });
46
            win.on('close', function () {
liyuan.chen's avatar
liyuan.chen committed
47 48
                $('acr610_invoice_result_ds').query();
            });
49 50
        }

liyuan.chen's avatar
liyuan.chen committed
51 52 53
        function acr610_apply_num_render(value, record, name) {
            if (name == 'invoice_apply_num') {
                if (record.get('wfl_apply_status') == 'NEW') {
54
                    url = $('acr_invoice_apply_detail_link').getUrl() + '?invoice_apply_id=' + record.get('invoice_apply_id') + '&invoice_apply_num=' + record.get('invoice_apply_num') + '&invoice_apply_user_n=' + record.get('invoice_apply_user_n') + '&invoice_apply_date=' + record.get('invoice_apply_date');
55
                } else {
liyuan.chen's avatar
liyuan.chen committed
56
                    url = $('acr_invoice_apply_detail_readonly_link').getUrl() + '?invoice_apply_id=' + record.get('invoice_apply_id') + '&invoice_apply_num=' + record.get('invoice_apply_num') + '&invoice_apply_user_n=' + record.get('invoice_apply_user_n') + '&invoice_apply_date=' + record.get('invoice_apply_date') + '&button_flag=YES';
57
                }
liyuan.chen's avatar
liyuan.chen committed
58
                return '<a href="javascript:acr610_grid_update(\'' + url + '\');">' + value + '</a>';
59 60 61
            }
        }

liyuan.chen's avatar
liyuan.chen committed
62
        function acr610_formatMoney(value, record, name) {
niminmin's avatar
niminmin committed
63
            return Leaf.formatMoney(value);
64 65
        }

liyuan.chen's avatar
liyuan.chen committed
66 67 68 69 70
        function acr610_invoice_cancel() {
            var records = $('acr610_invoice_result_ds').getSelected();
            if (records.length == 0) {
                $L.showInfoMessage('提示', '请至少选择一条数据!');
                return;
71
            }
liyuan.chen's avatar
liyuan.chen committed
72
            var record = records[0];
73
            if (record.get('wfl_apply_status') != 'NEW') {
liyuan.chen's avatar
liyuan.chen committed
74
                $L.showInfoMessage('提示', '仅新建状态的申请单据可以取消!');
75 76 77
                return;
            }

liyuan.chen's avatar
liyuan.chen committed
78
            Leaf.showConfirm('提示', "确认执行该操作?", function () {
79 80
                lock_current_window();
                Leaf.request({
liyuan.chen's avatar
liyuan.chen committed
81 82
                    url: $('acr610_invoice_apply_status_change').getUrl(),
                    para: record.data,
83
                    success: function () {
liyuan.chen's avatar
liyuan.chen committed
84
                        unlock_current_window();
85
                        Leaf.SideBar.show({
liyuan.chen's avatar
liyuan.chen committed
86 87
                            msg: '操作成功',
                            duration: 2000
88
                        });
liyuan.chen's avatar
liyuan.chen committed
89
                        $('acr610_invoice_result_ds').query();
90 91 92 93 94 95
                    },
                    error: function () {
                        unlock_current_window();
                    },
                    scope: this
                });
liyuan.chen's avatar
liyuan.chen committed
96 97 98
            }, function () {
                unlock_current_window();

99 100 101
            });
        }

liyuan.chen's avatar
liyuan.chen committed
102
        function acr610_invoice_result_select(ds, record, bp_seq) {
103
            if (record.get('wfl_apply_status') != 'NEW') {
liyuan.chen's avatar
liyuan.chen committed
104
                document.getElementById("acr610_invoice_cancel_id").style.display = "none";
105
            } else {
liyuan.chen's avatar
liyuan.chen committed
106
                document.getElementById("acr610_invoice_cancel_id").style.display = "";
107
            }
108
            if (record.get('wfl_apply_status') == 'CANCEL') {
liyuan.chen's avatar
liyuan.chen committed
109
                document.getElementById("acr610_invoice_print_id").style.display = "none";
110
            } else {
liyuan.chen's avatar
liyuan.chen committed
111
                document.getElementById("acr610_invoice_print_id").style.display = "";
112
            }
liyuan.chen's avatar
liyuan.chen committed
113

114 115
        }

116
        function acr610_invoice_print() {
liyuan.chen's avatar
liyuan.chen committed
117 118 119 120 121
            var record = $('acr610_invoice_result_ds').getSelected()[0];
            var document_id = record.get('invoice_apply_id');
            var url_l = $('acr_invoice_finish_print_link_id').getUrl() + '?document_id=' + document_id + '&document_table=ACR_INVOICE_APPLY&batch_flag=Y&source_type=COMMON';
            var OpenWindow = window.open(href = url_l, target = "_blank");
        }
122

123 124 125
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
liyuan.chen's avatar
liyuan.chen committed
126 127
            <a:dataSet id="acr610_invoice_apply_status_ds" lookupCode="WFL_STATUS"/>
            <a:dataSet id="acr610_invoice_apply_query_ds">
128
                <a:fields>
liyuan.chen's avatar
liyuan.chen committed
129 130 131
                    <a:field name="invoice_apply_num"/>
                    <a:field name="invoice_apply_date"/>
                    <a:field name="invoice_apply_user_n" lovGridHeight="320" lovHeight="500"
132 133
                             lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
                        <a:mapping>
liyuan.chen's avatar
liyuan.chen committed
134 135
                            <a:map from="user_id" to="invoice_apply_user"/>
                            <a:map from="description" to="invoice_apply_user_n"/>
136 137
                        </a:mapping>
                    </a:field>
liyuan.chen's avatar
liyuan.chen committed
138
                    <a:field name="invoice_apply_user"/>
139 140
                    <a:field name="wfl_apply_status_n" displayField="code_value_name"
                             options="acr610_invoice_apply_status_ds"
liyuan.chen's avatar
liyuan.chen committed
141
                             returnField="wfl_apply_status" valueField="code_value"/>
142
                </a:fields>
liyuan.chen's avatar
liyuan.chen committed
143 144
            </a:dataSet>
            <a:dataSet id="acr610_invoice_result_ds" autoPageSize="true" autoQuery="true"
145 146 147
                       model="acr.ACR610.acr_invoice_apply_query"
                       queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_query/query?apply_mode=APPLY"
                       queryDataSet="acr610_invoice_apply_query_ds"
liyuan.chen's avatar
liyuan.chen committed
148
                       selectable="true" selectionModel="single">
149
                <a:events>
liyuan.chen's avatar
liyuan.chen committed
150
                    <a:event name="select" handler="acr610_invoice_result_select"/>
151 152 153 154 155 156
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
liyuan.chen's avatar
liyuan.chen committed
157 158 159 160
                <a:toolbarButton click="acr610_invoice_reset" text="HLS.RESET"/>
                <a:toolbarButton click="acr610_invoice_query" text="HLS.QUERY"/>
                <a:toolbarButton id="acr610_invoice_print_id" click="acr610_invoice_print" text="HLS.PRINT"/>
                <a:toolbarButton id="acr610_invoice_cancel_id" click="acr610_invoice_cancel" text="取消申请"/>
161
            </a:screenTopToolbar>
liyuan.chen's avatar
liyuan.chen committed
162
            <a:form marginWidth="200" padding="0" title="销项发票申请">
163
                <a:hBox labelSeparator=" ">
164 165 166 167 168 169 170 171
                    <a:textField name="invoice_apply_num" bindTarget="acr610_invoice_apply_query_ds" prompt="申请编号"
                                 width="135"/>
                    <a:datePicker name="invoice_apply_date" bindTarget="acr610_invoice_apply_query_ds" prompt="申请时间"
                                  width="135"/>
                    <a:lov name="invoice_apply_user_n" bindTarget="acr610_invoice_apply_query_ds" prompt="申请人"
                           width="135"/>
                    <a:comboBox name="wfl_apply_status_n" bindTarget="acr610_invoice_apply_query_ds" prompt="申请状态"
                                width="135"/>
172 173
                </a:hBox>
            </a:form>
174 175
            <a:grid id="acr610_invoice_update_grid_ds" bindTarget="acr610_invoice_result_ds" marginHeight="135"
                    marginWidth="30" navBar="true">
176
                <a:columns>
177 178
                    <a:column name="invoice_apply_num" lock="true" prompt="申请编号" renderer="acr610_apply_num_render"
                              align="center" width="150"/>
liyuan.chen's avatar
liyuan.chen committed
179 180
                    <a:column name="invoice_apply_date" prompt="申请日期" align="center" width="100"/>
                    <a:column name="invoice_apply_user_n" prompt="申请人" align="center" width="100"/>
181 182 183 184
                    <a:column name="total_amount" prompt="开票总金额" align="right" renderer="acr610_formatMoney"
                              width="100"/>
                    <a:column name="net_amount" prompt="不含税总金额" align="right" renderer="acr610_formatMoney"
                              width="100"/>
liyuan.chen's avatar
liyuan.chen committed
185
                    <a:column name="tax_amount" prompt="税额总金额" align="right" renderer="acr610_formatMoney" width="150"/>
186
					<a:column name="invoice_kind_type_n" prompt="发票种类" align="center" width="150"/>
liyuan.chen's avatar
liyuan.chen committed
187
                    <a:column name="wfl_apply_status_n" prompt="申请状态" align="center" width="150"/>
188 189 190 191 192
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>