Explorar el Código

替代物料编辑交互

yangc hace 8 años
padre
commit
90bf8c312b

+ 17 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -2484,6 +2484,12 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                 $scope.editCmp = material.pcmpcode;
                 $scope.editBrand = material.pbranden;
                 $scope.replaceMaterialList = angular.copy(material.productReplaceList);
+				for (var i = 0; i < $scope.replaceMaterialList.length; i++) {
+					$scope.errorObj.push({
+						code: 0,
+						brand: 0
+					});
+				}
                 if ($scope.replaceMaterialList.length == 0) {
                     $scope.replaceMaterialList = [{detno : 1, productId : material.id}]
 				}
@@ -2558,12 +2564,14 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		}
 		$scope.setShowSimilarCodeList = function (flag, index) {
             if (!$scope.replaceMaterialList[index].ptrCmpcode || !$scope.similarCode || !$scope.similarCode.length) {
-                return;
+				$scope.replaceMaterialList[index].showSimilarCodeList = false;
+				return;
             }
 			$scope.replaceMaterialList[index].showSimilarCodeList = flag;
 		}
 		$scope.setShowSimilarBrandList = function (flag, index) {
 			if (!$scope.replaceMaterialList[index].ptrBranden || !$scope.similarBrand || !$scope.similarBrand.length) {
+				$scope.replaceMaterialList[index].showSimilarBrandList = false;
 				return;
 			}
 			$scope.replaceMaterialList[index].showSimilarBrandList = flag;
@@ -2608,6 +2616,14 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			$scope.replaceMaterialList[index].ptrBranden = brand;
 			$scope.setShowSimilarBrandList(false, index);
 		}
+		// $scope.resetSimilar = function (index, type) {
+		// 	for (var i = 0; i < $scope.replaceMaterialList.length; i++) {
+		// 		if (index != i) {
+		// 			$scope.replaceMaterialList[i].showSimilarCodeList = false;
+		// 			$scope.replaceMaterialList[i].showSimilarBrandList = false;
+		// 		}
+		// 	}
+		// }
 	}]);
 
 	//类目选择模态框

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

@@ -1562,7 +1562,7 @@
 	.edit-replace-box {
 		position: fixed;
 		width: 510px;
-		top: 30%;
+		top: 12%;
 		left: 33%;
 		/*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
 		/*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
@@ -2516,7 +2516,7 @@
                         <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>
-					<i class="fa fa-plus-circle" ng-if="replaceMaterialList.length -1 == key" ng-click="setReplies('add', key)"></i>
+					<i class="fa fa-plus-circle" ng-if="replaceMaterialList.length -1 == key && replaceMaterialList.length < 10" ng-click="setReplies('add', key)"></i>
 				</div>
 			</div>
 		</div>