Browse Source

销售订单批量回复增加时间选择

hejq 8 years ago
parent
commit
3bfdfb494d

+ 1 - 1
src/main/webapp/WEB-INF/views/normal/index.html

@@ -342,7 +342,7 @@
 	</div>
 	<!-- footer End -->
 	<!--新手引导-->
-	<div ng-init="currentStep = 1" class="guide">
+	<div ng-init="currentStep = 1" class="guide" style="display: none">
 		<ul  ui-tour="currentStep">
 			<li target="h1:eq(0)" class="popover right in" overlay>
 				<img src="static/img/guide/more1.png" alt=""/>

+ 49 - 10
src/main/webapp/resources/js/index/app.js

@@ -1,4 +1,4 @@
-+define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers'], function () {
+define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers'], function () {
     'use strict';
     var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour']);
     app.init = function () {
@@ -2977,7 +2977,7 @@
         };
     }]);
 
-    app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis', 'PagingRelease', 'SnapshotService', 'PurcOrderItemInfo', 'token', 'CurrentRole', '$timeout', function ($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis, PagingRelease, SnapshotService, PurcOrderItemInfo, token, CurrentRole, $timeout) {
+    app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis', 'PagingRelease', 'SnapshotService', 'PurcOrderItemInfo', 'token', 'CurrentRole', '$timeout', '$modal', function ($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis, PagingRelease, SnapshotService, PurcOrderItemInfo, token, CurrentRole, $timeout, $modal) {
         BaseService.scrollBackToTop();
 
         // 判断是否为普通用户
@@ -3257,16 +3257,28 @@
                 }
             });
             if (!(str == '')) {
+                $scope.loading = false;
                 str = str.substr(0, str.length - 1);
-                PurcOrderItem.replyByBatch(str, function () {
-                    $scope.loading = false;
-                    $scope.tableParams.reload();
-                    toaster.pop('success', '提示', '批量回复成功');
-                }, function (response) {
-                    $scope.loading = false;
-                    toaster.pop('error', '批量回复失败', response.data);
+                var modalInstance = $modal.open({
+                    animation: true,
+                    templateUrl: 'static/tpl/index/sale/modal/reply_bybatch.html',
+                    controller: 'ReplyByBatchCtrl',
+                    resolve: {
+                        enname: function () {
+                            return name
+                        }
+                    }
                 });
+                // PurcOrderItem.replyByBatch(str, function () {
+                //     $scope.loading = false;
+                //     $scope.tableParams.reload();
+                //     toaster.pop('success', '提示', '批量回复成功');
+                // }, function (response) {
+                //     $scope.loading = false;
+                //     toaster.pop('error', '批量回复失败', response.data);
+                // });
             } else {//没有勾选其中的明细
+                toaster.pop('error', '提示', '请先选择需要回复的单据');
                 $scope.loading = false;
             }
         };
@@ -3322,6 +3334,14 @@
             });
         }
     }]);
+
+    /**
+     * 批量回复模态框
+     */
+    app.controller('ReplyByBatchCtrl', ['$scope', '$modalInstance', function($scope, $modalInstance) {
+
+    }]);
+
     app.controller('SaleOrderDetailCtrl', ['$scope', '$stateParams', 'PurcOrder', 'PurcOrderItem', 'toaster', 'ReportService', 'CurrentRole', 'token',function ($scope, $stateParams, PurcOrder, PurcOrderItem, toaster, ReportService, CurrentRole, token) {
         // 获取当前用户是否为普通用户
         CurrentRole.isUser({}, {}, function (data) {
@@ -5150,7 +5170,9 @@
             } else if (zone == 7) { // 一星期内
                 date.setDate(date.getDate() - 7);
                 condition.dateFrom = date;
-                condition.dateTo = new Date();
+                var ndate = new Date();
+                ndate.setDate(date.getDate() - 1);
+                condition.dateTo = ndate;
             } else if (zone == 1) { // 一个月内
                 date.setMonth(date.getMonth() - 1);
                 condition.dateFrom = date;
@@ -5280,6 +5302,23 @@
              {option : "这个是第五条数据"},
              {option : "这个是第六条数据"}
          ]
+        // 转客户询价
+        $scope.transtoInquiry = function (id) {
+            PurchaseInquiry.transtoInquiry({id: id}, {}, function (data) {
+                if (data.success) {
+                    toaster.pop('success', '提示', data.success);
+                    window.location.hash = "sale/inquiry/" + data.id;
+                }
+                if (data.error) {
+                    toaster.pop('error', '提示', data.error);
+                }
+                if (data.info) {
+                    toaster.pop('info', '提示', data.info);
+                }
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
     }]);
 
     /**

+ 9 - 9
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -363,15 +363,15 @@
                                     </tr>
                                </thead>
                                <tbody>
-                                    <tr ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-repeat="inquiryItem in $data">
-                                        <td>{{::inquiryItem.inquiry.date| date: 'yyyy-MM-dd'}}</td>
-                                        <td>{{::inquiryItem.product.spec}}</td>
-                                        <td>{{::inquiryItem.product.brand || '无'}}</td>
-                                        <td>{{::inquiryItem.product.title}}</td>
-                                        <td>{{::inquiryItem.number}}</td>
-                                        <td><a>{{::inquiryItem.inquiry.enterprise.enName}}</a></td>
-                                        <td>{{::inquiryItem.inquiry.endDate| date: 'yyyy-MM-dd'}}</td>
-                                        <td><a class="offer">我要报价</a></td>
+                                    <tr ng-repeat="inquiryItem in $data">
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.inquiry.date| date: 'yyyy-MM-dd'}}</td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.product.spec}}</td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.product.brand || '无'}}</td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.product.title}}</td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.number}}</td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情"><a>{{::inquiryItem.inquiry.enterprise.enName}}</a></td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情">{{::inquiryItem.inquiry.endDate| date: 'yyyy-MM-dd'}}</td>
+                                        <td><a class="offer" ng-click="transtoInquiry(inquiryItem.id)">我要报价</a></td>
                                     </tr>
                                </tbody>
                            </table>

+ 5 - 0
src/main/webapp/resources/tpl/index/sale/modal/reply_bybatch.html

@@ -0,0 +1,5 @@
+<div class="modal-body">
+    hello world!
+</div>
+<div class="modal-footer">
+</div>