ソースを参照

新增采购单带出数据增加数量和税率

hejq 7 年 前
コミット
c3817e9b06

+ 7 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -195,10 +195,15 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
                 pageInfo.setSort(new org.springframework.data.domain.Sort(org.springframework.data.domain.Sort.Direction.DESC, "id"));
                 SPage<PurchaseInquiryItem> itemSPage = findByPageInfo(pageInfo, null, null);
                 if (!CollectionUtils.isEmpty(itemSPage.getContent())) {
-                    Set<PurchaseInquiryReply> replySet = itemSPage.getContent().get(0).getReplies();
+                	ModelMap map = new ModelMap();
+					PurchaseInquiryItem item = itemSPage.getContent().get(0);
+                    Set<PurchaseInquiryReply> replySet = item.getReplies();
                     List<PurchaseInquiryReply> replyList = Lists.newArrayList(replySet);
                     PurchaseInquiryReply reply = replyList.get(0);
-                    return new ModelMap("price", reply.getPrice());
+                    map.put("taxRate", item.getTaxrate());
+                    map.put("qty", item.getMinOrderQty());
+                    map.put("price", reply.getPrice());
+                    return map;
                 }
             }
 		}

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

@@ -14610,20 +14610,24 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         // 选择
         $scope.check = function (data) {
             var price = null;
+            var qty = null;
+            var taxRate = null;
             if (data.id) {
                 recentPrice.agreed({prId: data.id}, {}, function(response) {
                     price = response.price;
+                    qty = response.qty;
+                    taxRate = response.taxRate;
                     $scope.order.orderItems.push({
                         code: data.code,
                         title: data.title,
                         spec: data.spec,
                         unit: data.unit,
-                        qty: null,
+                        qty: qty,
                         price: price,
                         remark: null,
                         delivery: null,
                         prid: data.id,
-                        taxrate: $scope.order.rate,
+                        taxrate: taxRate,
                         prodsource: 'seller',
                     });
                 });
@@ -16263,20 +16267,24 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         // 选择
         $scope.check = function (data) {
             var price = null;
+            var qty = null;
+            var taxRate = null;
             if (data.id) {
                 recentPrice.agreed({prId: data.id}, {}, function(response) {
                     price = response.price;
+                    qty = response.qty;
+                    taxRate = response.taxRate;
                     $scope.order.orderItems.push({
                         code: data.code,
                         title: data.title,
                         spec: data.spec,
                         unit: data.unit,
-                        qty: null,
+                        qty: qty,
                         price: price,
                         remark: null,
                         delivery: null,
                         prid: data.id,
-                        taxrate: $scope.order.rate,
+                        taxrate: taxRate,
                         prodsource: 'seller',
                     });
                 });