瀏覽代碼

物料销售开关添加加载中状态

dongbw 8 年之前
父節點
當前提交
36f3763952
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/main/webapp/resources/js/index/app.js

+ 8 - 0
src/main/webapp/resources/js/index/app.js

@@ -21272,7 +21272,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 
         // 开启销售
         // 开启销售
         $scope.unlock = function (id) {
         $scope.unlock = function (id) {
+            $scope.loading = true;
             Products.unlock({id: id}, {}, function (data) {
             Products.unlock({id: id}, {}, function (data) {
+                $scope.loading = false;
                 toaster.pop('success', '提示', '操作成功');
                 toaster.pop('success', '提示', '操作成功');
                 $scope.tableParams.reload();
                 $scope.tableParams.reload();
             }, function (response) {
             }, function (response) {
@@ -21282,7 +21284,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 
         // 关闭销售
         // 关闭销售
         $scope.lock = function (id) {
         $scope.lock = function (id) {
+            $scope.loading = true;
             Products.lock({id: id}, {}, function (data) {
             Products.lock({id: id}, {}, function (data) {
+                $scope.loading = false;
                 toaster.pop('success', '提示', '操作成功');
                 toaster.pop('success', '提示', '操作成功');
                 $scope.tableParams.reload();
                 $scope.tableParams.reload();
             }, function (response) {
             }, function (response) {
@@ -21292,7 +21296,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 
         // 开启购买
         // 开启购买
         $scope.unlockPurc = function (id) {
         $scope.unlockPurc = function (id) {
+            $scope.loading = true;
             Products.unlockPurc({id: id}, {}, function (data) {
             Products.unlockPurc({id: id}, {}, function (data) {
+                $scope.loading = false;
                 toaster.pop('success', '提示', '操作成功');
                 toaster.pop('success', '提示', '操作成功');
                 $scope.tableParams.reload();
                 $scope.tableParams.reload();
             }, function (response) {
             }, function (response) {
@@ -21302,7 +21308,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 
         // 关闭购买
         // 关闭购买
         $scope.lockPurc = function (id) {
         $scope.lockPurc = function (id) {
+            $scope.loading = true;
             Products.lockPurc({id: id}, {}, function (data) {
             Products.lockPurc({id: id}, {}, function (data) {
+                $scope.loading = false;
                 toaster.pop('success', '提示', '操作成功');
                 toaster.pop('success', '提示', '操作成功');
                 $scope.tableParams.reload();
                 $scope.tableParams.reload();
             }, function (response) {
             }, function (response) {