瀏覽代碼

商城对接公共询价服务接口

liusw 8 年之前
父節點
當前提交
8f1770b84f

+ 4 - 0
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -22,6 +22,10 @@ define([ 'ngResource' ], function() {
         url: 'http://10.1.51.88:8080/inquiry/buyer/list',
         method: 'GET'
       },
+      getUserSeekPageInfoByStatus: {
+        url: 'http://10.1.51.88:8080/inquiry/public/quotation/list',
+        method: 'GET'
+      },
       getMallGoodsList: {
         url: 'seek/getMallGoodsList',
         method: 'GET',

+ 57 - 38
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -21,8 +21,63 @@ define(['app/app'], function (app) {
             $scope.tab = 'waitOffer';
             $scope.toogleTab = function (tab) {
                 $scope.tab = tab;
+              $scope.seekPurchaseTableParams = new ngTableParams({
+                pageNumber: 1,
+                pageSize: 10
+              }, {
+                total: 0,
+                getData: function ($defer, params) {
+                  const param = BaseService.parseParams(params.url());
+                  if ($scope.userInfo.enterprise) {
+                    param.enUU = $scope.userInfo.enterprise.uu;
+                  }
+                  param.recorderUU = $scope.userInfo.userUU;
+                  // param.isMallGoods = $scope.isMallGoods;
+                  // param.deadline = $scope.deadline;
+                  param.keyword = $scope.keyWord;
+                  param.fromDate = $scope.startDate
+                      ? $scope.startDate.getTime() : null;
+                  param.endDate = $scope.endDate ? $scope.endDate.getTime()
+                      : null;
+                  param.pageNumber = param.page;
+                  param.pageSize = param.count;
+                  if ($scope.isSearch) {
+                    param.page = 1;
+                    params.page(1);
+                    $scope.isSearch = false;
+                  }
+                  if ($scope.tab == 'waitOffer') {
+                    param.state = "todo";
+                    seekPurchase.getUserSeekPageInfo(param, function (data) {
+                      params.total(data.totalElements);
+                      $defer.resolve(data.content);
+                      $scope.seekListData = data;
+                    }, function (response) {
+                      toaster.pop('error', response.data);
+                    });
+                  } else if($scope.tab == 'offered') {
+                    param._state = "done";
+                    seekPurchase.getUserSeekPageInfoByStatus(param, function (data) {
+                      params.total(data.totalElements);
+                      $defer.resolve(data.content);
+                      $scope.seekListData = data;
+                    }, function (response) {
+                      toaster.pop('error', response.data);
+                    });
+                  } else if ($scope.tab == 'accepted') {
+                    param._state = "agreed";
+                    seekPurchase.getUserSeekPageInfoByStatus(param, function (data) {
+                      params.total(data.totalElements);
+                      $defer.resolve(data.content);
+                      $scope.seekListData = data;
+                    }, function (response) {
+                      toaster.pop('error', response.data);
+                    });
+                  }
+                }
+              });
             }
-
+          $scope.toogleTab('waitOffer');
           $scope.applyObj = {
             code: '',
             brand: '',
@@ -43,43 +98,7 @@ define(['app/app'], function (app) {
 
           // 买家求购列表
           $scope.searchStatus = 0;
-          $scope.seekPurchaseTableParams = new ngTableParams({
-            pageNumber: 1,
-            pageSize: 10
-          }, {
-            total: 0,
-            getData: function ($defer, params) {
-              const param = BaseService.parseParams(params.url());
-              if ($scope.userInfo.enterprise) {
-                param.enUU = $scope.userInfo.enterprise.uu;
-              } else {
-                param.recorderUU = $scope.userInfo.userUU;
-              }
-              // param.isMallGoods = $scope.isMallGoods;
-              // param.deadline = $scope.deadline;
-              param.keyword = $scope.keyWord;
-              param.state = "todo";
-              param.overdue = $scope.overdue;
-              param.fromDate = $scope.startDate
-                  ? $scope.startDate.getTime() : null;
-              param.endDate = $scope.endDate ? $scope.endDate.getTime()
-                  : null;
-              param.pageNumber = param.page;
-              param.pageSize = param.count;
-              if ($scope.isSearch) {
-                param.page = 1;
-                params.page(1);
-                $scope.isSearch = false;
-              }
-              seekPurchase.getUserSeekPageInfo(param, function (data) {
-                params.total(data.totalElements);
-                $defer.resolve(data.content);
-                $scope.seekListData = data;
-              }, function (response) {
-                toaster.pop('error', response.data);
-              });
-            }
-          });
+
 
           $scope.bomSearch = {};
           $scope.bomTableParams = new ngTableParams({

+ 1 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_accept_ctrl.js

@@ -26,6 +26,7 @@ define(['app/app'], function(app) {
                 // param.enUU = $scope.userInfo.enterprise.uu;
                 // param.deadline = $scope.deadline;
                 // param.status = $scope.status;
+                param._state = "agreed";
                 filter.keyword = $scope.keyWord;
                 filter.fromDate = $scope.startDate
                   ? $scope.startDate.getTime() : null;

+ 2 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -20,9 +20,8 @@ define(['app/app'], function(app) {
             total : 0,
             getData : function ($defer, params) {
                 const param = BaseService.parseParams(params.url());
-                filter = {};
+                var filter = {};
                 filter.vendUU = $scope.userInfo.enterprise.uu;
-
                 // param.enUU = $scope.userInfo.enterprise.uu;
                 // param.deadline = $scope.deadline;
                 // param.status = $scope.status;
@@ -31,6 +30,7 @@ define(['app/app'], function(app) {
                   ? $scope.startDate.getTime() : null;
                 filter.endDate = $scope.endDate ? $scope.endDate.getTime()
                   : null;
+                param._state = "done";
                 param.filter = filter;
                 param.pageNumber = param.page;
                 param.pageSize = param.count;

+ 1 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -19,6 +19,7 @@ define(['app/app'], function (app) {
               const param = BaseService.parseParams(params.url());
               // param.deadline = $scope.deadline;
               // param.status = $scope.status;
+              param.enUU = $scope.userInfo.enterprise.uu;
               param.keyword = $scope.keyWord;
               param.fromDate = $scope.startDate
                   ? $scope.startDate.getTime() : null;

+ 2 - 1
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -624,11 +624,12 @@
             </ul>
         </div>
     </div>
-    <div class="oder" style="margin-top: 10px;">
+    <div class="oder" style="margin-top: 10px;" ng-show="activeType == 'seekManage'">
         <div class="oder01">
             <ul>
                 <li ng-class="{'active': tab == 'waitOffer'}"><a href="javascript:void(0)" ng-click="toogleTab('waitOffer')">待报价</a></li>
                 <li ng-class="{'active': tab == 'offered'}"><a href="javascript:void(0)" ng-click="toogleTab('offered')">已报价</a></li>
+              <li ng-class="{'active': tab == 'accepted'}"><a href="javascript:void(0)" ng-click="toogleTab('offered')">已采纳</a></li>
             </ul>
         </div>
     </div>

+ 2 - 3
src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html

@@ -546,10 +546,9 @@
                 <td class="left-time" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></td>
                 <td class="left-time" ng-if="seek.remainingTime <= 0"><span>已截止</span></td>
                 <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
-                <td class="operate" ng-switch="seek.agreed">
+                <td class="operate">
                     <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
-                    <span ng-switch-when="0">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
-                    <img ng-switch-when="1" src="static/img/seekPurchase/recieved.png" alt="">
+                    <span>已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
                 </td>
             </tr>
             <!--

+ 3 - 1
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -614,7 +614,9 @@
                     <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
                     <td class="operate">
                         <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
-                        <div ng-click="setSeekActive(seek, true, index)">我要报价</div>
+                        <div ng-if="seek.quoted != 1 && seek.remainingTime > 0" ng-click="setSeekActive(seek, true, index)">我要报价</div>
+                        <span ng-if="seek.quoted == 1">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
+                        <!--<img ng-if="seek.quoted == 1" src="static/img/seekPurchase/recieved.png" alt="">-->
                     </td>
                 </tr>
                 <!--<tr class="say-price">