Explorar o código

替代料bug修改

yangc %!s(int64=8) %!d(string=hai) anos
pai
achega
729ed00d3d

+ 14 - 8
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -2478,6 +2478,8 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 		$scope.setActiveIndex = function (index,material) {
             $scope.errorObj = [];
+			$scope.isInCodeList = [];
+			$scope.isInBrandList = [];
 			$scope.activeIndex = index;
 			if (material) {
                 $scope.editCmp = material.pcmpcode;
@@ -2488,6 +2490,8 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 						code: 0,
 						brand: 0
 					});
+					$scope.isInCodeList.push(false);
+					$scope.isInBrandList.push(false);
 				}
                 if ($scope.replaceMaterialList.length == 0) {
                     $scope.replaceMaterialList = [{detno : 1, productId : material.id}]
@@ -2507,6 +2511,8 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			if (type === 'add' && $scope.replaceMaterialList.length < 10) {
                 for (var i = 0; i < $scope.replaceMaterialList.length; i ++) {
                         $scope.errorObj[i] = {code : 0, brand : 0};
+						$scope.isInCodeList[i] = false;
+						$scope.isInBrandList[i] = false;
                         if (!$scope.replaceMaterialList[i].ptrCmpcode) {
                             $scope.errorObj[i].code = 1;
                         }
@@ -2559,9 +2565,9 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		};
 
 		// $scope.showSimilarCodeList = false;
-		$scope.isInCodeList = true;
+		// $scope.isInCodeList = true;
 		// $scope.showSimilarBrandList = false;
-		$scope.isInBrandList = true;
+		// $scope.isInBrandList = true;
 
 		$scope.getSimilarCode = function (keyword, index) {
 			if (keyword) {
@@ -2597,11 +2603,11 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			}
 			$scope.replaceMaterialList[index].showSimilarBrandList = flag;
 		}
-		$scope.setIsInCodeList = function (flag) {
-			$scope.isInCodeList = flag;
+		$scope.setIsInCodeList = function (flag, index) {
+			$scope.isInCodeList[index] = flag;
 		}
-		$scope.setIsInBrandList = function (flag) {
-			$scope.isInBrandList = flag;
+		$scope.setIsInBrandList = function (flag, index) {
+			$scope.isInBrandList[index] = flag;
 		}
 		$scope.onCodeChange = function (code, index) {
 			if ((/[^\x00-\xff]/g).test(code)) {
@@ -2649,13 +2655,13 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             if ($scope.replaceMaterialList[index].ptrCmpcode) {
 				$scope.errorObj[index].code = 0;
             }
-			$scope.setShowSimilarCodeList($scope.isInCodeList, index);
+			$scope.setShowSimilarCodeList($scope.isInCodeList[index], index);
 		}
 		$scope.onBrandBlur = function (index) {
 			if ($scope.replaceMaterialList[index].ptrBranden) {
                 $scope.errorObj[index].brand = 0;
 			}
-			$scope.setShowSimilarBrandList($scope.isInBrandList, index);
+			$scope.setShowSimilarBrandList($scope.isInBrandList[index], index);
 		}
 		$scope.setCode = function (index, code) {
 			$scope.replaceMaterialList[index].ptrCmpcode = code;

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html

@@ -2509,14 +2509,14 @@
 				<div class="form-item form-left">
 					<span><i>{{key + 1}}</i><em>*</em>型号:</span>
 					<input type="text" class="form-control" ng-model="mate.ptrCmpcode" ng-change="onCodeChange(mate.ptrCmpcode, key)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
-                    <ul class="similar-list" ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true)" ng-mouseleave="setIsInCodeList(false)">
+                    <ul class="similar-list" ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
                         <li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(key, sCode.code)"></li>
                     </ul>
 				</div>
 				<div class="form-item form-right">
 					<span><em>*</em>品牌:</span>
 					<input type="text" class="form-control" ng-model="mate.ptrBranden" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
-                    <ul class="similar-list" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true)" ng-mouseleave="setIsInBrandList(false)">
+                    <ul class="similar-list" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
                         <li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(key, sBrand.nameEn)"></li>
                     </ul>
                     <i class="fa fa-minus-circle" ng-if="replaceMaterialList.length > 1" ng-click="setReplies('sub', key)"></i>