Browse Source

手机页面报价查看验收验退单错误的处理

hejq 9 years ago
parent
commit
9a0a00ace0

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

@@ -67,7 +67,10 @@ public class SaleAcceptController {
 	@ResponseBody
 	public SPage<PurchaseAccept> getReceivedPurchaseAccepts(PageParams params, String searchFilter) {
 		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
+		String keyword = null;
+		if(jsonObject != null) {
+			keyword = jsonObject.getString("keyword");
+		}
 		logger.log("客户验收单", "获取全部客户验收单");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
 		// 当前登录企业作为供应商

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

@@ -69,7 +69,10 @@ public class SaleReturnController {
 	public SPage<PurchaseReturn> getReceivedPurchaseReturns(PageParams params, String searchFilter) {
 		logger.log("客户验退单", "获取全部客户验退单");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
+		String keyword = null;
+		if(jsonObject != null) {
+			keyword = jsonObject.getString("keyword");
+		}
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
 		// 当前登录企业作为供应商
 		pageParams.getFilters().put("pr_venduu", SystemSession.getUser().getEnterprise().getUu());

+ 16 - 7
src/main/webapp/resources/js/index/mobile.index.app.js

@@ -1,6 +1,6 @@
-define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'ui.router','service/Fa','ui.bootstrap' ], function() {
+define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'ui.router','service/Fa','ui.bootstrap', 'service/Token'], function() {
 	'use strict';
-	var app = angular.module('myApp', ['ngAnimate', 'toaster', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices' , 'ui.bootstrap']);
+	var app = angular.module('myApp', ['ngAnimate', 'toaster', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices' , 'ui.bootstrap', 'TokenService']);
 
 	app.init = function() {
 		angular.bootstrap(document, [ 'myApp' ]);
@@ -696,7 +696,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
 	/**
 	 * 客户询价单详情
 	 */
-	app.controller('SaleInquiryCtrl', ['$scope', '$stateParams', 'toaster', 'PurcInquiry', 'Symbol', function($scope, $stateParams, toaster, PurcInquiry, Symbol){
+	app.controller('SaleInquiryCtrl', ['$scope', '$stateParams', 'toaster', 'PurcInquiry', 'Symbol', 'token', function($scope, $stateParams, toaster, PurcInquiry, Symbol, token){
 		$scope.loading = true;
 		$scope.vendFromDateOpen = false;
 		$scope.vendToDateOpen = false;
@@ -728,7 +728,16 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
   			$scope.purcInquiry.replies.push({price: null, lapQty: null, id: null, editing: true});
   			reply.editing = false;
   		};
-  		
+
+        // 获取token信息
+        $scope.getToken = function() {
+            token.info({userType: 'saleinquiry'}, {}, function(data) {
+                $scope.token = data.token;
+            }, function(response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        };
+
   		$scope.save = function(item) {
   			$scope.loading = true;
   			if(angular.equals($scope.purcInquiry, inquiry)) {
@@ -742,7 +751,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
   			if(angular.isDate(item.vendToDate)) {
   				item.vendToDate = item.vendToDate.getTime();
   			}
-  			PurcInquiry.saveItem({itemId: item.id}, item, function(data) {
+  			PurcInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function(data) {
   				toaster.pop('info', '提示', '保存成功');
   				PurcInquiry.getItem({itemId: $stateParams.itemId}, function(data){
 					$scope.purcInquiry = data;
@@ -756,7 +765,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
 				toaster.pop('error', '保存失败', response.data);
   			});
   		};
-  		
+
   		$scope.reply = function(item) {
   			$scope.loading = true;
   			if(item.vendFromDate instanceof Date) {
@@ -767,7 +776,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
   			}
   			PurcInquiry.reply({itemId: item.id}, item, function(data) {
   				toaster.pop('info', '提示', '回复成功');
-  				PurcInquiry.getItem({itemId: $stateParams.itemId}, function(data){
+  				PurcInquiry.getItem({itemId: $stateParams.itemId, token: $scope.token}, function(data){
 					$scope.purcInquiry = data;
 					$scope.loading = false;
 				}, function(data){

+ 2 - 2
src/main/webapp/resources/tpl/index_mobile/sale/accept_list.html

@@ -51,9 +51,9 @@
 }
 </style>
 <!-- loading start -->
-<div class="loading in" ng-class="{'in': loading}">
+<!--<div class="loading in" ng-class="{'in': loading}">
 	<i></i>
-</div>
+</div>-->
 <!-- loading end -->
 
 <div class="row">

+ 14 - 14
src/main/webapp/resources/tpl/index_mobile/sale/inquiry_detail.html

@@ -76,14 +76,14 @@
 	.wordspacing25 {
 		word-spacing: 25px;
 	}
-</style>
-<div class="row">
-	<div class="top bold">
-		<a ui-sref="sale.inquiry" class="f16 topText">&nbsp;<i class="fa fa-angle-left"></i>&nbsp;单据详情</a>
-		<!-- <div class="right"><i class="fa fa-reorder"></i>&nbsp;&nbsp;</div> -->
-	</div>
-	<div class="orderInfo">
-		<table>
+</style>
+<div class="row">
+	<div class="top bold">
+		<a ui-sref="sale.inquiry" class="f16 topText">&nbsp;<i class="fa fa-angle-left"></i>&nbsp;单据详情</a>
+		<!-- <div class="right"><i class="fa fa-reorder"></i>&nbsp;&nbsp;</div> -->
+	</div>
+	<div class="orderInfo">
+		<table>
 			<tr>
 				<td class="va-top text-center" width="80px"><label class="text-black wordspacing25">客 户:</label></td>
 				<td>
@@ -100,7 +100,7 @@
 					<span class="text-num" ng-bind="purcInquiry.inquiry.code"></span> {{purcInquiry.status | status}}<br>
 					<span class="text-help text-num">{{purcInquiry.inquiry.date | date:'yyyy-MM-dd'}} </span>
 				</td>
-			</tr>
+			</tr>
 			<tr>
 				<td class="va-top text-center"><label class="text-black wordspacing25">物  料:</label></td>
 				<td>
@@ -132,9 +132,9 @@
 				<td>
 					<span ng-bind="purcInquiry.inquiry.priceType || '(无)'"></span>
 				</td>
-			</tr>
-		</table>
-	</div>
+			</tr>
+		</table>
+	</div>
 	<div id="detail">
 		<div class="loading"  ng-class="{'in': loading}">
 			<i></i>
@@ -201,7 +201,7 @@
 								</span>
 							</th>
 						</tr>
-						<tr ng-repeat="reply in purcInquiry.replies" ng-click="reply.editing = true">
+						<tr ng-repeat="reply in purcInquiry.replies" ng-click="reply.editing = true;getToken()">
 							<td>{{$index + 1}}</td>
 							<td>
 								<span ng-if="!reply.editing" class="text-num">≥ {{reply.lapQty}}</span>
@@ -240,5 +240,5 @@
 				</div>
 			</form>
 		</div>
-	</div>
+	</div>
 </div>