|
|
@@ -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;
|