瀏覽代碼

分段报价

yangc 8 年之前
父節點
當前提交
9eb250aaf7
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

+ 8 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -406,10 +406,14 @@ define(['app/app'], function (app) {
 
           $scope.setReplies = function (type, index) {
             if (type === 'add' && $scope.inquiryItem.replies.length < 5) {
-              $scope.inquiryItem.replies.splice(index + 1, 0, {
-                lapQty: '',
-                price: ''
-              });
+              if ($scope.inquiryItem.replies[index].price && $scope.inquiryItem.replies[index].lapQty) {
+                $scope.inquiryItem.replies.splice(index + 1, 0, {
+                  lapQty: '',
+                  price: ''
+                });
+              } else {
+                toaster.pop('error', '请填完整信息');
+              }
             } else if (type === 'sub' && $scope.inquiryItem.replies.length > 1) {
               $scope.inquiryItem.replies.splice(index, 1);
             }