Browse Source

更新UI,增加供应商搜索

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7534 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
b4824c4818

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

@@ -15,7 +15,7 @@
 	href="static/lib/fontawesome/css/font-awesome.min.css" />
 <link rel="stylesheet" href="static/lib/angular/toaster.css" />
 <link rel="stylesheet" href="static/css/index.css" />
-	<script src="../../../resources/lib/jquery/jquery.min.js"></script>
+	<script src="resources/lib/jquery/jquery.min.js"></script>
 </head>
 <body ng-controller="AuthCtrl">
 	<!-- top Start -->
@@ -79,9 +79,9 @@
 								<li><a href="#/sale/returns" title="客户验退单">客户验退单</a></li>
 								<li><a href="#/sale/sample" title="客户打样申请">客户打样申请</a></li>
 								<li><a href="#/sale/approval" title="客户认定单">客户认定单</a></li>
-								<li><a href="#/qc/badIn" title="客户不良品入库">客户不良品入库</a></li>
-								<li><a href="#/qc/badOut" title="客户不良品出库">客户不良品出库</a></li>
-								<li><a href="#/qc/MRB" title="客户MRB单">客户MRB单</a></li>
+								<li><a href="#/sale/badIn" title="客户不良品入库">客户不良品入库</a></li>
+								<li><a href="#/sale/badOut" title="客户不良品出库">客户不良品出库</a></li>
+								<li><a href="#/sale/MRB" title="客户MRB单">客户MRB单</a></li>
 							</ul>
 						</div>
 					</div>
@@ -91,6 +91,7 @@
 						</div>
 						<div class="col-xs-10">
 							<ul class="nav nav-pills" >
+								<li><a href="#/purc/vendor" title="采购询价">供应商资料</a></li>
 								<li><a href="#/purc/tender" title="采购招标">采购招标</a></li>
 								<li><a href="#/purc/order" title="采购订单">采购订单</a></li>
 								<li><a href="" title="采购询价">采购询价</a></li>

+ 56 - 13
src/main/webapp/resources/js/index/app.js

