Преглед изворни кода

新增询价单批量导入,提交失败问题处理。

dongbw пре 8 година
родитељ
комит
d50c823c98

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurcInquiryServiceImpl.java

@@ -237,7 +237,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
                                         product.setSpec(purcitem.getProdTitle());
                                         product.setCreateTime(new Date());
                                         Long proId = ProductUtils.updateOne(product);
-                                        item.setProduct(product);
+//                                        item.setProduct(product);
                                         item.setProductId(proId);
                                     }
                                 }

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

@@ -4841,6 +4841,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.ifrepeat = false;
         // 保存
         $scope.save = function () {
+            $scope.loading = true;
             for (var i = 0; i < $scope.inquiry.inquiryItems.length; i++) {
                 $scope.item = $scope.inquiry.inquiryItems[i];
                 for (var j = 0; j < $scope.inquiry.inquiryItems.length; j++) {
@@ -4867,6 +4868,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                 contacts: $scope.vendors
                             },
                         }).success(function (data) {
+                            $scope.loading = false;
                             if (data.success) {
                                 toaster.pop('success', '提示', data.success);
                                 $timeout(function () {
@@ -4897,6 +4899,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             inquiry: $scope.inquiry,
                         },
                     }).success(function (data) {
+                        $scope.loading = false;
                         if (data.success) {
                             toaster.pop('success', '提示', data.success);
                             $timeout(function () {
@@ -4917,12 +4920,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     });
                 }
             } else {
+                $scope.loading = false;
                 toaster.pop('error', '提示', '存在相同条件的物料信息');
             }
         }
 
         // 保存并提交
         $scope.submit = function () {
+            $scope.loading = true;
             for (var i = 0; i < $scope.inquiry.inquiryItems.length; i++) {
                 $scope.item = $scope.inquiry.inquiryItems[i];
                 for (var j = 0; j < $scope.inquiry.inquiryItems.length; j++) {
@@ -4949,6 +4954,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                 contacts: $scope.vendors
                             },
                         }).success(function (data) {
+                            $scope.loading = false;
                             if (data.success) {
                                 toaster.pop('success', '提示', data.success);
                                 $timeout(function () {
@@ -4978,6 +4984,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             inquiry: $scope.inquiry,
                         },
                     }).success(function (data) {
+                        $scope.loading = false;
                         if (data.success) {
                             toaster.pop('success', '提示', data.success);
                             $timeout(function () {
@@ -4997,6 +5004,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     });
                 }
             } else {
+                $scope.loading = false;
                 toaster.pop('error', '提示', '存在相同条件的物料信息');
             }
         }
@@ -21226,6 +21234,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.ifrepeat = false;
         // 保存并提交
         $scope.submit = function () {
+            $scope.loading = true;
             for (var i = 0; i < $scope.inquiry.inquiryItems.length; i++) {
                 $scope.item = $scope.inquiry.inquiryItems[i];
                 for (var j = 0; j < $scope.inquiry.inquiryItems.length; j++) {
@@ -21258,12 +21267,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     },
                 }).success(function (data) {
                     if (data.success) {
+                        $scope.loading = false;
                         toaster.pop('success', '提示', data.success);
                         $timeout(function () {
                             window.location.hash = "#/purc/purchaseinquiry";
                         }, 500);
                     }
                     if (data.error) {
+                        $scope.loading = false;
                         toaster.pop('error', '提示', data.error);
                     }
                 }).error(function (data) {
@@ -21271,6 +21282,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     toaster.pop('error', '操作失败', data.error);
                 });
             } else {
+                $scope.loading = false;
                 toaster.pop('error', '提示', '存在条件相同的物料');
             }
         }

+ 3 - 0
src/main/webapp/resources/tpl/index/purc/inquiry_new.html

@@ -928,6 +928,9 @@ select.disabled {
     width: auto !important;
 }
 </style>
+<div class="loading " ng-class="{'in': loading}">
+    <i></i>
+</div>
 <div class="ng-scope">
     <form name="tenderForm">
         <div class="purc-tender">