|
|
@@ -1033,14 +1033,13 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
}
|
|
|
productReplaceList[i].detno = i + 1;
|
|
|
}
|
|
|
- console.log($scope.errorObj);
|
|
|
for (var i = 0; i < productReplaceList.length; i++) {
|
|
|
if ($scope.errorObj[i].code == 1 || $scope.errorObj[i].brand == 1) {
|
|
|
toaster.pop('error', '请填完整信息');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- Material.setProductReplacesByPerson(productReplaceList , function (data) {
|
|
|
+ Material.setProductReplacesByPerson({productId:$scope.replaceMaterialId}, productReplaceList , function (data) {
|
|
|
loadDataReload();
|
|
|
$scope.setActiveIndex(-1);
|
|
|
}, function (response) {
|
|
|
@@ -2491,6 +2490,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
$scope.editCmp = material.pcmpcode;
|
|
|
$scope.editBrand = material.pbranden;
|
|
|
$scope.replaceMaterialList = angular.copy(material.productReplaceList);
|
|
|
+ $scope.replaceMaterialId = material.id;
|
|
|
for (var i = 0; i < $scope.replaceMaterialList.length; i++) {
|
|
|
$scope.errorObj.push({
|
|
|
code: 0,
|
|
|
@@ -2563,7 +2563,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
} else {
|
|
|
toaster.pop('error', '请填完整信息');
|
|
|
}
|
|
|
- } else if (type === 'sub' && $scope.replaceMaterialList.length > 1) {
|
|
|
+ } else if (type === 'sub' && $scope.replaceMaterialList.length > 0) {
|
|
|
$scope.replaceMaterialList.splice(index, 1);
|
|
|
$scope.errorObj.splice(index, 1);
|
|
|
$scope.isInCodeList.splice(index, 1);
|