@@ -3139,7 +3139,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 
     // 查找供应商
     app.controller('DbfindVendorCtrl', ['$scope', 'Vendor', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance','$rootScope', function($scope, Vendor, BaseService, ngTableParams, toaster, $modalInstance, $rootScope){
-       console.log($rootScope);
         $scope.tableParams = new ngTableParams({
             page : 1,
             count : 25
@@ -7996,8 +7995,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		// 查找客户
 		$scope.dbfindCust = function(){
 			var modalInstance = $modal.open({
-				templateUrl: 'static/tpl/index/purc/modal/purc_order_cust.html',
-				controller: 'DbfindCustCtrl',
+				templateUrl: 'static/tpl/index/purc/modal/purc_order_vendor.html',
+				controller: 'DbfindVendorInfoCtrl',
 				size: 'lg',
 				resolve: {
 					
@@ -8005,8 +8004,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			});
 			
 			modalInstance.result.then(function(data) {
-				$scope.order.cust = data.myEnterprise;
-				$scope.order.custUser = data.myUser;
+				$scope.order.cust = data.vendorEnterprise;
+				$scope.order.custUser = data.vendorUser;
 				$scope.order.orderItems = [];
 				var item = {
 						code: null,
@@ -8211,17 +8210,61 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		
 		// 新增收货地址保存
 		$scope.saveShipAddress = function(ship) {
-			ShipAddress.saveAddress( {}, ship, function(data) {
-				if(data.success) {
-					toaster.pop('success', '提示', data.success);
-				}
-				if(data.error) {
-					toaster.pop('error', '提示', data.error);
-				}
-			});
+			ship.address = ship.province + ship.city + ship.district;
+			console.log(ship);
+//			ShipAddress.saveAddress( {}, ship, function(data) {
+//				if(data.success) {
+//					toaster.pop('success', '提示', data.success);
+//				}
+//				if(data.error) {
+//					toaster.pop('error', '提示', data.error);
+//				}
+//			});
 		}
 	}]);
 	
+	// 查找供应商
+	app.controller('DbfindVendorInfoCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'Vendor', function($scope, BaseService, ngTableParams, toaster, $modalInstance, Vendor){
+		// 搜索框回车
+		$scope.onSearch = function(keyword) {
+			$scope.keyword = keyword;
+			$scope.customerParams.page(1);
+			$scope.customerParams.reload();
+		};
+		
+		$scope.customerParams = new ngTableParams({
+			page : 1, 
+			count : 10
+		}, {
+			total : 0, 
+			counts: [5, 10, 25, 50],
+			getData : function($defer, params) {
+				$scope.loading = true;
+				var pageParams = params.url();
+				pageParams.keyword = $scope.keyword;
+				Vendor.getVendor.call(null, BaseService.parseParams(pageParams), function(page){
+					$scope.loading = false;
+					if(page) {
+						params.total(page.totalElements);
+						$defer.resolve(page.content);
+					}
+					$scope.totalCount = page.totalElements;
+				}, function(response){
+					$scope.loading = false;
+					toaster.pop('error', '数据加载失败', response.data);
+				});
+			}
+		});
+		
+  		$scope.cancel = function() {
+    		$modalInstance.dismiss();
+  		};
+  		
+  		$scope.check = function(vendor){
+  			$modalInstance.close(vendor);
+  		};
+	}]);
+	
 	/**
 	 * 我的客户
 	 */

+ 3 - 8
src/main/webapp/resources/tpl/index/home/right.html

@@ -56,20 +56,15 @@
 										ng-class="{'text-inverse': todo.orderChange>0}">{{todo.orderChange
 											|| 0}}</span>)
 								</a></li>
-							<!-- 	<li><a ui-sref="sale.send">发货单</a></li>
-								<li><a ui-sref="sale.accept">买家验收</a></li>
-								<li><a ui-sref="sale.returns">买家退货</a></li>
-								<li><a ui-sref="baseInfo.prodList">物料列表</a></li>
-								<li><a ui-sref="sale.accept">买家验收</a></li> -->
 							</ul>
 						</li>
 					</ul>
 					<div id="operateTips" ng-controller="VendCountCtrl">
 						<a class="col-xs-4" href="#/sale/customer"> 我的客户(<span ng-class="{'text-inverse': count.customer>0}">{{count.customer || 0}}</span>)</a>
 						<a class="col-xs-4" style="color: #327ebe" href="#/baseInfo/myRquest"><i class="fa fa-plus"></i> 添加客户</a>
-						<a class="col-xs-4" style="color: #327ebe" ui-sref="baseInfo.newProdInfo"><i class="fa fa-plus"></i> 新增产品信息</a>
-						<a class="col-xs-4" style="color: #327ebe" ui-sref="baseInfo.uploadByBatch"><i class="fa fa-plus"></i> 导入产品信息</a>
-						<a class="col-xs-4" style="color: #327ebe" ui-sref="baseInfo.prodList">产品信息</a>
+						<a class="col-xs-4" style="color: #327ebe" ui-sref="sale.newProdInfo"><i class="fa fa-plus"></i> 新增产品信息</a>
+						<a class="col-xs-4" style="color: #327ebe" ui-sref="sale.uploadByBatch"><i class="fa fa-plus"></i> 导入产品信息</a>
+						<a class="col-xs-4" style="color: #327ebe" ui-sref="sale.prodList">产品信息</a>
 					</div>
 				</div>
 			</div>

+ 6 - 5
src/main/webapp/resources/tpl/index/purc/addOrder.html

@@ -229,15 +229,15 @@
                 <div class="fl">所在地址<em>*</em>:</div>
                 <!--<div class="select fr"><input type="text" placeholder="请选择" ng-model="ship.address" required="true"/><i class="fa fa-angle-down"></i></div>-->
 				 <div class="select fr">
-                    <select required="" class="area-select" ng-model="address.province" ng-options="key as key for (key,value) in provinces"
-                            ng-change="address.city='';address.district='';">  
+                    <select required="" class="area-select" ng-model="ship.province" ng-options="key as key for (key,value) in provinces"
+                            ng-change="ship.city='';ship.district='';" required="true">  
                         <option value="">省</option>  
                     </select>
-                    <select class="area-select" ng-model="address.city" ng-options="key as key for (key,value) in provinces[address.province]"
-                            ng-change="address.district='';">  
+                    <select class="area-select" ng-model="ship.city" ng-options="key as key for (key,value) in provinces[ship.province]"
+                            ng-change="ship.district='';" required="true">  
                         <option value="">市</option>  
                     </select>
-                    <select class="area-select" ng-model="address.district" ng-options="value as value for value in provinces[address.province][address.city]">
+                    <select class="area-select" ng-model="ship.district" ng-options="value as value for value in provinces[ship.province][ship.city]" required="true">
                         <option value="">区</option>  
                     </select>  
 				</div>
@@ -299,6 +299,7 @@
         });
         //新增收货地址
         $(".oder-change ul li .add-address").click(function(){
+        	document.getElementById('shipAddress').reset();
             $(".bomb-box").show();
         });
         $(".bomb-box .box04 .off,.box04 .many-file-btn .btn02").click(function(){

+ 48 - 0
src/main/webapp/resources/tpl/index/purc/modal/purc_order_vendor.html

@@ -0,0 +1,48 @@
+<style>
+.headerline .content {
+	width: 200px;
+	font-size: 14px;
+}
+.modal-body {
+	min-height: 350px;
+}
+.modal {
+ 	top: 70px;
+}
+</style>
+<div class="modal-body">
+	<div class="headerline">
+		<span class="content"><i class="fa fa-fw fa-edit text-primary"></i>采购订单 - 选择供应商</span>
+	</div>
+	<form class="form-horizontal">
+		<div class="form-group">
+			<label class="col-md-2 col-sm-2 control-label">筛选:</label>
+			<div class="col-md-8 col-sm-8">
+				<input type="text" class="form-control input-sm" 
+					required placeholder="输入供应商名称关键字查询" autofocus ng-model="keyword" ng-search="onSearch(keyword)">
+			</div>
+		</div>
+	</form>
+	<table class="block table table-default table-striped table-bordered"
+		ng-table="customerParams">
+		<thead>
+			<tr class="header">
+				<th>UU</th>
+				<th>供应商名称</th>
+				<th>地址</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+			<tr ng-repeat="vendor in $data">
+				<td class="text-center" ng-bind="::vendor.vendorEnterprise.uu"></td>
+				<td class="text-center" ng-bind="::vendor.vendorEnterprise.enName"></td>
+				<td class="text-center" ng-bind="::vendor.vendorEnterprise.enAddress"></td>
+				<td class="text-center"><a title="选择" href="javascript:void(0)" ng-click="check(vendor)" style="text-decoration: none;">选择</a></td>
+			</tr>
+		</tbody>
+	</table>
+</div>
+<div class="modal-footer">
+	<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
+</div>