|
|
@@ -13803,11 +13803,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
//更新为标准器件
|
|
|
$scope.updateone = function (id) {
|
|
|
+ $scope.loading = true;
|
|
|
Products.updateone({id: id}, {}, function (data) {
|
|
|
if (data.success) {
|
|
|
toaster.pop('success', '提示', data.success);
|
|
|
window.location.reload();
|
|
|
}
|
|
|
+ $scope.loading = false;
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '提示', response.data);
|
|
|
});
|
|
|
@@ -13874,7 +13876,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
//删除
|
|
|
$scope.deleteById = function (id) {
|
|
|
+ $scope.loading = true;
|
|
|
GetProductInfo.deleteById({}, id, function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
if (data.error) {
|
|
|
toaster.pop("error", "提示", data.error);
|
|
|
} else {
|
|
|
@@ -13882,12 +13886,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
window.location.href = "#/sale/prodList";
|
|
|
}
|
|
|
}, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop("error", "删除失败", response.data);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
$scope.submit = function (prodInfo) {
|
|
|
$scope.prodInfo.isSale = 1;
|
|
|
+ $scope.loading = true;
|
|
|
var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
$upload.upload({
|
|
|
url: 'product/baseInfo/edit/updateProdInfo',
|
|
|
@@ -13897,6 +13903,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
prodInfo: $scope.prodInfo
|
|
|
},
|
|
|
}).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
if (data.success) {
|
|
|
toaster.pop('success', '提示', data.success);
|
|
|
$rootScope.isProductEdit = false;
|
|
|
@@ -13907,6 +13914,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '提示', data.error);
|
|
|
}
|
|
|
}).error(function (data, status) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.loadingShow = false;
|
|
|
if (status == 403){
|
|
|
toaster.pop('error', '操作失败', data);
|
|
|
@@ -14086,6 +14094,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
//提交
|
|
|
$scope.submit = function (prodInfo) {
|
|
|
+ $scope.loading = true;
|
|
|
$scope.prodInfo.isSale = 1;
|
|
|
var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
$upload.upload({
|
|
|
@@ -14096,6 +14105,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
prodInfo: prodInfo
|
|
|
},
|
|
|
}).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
if (data.success) {
|
|
|
toaster.pop('success', '提示', '产品添加成功');
|
|
|
$timeout(function () {
|
|
|
@@ -14114,6 +14124,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
|
|
|
}).error(function (data, status) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.loadingShow = false;
|
|
|
if (status == 403) {
|
|
|
toaster.pop('error', '操作失败', data);
|
|
|
@@ -21434,6 +21445,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '提示', '转入失败');
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
// 当前企业匹配的标准物料信息
|
|
|
@@ -22403,6 +22415,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
//提交
|
|
|
$scope.submit = function (prodInfo) {
|
|
|
+ $scope.loading = true;
|
|
|
$scope.prodInfo.isPurchase = 1;
|
|
|
var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
$upload.upload({
|
|
|
@@ -22413,6 +22426,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
prodInfo: prodInfo
|
|
|
},
|
|
|
}).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
if (data.success) {
|
|
|
toaster.pop('success', '提示', data.success);
|
|
|
$timeout(function () {
|
|
|
@@ -22431,6 +22445,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
|
|
|
}).error(function (data, status, headers, config) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.loadingShow = false;
|
|
|
if (status == 403) {
|
|
|
toaster.pop('error', '操作失败', data);
|