ソースを参照

一些拦截bug

wangmh 8 年 前
コミット
84431fdf7c

+ 1 - 1
src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java

@@ -62,7 +62,7 @@ public class MakeOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/status", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<MakeOrder> getAllMakeOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括委外明细)(全部)");

+ 5 - 5
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -82,7 +82,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "list", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getReceivedPurchaseNotices(PageParams params, String keyword, Long fromDate,
 			Long endDate){
@@ -204,7 +204,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "list", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getTodoPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(待发货)");
@@ -243,7 +243,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "list", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getDonePurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已发货)");
@@ -282,7 +282,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "list", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getWaitingPurchaseNotices(PageParams params, String keyword, Long fromDate,
 			Long endDate){
@@ -321,7 +321,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "list", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getEndPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已结案)");

+ 20 - 1
src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java

@@ -434,9 +434,10 @@ public class SaleQuotationController {
 	 * @param json
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.POST)
+	@RequestMapping(value = "/save", method = RequestMethod.POST)
 	public ResponseEntity<ModelMap> save(@RequestBody String json) {
 		SaleQuotationItem item = FlexJsonUtils.fromJson(json, SaleQuotationItem.class);
+		item.getQuotation().setStatus((short) Status.INPUTTING.value());
 		item = saleQuotationService.save(item);
 		logger.log("主动报价单", "在平台上录入主动报价单", item.replyDescription(), item.getQuotation().getCode(),
 				item.getQuotation().getId());
@@ -445,6 +446,24 @@ public class SaleQuotationController {
 		return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
 	}
 
+	/**
+	 * 作为卖家,主动报价
+	 *
+	 * @param json
+	 * @return
+	 */
+	@RequestMapping(value = "/submit", method = RequestMethod.POST)
+	public ResponseEntity<ModelMap> submit(@RequestBody String json) {
+		SaleQuotationItem item = FlexJsonUtils.fromJson(json, SaleQuotationItem.class);
+		item.getQuotation().setStatus((short) Status.SUBMITTED.value());
+		item = saleQuotationService.save(item);
+		logger.log("主动报价单", "在平台上提交主动报价单", item.replyDescription(), item.getQuotation().getCode(),
+				item.getQuotation().getId());
+		ModelMap map = new ModelMap();
+		map.put("id", item.getQuotation().getId());
+		return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
+	}
+
 	/**
 	 * 作为卖家,获取主动报价明细
 	 * 

+ 21 - 9
src/main/webapp/resources/js/index/app.js

@@ -2050,6 +2050,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     $scope.loading = false;
                     toaster.pop('error', '数据加载失败', response.data);
                 });
+            }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '数据加载失败', response.data);
             });
         };
         loadData();
@@ -5543,6 +5546,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     attach.type = attach.name.substr(attach.name.lastIndexOf('.') + 1);
                 });
                 $scope.inquiryMould = mould;
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
             });
         };
         loadData();
@@ -5986,7 +5991,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
                 $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
                 $scope.item.productId = $scope.item.product.id;
-                $scope.item.quotation.status = 100;//在录入
+                // $scope.item.quotation.status = 100;//在录入
                 if ($scope.item.quotation.date instanceof Date) {
                     $scope.item.quotation.date = $scope.item.quotation.date.getTime();
                 }
@@ -5995,6 +6000,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 }
                 Quotation.save({}, $scope.item, function (data) {
                     $scope.loading = false;
+                    $scope.item = data;
                     toaster.pop('success', '成功', '保存成功');
                     if ($stateParams.id)
                         window.location.reload();
@@ -6035,15 +6041,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
                 $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
                 $scope.item.productId = $scope.item.product.id;
-                $scope.item.quotation.status = 101;//已提交
+                // $scope.item.quotation.status = 101;//已提交
                 if ($scope.item.quotation.date instanceof Date) {
                     $scope.item.quotation.date = $scope.item.quotation.date.getTime();
                 }
                 if ($scope.item.quotation.endDate instanceof Date) {
                     $scope.item.quotation.endDate = $scope.item.quotation.endDate.getTime();
                 }
-                Quotation.save({}, $scope.item, function (data) {
+                Quotation.submit({}, $scope.item, function (data) {
                     $scope.loading = false;
+                    $scope.item = data;
                     toaster.pop('success', '成功', '提交成功');
                     // window.location.hash = '#/sale/quotation/' + data.id;
                     window.location.hash = '#/sale/quotation/list';
@@ -9305,9 +9312,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     toaster.pop('error', '提示', '单据被反过账,请立即作废本单据');
                     $scope.haveSelected = true;
                 }
-            }, function () {
+            }, function (response) {
                 $scope.loading = false;
-                toaster.pop('error', '提示', '更新已转数失败');
+                toaster.pop('error', '更新已转数失败', response.data);
             });
         }
 
@@ -9339,8 +9346,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             FaApCheck.deleteApCheck({id: $stateParams.id}, function (data) {
                 updateYCheckQty();
                 toaster.pop('success', '提示', '删除成功');
-            }, function () {
-                toaster.pop('error', '提示', '删除失败');
+            }, function (response) {
+                toaster.pop('error', '删除失败', response.data);
             });
             $scope.haveSelected = false;
 
@@ -9357,9 +9364,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 } else {
                     toaster.pop('error', '提示', '作废失败');
                 }
-            }, function () {
+            }, function (response) {
                 $scope.loading = false;
-                toaster.pop('error', '提示', '作废失败');
+                toaster.pop('error', '作废失败', response.data);
             });
 
         }
@@ -11734,6 +11741,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         var loadData = function () {
             MakeChange.get({id: $stateParams.id}, function (data) {
                 $scope.change = data;
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
             });
         };
         loadData();
@@ -12503,6 +12512,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     });
                 }
                 $scope.loading = false;
+            }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '数据加载失败', response.data);
             });
         };
         loadData();

+ 1 - 1
src/main/webapp/resources/js/index/services/Make.js

@@ -1,7 +1,7 @@
 define([ 'ngResource'], function() {
 	angular.module('MakeServices', [ 'ngResource'
 	]).factory('MakeOrder', ['$resource', function($resource) {
-		return $resource('make/orders/:id', {}, {
+		return $resource('make/orders/status', {}, {
 			getItem: {
 				url: 'make/orders/:id/info',
 				method: 'GET'

+ 13 - 4
src/main/webapp/resources/js/index/services/Purc.js

@@ -276,7 +276,7 @@ define([ 'ngResource'], function() {
 			}
 		});
 	}]).factory('PurcInquiry', ['$resource', function($resource) {
-        return $resource('sale/inquiry', {}, {
+        return $resource('sale/inquiry/info/search', {}, {
             getAll: {
 				url: 'sale/inquiry/:id/info',
                 isArray: true
@@ -357,7 +357,7 @@ define([ 'ngResource'], function() {
         });
         // 数据库直接获取
     }]).factory('PurcInquiryInfo', ['$resource', function($resource) {
-        return $resource('sale/inquiry/info', {}, {
+        return $resource('sale/inquiry/info/nosearch', {}, {
             getAll: {
                 isArray: true
             },
@@ -731,7 +731,7 @@ define([ 'ngResource'], function() {
             }
         });
 	}]).factory('PurcNotice', ['$resource', function($resource) {
-		return $resource('sale/notice/:id', {}, {
+		return $resource('sale/notice/list', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -775,7 +775,7 @@ define([ 'ngResource'], function() {
 			}
 		});
     }]).factory('PurcNoticeInfo', ['$resource', function($resource) {
-        return $resource('sale/notice', {}, {
+        return $resource('sale/notice/list', {}, {
             getTodo: {
                 url: 'sale/notice/info',
                 params: {
@@ -1231,6 +1231,15 @@ define([ 'ngResource'], function() {
                 }
             },
 			save: {
+				url: 'sale/quotation/save',
+				method: 'POST',
+				isArray: false,
+				headers: {
+					'Content-Type' : 'application/text;charset=UTF-8'
+				}
+			},
+			submit: {
+				url: 'sale/quotation/submit',
 				method: 'POST',
 				isArray: false,
 				headers: {

+ 2 - 2
src/main/webapp/resources/tpl/index/fa/apCheck_detail.html

@@ -152,8 +152,8 @@
 			</table>
 		</div>	
  		<div class="row">
-			<div ng-hide="data.status" class="col-xs-1 col-xs-offset-5"><button class="btn btn-success" ng-click="submitApCheck()">提交</button></div>
-			<div ng-hide="data.status"  class="col-xs-1"><button class="btn btn-info" ui-sref="fa.apCheck" ng-click="deleteApCheck()">删除</button></div>
+			<div ng-hide="data.status || !data.code" class="col-xs-1 col-xs-offset-5"><button class="btn btn-success" ng-click="submitApCheck()">提交</button></div>
+			<div ng-hide="data.status || !data.code"  class="col-xs-1"><button class="btn btn-info" ui-sref="fa.apCheck" ng-click="deleteApCheck()">删除</button></div>
 			<div ng-if="data.checkStatus == '不同意'" class="col-xs-1 col-xs-offset-5"><button class="btn btn-warning" ui-sref="fa.apCheck" ng-click="cancelApCheck(data)">作废</button></div>
 			<div ng-show="data.status == 314 && data.checkStatus != '已作废'" class="col-xs-1 col-xs-offset-5"><button class="btn btn-warning" ui-sref="fa.apCheck" ng-click="cancelApCheck(data)">作废</button></div>
 			<div class="col-xs-7 col-xs-offset-2" ng-show="data.status == 314" style="margin-top:5px">