|
|
@@ -13819,11 +13819,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);
|
|
|
});
|
|
|
@@ -13890,7 +13892,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 {
|
|
|
@@ -13898,12 +13902,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',
|
|
|
@@ -13913,6 +13919,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;
|
|
|
@@ -13923,6 +13930,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);
|
|
|
@@ -14102,6 +14110,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({
|
|
|
@@ -14112,6 +14121,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 () {
|
|
|
@@ -14130,6 +14140,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);
|
|
|
@@ -21450,6 +21461,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '提示', '转入失败');
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
// 当前企业匹配的标准物料信息
|
|
|
@@ -22419,6 +22431,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({
|
|
|
@@ -22429,6 +22442,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 () {
|
|
|
@@ -22447,6 +22461,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);
|