Просмотр исходного кода

Merge remote-tracking branch 'origin/feature_bill_v2' into feature_bill_v2_new

wangyc 8 лет назад
Родитель
Сommit
3cc2abd47e

+ 1 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_no_invoice_ctrl.js

@@ -224,6 +224,7 @@ define([ 'app/app' ], function(app) {
             orderids = orderids.substring(0, orderids.length-1)
             orderids = orderids.substring(0, orderids.length-1)
             BillSubmit.submitBillApply(null, {orderids: orderids, invoiceid: $scope.invoiceData.id}, function (data) {
             BillSubmit.submitBillApply(null, {orderids: orderids, invoiceid: $scope.invoiceData.id}, function (data) {
                 toaster.pop('success', '申请发票成功')
                 toaster.pop('success', '申请发票成功')
+                $scope.closeModal()
             },function (error) {
             },function (error) {
                 toaster.pop('error', '申请发票失败')
                 toaster.pop('error', '申请发票失败')
             })
             })

+ 47 - 20
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_invoice_ctrl.js

@@ -1,33 +1,43 @@
 define([ 'app/app' ], function(app) {
 define([ 'app/app' ], function(app) {
     'use strict';
     'use strict';
-    app.register.controller('vendorInvoiceCtrl', ['$scope','$rootScope','$modal','BillSubmit','BaseService', 'toaster','ngTableParams', function ($scope, $rootScope, $modal, BillSubmit, BaseService, toaster, ngTableParams) {
+    app.register.controller('vendorInvoiceCtrl', ['$scope','$rootScope','$modal','BillSubmit','BaseService', 'toaster','ngTableParams','$state', function ($scope, $rootScope, $modal, BillSubmit, BaseService, toaster, ngTableParams, $state) {
         $rootScope.active = 'vendor_invoice';
         $rootScope.active = 'vendor_invoice';
         // 切换tab
         // 切换tab
         $scope.active = 'apply_invoice';
         $scope.active = 'apply_invoice';
         $scope.toggleTab = function (t) {
         $scope.toggleTab = function (t) {
-            $scope.keyword = '';
             if (t=='apply_invoice') {
             if (t=='apply_invoice') {
                 initDataRule(101);
                 initDataRule(101);
             } else {
             } else {
                 initDataRule(102);
                 initDataRule(102);
             }
             }
+            initTable();
             $scope.active = t;
             $scope.active = t;
         };
         };
 
 
         var initDataRule = function (stateNum) {
         var initDataRule = function (stateNum) {
-            $scope.param = {};
-            $scope.pageparam = {};
-            $scope.keyword = '';
-            $scope.role = 'SELLER';
-            $scope.status = stateNum;
-            $scope.pageparam.page = 1;
-            $scope.pageparam.count = 10;
-            $scope.pageparam.sorting = {createTime : "DESC"};
+            // $scope.param = {};
+            // $scope.pageparam = {};
+             $scope.keyword = '';
+             $scope.billType = 1;
+            // $scope.role = 'SELLER';
+            // $scope.status = stateNum;
+            // $scope.pageparam.page = 1;
+            // $scope.pageparam.count = 10;
+            // $scope.pageparam.sorting = {createTime : "DESC"};
+            $scope.param = {
+                page : 1,
+                count : 10,
+                status : stateNum,
+                sorting: {createTime : "DESC"},
+                keyword : '',
+                role :'SELLER',
+                invoicetype: ''
+            };
 
 
-            $scope.param.pageParams = $scope.pageparam;
-            $scope.param.keyword = $scope.keyword;
-            $scope.param.role = $scope.role;
-            $scope.param.status = $scope.status;
+            // $scope.param.pageParams = $scope.pageparam;
+            // $scope.param.keyword = $scope.keyword;
+            // $scope.param.role = $scope.role;
+            // $scope.param.status = $scope.status;
         }
         }
         initDataRule(101);
         initDataRule(101);
 
 
@@ -37,7 +47,8 @@ define([ 'app/app' ], function(app) {
                 total : 0,
                 total : 0,
                 getData : function ($defer, params) {
                 getData : function ($defer, params) {
                     var param = BaseService.parseParams(params.url());
                     var param = BaseService.parseParams(params.url());
-                    param.pageParams.sorting = {creattime : "DESC"};
+                //    param.pageParams.sorting = {creattime : "DESC"};
+              //      param.keyword = $scope.keyword;
                     BillSubmit.getSubmitBillApply(param, function (page) {
                     BillSubmit.getSubmitBillApply(param, function (page) {
                         $scope.$$kdnData.totalElements = page.totalElements;
                         $scope.$$kdnData.totalElements = page.totalElements;
                         if(Number(page.totalElements) > 0) {
                         if(Number(page.totalElements) > 0) {
@@ -65,8 +76,21 @@ define([ 'app/app' ], function(app) {
         };
         };
         initTable();
         initTable();
 
 
-        $scope.searchByKey = function () {
-            $scope.param.keyword = $scope.keyword
+        $scope.billTypeSearch = function (billType) {
+        //    console.log($scope.billType)
+            if (billType == 1) {
+                $scope.param.invoicetype  = '';
+            } else if (billType == 2) {
+                $scope.param.invoicetype  = 1206;
+            } else if (billType == 3) {
+                $scope.param.invoicetype  = 1205;
+            }
+            initTable();
+        }
+
+        $scope.searchByKey = function (k) {
+        //    console.log($scope.keyword)
+            $scope.param.keyword = k
             initTable();
             initTable();
         }
         }
 
 
@@ -123,13 +147,16 @@ define([ 'app/app' ], function(app) {
             var tmpIds = '';
             var tmpIds = '';
             angular.forEach($scope.billData, function (item) {
             angular.forEach($scope.billData, function (item) {
                 if (item.checked) {
                 if (item.checked) {
-                    tmpIds += item.invoiceid + ',';
+                    tmpIds += item.id + ',';
                 }
                 }
             });
             });
             tmpIds = tmpIds.substring(0, tmpIds.length-1)
             tmpIds = tmpIds.substring(0, tmpIds.length-1)
-            BillSubmit.sureBillApply({id: tmpIds}, null, function (data) {
+            BillSubmit.sureBillApply({ids: tmpIds}, null, function (data) {
+                $state.reload();
+                toaster.pop('success','开票成功');
+                $scope.setShowSubmitBox(false);
             },function (error) {
             },function (error) {
-                toaster.pop('error','提交失败');
+                toaster.pop('error','开票失败');
             })
             })
         }
         }
 
 

+ 43 - 50
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -258,7 +258,7 @@
         <div class="invoice-search">
         <div class="invoice-search">
             <div class="fr">
             <div class="fr">
                 <input type="text" class="form-control" ng-model="keyword" placeholder="商家名称/订单号/发票抬头/收票人/联系电话"/>
                 <input type="text" class="form-control" ng-model="keyword" placeholder="商家名称/订单号/发票抬头/收票人/联系电话"/>
-                <button ng-click="searchByKey">搜索</button>
+                <button ng-click="searchByKey(keyword)">搜索</button>
             </div>
             </div>
         </div>
         </div>
         <div class="vendor-invoice-content">
         <div class="vendor-invoice-content">
@@ -275,7 +275,7 @@
                     <th width="90">订单号</th>
                     <th width="90">订单号</th>
                     <th width="90">可开票金额(¥)</th>
                     <th width="90">可开票金额(¥)</th>
                     <th width="55" class="select-line">
                     <th width="55" class="select-line">
-                        <select class="select-adder form-control">
+                        <select class="select-adder form-control" ng-change="billTypeSearch(billType)" ng-model="billType">
                             <option value="1">状态</option>
                             <option value="1">状态</option>
                             <option value="2">普票</option>
                             <option value="2">普票</option>
                             <option value="3">专票</option>
                             <option value="3">专票</option>
@@ -326,68 +326,61 @@
     </div>
     </div>
     <!--开票记录-->
     <!--开票记录-->
     <div class="vendor-invoice" ng-if="active == 'apply_record'">
     <div class="vendor-invoice" ng-if="active == 'apply_record'">
+        <div class="vendor-invoice-tip">
+            <p>温馨提示:</p>
+            <P>1、买家只能对订单状态为<strong>“交易成功”</strong>,且已不能再发起售后的人民币交易订单进行补开发票。</P>
+            <p>2、发票金额为产品总金额且不含运费、积分、优惠券、促销折扣等金额。</p>
+            <p>3、发票邮寄费用将有卖家承担。</p>
+        </div>
         <div class="invoice-search">
         <div class="invoice-search">
             <div class="fr">
             <div class="fr">
-                <input type="text" ng-model="keyword" class="form-control" placeholder="商家名称/订单号/发票抬头/收票人/联系电话"/>
-                <button ng-click="searchByKey">搜索</button>
+                <input type="text" class="form-control" ng-model="keyword" placeholder="商家名称/订单号/发票抬头/收票人/联系电话"/>
+                <button ng-click="searchByKey(keyword)">搜索</button>
             </div>
             </div>
         </div>
         </div>
         <div class="vendor-invoice-content">
         <div class="vendor-invoice-content">
-            <table class="invoice-com-tab table">
+            <table class="invoice-com-tab table" ng-table="billRecordTableParam">
                 <thead>
                 <thead>
-                    <tr>
-                        <th width="70">申请时间</th>
-                        <th width="90">订单号</th>
-                        <th width="90">可开票金额(¥)</th>
-                        <th width="55" class="select-line">
-                            <select class="select-adder form-control">
-                                <option value="1">状态</option>
-                                <option value="2">普票</option>
-                                <option value="3">专票</option>
-                            </select>
-                        </th>
-                        <th width="120">发票抬头</th>
-                        <th width="50">收票人</th>
-                        <th width="170">收票地址</th>
-                        <th width="50">联系电话</th>
-                    </tr>
+                <tr>
+                    <th width="70">申请时间</th>
+                    <th width="90">订单号</th>
+                    <th width="90">可开票金额(¥)</th>
+                    <th width="55" class="select-line">
+                        <select class="select-adder form-control" ng-change="billTypeSearch(billType)" ng-model="billType">
+                            <option value="1">状态</option>
+                            <option value="2">普票</option>
+                            <option value="3">专票</option>
+                        </select>
+                    </th>
+                    <th width="120">发票抬头</th>
+                    <th width="50">收票人</th>
+                    <th width="160">收票地址</th>
+                    <th width="50">联系电话</th>
+                </tr>
                 </thead>
                 </thead>
                 <tbody>
                 <tbody>
-                    <tr>
-                        <td>2017-08-28</td>
-                        <td>131364634534</td>
-                        <td>131313</td>
-                        <td>普票</td>
-                        <td>深圳市优软商城科技技</td>
-                        <td>哦哦哦</td>
-                        <td class="address">
-                            <p>广东省&nbsp;&nbsp;深圳市&nbsp;&nbsp;南山区</p>
-                            <p>科技园科技五路5号英唐大厦6楼</p>
-                        </td>
-                        <td>13135015772</td>
-                    </tr>
-                    <tr>
-                        <td>2017-08-28</td>
-                        <td>131364634534</td>
-                        <td>131313</td>
-                        <td>普票</td>
-                        <td>深圳市优软商城科技技</td>
-                        <td>哦哦哦</td>
-                        <td class="address">
-                            <p>广东省&nbsp;&nbsp;深圳市&nbsp;&nbsp;南山区</p>
-                            <p>科技园科技五路5号英唐大厦6楼</p>
-                        </td>
-                        <td>13135015772</td>
-                    </tr>
+                <tr ng-repeat="item in billData track by $index">
+                    <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
+                    <td ng-bind="item.orderids"></td>
+                    <td ng-bind="item.price"></td>
+                    <td ng-bind="item.invoicetype==1206?'普票':'专票'"></td>
+                    <td ng-bind="item.invoicetitle"></td>
+                    <td ng-bind="item.receiverName"></td>
+                    <td class="address">
+                        <p ng-bind="item.area"></p>
+                        <p ng-bind="item.detailAddr"></p>
+                    </td>
+                    <td ng-bind="item.recTel">13135015772</td>
+                </tr>
                 <tr class="record-num">
                 <tr class="record-num">
-                    <td colspan="8">
-                        <span class="count-tip">显示 1-<span>10</span> 条,共<em> 2506 </em>条</span>
+                    <td colspan="9">
+                        <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements"></span> 条</span>
                     </td>
                     </td>
                 </tr>
                 </tr>
                 </tbody>
                 </tbody>
                 <!--<tbody class="no-record-list">-->
                 <!--<tbody class="no-record-list">-->
                 <!--<tr class="height200">-->
                 <!--<tr class="height200">-->
-                <!--<td colspan="8"><img src="static/img/all/empty-cart.png"><span>暂无未开票信息!</span></td>-->
+                <!--<td colspan="10"><img src="static/img/all/empty-cart.png"><span>暂无未开票信息!</span></td>-->
                 <!--</tr>-->
                 <!--</tr>-->
                 <!--</tbody>-->
                 <!--</tbody>-->
             </table>
             </table>