acr_invoice_claim_confirm.lview 17.5 KB
Newer Older
1 2 3 4 5 6
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure>

    </a:init-procedure>
    <a:view>
7 8
        <a:link id="bmLink_acr_invoice_return" model="acr.ACR605.acr_invoice_claim_return" modelaction="update"/>
        <a:link id="bmLink_acr_invoice_claim_confirm" model="acr.ACR605.acr_invoice_claim_confirm" modelaction="update"/>
9
        <a:link id="acr_invoice_refuse_link_id" model="acr.ACR605.acr_invoice_claim_return" modelaction="batch_update"/>
10 11
        <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
12
        <a:link id="acr517_invoice_send_to_email_link" url="${/request/@context_path}/modules/acr/ACR516/import_invoice_to_email.lsc"/>
13

14
        <script type="text/javascript"><![CDATA[
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

        function document_number_render(value,record,name)
        {
            if (name == 'document_number' && value) {
                return '<a href="javascript:open_document_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
            }
            return value;
        }
        function open_document_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'ACR513';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'UPDATE';
            param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
        }

33 34 35 36 37 38 39 40 41
        function acr517_invoice_query() {
            $('acr517_invoice_result_ds').query();
        }

        function acr517_invoice_reset() {
            $('acr517_invoice_query_ds').reset();
        }

        function acr517_invoice_confirm() {
42 43
          //  var records = $('acr517_invoice_result_ds').getSelected();

stone's avatar
stone committed
44 45
            // $('acr517_invoice_result_ds').setSubmitUrl('${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update');
            var records=$('acr517_invoice_result_ds').getSelected();
46
            debugger;
stone's avatar
stone committed
47
            var datas = [];
48
            var r_map = new Map();
stone's avatar
stone committed
49 50 51 52 53
            for (var i = 0;i < records.length;i++) {
                datas.push({
                    'invoice_hd_id':records[i].get('invoice_hd_id'),
                    '_status': 'update'
                })
54 55 56 57 58 59 60 61 62
                if(records[i].get('division') == '70'){
                    if(!r_map.has(records[i].get('bp_id_agent_level1'))){
                        var arr = new Array();
                        arr.add(records[i].get('invoice_hd_id'));
                        r_map.set(records[i].get('bp_id_agent_level1'),arr);
                    }else{
                        r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id'));
                    }
                } else if(records[i].get('invoice_type') == 'ECT'){
63 64 65 66 67 68 69 70
                    if(!r_map.has(records[i].get('invoice_bp_id'))){
                        var arr = new Array();
                        arr.add(records[i].get('invoice_hd_id'));
                        r_map.set(records[i].get('invoice_bp_id'),arr);
                    }else{
                        r_map.get(records[i].get('invoice_bp_id')).add(records[i].get('invoice_hd_id'));
                    }
                }
stone's avatar
stone committed
71
            }
72
            var result_map = MapTOJson(r_map);
stone's avatar
stone committed
73 74 75 76 77
            $L.showConfirm("提示",'确认执行该操作?',function(){
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update',
                    para: datas,
                    success: function () {
78 79 80 81 82 83
                        Leaf.request({
                            url: $('acr517_invoice_send_to_email_link').getUrl(),
                            para: {
                                result_map : result_map
                            }
                        });
stone's avatar
stone committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
                        Leaf.SideBar.show({
                            msg: '操作成功',
                            duration: 2000
                        });
                        $('acr517_invoice_result_ds').query();
                    },
                    failure: function () {
                        Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function () {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
99 100
            })

101 102
            // alert(record.get('invoice_hd_id'));
            // debugger;
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
           // var invoice_hd_id = record.get('invoice_hd_id');
            // Leaf.request({
            //     url: $("bmLink_acr_invoice_claim_confirm").getUrl(),
            //     para: {
            //         invoice_hd_id:invoice_hd_id
            //     },
            //     success:function(){
            //         $('acr517_invoice_result_ds').query();
            //         Leaf.SideBar.show({
            //             msg: '操作成功',
            //             duration: 2000
            //         });
            //     },
            //     sync:true,
            //     scope: this
            // });
119 120
        }

121
        function acr517_invoice_return() {
stone's avatar
stone committed
122 123 124 125 126 127 128
            var records=$('acr517_invoice_result_ds').getSelected();
            var datas = [];
            for (var i = 0;i < records.length;i++) {
                datas.push({
                    'invoice_hd_id':records[i].get('invoice_hd_id'),
                    '_status': 'update'
                })
129

stone's avatar
stone committed
130 131
            }
            $L.showConfirm("提示",'确认执行该操作?',function(){
132
                Leaf.Masker.mask(Ext.getBody(),'正在操作...');
stone's avatar
stone committed
133 134 135 136
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_return/batch_update',
                    para: datas,
                    success: function () {
137
                        Leaf.Masker.unmask(Ext.getBody());
stone's avatar
stone committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
                        Leaf.SideBar.show({
                            msg: '操作成功',
                            duration: 2000
                        });
                        $('acr517_invoice_result_ds').query();
                    },
                    failure: function () {
                        Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function () {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
153
            })
stone's avatar
stone committed
154

155
        }
156 157 158
      function submit_success_btn(){
         $('acr517_invoice_result_ds').query();
      }
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
        function MapTOJson(m) {
            var str = '{';
            var i = 1;
            m.forEach(function (item, key, mapObj) {
                if (mapObj.size == i) {
                    str += '"' + key + '":"' + item + '"';
                } else {
                    str += '"' + key + '":"' + item + '",';
                }
                i++;
            });
            str += '}';
            //console.log(str);
            return str;
        }
174 175 176
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
177 178
<!--            <a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
            <a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
18083's avatar
18083 committed
179
            <a:dataSet id="overdue_status_ds" lookupCode="YES_NO"/>
180 181 182 183 184
            <a:dataSet id="acr517_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
            <a:dataSet id="acr517_claim_status_ds" lookupCode="CLAIM_STATUS"/>
            <a:dataSet id="cf_item_options">
                <a:datas dataSource="/model/hls_cashflow_item_list"/>
            </a:dataSet>
185
<!--            <a:dataSet id="claim_status_ds" loadData="true" lookupCode="CLAIM_STATUS"/>-->
186 187 188 189 190 191 192
            <a:dataSet id="csh_transaction_flag_ds">
                <a:datas>
                    <a:record code_value="NOT" code_value_name="未收款"/>
                    <a:record code_value="FULL" code_value_name="完全收款"/>
                    <a:record code_value="PARTIAL" code_value_name="部分收款"/>
                </a:datas>
            </a:dataSet>
193 194 195

            <a:dataSet id="acr517_invoice_query_ds" autoCreate="true">
                <a:fields>
196
                    <a:field name="document_number"/>
197
                    <a:field name="invoice_apply_num"/>
198
                    <a:field name="bp_id_agent_level1"/>
199 200 201 202 203
<!--                    <a:field name="invoice_kind_desc" displayField="code_value_name" options="acr517_invoice_kind_ds"
                             returnField="invoice_kind" valueField="code_value"/>-->
                    <a:field name="invoice_kind_type"/>
                    <a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr517_invoice_kind_ds"
                             returnField="invoice_kind_type" valueField="code_value"/>
18083's avatar
18083 committed
204 205 206
                    <a:field name="full_elec_invoice_flag"/>
                   <a:field name="full_elec_invoice_flag_n" displayField="code_value_name" options="overdue_status_ds"
                                                returnField="full_elec_invoice_flag" valueField="code_value"/>
207 208
                    <a:field name="invoice_status_desc" displayField="code_value_name" options="acr517_invoice_statu_ds" returnField="invoice_status" valueField="code_value"/>
                    <a:field name="total_amount"/>
209 210
                    <a:field name="csh_transaction_flag"/>
                    <a:field name="csh_transaction_flag_desc" options="csh_transaction_flag_ds"
211
                             displayField="code_value_name" returnField="csh_transaction_flag" valueField="code_value"/>
212 213
                    <a:field name="cf_item"/>
                    <a:field name="cf_item_n" options="cf_item_options" displayField="description" returnField="cf_item" valueField="cf_item"/>
214
<!--                    <a:field name="claim_status" options="claim_status_ds" displayField="code_value_name" valueField="code_value" returnField="claim_status"/>-->
215 216 217 218 219 220
                    <a:field name="cf_item_desc" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="csh.CSH518.hls_cashflow_item_v_lov?cf_direction=INFLOW" lovWidth="520" title="现金流项目">
                        <a:mapping>
                            <a:map from="cf_item" to="cf_item"/>
                            <a:map from="cf_item_desc" to="cf_item_desc"/>
                        </a:mapping>
                    </a:field>
221
                    <a:field name="claim_status_n" displayField="code_value_name" options="acr517_claim_status_ds"
222 223 224
                             returnField="claim_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
225
            <a:dataSet id="acr517_invoice_result_ds" autoQuery="true" fetchAll="false" autoPageSize="true"
226 227 228 229
                       model="acr.ACR605.acr_invoice_claim_confirm_new" queryDataSet="acr517_invoice_query_ds" selectable="true">
              <a:events>
                  <a:event name="submitsuccess" handler="submit_success_btn"/>
              </a:events>
230 231 232 233 234 235 236
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:toolbarButton click="acr517_invoice_query" text="HLS.QUERY"/>
                <a:toolbarButton click="acr517_invoice_reset" text="HLS.RESET"/>
237
                <a:toolbarButton click="acr517_invoice_confirm" text="确认"/>
stone's avatar
stone committed
238
                <a:toolbarButton click="acr517_invoice_return" text="退回"/>
239 240
            </a:screenTopToolbar>
            <a:form marginWidth="30" padding="0" title="查询条件" column="4">
241 242 243
                <a:textField name="document_number" bindTarget="acr517_invoice_query_ds" prompt="单据编号" width="120"/>
                <a:textField name="contract_number" bindTarget="acr517_invoice_query_ds" prompt="合同编号" width="120"/>
                <a:textField name="contract_name" bindTarget="acr517_invoice_query_ds" prompt="合同名称" width="120"/>
244
<!--                <a:lov name="cf_item_desc" bindTarget="acr517_invoice_query_ds" prompt="现金流项目" width="135"/>-->
245 246 247
                <a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额从" width="120"/>
                <a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额到" width="120"/>
                <a:textField name="invoice_title" bindTarget="acr517_invoice_query_ds" prompt="发票抬头" width="120"/>
248 249
<!--                <a:comboBox name="invoice_kind_desc" bindTarget="acr517_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="120"/>-->
                <a:comboBox name="invoice_kind_type_n" bindTarget="acr517_invoice_query_ds" prompt="发票种类" width="120"/>
stone's avatar
stone committed
250
<!--                <a:comboBox name="invoice_status_desc" bindTarget="acr517_invoice_query_ds" prompt="发票状态" width="135"/>-->
251 252 253
                <a:textField name="vat_invoice_code" bindTarget="acr517_invoice_query_ds" prompt="发票代码" width="120"/>
                <a:textField name="invoice_number" bindTarget="acr517_invoice_query_ds" prompt="发票号码" width="120"/>
                <a:comboBox name="claim_status_n" bindTarget="acr517_invoice_query_ds" prompt="认领状态" width="120"/>
254
                <a:comboBox name="csh_transaction_flag_desc" bindTarget="acr517_invoice_query_ds" prompt="收款标记"
255
                            width="120"/>
256 257 258
                <a:textField name="invoice_apply_num" bindTarget="acr517_invoice_query_ds" prompt="申请编号" width="120"/>
                <a:datePicker name="invoice_date_from" bindTarget="acr517_invoice_query_ds" prompt="发票日期从" width="120"/>
                <a:datePicker name="invoice_date_to" bindTarget="acr517_invoice_query_ds" prompt="发票日期到" width="120"/>
18083's avatar
18083 committed
259
                <a:comboBox name="full_elec_invoice_flag_n" bindTarget="acr517_invoice_query_ds" prompt="是否全电发票" width="120"/>
260 261 262
            </a:form>
            <a:grid id="acr516_invoice_grid_id" bindTarget="acr517_invoice_result_ds" marginHeight="225" marginWidth="30" navBar="true">
                <a:columns>
263
                    <a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" width="120" renderer="document_number_render"/>
264 265 266
                    <a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true" width="150"/>
                    <a:column name="contract_name" width="150" prompt="合同名称"/>
                    <a:column name="bp_agent_name" prompt="代理商" width="100"/>
267 268
<!--                    <a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>-->
                    <a:column name="invoice_kind_type_n" prompt="发票种类" width="200"/>
269 270 271 272
                    <a:column name="invoice_number" width="120" prompt="发票号码"/>
                    <a:column name="vat_invoice_code" width="120" prompt="发票代码"/>
                    <a:column name="invoice_date" renderer="Leaf.formatDate" prompt="发票日期" width="100"/>
                    <a:column name="invoice_bp_code" prompt="开票客户编号" width="100"/>
273
<!--                    <a:column name="invoice_bp_name" autoAdjust="false" showTitle="true" prompt="开票客户名称" width="150"/>-->
274 275 276 277
                    <a:column name="invoice_title" autoAdjust="false" showTitle="true" prompt="发票抬头" width="150"/>
                    <a:column name="total_amount" align="right" renderer="Leaf.formatMoney"  prompt="发票金额" width="100"/>
                    <a:column name="tax_amount" align="right" renderer="Leaf.formatMoney" prompt="税额" width="100"/>
                    <a:column name="net_amount" align="right" renderer="Leaf.formatMoney" prompt="不含税金额" width="100"/>
278
<!--                    <a:column name="currency" prompt="币种" width="80"/>-->
279
                    <a:column name="created_by_name" autoAdjust="false" showTitle="true" prompt="创建人" width="150"/>
280 281
<!--                    <a:column name="invoice_status_desc" prompt="发票状态" width="100"/>-->
<!--                    <a:column name="vat_interface_status_desc"  prompt="金税状态" width="100"/>-->
282
                    <a:column name="accounting_date" renderer="Leaf.formatDate" prompt="期间序号" width="100"/>
283
<!--                    <a:column name="create_je_flag" prompt="凭证标志" width="60"/>-->
284
                    <a:column name="bp_tax_registry_num" prompt="纳税人识别号"/>
285 286
<!--                    <a:column name="ele_invoice_status_desc" prompt="电子发票状态"/>-->
<!--                    <a:column name="swno" prompt="电子发票流水号" width="100"/>-->
287
                    <a:column name="claim_status_n" prompt="认领状态" width="100"/>
288 289
                    <a:column name="invoice_apply_num" prompt="申请编号" width="120"/>
                    <a:column name="csh_transaction_flag_desc" prompt="收款标记" width="80"/>
18083's avatar
18083 committed
290
                    <a:column name="full_elec_invoice_flag_n" prompt="是否全电发票" width="80"/>
291 292 293 294 295
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>