Browse Source

品牌映射调整

hulh 8 years ago
parent
commit
d3608eaadd

+ 26 - 6
src/main/webapp/resources/js/admin/controllers/product/brandMapCtrl.js

@@ -4,17 +4,18 @@ define(['app/app'], function(app) {
 		$scope.$$map = {};
 		$scope.keyword = '';
 		$scope.storeType = 'ALL';
+		$scope.typeCn = '全部';
 		$scope.brandMap = {};
 
 		$scope.startDate = null;
 		$scope.endDate = null;
 
-		$scope.filterStoreType = function () {
+		$scope.onSearch = function () {
 			reloadData();
 		};
 
-		$scope.onSearch = function () {
-			reloadData();
+		$scope.showType = function () {
+			$scope.typeFrame = !$scope.typeFrame;
 		};
 
 		var reloadData = function () {
@@ -113,16 +114,31 @@ define(['app/app'], function(app) {
 		};
 
 		$scope.convertType = {
+			'ALL' : '全部',
 			'AGENCY' : '代理商',
 			'DISTRIBUTION' : '经销商',
 			'ORIGINAL_FACTORY' : '原厂商',
 			'CONSIGNMENT' : '寄售商'
 		};
 
+		$scope.changeDateZone = function (item) {
+			$scope.typeFrame = false;
+			if ($scope.storeType != item){
+				$scope.storeType = item;
+				$scope.typeCn = $scope.convertType[item];
+				reloadData();
+			}
+		};
+
 		$scope.addOneMap = function () {
 			$scope.addFrame = !$scope.addFrame;
 		};
 
+		$scope.cancelAdd = function () {
+			$scope.brandMap = {};
+			$scope.addFrame = false;
+		};
+
 		$scope.ensureAdd = function () {
 			if (!$scope.brandMap.enName){
 				toaster.pop("info", "请选择店铺信息");
@@ -136,8 +152,12 @@ define(['app/app'], function(app) {
 				toaster.pop("info", "请选择对应标准库的品牌");
 				return ;
 			}
-			BrandMap.addOneBrandMap({}, $scope.brandMap, function () {
-
+			BrandMap.addOneBrandMap({}, $scope.brandMap, function (data) {
+				if (data){
+					$scope.brandMap = {};
+					$scope.addFrame = false;
+					reloadData();
+				}
 			}, function (error) {
 				toaster.pop("error", error.data);
 			})
@@ -287,7 +307,7 @@ define(['app/app'], function(app) {
 
 		$scope.fitStoreInMap = function () {
 			if (!$scope.storeInfo){
-				toaster.pop("info", "请选择对应标准库的品牌");
+				toaster.pop("info", "请选择店铺信息");
 				return ;
 			}
 			$scope.brandMap.enName = $scope.storeInfo.storeName;

+ 41 - 22
src/main/webapp/resources/view/admin/product/brand_map.html

@@ -2,6 +2,26 @@
     .row {
         margin-bottom: 10px;
     }
+    .btn-select{
+        min-height: 80px;
+        width:88px;
+        list-style: none;
+        text-align: left;
+        border:1px solid #2fa4e7;
+        float: left;
+        background: #fff;
+    }
+    .btn-select li{
+        padding-left:5px;
+        line-height: 22px;
+        color:#000;
+    }
+    .btn-select li:hover{
+        background: #2fa4e7;
+        color:#fff;
+        cursor:pointer;
+    }
+
     .mobile-select{
         position:absolute;
         top:25px;
@@ -92,13 +112,13 @@
                     <form class="form-inline ng-pristine ng-invalid ng-invalid-required ng-valid-date ng-valid-date-disabled">
                         <div class="form-group" style="margin-right:20px">
                             <label style="color:#2fa4e7">企业类型:</label>
-                            <div class="btn-group btn-menu" is-open="condition.$dateZoneOpen">
-                                <input type="text" style="padding-left:3px;width:88px;background: url('static/img/product/cart/up-map.png')no-repeat 75px 6px;" placeholder="全部">
-                                <ul class="dropdown-menu dateinput" style="height: inherit">
-                                    <li><a ng-click="changeDateZone(-1)">全部</a></li>
-                                    <li><a ng-click="changeDateZone(1)">原厂</a></li>
-                                    <li><a ng-click="changeDateZone(6)">代理商</a></li>
-                                    <li><a ng-click="changeDateZone(7)">经销商</a></li>
+                            <div class="btn-group btn-menu" style="position:relative">
+                                <input type="text" ng-model="typeCn" ng-click="showType()" style="padding-left:3px;width:88px;background: url('static/img/product/cart/up-map.png')no-repeat 75px 6px;">
+                                <ul class="btn-select" ng-if="typeFrame" style="position:absolute;top:22px;">
+                                    <li ng-click="changeDateZone('ALL')">全部</li>
+                                    <li ng-click="changeDateZone('ORIGINAL_FACTORY')">原厂商</li>
+                                    <li ng-click="changeDateZone('AGENCY')">代理商</li>
+                                    <li ng-click="changeDateZone('DISTRIBUTION')">经销商</li>
                                 </ul>
                             </div>
                         </div>
@@ -172,7 +192,7 @@
                 <td></td>
                 <td class="tdcenter">
                     <div style="position:relative;display: inline-flex;align-items: center">
-                        <input type="text" style="width:248px;height:29px;" ng-model="brandMap.enName">
+                        <input type="text" style="width:248px;height:29px;" ng-model="brandMap.enName" readonly="readonly">
                         <span style="background:url('static/img/product/cart/up-map.png')no-repeat 3px 10px;width:16px;height:29px;display:inline-block;border:1px solid #c0c6ca;" ng-click="showStoreFrame()"></span>
                         <div class="mobile-select" ng-if="showStore">
                             <form style="display: inline-flex; align-items:center;">
@@ -218,9 +238,9 @@
                 <td><input type="text" style="width:115px;height:29px;" ng-model="brandMap.nameChildEn"/></td>
                 <td class="tdcenter">
                     <div style="position:relative;display: inline-flex;align-items: center">
-                        <input type="text" style="width:96px;height:29px;" ng-model="brandMap.nameStandardCn">
+                        <input type="text" style="width:96px;height:29px;" ng-model="brandMap.nameStandardCn" readonly="readonly">
                         <span style="background:url('static/img/product/cart/up-map.png')no-repeat 3px 10px;width:16px;height:29px;display:inline-block;border:1px solid #c0c6ca;" ng-click="showBrandFrame()"></span>
-                        <div class="mobile-select">
+                        <div class="mobile-select" ng-if="showBrand">
                             <div style="margin-bottom:10px;display: inline-flex;align-items: center">
                                 <input type="text" ng-model="wordInBrand" ng-change="changeTextInBrand(wordInBrand)" style="width:395px;height:20px;line-height:20px;padding:0 20px 0 10px;border:1px solid #2fa4e7" placeholder="输入品牌中文/英文名称">
                            <i ng-click="searchBrand()" class="fa fa-search" style="color:#fff;width:20px;height:20px;display:inline-block;margin-left:-20px;background: #2fa4e7;padding:3px;" ng-click="showStoreFrame()"></i>
@@ -243,22 +263,22 @@
                                 <li><a ng-click="clickChar('N')">N</a></li>
                                 <li><a ng-click="clickChar('O')">O</a></li>
                                 <li><a ng-click="clickChar('P')">P</a></li>
-                                <li><a href="#">Q</a></li>
-                                <li><a href="#">R</a></li>
-                                <li><a href="#">S</a></li>
-                                <li><a href="#">T</a></li>
-                                <li><a href="#">U</a></li>
-                                <li><a href="#">V</a></li>
-                                <li><a href="#">W</a></li>
-                                <li><a href="#">X</a></li>
-                                <li><a href="#">Y</a></li>
-                                <li><a href="#">Z</a></li>
+                                <li><a ng-click="clickChar('Q')">Q</a></li>
+                                <li><a ng-click="clickChar('R')">R</a></li>
+                                <li><a ng-click="clickChar('S')">S</a></li>
+                                <li><a ng-click="clickChar('T')">T</a></li>
+                                <li><a ng-click="clickChar('U')">U</a></li>
+                                <li><a ng-click="clickChar('V')">V</a></li>
+                                <li><a ng-click="clickChar('W')">W</a></li>
+                                <li><a ng-click="clickChar('X')">X</a></li>
+                                <li><a ng-click="clickChar('Y')">Y</a></li>
+                                <li><a ng-click="clickChar('Z')">Z</a></li>
                                 <!--<li><a href="#">0-9</a></li>-->
                             </ul>
                             <table class="table table-condensed" ng-table="brandInfoTableParams">
                                 <tr ng-repeat="value in showList">
                                     <td ng-repeat="item in value" style="width:33%;padding-left:5px;text-align: left;">
-                                        <input type="radio" name="radio-type">
+                                        <input type="radio" name="radio-type" ng-click="fitBrandObj(item)">
                                         <span style="width:110px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;" ng-click="fitBrandObj(item)">{{item.nameEn}}/{{item.nameCn}}</span>
                                     </td>
                                 </tr>
@@ -268,7 +288,6 @@
                     </div>
                 </td>
                 <td><input type="text" style="width:115px;height:29px;" ng-model="brandMap.nameStandardEn"/></td>
-                <td><span >张三</span></td>
                 <td>
                     <button style="width:43px;color:#fff;background: #50b2eb;border:0;" ng-click="ensureAdd()">保存</button>
                 </td>