Browse Source

替代料报价+订单bug

yangc 7 years ago
parent
commit
6dfde71948

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

@@ -23,7 +23,7 @@ define([ 'ngResource' ], function() {
         method: 'POST'
       },
      saveOffer: {
-        url: 'http://218.17.158.219:24000/inquiry/sale/item/save',
+        url: 'http://10.1.51.82:24002/inquiry/sale/item/save',
         method: 'POST'
       },
       saveOfferProd: {

+ 40 - 8
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -39,7 +39,8 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
             $scope.seekPurchaseTableParams.reload();
           }
           seekPurchase.getSeekUrl({}, function(data) {
-            var seekUrl = data.url;
+            // var seekUrl = data.url;
+              var seekUrl = 'http://10.1.51.82:24002';
             /*$scope.tab = 'waitOffer';*/
             $scope.toogleTab = function (tab) {
               $scope.vendorType = 'all'
@@ -80,7 +81,16 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
                     }).success(function (data) {
                       params.total(data.totalElements);
                       $defer.resolve(data.content);
+                        // for (var i = 0; i < data.content.length; i++) {
+                        //     data.content[i].replaceQutations = [];
+                        //     for (var j = 0; j < data.content[i].qutations.length; j++) {
+                        //         if (data.content[i].qutations[j].isReplace) {
+                        //             data.content[i].replaceQutations.push(data.content[i].qutations[j])
+                        //         }
+                        //     }
+                        // }
                       $scope.seekListData = data;
+
                     }).error(function (response) {
                       toaster.pop('error', response);
                     });
@@ -581,16 +591,38 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
 
           $scope.offerCount = 0;
           $scope.goodsCount = 0;
+              $scope.replaceOfferCount = 0;
           $scope.currentSeek = {};
-          $scope.setSeekStatus = function (seek, status) {
-            $scope.offerCount = seek.offerAmount;
+          $scope.setSeekStatus = function (seek, status, isDisabled) {
+              if (isDisabled) {
+                  return;
+              }
+              if (seek.id != $scope.currentSeek.id) {
+                  $scope.isInit = true;
+                  $scope.goodsCount = 0;
+                  $scope.offerCount = 0;
+                  $scope.replaceOfferCount = 0;
+              }
+              if (seek.qutations && seek.qutations.length && $scope.isInit) {
+                  for (var i = 0; i < seek.qutations.length; i++) {
+                      if (seek.qutations[i].isReplace == 1) {
+                          $scope.replaceOfferCount++;
+                      } else {
+                          $scope.offerCount++;
+                      }
+                  }
+                  $scope.isInit = false;
+              }
+            // $scope.offerCount = seek.offerAmount;
             $scope.currentSeek = seek;
-            seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
-              $scope.goods = data;
-              $scope.goodsCount = data.length;
-            });
+              if (!seek.$status || seek.$status != 1) {
+                  seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
+                      $scope.goods = data;
+                      $scope.goodsCount = data.length;
+                  });
+              }
             // 查看报价
