Просмотр исходного кода

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

liusw 8 лет назад
Родитель
Сommit
5e7e31bc3b

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

@@ -15,11 +15,11 @@ define([ 'ngResource' ], function() {
         method: 'POST'
       },
       saveOffer: {
-        url: 'seek/offer/saveOffer',
+        url: 'http://10.1.51.88:8080/inquiry/sale/item/save',
         method: 'POST'
       },
       getUserSeekPageInfo: {
-        url: 'http://10.1.51.88:8080/inquiry/public',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/list',
         method: 'GET'
       },
       getMallGoodsList: {
@@ -28,7 +28,7 @@ define([ 'ngResource' ], function() {
         isArray: true
       },
       getSeekPurchaseOfferPageInfo: {
-        url: 'seek/offer/getSeekPurchaseOfferPageInfo',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/product/detail',
         method: 'GET'
       },
       getMyOfferPageInfo: {
@@ -36,11 +36,11 @@ define([ 'ngResource' ], function() {
         method: 'GET'
       },
       updateSeekPurchaseStatus: {
-        url: 'seek/updateSeekPurchaseStatus',
-        method: 'PUT'
+        url: 'http://10.1.51.88:8080/inquiry/buyer/decide',
+        method: 'POST'
       },
       getSeekPurchaseBomListPage: {
-        url: 'seek/getSeekPurchaseBomListPage',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/inquiryList',
         method: 'GET'
       },
       findOneBom: {

+ 106 - 84
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -36,6 +36,78 @@ define(['app/app'], function (app) {
             deadline: true
           };
 
+          // 买家求购列表
+          $scope.searchStatus = 0;
+          $scope.seekPurchaseTableParams = new ngTableParams({
+            pageNumber: 1,
+            pageSize: 10
+          }, {
+            total: 0,
+            getData: function ($defer, params) {
+              const param = BaseService.parseParams(params.url());
+              param.userUU = $scope.userInfo.userUU;
+              if ($scope.userInfo.enterprise) {
+                param.enUU = $scope.userInfo.enterprise.uu;
+              }
+              // param.isMallGoods = $scope.isMallGoods;
+              // param.deadline = $scope.deadline;
+              param.keyword = $scope.keyWord;
+              param.state = $scope.searchStatus;
+              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({
+            page: 1,
+            count: 10
+          }, {
+            total: 0,
+            getData: function ($defer, params) {
+              const param = BaseService.parseParams(params.url());
+              param.userUU = $scope.userInfo.userUU;
+              if ($scope.userInfo.enterprise.uu) {
+                param.enUU = $scope.userInfo.enterprise.uu;
+              }
+              // param.minReleaseDate = $scope.bomSearch.startDate
+              //     ? $scope.bomSearch.startDate.getTime() : null;
+              // param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
+              //     : null;
+              // param.name = $scope.bomSearch.name;
+              // 返回首页
+              if ($scope.isSearch) {
+                param.page = 1;
+                params.page(1);
+                $scope.isSearch = false;
+              }
+              seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
+                params.total(data.totalElements);
+                $scope.bomTotal = data.totalElements;
+                $defer.resolve(data.content);
+              }, function (response) {
+                toaster.pop('error', response.data);
+              });
+            }
+          });
+
           var getRealLen = function (str) {
             var len = 0;
             for (var i = 0; i < str.length; i++) {
@@ -199,14 +271,18 @@ define(['app/app'], function (app) {
               var inquiry = {};
               var inquiryItem = {};
               inquiry.recorderUU = $scope.userInfo.userUU;
-              inquiry.enUU = $scope.userInfo.enterprise.uu;
+              if ($scope.userInfo.enterprise) {
+                inquiry.enUU = $scope.userInfo.enterprise.uu;
+              }
               inquiry.code = "MALL" + $filter('date')(new Date, 'yyyyMMddsss');
               inquiry.date = new Date();
               inquiry.recorder = $scope.userInfo.userName;
               inquiry.endDate = $scope.applyObj.deadline;
               inquiry.sourceapp = "MALL";
               inquiry.amount = 1;
+              inquiryItem.prodTitle = $scope.applyObj.code;
               inquiryItem.userUU = $scope.userInfo.userUU;
+              inquiryItem.source = "MALL";
               inquiryItem.userName = $scope.userInfo.userName;
               inquiryItem.userTel = $scope.userInfo.userTel;
               inquiryItem.needquantity = $scope.applyObj.amount;
@@ -276,39 +352,6 @@ 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());
-              param.userUU = $scope.userInfo.userUU;
-              param.enUU = $scope.userInfo.enterprise.uu;
-              // param.isMallGoods = $scope.isMallGoods;
-              // param.deadline = $scope.deadline;
-              param.keyword = $scope.keyWord;
-              // param.status = $scope.searchStatus;
-              param.fromDate = $scope.startDate
-                  ? $scope.startDate.getTime() : null;
-              param.endDate = $scope.endDate ? $scope.endDate.getTime()
-                  : null;
-              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.onSearch = function (searchStatus) {
@@ -325,27 +368,32 @@ define(['app/app'], function (app) {
             }
           }
           // 采纳报价
-          $scope.adopt = function () {
-            if (!$scope.purchaseQuantity) {
-              toaster.pop('error', "请输入正确的采购数量");
-              return;
-            }
-            seekPurchase.updateSeekPurchaseStatus({
-              spId: $scope.currentOffer.spId,
-              ofId: $scope.currentOffer.id,
-              purchaseQuantity: $scope.purchaseQuantity
-            }, {}, function (data) {
-              if (data.success) {
-                $scope.currentOffer = null;
-                $scope.seekPurchaseTableParams.reload();
-                $scope.showUseFlag = false;
-                toaster.pop('success', '采纳报价成功');
-              } else {
-                toaster.pop('error', data.message);
-              }
-            }, function (response) {
+          $scope.adopt = function (id) {
+            seekPurchase.updateSeekPurchaseStatus({id: id, status: 1},{},function(){
+              toaster.pop('success', '采纳报价成功');
+            }, function(response){
               toaster.pop('error', response.data);
             });
+            // if (!$scope.purchaseQuantity) {
+            //   toaster.pop('error', "请输入正确的采购数量");
+            //   return;
+            // }
+            // seekPurchase.updateSeekPurchaseStatus({
+            //   spId: $scope.currentOffer.spId,
+            //   ofId: $scope.currentOffer.id,
+            //   purchaseQuantity: $scope.purchaseQuantity
+            // }, {}, function (data) {
+            //   if (data.success) {
+            //     $scope.currentOffer = null;
+            //     $scope.seekPurchaseTableParams.reload();
+            //     $scope.showUseFlag = false;
+            //     toaster.pop('success', '采纳报价成功');
+            //   } else {
+            //     toaster.pop('error', data.message);
+            //   }
+            // }, function (response) {
+            //   toaster.pop('error', response.data);
+            // });
           }
 
           $scope.offerCount = 0;
@@ -353,19 +401,20 @@ define(['app/app'], function (app) {
           $scope.currentSeek = {};
           $scope.setSeekStatus = function (seek, status) {
             $scope.offerCount = seek.offerAmount;
-            $scope.goodsCount = seek.goodsAmount;
+            $scope.goodsCount = 0;
             $scope.currentSeek = seek;
             // 查看报价
             if (status == 2 && $scope.offerCount != 0) {
               seekPurchase.getSeekPurchaseOfferPageInfo(
-                  {count: 100, page: 1, spId: seek.spId}, function (data) {
-                    $scope.offer = data.content;
+                  {id: seek.id}, function (data) {
+                    $scope.offer = data.inquiryItems;
                     clearSeekStatus();
                     seek.$status = status;
                   });
             } else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
               seekPurchase.getMallGoodsList({spId: seek.spId}, function (data) {
                 $scope.goods = data;
+                $scope.goodsCount = data.length;
                 clearSeekStatus();
                 initFragments();
                 seek.$status = status;
@@ -719,34 +768,7 @@ define(['app/app'], function (app) {
               toaster.pop('error', response.data);
             });
           };
-          $scope.bomSearch = {};
-          $scope.bomTableParams = new ngTableParams({
-            page: 1,
-            count: 10
-          }, {
-            total: 0,
-            getData: function ($defer, params) {
-              const param = BaseService.parseParams(params.url());
-              param.minReleaseDate = $scope.bomSearch.startDate
-                  ? $scope.bomSearch.startDate.getTime() : null;
-              param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
-                  : null;
-              param.name = $scope.bomSearch.name;
-              // 返回首页
-              if ($scope.isSearch) {
-                param.page = 1;
-                params.page(1);
-                $scope.isSearch = false;
-              }
-              seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
-                params.total(data.totalElements);
-                $scope.bomTotal = data.totalElements;
-                $defer.resolve(data.content);
-              }, function (response) {
-                toaster.pop('error', response.data);
-              });
-            }
-          });
+
           // 搜索
           $scope.onBomSearch = function () {
             $scope.isSearch = true;

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

@@ -22,13 +22,18 @@ define(['app/app'], function(app) {
                 const param = BaseService.parseParams(params.url());
                 filter = {};
                 filter.vendUU = $scope.userInfo.enterprise.uu;
-                param.filter = filter;
+
                 // param.enUU = $scope.userInfo.enterprise.uu;
                 // param.deadline = $scope.deadline;
                 // param.status = $scope.status;
-                // param.keyWord = $scope.keyWord;
-                // param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
-                // param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
+                filter.keyword = $scope.keyWord;
+                filter.fromDate = $scope.startDate
+                  ? $scope.startDate.getTime() : null;
+                filter.endDate = $scope.endDate ? $scope.endDate.getTime()
+                  : null;
+                param.filter = filter;
+                param.pageNumber = param.page;
+                param.pageSize = param.count;
               if ($scope.isSearch) {
                 param.page = 1;
                 params.page(1);

+ 67 - 46
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -1,13 +1,13 @@
 define(['app/app'], function (app) {
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$rootScope', '$stateParams', '$state', 'toaster',
-        'seekPurchase', 'BaseService', 'ngTableParams', '$modal',
+        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload',
         function ($scope, $rootScope, $stateParams, $state, toaster,
-            seekPurchase, BaseService, ngTableParams, $modal) {
+            seekPurchase, BaseService, ngTableParams, $modal, $upload) {
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
-          $scope.offer = {};
+          $scope.inquiryItem = {};
 
           // 获取当前卖家求购推送列表
           $scope.seekPurchaseTableParams = new ngTableParams({
@@ -19,11 +19,13 @@ define(['app/app'], function (app) {
               const param = BaseService.parseParams(params.url());
               // param.deadline = $scope.deadline;
               // param.status = $scope.status;
-              // param.keyWord = $scope.keyWord;
-              // param.minReleaseDate = $scope.startDate
-              //     ? $scope.startDate.getTime() : null;
-              // param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime()
-              //     : null;
+              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);
@@ -145,44 +147,60 @@ define(['app/app'], function (app) {
             return $scope.validOffer.unitPrice && $scope.validOffer.minDay && $scope.validOffer.maxDay;
           }
 
+
+          // 删除一列分段报价
+          $scope.removeStep = function (inquiryItem, stepIndex) {
+            inquiryItem.replies.splice(stepIndex, 1);
+            $scope.replyPrices.splice(stepIndex, 1);
+            $scope.replylapQtys.splice(stepIndex, 1);
+          };
+
           // 保存报价
           $scope.saveOfferBtn = false;
-          $scope.saveOffer = function (seek) {
-            if ($scope.checkAllOffer()) {
-              $scope.saveOfferBtn = true;
-              seekPurchase.saveOffer($scope.offer, function (data) {
-                if (data.success) {
-                  $scope.setSeekActive(seek, false);
-                  $scope.seekPurchaseTableParams.reload();
-                  $scope.saveOfferBtn = true;
-                  toaster.pop('success', '报价成功');
-                } else {
-                  $scope.saveOfferBtn = true;
-                  toaster.pop('error', data.message);
-                }
-              }, function (res) {
-                toaster.pop('error', res.data);
-              });
-            } else {
-              if (!$scope.validOffer.unitPrice) {
-                if (!$scope.offer.unitPrice) {
-                  toaster.pop('warning', '提示', '单价不能为空');
-                } else {
-                  toaster.pop('warning', '提示', '单价必须是大于0的数字');
-                }
-              } else if (!$scope.validOffer.minDay || !$scope.validOffer.maxDay) {
-                if ((!$scope.offer.minDay && !angular.isNumber($scope.offer.minDay)) || (!$scope.offer.maxDay && !angular.isNumber($scope.offer.maxDay))) {
-                  toaster.pop('warning', '提示', '交期不能为空');
-                } else {
-                  if ($scope.offer.minDay > 31 || $scope.offer.minDay < 1 || $scope.offer.minDay.toString().indexOf('.') !== -1
-                      || $scope.offer.maxDay > 31 || $scope.offer.maxDay < 1 || $scope.offer.maxDay.toString().indexOf('.') !== -1) {
-                    toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                  } else {
-                    toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
-                  }
-                }
-              }
-            }
+          $scope.saveOffer = function () {
+            $scope.inquiryItem.vendUU = $scope.userInfo.enterprise.uu;
+            $scope.inquiryItem.vendUserUU = $scope.userInfo.userUU;
+            seekPurchase.saveOffer($scope.inquiryItem,function(){
+              toaster.pop('success', '报价成功');
+              $scope.isShowSayPriceBox = false;
+            }, function (response) {
+              toaster.pop('error', response.data.message);
+            });
+            // if ($scope.checkAllOffer()) {
+            //   $scope.saveOfferBtn = true;
+            //   seekPurchase.saveOffer($scope.offer, function (data) {
+            //     if (data.success) {
+            //       $scope.setSeekActive(seek, false);
+            //       $scope.seekPurchaseTableParams.reload();
+            //       $scope.saveOfferBtn = true;
+            //       toaster.pop('success', '报价成功');
+            //     } else {
+            //       $scope.saveOfferBtn = true;
+            //       toaster.pop('error', data.message);
+            //     }
+            //   }, function (res) {
+            //     toaster.pop('error', res.data);
+            //   });
+            // } else {
+            //   if (!$scope.validOffer.unitPrice) {
+            //     if (!$scope.offer.unitPrice) {
+            //       toaster.pop('warning', '提示', '单价不能为空');
+            //     } else {
+            //       toaster.pop('warning', '提示', '单价必须是大于0的数字');
+            //     }
+            //   } else if (!$scope.validOffer.minDay || !$scope.validOffer.maxDay) {
+            //     if ((!$scope.offer.minDay && !angular.isNumber($scope.offer.minDay)) || (!$scope.offer.maxDay && !angular.isNumber($scope.offer.maxDay))) {
+            //       toaster.pop('warning', '提示', '交期不能为空');
+            //     } else {
+            //       if ($scope.offer.minDay > 31 || $scope.offer.minDay < 1 || $scope.offer.minDay.toString().indexOf('.') !== -1
+            //           || $scope.offer.maxDay > 31 || $scope.offer.maxDay < 1 || $scope.offer.maxDay.toString().indexOf('.') !== -1) {
+            //         toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+            //       } else {
+            //         toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+            //       }
+            //     }
+            //   }
+            // }
           }
 
           $scope.condition = {endDateOpen: false, startDateOpen: false};
@@ -261,8 +279,9 @@ define(['app/app'], function (app) {
             return Math.floor((timeStamp / (1000 * 60 * 60)) % 24);
           }
 
+          $scope.isShowSayPriceBox = false;
           /*设置列表状态*/
-          $scope.setSeekActive = function (seek, flag) {
+          $scope.setSeekActive = function (seek, flag, index) {
             if (flag) {
               angular.forEach($scope.seekListData, function (item) {
                 item.$active = false;
@@ -272,7 +291,9 @@ define(['app/app'], function (app) {
                 spId: seek.spId
               }
             }
-            seek.$active = flag;
+            //seek.$active = flag;
+            $scope.inquiryItem = seek;
+            $scope.isShowSayPriceBox = flag;
           }
         }]);
 });

+ 16 - 11
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -684,16 +684,19 @@
         <!--搜索时间筛选-->
         <div class="screen">
             <div class="fl">
+                <!--
                 <label class="com-check-box">
                     <input type="checkbox" id="1" ng-model="isMallGoods" ng-change="onSearch()">
                     <label for="1"></label>
-                </label>&nbsp;有现货&nbsp;&nbsp;
+                </label>&nbsp;有现货&nbsp;&nbsp;-->
+                <!--
                 截止时间&nbsp;
-                <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
-                    <option value="全部">全部</option>
-                    <option value="已截止">已截止</option>
+                <select class="form-control select-adder" ng-model="overdue" ng-change="onSearch()" ng-init="overdue='0'">
+                    <option value="0">全部</option>
+                    <option value="1">已截止</option>
                     <option value="正在生效">正在生效</option>
                 </select>
+                -->
             </div>
             <div class="sreach fr">
                 <span>发布时间&nbsp;</span>
@@ -743,12 +746,14 @@
                 <th width="105">生产日期</th>
                 <th width="123">截止时间</th>
                 <th width="81">
+                    <!--
                     <select class="select-adder form-control" ng-model="searchStatus" ng-change="onSearch(searchStatus)">
                         <option value="0">全部</option>
-                        <option value="200">待报价</option>
-                        <option value="201">已报价</option>
+                        <option value="">待报价</option>
+                        <option value="done">已报价</option>
                         <option value="202">已采纳</option>
-                    </select>
+                    </select>-->
+                    状态
                 </th>
                 <th width="92">操作</th>
             </tr>
@@ -855,14 +860,14 @@
                                 <table>
                                     <tbody>
                                     <tr ng-repeat="of in offer">
-                                        <td width="173" ng-bind="(of.enterprise).enName"></td>
+                                        <td width="173" ng-bind="of.userName"></td>
                                         <td width="186" class="red-text" ng-bind="of.minDay+'-'+of.maxDay">4-6</td>
                                         <td width="186"><span>{{of.currency + of.unitPrice | currencyStr}}</span></td>
                                         <td width="195" ng-bind="of.produceDate || '-'"></td>
                                         <td width="221" class="operate">
                                             <a>联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                                             <img ng-if="of.status == 202" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
-                                            <span ng-if="seek.status != 202" ng-click="setShowUseFlag(true, of)">采纳报价</span>
+                                            <span ng-if="seek.status != 202" ng-click="adopt(of.id)">采纳报价</span>
                                         </td>
                                     </tr>
                                     </tbody>
@@ -936,8 +941,8 @@
                 <td>
                     <img src="static/img/seekPurchase/Excel.png" alt="">
                     <div>
-                        <p ng-bind="bom.name"></p>
-                        <div>共 <span class="blue-text" ng-bind="bom.productAmount || 0"></span> 个产品,<span class="red-text" ng-bind="bom.offerAmount || 0">10</span> 个有报价,<span class="red-text" ng-bind="bom.goodsAmount || 0">7</span> 个有现货</div>
+                        <p ng-bind="bom.remark"></p>
+                        <div>共 <span class="blue-text" ng-bind="bom.amount || 0"></span> 个产品<!--,<span class="red-text" ng-bind="bom.offerAmount || 0">10</span> 个有报价,<span class="red-text" ng-bind="bom.goodsAmount || 0">7</span> 个有现货--></div>
                         <div ng-bind="bom.releaseDate | date:'yyyy-MM-dd HH:mm:ss'"></div>
                     </div>
                     <a href="user#/bomDetail/{{bom.bomId}}" class="fr">查看详情</a>

+ 19 - 11
src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html

@@ -442,20 +442,24 @@
         </div>
     </div>
     <div class="seek-purchase-content">
+        <!--
         <div class="seek-purchase-title">
             <div class="seek-data">采纳次数:<span ng-bind="seekPurchaseRate.acceptedAmount"></span></div>
             <div class="seek-data">报价次数:<span ng-bind="seekPurchaseRate.offerAmount"></span></div>
             <div class="seek-rate">求购成交率<span ng-bind="seekPurchaseRate.rate+'%'"></span></div>
         </div>
+        -->
         <!--搜索时间筛选-->
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
             <div class="fl">
+                <!--
                 截止时间&nbsp;
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                     <option value="全部">全部</option>
                     <option value="已截止">已截止</option>
                     <option value="正在生效">正在生效</option>
                 </select>
+                -->
                 <!--
                 报价状态&nbsp;
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
@@ -518,33 +522,36 @@
             <tbody ng-repeat="seek in $data" ng-class="{'active': seek.$active, 'hover': seek.$hover && (seek.status == 201 || seek.status == 202)}">
             <tr class="default-row" ng-mouseenter="seek.$hover = true;" ng-mouseleave="seek.$hover = false;" >
                 <td class="release-time">
-                    <span ng-bind="seek.releaseDate | date:'yyyy-MM-dd'"></span>
-                    <span ng-bind="seek.releaseDate | date:'HH:mm:ss'"></span>
+                    <span ng-bind="seek.inquiry.date | date:'yyyy-MM-dd'"></span>
+                    <span ng-bind="seek.inquiry.date | date:'HH:mm:ss'"></span>
+                    <!--
                     <div class="seek-status">
                         <div ng-show="seek.goodsEnuu" class="status">已在库</div>
                         <div ng-show="!seek.goodsEnuu" class="no-grounding">未在库</div>
                         <div class="BOM-list-btn" ng-if="seek.bomId">BOM清单</div>
                         <a ng-show="!seek.goodsEnuu" target="_blank" href="vendor#/vendor_upload">产品导入>></a>
                     </div>
+                    -->
                 </td>
-                <td class="user-name"><div title="{{seek.userName}}" ng-bind="seek.userName"></div></td>
-                <td><div title="{{seek.code}}" ng-bind="seek.code"></div></td>
-                <td><div title="{{seek.brand}}" ng-bind="seek.brand"></div></td>
+                <td class="user-name"><div title="{{seek.userName || seek.inquiry.enterprise.enName}}" ng-bind="seek.userName || seek.inquiry.enterprise.enName"></div></td>
+                <td><div title="{{seek.cmpCode || seek.prodCode || seek.product.cmpCode}}" ng-bind="seek.cmpCode || seek.prodCode || seek.product.cmpCode"></div></td>
+                <td><div title="{{seek.inbrand}}" ng-bind="seek.inbrand || '-'"></div></td>
                 <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '--'"></div></td>
                 <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '--'"></div></td>
-                <td><div title="{{seek.amount}}" ng-bind="seek.amount || '--'"></div></td>
+                <td><div title="{{seek.needquantity}}" ng-bind="seek.amount || '--'"></div></td>
                 <td class="unit-price">
-                    <span>{{seek.spCurrency + seek.spUnitPrice | currencyStr}}</span>
+                    <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                 </td>
                 <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="operate" ng-switch="seek.status">
+                <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
+                <td class="operate" ng-switch="seek.agreed">
                     <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
-                    <div  ng-switch-when="200" ng-click="setSeekActive(seek, true)">我要报价</div>
-                    <span ng-switch-when="201">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
-                    <img ng-switch-when="202" src="static/img/seekPurchase/recieved.png" alt="">
+                    <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="">
                 </td>
             </tr>
+            <!--
             <tr class="expand-row">
                 <td colspan="10">
                     <div style="width: 173px;">历史报价</div>
@@ -557,6 +564,7 @@
                     <div style="width: 271px;">生产日期:{{seek.produceDate || '-'}}</div>
                 </td>
             </tr>
+            -->
             </tbody>
         </table>
     </div>

+ 26 - 18
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -520,12 +520,14 @@
         <!--搜索时间筛选-->
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
             <div class="fl">
+                <!--
                 截止时间&nbsp;
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                     <option value="全部">全部</option>
                     <option value="已截止">已截止</option>
                     <option value="正在生效">正在生效</option>
                 </select>
+                -->
                 <!--
                 报价状态&nbsp;
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
@@ -585,7 +587,7 @@
                     <th width="92">操作</th>
                 </tr>
             </thead>
-            <tbody ng-repeat="seek in seekListData" ng-class="{'active': seek.$active}">
+            <tbody ng-repeat="seek in seekListData track by $index" ng-class="{'active': seek.$active}">
                 <tr class="default-row">
                     <td class="release-time">
                         <span ng-bind="seek.date | date:'yyyy-MM-dd'"></span>
@@ -597,12 +599,12 @@
                         </div>
                         -->
                     </td>
-                    <td class="user-name"><div title="{{seek.userName}}" ng-bind="seek.userName || '-'"></div></td>
-                    <td><div title="{{seek.cmpCode}}" ng-bind="seek.code || '-'"></div></td>
-                    <td><div title="{{seek.inbrand}}" ng-bind="seek.brand || '-'"></div></td>
+                    <td class="user-name"><div title="{{seek.userName || seek.inquiry.enterprise.enName}}" ng-bind="seek.userName || seek.inquiry.enterprise.enName"></div></td>
+                    <td><div title="{{seek.cmpCode}}" ng-bind="seek.cmpCode || '-'"></div></td>
+                    <td><div title="{{seek.inbrand}}" ng-bind="seek.inbrand || '-'"></div></td>
                     <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '-'"></div></td>
                     <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '-'"></div></td>
-                    <td><div title="{{seek.needquantity}}" ng-bind="seek.amount || '-'"></div></td>
+                    <td><div title="{{seek.needquantity}}" ng-bind="seek.needquantity || '-'"></div></td>
                     <td class="unit-price">
                         <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                     </td>
@@ -611,10 +613,10 @@
                     <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)">我要报价</div>
+                        <div ng-click="setSeekActive(seek, true, index)">我要报价</div>
                     </td>
                 </tr>
-                <tr class="say-price">
+                <!--<tr class="say-price">
                     <td colspan="10">
                         <div>
                             <div>报价</div>
@@ -641,28 +643,30 @@
                             </div>
                         </div>
                     </td>
-                </tr>
+                </tr>-->
             </tbody>
         </table>
     </div>
-    <div class="say-price-box">
+    <div class="say-price-box" ng-show="isShowSayPriceBox">
         <div class="title">
-            <div>型号:<span>PMDIDASJD</span></div>
-            <div>品牌:<span>台积电</span></div>
+            <div>型号:<span ng-bind="inquiryItem.cmpCode">PMDIDASJD</span></div>
+            <div>品牌:<span ng-bind="inquiryItem.inbrand">台积电</span></div>
             <i class="fa fa-close"></i>
         </div>
         <div class="content">
             <div class="content-line">
                 <div class="form-item form-left">
                     <span><i>*</i>交期:</span>
+                    <!--
                     <input type="text" class="form-control" placeholder="天数">
                     -
-                    <input type="text" class="form-control" placeholder="天数">
+                    -->
+                    <input type="text" class="form-control" ng-model="inquiryItem.leadtime" placeholder="天数">
                 </div>
                 <div class="form-item form-upload">
                     <label>
                         <span><i>+</i>添加附件</span>
-                        <input type="file">
+                        <input type="file" ng-model="myFiles">
                     </label>
                     <!--<div>
                       <span>我是Excel的名字111</span>
@@ -674,17 +678,20 @@
             <div class="content-line">
                 <div class="form-item form-left">
                     <span><i>*</i>价格梯度:</span>
+                    <!--
                     <input type="text" class="form-control" placeholder="数量">
                     -
-                    <input type="text" class="form-control" placeholder="数量">
+                    -->
+                    <input type="text" class="form-control" ng-model="inquiryItem.replies[0].lapQty" placeholder="数量">
                 </div>
                 <div class="form-item form-right">
                     <span><i>*</i>单价($):</span>
-                    <input type="text" class="form-control" placeholder="单价">
+                    <input type="text" class="form-control"  ng-model="inquiryItem.replies[0].price" placeholder="单价">
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                 </div>
             </div>
+            <!--
             <div class="content-line">
                 <div class="form-item form-left">
                     <span><i>*</i>价格梯度:</span>
@@ -694,15 +701,16 @@
                 </div>
                 <div class="form-item form-right">
                     <span><i>*</i>单价($):</span>
-                    <input type="text" class="form-control" placeholder="单价">
+                    <input type="text" class="form-control" placeholder="单价" ng-model="reply.price">
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                 </div>
             </div>
+    -->
         </div>
         <div class="operate">
-            <span>确定</span>
-            <span>取消</span>
+            <span ng-click="saveOffer()">确定</span>
+            <span ng-click="setSeekActive(seek, false, index)">取消</span>
         </div>
     </div>
 </div>