|
|
@@ -1025,6 +1025,10 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
|
|
|
$scope.setProductReplacesByPerson = function (productReplaceList) {
|
|
|
for (var i = 0; i < productReplaceList.length; i++) {
|
|
|
+ if (!(productReplaceList[i].ptrBranden && productReplaceList[i].ptrCmpcode)) {
|
|
|
+ toaster.pop('error', '请填完整信息');
|
|
|
+ return;
|
|
|
+ }
|
|
|
productReplaceList[i].detno = i + 1;
|
|
|
}
|
|
|
Material.setProductReplacesByPerson(productReplaceList , function (data) {
|
|
|
@@ -2485,7 +2489,15 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
]
|
|
|
$scope.setReplies = function (type, index) {
|
|
|
if (type === 'add' && $scope.replaceMaterialList.length < 10) {
|
|
|
- if ($scope.replaceMaterialList[index].ptrBranden && $scope.replaceMaterialList[index].ptrCmpcode) {
|
|
|
+ for (var index = 0 ;index < $scope.replaceMaterialList.length ; index ++) {
|
|
|
+ if ($scope.replaceMaterialList[index].ptrBranden && $scope.replaceMaterialList[index].ptrCmpcode) {
|
|
|
+ $scope.canAdd = true;
|
|
|
+ } else {
|
|
|
+ $scope.canAdd = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if ($scope.canAdd) {
|
|
|
$scope.replaceMaterialList.splice(index + 1, 0, {
|
|
|
ptrCmpcode: '',
|
|
|
ptrBranden: '',
|