-            if (status == 2 && $scope.offerCount != 0) {
+            if ((!seek.$status || seek.$status < 2) || (status == 2 && $scope.offerCount != 0) || (status == 3 && $scope.replaceOfferCount != 0)) {
                 Authority.getAuthority({resUrl: '/authInquiry/inquiry/getQuotations'}, function (data) {
                     if (data.status == 'fail') {
                         toaster.pop('error', data.msg || '系统错误');

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

@@ -5,7 +5,8 @@ define(['app/app'], function(app) {
         $scope.seekPurchaseRate = {};
         $scope.offer = {};
       seekPurchase.getSeekUrl({}, function(data) {
-        var seekUrl = data.url;
+        // var seekUrl = data.url;
+          var seekUrl = 'http://10.1.51.82:24002';
         // 获取我的报价列表
         $scope.seekPurchaseTableParams = new ngTableParams({
           pageNumber: 1,

+ 58 - 5
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -7,21 +7,46 @@ define(['app/app'], function (app) {
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
+          $scope.sayType = 'current'; // 报价类型,current为当前,replace为替代料
           seekPurchase.getSeekUrl({}, function(data) {
-            var seekUrl = data.url;
+            // var seekUrl = data.url;
+            var seekUrl = 'http://10.1.51.82:24002';
           $scope.initInquiryItem = function () {
             $scope.validSayPrice = {
               leadtime: false,
               repliesPrice: false,
-              repliesLapQty: false
+              repliesLapQty: false,
+              replaceBrand: false,
+              replaceCmpCode: false,
+              replaceSpec: false
             }
           }
           $scope.initInquiryItem();
 
+            $scope.setSayType = function (type) {
+              if (type == 'current') {
+                delete $scope.inquiryItem.replaceBrand;
+                delete $scope.inquiryItem.replaceCmpCode;
+                delete $scope.inquiryItem.replaceSpec;
+                // $scope.inquiryItem.isReplace = null;
+              }
+              $scope.inquiryItem.leadtime = '';
+              for (var i = 0; i < $scope.seekCurrency.length; i++) {
+                $scope.seekCurrency[i] = 'RMB';
+              }
+              $scope.inquiryItem.replies = [
+                {
+                  lapQty: '',
+                  price: ''
+                }
+              ];
+              $scope.sayType = type;
+            }
+
             //卖家待报价推送信息,self为我的商机,all为公司商机
             if ($location.search().type === '1') {
               $scope.vendorType = 'self';
-              console.log(1)
+              // console.log(1)
             } else {
               $scope.vendorType = 'all';
             }
@@ -210,6 +235,9 @@ define(['app/app'], function (app) {
               if ($scope.vendorType !== 'noOppor') {
                   $scope.inquiryItem.id = $scope.inquiryItem.itemId;
               }
+              if ($scope.sayType == 'replace') {
+                $scope.inquiryItem.isReplace = 1;
+              }
               // $scope.inquiryItem.id = $scope.inquiryItem.itemId;
               if (seekUrl == 'https://api-inquiry.usoftmall.com') {
                 seekPurchase.saveOfferProd($scope.inquiryItem, function (data) {
@@ -342,7 +370,7 @@ define(['app/app'], function (app) {
 
           $scope.onLeadtimeInput = function () {
             var time = $scope.inquiryItem.leadtime.toString();
-            console.info();
+            // console.info();
             if (time.length > 3) {
               $scope.inquiryItem.leadtime = Number(time.substring(0, 3));
             }
@@ -355,6 +383,30 @@ define(['app/app'], function (app) {
               $scope.validSayPrice.leadtime = true;
             }
           }
+            $scope.onReplaceBrandBlur = function () {
+              if (!$scope.inquiryItem.replaceBrand || $scope.inquiryItem.replaceBrand.length == 0) {
+                $scope.validSayPrice.replaceBrand = false;
+                toaster.pop('error', '请填写替代物料品牌');
+              } else {
+                $scope.validSayPrice.replaceBrand = true;
+              }
+            }
+            $scope.onReplaceCmpCodeBlur = function () {
+              if (!$scope.inquiryItem.replaceCmpCode || $scope.inquiryItem.replaceCmpCode.length == 0) {
+                $scope.validSayPrice.replaceCmpCode = false;
+                toaster.pop('error', '请填写替代物料型号');
+              } else {
+                $scope.validSayPrice.replaceCmpCode = true;
+              }
+            }
+            $scope.onReplaceSpecBlur = function () {
+              if (!$scope.inquiryItem.replaceSpec || $scope.inquiryItem.replaceSpec.length == 0) {
+                $scope.validSayPrice.replaceSpec = false;
+                toaster.pop('error', '请填写替代物料规格');
+              } else {
+                $scope.validSayPrice.replaceSpec = true;
+              }
+            }
           $scope.onReplyLapQtyBlur = function (index) {
             var lapQty = $scope.inquiryItem.replies[index].lapQty;
             var limitDownObj = $scope.getLimitDownQty();
@@ -436,12 +488,13 @@ define(['app/app'], function (app) {
           }*/
 
           $scope.checkValid = function () {
+            var validReplace = $scope.sayType == 'replace' ? $scope.validSayPrice.replaceBrand && $scope.validSayPrice.replaceCmpCode && $scope.validSayPrice.replaceSpec : true;
             for (var i = 0; i < $scope.inquiryItem.replies.length; i++) {
               if (!$scope.inquiryItem.replies[i].lapQty || !$scope.inquiryItem.replies[i].price) {
                 return false;
               }
             }
-            return $scope.validSayPrice.leadtime && $scope.validSayPrice.repliesLapQty && $scope.validSayPrice.repliesPrice;
+            return $scope.validSayPrice.leadtime && $scope.validSayPrice.repliesLapQty && $scope.validSayPrice.repliesPrice && validReplace;
           }
 
           $scope.setReplies = function (type, index) {

+ 143 - 142
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -65,148 +65,6 @@ define(['app/app'], function (app) {
             if (!$scope.isYrscStore && !$scope.isCONSIGNMENT) {
                 $scope.storeType = 'other';
                 window.sessionStorage.setItem('storeType', $scope.storeType);
-                $scope.orderTableParams = new ngTableParams($scope.tableParams, {
-                    total: 0,
-                    getData: function ($defer, params) {
-                        $scope.loading = true;
-                        $scope.paginationParams = params;
-                        var param = BaseService.parseParams(params.url());
-                        param.keyword = $scope.keyword ? $scope.keyword : null;
-                        if ($scope.childStatus!==''){
-                            param.status = $scope.childStatus;
-                        }else{
-                            param.status = getState();
-                        }
-                        param.page = $scope.param.page;
-                        // param.startMils = $scope.startMils;
-                        // param.endMils = $scope.endMils;
-                        param.exceptionType = window.sessionStorage.getItem('exceptionType');
-                        param.storeType = $scope.storeType;
-
-                        param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
-                        param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
-                        if (param.startMils != null && param.endMils != null){
-                            if (param.startMils > param.endMils){
-                                alert("开始时间不得超过结束时间!");
-                                return;
-                            }
-                        }
-
-                        Purchase.getByStatusAndInternal(param, function (page) {
-                            if (page) {
-                                if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
-                                    if ($scope.childStatus == '') {
-                                        if (page.content) {
-                                            angular.forEach(page, function (value, key) {
-                                                if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
-                                                    || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
-                                                    if (!$scope.counts) {
-                                                        $scope.counts = {};
-                                                    }
-                                                    $scope.counts[key] = value;
-                                                }
-                                                $scope.counts[$scope.status] = page.totalElements;
-                                            });
-                                        } else {
-                                            $scope.counts = {};
-                                        }
-                                    }
-                                }
-
-                                $scope.purchases = page.content;
-                                angular.forEach($scope.purchases, function (data) {
-                                    if (data.installmentId && data.installment.status == 504) {
-                                        angular.forEach(data.installment.installmentDetails, function (list) {
-                                            if (list.detno == data.installment.currentNo) {
-                                                if (list.status == 504) {
-                                                    data.installmentDetailPaid = true;
-                                                }
-                                            }
-                                        })
-                                    }
-                                    // 循环判断一期都没有付款并且延期的
-                                    if (data.installmentId && data.installment.status == 503) {
-                                        angular.forEach(data.installment.installmentDetails, function (detailslist) {
-                                            var nowTime = new Date();
-                                            if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
-                                                data.Overtime = true;
-                                            }
-                                        })
-                                    }
-                                    // 循环判断已付款未收款卖家可取消的
-
-                                });
-                                $scope.requestOver = 0;
-                                angular.forEach($scope.purchases, function (order) {
-                                    Rate.getRateVendor({orderId:order.orderid},{},function (data) {
-                                        if (data.data){
-                                            order.isEachRate = true;
-                                        }
-                                    });
-                                    Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
-                                        if(data.data){
-                                            if (data.data.vendorRateTime){
-                                                order.isFirstRate = true; // 是否完成初评
-                                            }
-                                            if (data.data.vendorAfterRateTime){
-                                                order.isAfterRate = true; // 是否完成追评
-                                            }
-                                        }
-                                        $scope.requestOver += 1;
-                                    });
-                                    angular.forEach(JSON.parse(order.statushistory),function (data) {
-                                        if (data.status == 520){
-                                            order.complete = data.time;
-                                        }
-                                    });
-                                });
-                                getExMsgState(); // 获取异常消息状态
-                                getReturnByPurchaseIds(); // 获取退货单信息
-
-                                $scope.orderLength = page.numberOfElements;
-                                $scope.pageParams.content = page.content;
-                                $scope.pageParams.number = page.number;
-                                // 分页部分有关内容
-                                $scope.param.currentPage = page.number;
-                                $scope.AllOrderInfo = page;
-                                $scope.acculatePages(page.number, page.totalPages);
-
-                                $scope.pageParams.totalElements = page.totalElements;
-                                $scope.pageParams.totalPages = page.totalPages;
-                                params.total(page.totalElements);
-                                $defer.resolve(page.content);
-                                $scope.orderLength = page.content.length;
-
-                                angular.forEach(page.content, function (order) {
-                                    var purchaseDetails = angular.copy(order.purchaseDetails);
-                                    // 获取型号数量
-                                    var components = {};
-                                    angular.forEach(purchaseDetails, function (purchaseDetail) {
-                                        components[purchaseDetail.uuid]++;
-                                    });
-                                    order.codeNum = Object.getOwnPropertyNames(components).length;
-                                    // TODO huxz 获取付款到账时间[已付款时间]
-                                    // 获取订单发货时间
-                                    getTimeByStatus(order, order.statushistory, 406, 'inbound');
-                                    // 获取订单收货时间
-                                    getTimeByStatus(order, order.statushistory, 405, 'receivedGoods');
-                                    // 当订单状态码为失效状态时
-                                    var statusCode = order.status;
-                                    if (statusCode == 602 || statusCode == 603 || statusCode == 604 || statusCode == 315 || statusCode == 605 || statusCode == 606) {
-                                        getTimeByStatus(order, order.statushistory, statusCode, 'unavailable');
-                                        order.unavailableReason = unavailableReasons[statusCode];
-                                    }
-                                });
-                            }
-                        }, function (reponse) {
-                            if ("系统错误".indexOf(reponse.data) > -1) {
-                                toaster.pop('error', '不好意思,系统出错,请联系客服。');
-                            } else {
-                                toaster.pop('info', reponse.data);
-                            }
-                        });
-                    }
-                });
                 $scope.orderTableParams.reload();
             }
         }, function (error) {
@@ -679,6 +537,149 @@ define(['app/app'], function (app) {
             $scope.orderTableParams.reload();
         };
 
+        $scope.orderTableParams = new ngTableParams($scope.tableParams, {
+            total: 0,
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                $scope.paginationParams = params;
+                var param = BaseService.parseParams(params.url());
+                param.keyword = $scope.keyword ? $scope.keyword : null;
+                if ($scope.childStatus!==''){
+                    param.status = $scope.childStatus;
+                }else{
+                    param.status = getState();
+                }
+                param.page = $scope.param.page;
+                // param.startMils = $scope.startMils;
+                // param.endMils = $scope.endMils;
+                param.exceptionType = window.sessionStorage.getItem('exceptionType');
+                param.storeType = $scope.storeType;
+
+                param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
+                param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
+                if (param.startMils != null && param.endMils != null){
+                    if (param.startMils > param.endMils){
+                        alert("开始时间不得超过结束时间!");
+                        return;
+                    }
+                }
+
+                Purchase.getByStatusAndInternal(param, function (page) {
+                    if (page) {
+                        if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
+                            if ($scope.childStatus == '') {
+                                if (page.content) {
+                                    angular.forEach(page, function (value, key) {
+                                        if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
+                                            || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
+                                            if (!$scope.counts) {
+                                                $scope.counts = {};
+                                            }
+                                            $scope.counts[key] = value;
+                                        }
+                                        $scope.counts[$scope.status] = page.totalElements;
+                                    });
+                                } else {
+                                    $scope.counts = {};
+                                }
+                            }
+                        }
+
+                        $scope.purchases = page.content;
+                        angular.forEach($scope.purchases, function (data) {
+                            if (data.installmentId && data.installment.status == 504) {
+                                angular.forEach(data.installment.installmentDetails, function (list) {
+                                    if (list.detno == data.installment.currentNo) {
+                                        if (list.status == 504) {
+                                            data.installmentDetailPaid = true;
+                                        }
+                                    }
+                                })
+                            }
+                            // 循环判断一期都没有付款并且延期的
+                            if (data.installmentId && data.installment.status == 503) {
+                                angular.forEach(data.installment.installmentDetails, function (detailslist) {
+                                    var nowTime = new Date();
+                                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
+                                        data.Overtime = true;
+                                    }
+                                })
+                            }
+                            // 循环判断已付款未收款卖家可取消的
+
+                        });
+                        $scope.requestOver = 0;
+                        angular.forEach($scope.purchases, function (order) {
+                            Rate.getRateVendor({orderId:order.orderid},{},function (data) {
+                                if (data.data){
+                                    order.isEachRate = true;
+                                }
+                            });
+                            Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
+                                if(data.data){
+                                    if (data.data.vendorRateTime){
+                                        order.isFirstRate = true; // 是否完成初评
+                                    }
+                                    if (data.data.vendorAfterRateTime){
+                                        order.isAfterRate = true; // 是否完成追评
+                                    }
+                                }
+                                $scope.requestOver += 1;
+                            });
+                            angular.forEach(JSON.parse(order.statushistory),function (data) {
+                                if (data.status == 520){
+                                    order.complete = data.time;
+                                }
+                            });
+                        });
+                        getExMsgState(); // 获取异常消息状态
+                        getReturnByPurchaseIds(); // 获取退货单信息
+
+                        $scope.orderLength = page.numberOfElements;
+                        $scope.pageParams.content = page.content;
+                        $scope.pageParams.number = page.number;
+                        // 分页部分有关内容
+                        $scope.param.currentPage = page.number;
+                        $scope.AllOrderInfo = page;
+                        $scope.acculatePages(page.number, page.totalPages);
+
+                        $scope.pageParams.totalElements = page.totalElements;
+                        $scope.pageParams.totalPages = page.totalPages;
+                        params.total(page.totalElements);
+                        $defer.resolve(page.content);
+                        $scope.orderLength = page.content.length;
+
+                        angular.forEach(page.content, function (order) {
+                            var purchaseDetails = angular.copy(order.purchaseDetails);
+                            // 获取型号数量
+                            var components = {};
+                            angular.forEach(purchaseDetails, function (purchaseDetail) {
+                                components[purchaseDetail.uuid]++;
+                            });
+                            order.codeNum = Object.getOwnPropertyNames(components).length;
+                            // TODO huxz 获取付款到账时间[已付款时间]
+                            // 获取订单发货时间
+                            getTimeByStatus(order, order.statushistory, 406, 'inbound');
+                            // 获取订单收货时间
+                            getTimeByStatus(order, order.statushistory, 405, 'receivedGoods');
+                            // 当订单状态码为失效状态时
+                            var statusCode = order.status;
+                            if (statusCode == 602 || statusCode == 603 || statusCode == 604 || statusCode == 315 || statusCode == 605 || statusCode == 606) {
+                                getTimeByStatus(order, order.statushistory, statusCode, 'unavailable');
+                                order.unavailableReason = unavailableReasons[statusCode];
+                            }
+                        });
+                    }
+                }, function (reponse) {
+                    if ("系统错误".indexOf(reponse.data) > -1) {
+                        toaster.pop('error', '不好意思,系统出错,请联系客服。');
+                    } else {
+                        toaster.pop('info', reponse.data);
+                    }
+                });
+            }
+        });
+
         // 确认收款
         // 分期明细
         $scope.numArray = {

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

@@ -307,7 +307,7 @@ define([ 'app/app' ], function(app) {
         // 下载模板
         $scope.download = function() {
             var show = SessionService.get($scope.userInfo.userUU + "-releasetip");
-            var downloadUrl = $rootScope.isPcbStore ? 'release/product/release/template/pcb' : 'release/product/release/template'
+            var downloadUrl = $rootScope.isPcbStore ? '/release/product/release/template/pcb' : '/release/product/release/template'
             if (!show) {
                 var modalInstance = $modal.open({
                     animation: true,

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

@@ -344,10 +344,10 @@
         background: #e8e8e8;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.input-number span:first-child {
-        top: 12px;
+        top: 22px;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.input-number span:last-child {
-        top: 12px;
+        top: 22px;
         right: -5px;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate > div > a {
@@ -430,18 +430,19 @@
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a {
         position: relative;
-        width: 50%;
+        width: 33.2%;
         height: 34px;
         line-height: 34px;
         text-align: center;
         display: inline-block;
-        background: #d7d6d5;
-        color: #fff;
+        background: #d6e5ff;
+        color: #3f84f6;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a.active {
-        background: #414140;
+        background: #3f84f6;
+        color: #fff;
     }
-    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child::after {
+  /*  .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child::after {
         position: absolute;
         right: 0;
         content: '';
@@ -452,7 +453,7 @@
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child.active::after {
         border-bottom-color: #d7d6d5;
-    }
+    }*/
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .seek-list {
         max-height: 250px;
         overflow-y: auto;
@@ -727,9 +728,9 @@
         border-radius: 2px;
         color: #fff;
     }
-    .seek-purchase .link-saler-box .content div a:first-child {
+   /* .seek-purchase .link-saler-box .content div a:first-child {
         background: #b4b5b9 !important;
-    }
+    }*/
     .seek-purchase .link-saler-box .select-adder {
         display: inline-block;
         width: 127px;
@@ -1134,14 +1135,15 @@
                     </div>
                 </td>
             </tr>
-            <tr class="expand-row" ng-if="seek.$status == 1 || seek.$status == 2">
+            <tr class="expand-row" ng-if="seek.$status == 1 || seek.$status == 2 || seek.$status == 3">
                 <td colspan="6">
                     <div>
                         <div class="switch-line">
-                            <a ng-disabled="goodsCount == 0" ng-class="{'active': seek.$status == 1}" ng-click="setSeekStatus(seek, 1)">商城现货(<span ng-bind="goodsCount"></span>)</a>
-                            <a ng-disabled="offerCount == 0" ng-class="{'active': seek.$status == 2}"  ng-click="setSeekStatus(seek, 2)">当前报价(<span ng-bind="offerCount"></span>)</a>
+                            <a ng-disabled="goodsCount == 0" ng-class="{'active': seek.$status == 1}" ng-click="setSeekStatus(seek, 1, goodsCount == 0)">商城现货(<span ng-bind="goodsCount"></span>)</a>
+                            <a ng-disabled="offerCount == 0" ng-class="{'active': seek.$status == 2}"  ng-click="setSeekStatus(seek, 2, offerCount == 0)">当前报价(<span ng-bind="offerCount"></span>)</a>
+                            <a ng-disabled="replaceOfferCount == 0" ng-class="{'active': seek.$status == 3}"  ng-click="setSeekStatus(seek, 3, replaceOfferCount == 0)">替代型号报价(<span ng-bind="replaceOfferCount"></span>)</a>
                         </div>
-                        <div ng-show="seek.$status == 1">
+                        <div ng-show="currentSeek.$status == 1">
                             <table>
                                 <thead>
                                 <tr>
@@ -1209,7 +1211,7 @@
                             </div>
                             -->
                         </div>
-                        <div ng-show="seek.$status == 2">
+                        <div ng-show="currentSeek.$status == 2 || currentSeek.$status == 3">
                             <table>
                                 <thead>
                                 <tr>
@@ -1224,7 +1226,7 @@
                             <div class="seek-list">
                                 <table>
                                     <tbody>
-                                    <tr ng-repeat="of in offer track by $index">
+                                    <tr ng-repeat="of in offer track by $index" ng-show="(currentSeek.$status == 3 && of.isReplace == 1) || (currentSeek.$status == 2 && of.isReplace != 1)">
                                         <td width="273" ng-bind="of.vendName" title="{{of.vendName}}"></td>
                                         <td width="233" class="red-text" ng-bind="of.leadtime">4-6</td>
                                         <td width="234" class="seek-replies">

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

@@ -583,6 +583,14 @@
     .oder01 ul li.active:after{
         display: block
     }
+    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history .replace-param {
+        display: block;
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        text-align: left;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -704,8 +712,8 @@
                 <td>
                     <div class="row-wrap il-content">
                         <div class="il-box-large il-box">
-                            <div title="{{seek.cmpCode}}" style="width: 100%" class="fl item"><span>型号:</span><div class="content" style="width:135px">{{seek.cmpCode || '-'}}</div></div>
-                            <div title="{{seek.spec}}" style="width: 100%" class="fl item bottom"><span>规格:</span><div class="content" style="width:135px">{{seek.spec || '-'}}</div></div>
+                            <div title="{{seek.cmpCode}}" style="width: 100%" class="fl item"><span>型号:</span><div class="content" style="width:130px">{{seek.cmpCode || '-'}}</div></div>
+                            <div title="{{seek.spec}}" style="width: 100%" class="fl item bottom"><span>规格:</span><div class="content" style="width:130px">{{seek.spec || '-'}}</div></div>
                         </div>
                     </div>
                 </td>
@@ -726,9 +734,18 @@
                     <a ng-click="setLinkBoxIndex($index)">联系买家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                     <div class="is-say-price" ng-if="seek.agreed != 1 && seek.agreed != 0 || seek.replies">已报价 <img src="static/img/seekPurchase/check.png" alt="">
                         <div class="say-price-history">
-                            <p class="price-title">历史报价</p>
+                            <p class="price-title">{{seek.isReplace == 1 ? '替代型号报价' : '当前型号报价'}}</p>
                             <div>
                                 <div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料品牌:</span><span ng-bind="seek.replaceBrand"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料型号:</span><span ng-bind="seek.replaceCmpCode"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料规格:</span><span ng-bind="seek.replaceSpec"></span>
+                                    </div>
                                     <span>交期:</span><span class="red-text" ng-bind="seek.leadtime + '天'">6 天</span>
                                 </div>
                                 <!--<div>-->

+ 79 - 10
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -387,8 +387,10 @@
       /*  display: none;*/
         position: fixed;
         width: 476px;
-        top: 30%;
-        left: 33%;
+        top: 50%;
+        left: 50%;
+        margin-top: -183px;
+        margin-left: -238px;
         /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
         -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
         box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
@@ -526,6 +528,12 @@
         padding-left: 36px;
         width: 133px;
     }
+    .seek-purchase .say-price-box  .content .content-line .form-item.form-long {
+        width: 100%;
+    }
+    .seek-purchase .say-price-box  .content .content-line .form-item.form-long input {
+        width: 292px;
+    }
     .seek-purchase .say-price-box .operate {
         border-top: 1px solid #e4e5e6;
         border-bottom-left-radius: 5px;
@@ -651,16 +659,16 @@
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div {
         padding: 9px 12px;
     }
-    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div {
+    /*.seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div {
         display: inline-block;
         text-align: left;
-    }
+    }*/
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(1) {
         /*float: left;*/
     }
-    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(2) {
-        margin-left: 32px;
-    }
+    /*.seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(2) {*/
+        /*margin-left: 32px;*/
+    /*}*/
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div span {
         color: #020202;
         margin: 0;
@@ -668,6 +676,14 @@
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div span.red-text {
         color: #f62d37;
     }
+    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history .replace-param {
+        display: block;
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        text-align: left;
+    }
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div.pre-line {
         display: block;
         padding: 13px 0;
@@ -696,6 +712,26 @@
         opacity: 1;
         height: 210px;
     }
+    .say-price-box .switch-say {
+        text-align: center;
+        margin: 13px 0;
+        font-size: 0;
+    }
+    .say-price-box .switch-say li {
+        width: 200px;
+        height: 34px;
+        line-height: 34px;
+        color: #4290f7;
+        border: 1px solid #4290f7;
+        display: inline-block;
+        vertical-align: middle;
+        font-size: 14px;
+        cursor: pointer;
+    }
+    .say-price-box .switch-say li.active {
+        color: #fff;
+        background: #4290f7;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -841,10 +877,19 @@
                         <!--<span ng-if="seek.quoted == 1 || seek.newId">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>-->
                         <div class="is-say-price" ng-if="seek.quoted == 1 || seek.newId">已报价 <img src="static/img/seekPurchase/check.png" alt="">
                             <div class="say-price-history">
-                                <p class="price-title">历史报价</p>
+                                <p class="price-title">{{seek.quotation.isReplace == 1 ? '替代型号报价' : '当前型号报价'}}</p>
                                 <div>
-                                    <div>
-                                        <span>交期:</span><span class="red-text" ng-bind="seek.quotation.leadtime + '天'">6 天</span>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料品牌:</span><span ng-bind="seek.quotation.replaceBrand"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料型号:</span><span ng-bind="seek.quotation.replaceCmpCode"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料规格:</span><span ng-bind="seek.quotation.replaceSpec"></span>
+                                    </div>
+                                    <div class="replace-param">
+                                        <span>交期:</span><span class="red-text" ng-bind="seek.quotation.leadtime + '天'"></span>
                                     </div>
                                     <!--<div>-->
                                     <!--<span>附件:</span><a href="">下载</a>-->
@@ -907,6 +952,30 @@
                         <span>规格:</span><span class="text" ng-bind="inquiryItem.spec || '-'" title="{{inquiryItem.spec || '-'}}"></span>
                     </div>
                 </div>
+                <ul class="switch-say">
+                    <li ng-class="{'active': sayType == 'current'}" ng-click="setSayType('current')">当前型号报价</li>
+                    <li ng-class="{'active': sayType == 'replace'}" ng-click="setSayType('replace')">替代型号报价</li>
+                </ul>
+                <div ng-show="sayType == 'replace'">
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>品牌:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceBrand" ng-blur="onReplaceBrandBlur()">
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>型号:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceCmpCode" ng-blur="onReplaceCmpCodeBlur()">
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>规格:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceSpec" ng-blur="onReplaceSpecBlur()">
+                        </div>
+                    </div>
+                </div>
                 <div class="content-line">
                     <div class="form-item form-left">
                         <span><i>*</i>交期:</span>