Преглед изворни кода

Merge remote-tracking branch 'origin/release-201815-liusw' into release-201815-liusw

shenjj пре 7 година
родитељ
комит
4a6fa7781c

+ 1 - 1
src/main/webapp/resources/js/sso/controllers/applyBindCtrl.js

@@ -6,7 +6,7 @@ define(['app/app'], function (app) {
     "use strict";
     app.register.controller('applyBindCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority) {
         $rootScope.active = 'sso_apply';
-        document.title = '申请绑定——帐户中心';
+        document.title = '绑定审核——帐户中心';
         $scope.tab = 'base';
         $scope.addingUser = false;
         $scope.setAddingUser = function (status) {

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

@@ -40,7 +40,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
           }
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
-              // var seekUrl = 'http://10.1.51.82:24002';
+            //   var seekUrl = 'http://10.1.51.82:24002';
             /*$scope.tab = 'waitOffer';*/
             $scope.toogleTab = function (tab) {
               $scope.vendorType = 'all'
@@ -248,7 +248,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
               toaster.pop('error', '型号输入不合法');
               $scope.validObj.code = false;
             }
-            return this.validObj.code;
+            return $scope.validObj.code;
           }
           $scope.checkBrand = function () {
             $scope.setShowSimilarBrandList($scope.isInBrandList);
@@ -1070,7 +1070,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
             if($(canvas).children().length> 1){
               return false
             }
-            console.log(QRCode)
+            // console.log(QRCode)
             // QRCode.toCanvas(shareMurl, canvas, function (error) {
             //   if (error){ console.error(error);return;}
             //   console.log('success!');

+ 166 - 6
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -1,9 +1,9 @@
 define(['app/app'], function (app) {
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$location', '$rootScope', '$stateParams', '$state', 'toaster',
-        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload', '$http', 'Authority',
+        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload', '$http', 'Authority', 'Search',
         function ($scope, $location, $rootScope, $stateParams, $state, toaster,
-            seekPurchase, BaseService, ngTableParams, $modal, $upload, $http, Authority) {
+            seekPurchase, BaseService, ngTableParams, $modal, $upload, $http, Authority, Search) {
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
@@ -11,17 +11,18 @@ define(['app/app'], function (app) {
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
             // var seekUrl = 'http://10.1.51.82:24002';
-          $scope.initInquiryItem = function () {
+          var initInquiryItem = function () {
             $scope.validSayPrice = {
               leadtime: false,
               repliesPrice: false,
               repliesLapQty: false,
               replaceBrand: false,
               replaceCmpCode: false,
-              replaceSpec: false
-            }
+              replaceSpec: true
+            };
+            $scope.inquiryItem = {};
           }
-          $scope.initInquiryItem();
+          initInquiryItem();
 
             $scope.setSayType = function (type) {
               if (type == 'current') {
@@ -205,6 +206,15 @@ define(['app/app'], function (app) {
             }
             return len;
           }
+            var cutOutString = function (str, length) {
+              for (var i = 1; i <= str.length; i++) {
+                if (getRealLen(str.substr(0, i)) > length){
+                  str = str.substr(0, i-1);
+                  break;
+                }
+              }
+              return str;
+            };
 
           $scope.onProduceDateChange = function () {
             if ($scope.offer.produceDate && getRealLen($scope.offer.produceDate) > 12) {
@@ -340,6 +350,7 @@ define(['app/app'], function (app) {
           $scope.isShowSayPriceBox = false;
           /*设置列表状态*/
           $scope.setSeekActive = function (seek, flag, index) {
+            $scope.setSayType('current');
             Authority.getAuthority({resUrl: '/authInquiry/inquiry/sale/item/save'}, function (data) {
               if (data.status == 'fail') {
                 toaster.pop('error', data.msg || '系统错误');
@@ -487,6 +498,155 @@ define(['app/app'], function (app) {
             return {index: -1};
           }*/
 
+            $scope.checkNull = function (code) {
+              var str = code;
+              var filterStr = new Array("空", "没", "无", "-", "—", "null", "#N/A");
+              var flag = true;
+              angular.forEach (filterStr, function(item) {
+                if (str == item){
+                  flag = false;
+                  return;
+                }
+              })
+              return flag;
+            }
+
+            $scope.showSimilarCodeList = false;
+            $scope.isInCodeList = false;
+            $scope.showSimilarBrandList = false;
+            $scope.isInBrandList = false;
+
+            $scope.checkBrand = function () {
+              $scope.setShowSimilarBrandList($scope.isInBrandList);
+              $scope.validSayPrice.replaceBrand = $scope.inquiryItem.replaceBrand
+                  && $scope.inquiryItem.replaceBrand !== '';
+              if (!$scope.validSayPrice.replaceBrand) {
+                toaster.pop('error', '品牌不能为空');
+              }
+              if (!$scope.checkNull($scope.inquiryItem.replaceBrand)){
+                toaster.pop('error', '品牌输入不合法');
+                $scope.validSayPrice.replaceBrand = false;
+              }
+              return $scope.validSayPrice.replaceBrand;
+            }
+            $scope.checkCode = function () {
+              $scope.setShowSimilarCodeList($scope.isInCodeList);
+              $scope.validSayPrice.replaceCmpCode = $scope.inquiryItem.replaceCmpCode && $scope.inquiryItem.replaceCmpCode !== '';
+              if (!$scope.validSayPrice.replaceCmpCode) {
+                toaster.pop('error', '型号不能为空');
+              }
+              if (!$scope.checkNull($scope.inquiryItem.replaceCmpCode)){
+                toaster.pop('error', '型号输入不合法');
+                $scope.validSayPrice.replaceCmpCode = false;
+              }
+              return $scope.validSayPrice.replaceCmpCode;
+            }
+
+
+            $scope.getSimilarCode = function () {
+              if ($scope.inquiryItem.replaceCmpCode) {
+                Search.getSimilarComponents({keyword : $scope.inquiryItem.replaceCmpCode}, function (data) {
+                  $scope.similarCode = data || [];
+                  $scope.setShowSimilarCodeList(data && data.length);
+                }, function (error) {
+                  toaster.pop('error', '系统错误');
+                })
+              }
+            }
+
+            $scope.getSimilarBrand = function () {
+              if ($scope.inquiryItem.replaceBrand) {
+                Search.getSimilarBrands({keyword : $scope.inquiryItem.replaceBrand}, function (data) {
+                  $scope.similarBrand = data || [];
+                  $scope.setShowSimilarBrandList(data && data.length);
+                }, function (error) {
+                  toaster.pop('error', '系统错误');
+                })
+              }
+            }
+
+
+            $scope.setShowSimilarBrandList = function (flag) {
+              $scope.showSimilarBrandList = flag;
+            }
+
+            $scope.setShowSimilarCodeList = function (flag) {
+              $scope.showSimilarCodeList = flag;
+            }
+
+            $scope.onBrandChange = function () {
+              // $scope.applyObj.brand = $scope.applyObj.brand.trim();
+              if ((/[^\x00-\xff]/g).test($scope.inquiryItem.replaceBrand)) {
+                var chineseIndex = -1;
+                for (var i = 0; i < $scope.inquiryItem.replaceBrand.length; i++) {
+                  if ((/[^\x00-\xff]/g).test($scope.inquiryItem.replaceBrand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test($scope.inquiryItem.replaceBrand.charAt(i))) {
+                    chineseIndex = i;
+                    break;
+                  }
+                }
+                if (chineseIndex > -1) {
+                  $scope.inquiryItem.replaceBrand = $scope.inquiryItem.replaceBrand.substring(0, chineseIndex);
+                }
+              } else if ($scope.inquiryItem.replaceBrand && getRealLen($scope.inquiryItem.replaceBrand) > 50) {
+                $scope.inquiryItem.replaceBrand = cutOutString($scope.inquiryItem.replaceBrand, 50);
+              } else {
+                if ($scope.inquiryItem.replaceBrand) {
+                  $scope.getSimilarBrand();
+                } else {
+                  $scope.showSimilarBrandList = false;
+                }
+              }
+            }
+
+            $scope.onCodeChange = function () {
+              // $scope.applyObj.code = $scope.applyObj.code.trim();
+              if ((/[^\x00-\xff]/g).test($scope.inquiryItem.replaceCmpCode)) {
+                var chineseIndex = -1;
+                for (var i = 0; i < $scope.inquiryItem.replaceCmpCode.length; i++) {
+                  if ((/[^\x00-\xff]/g).test($scope.inquiryItem.replaceCmpCode.charAt(i))) {
+                    chineseIndex = i;
+                    break;
+                  }
+                }
+                $scope.inquiryItem.replaceCmpCode = cutOutString($scope.inquiryItem.replaceCmpCode, chineseIndex);
+              } else if ($scope.inquiryItem.replaceCmpCode && getRealLen($scope.inquiryItem.replaceCmpCode) > 100) {
+                $scope.inquiryItem.replaceCmpCode = cutOutString($scope.inquiryItem.replaceCmpCode, 100);
+              } else {
+                if ($scope.inquiryItem.replaceCmpCode) {
+                  $scope.getSimilarCode();
+                } else {
+                  $scope.showSimilarCodeList = false;
+                }
+              }
+            }
+
+            $scope.setBrand = function (brand) {
+              $scope.inquiryItem.replaceBrand = brand;
+              $scope.setShowSimilarBrandList(false);
+            }
+
+            $scope.setCode = function (code) {
+              $scope.inquiryItem.replaceCmpCode = code;
+              $scope.setShowSimilarCodeList(false);
+            }
+
+
+            $scope.checkSpec = function () {
+              if (!$scope.checkNull($scope.inquiryItem.replaceSpec)){
+                toaster.pop('error', '规格输入不合法');
+                $scope.validSayPrice.replaceSpec = false;
+              } else {
+                $scope.validSayPrice.replaceSpec = true;
+              }
+              return $scope.validSayPrice.replaceSpec;
+            }
+            $scope.onSpecInput = function () {
+              if ($scope.inquiryItem.replaceSpec && getRealLen($scope.inquiryItem.replaceSpec) > 100) {
+                $scope.inquiryItem.replaceSpec = cutOutString($scope.inquiryItem.replaceSpec, 100);
+              }
+            };
+
+
           $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++) {

+ 3 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js

@@ -726,6 +726,9 @@ define(['app/app'], function (app) {
 			console.log(products);
 			RecommendProductService.saveProductsWhenSellerUpdate($scope.storeInfo.uuid, products).then(function (products) {
 				$scope.recommendProducts = products;
+				angular.forEach(products, function (item) {
+					item.exist = true;
+				})
 				$scope.backupProducts = angular.copy(products);
 				cancleProductEdit('EDIT_PRODUCTS');
 				toaster.pop('success', '保存成功');

+ 62 - 4
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -29,7 +29,7 @@
         position: relative;
     }
     .seek-purchase .seek-purchase-content .publish-purchase .fl .form-block >span {
-        width: 105px;
+        width: 110px;
         height: 24px;
         line-height: 24px;
         display: inline-block;
@@ -301,6 +301,7 @@
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td {
         height: 68px;
         line-height: 68px;
+        padding: 0 8px;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate {
         overflow: visible;
@@ -478,7 +479,7 @@
         background: #fff;
         top: 0;
         left: 33px;*/
-        width: 135px;
+        width: 102px;
        /* border: 1px solid #fce8df;*/
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .seek-list table tbody tr td.seek-replies ul li {
@@ -1214,19 +1215,30 @@
                         <div ng-show="currentSeek.$status == 2 || currentSeek.$status == 3">
                             <table>
                                 <thead>
-                                <tr>
+                                <tr ng-if="currentSeek.$status == 2">
                                     <th width="273">卖家</th>
                                     <th width="233">交期(天)</th>
                                     <th width="234">价格梯度</th>
                                     <!--<th width="195">生产日期</th>-->
                                     <th width="221">操作</th>
                                 </tr>
+                                <tr ng-if="currentSeek.$status == 3">
+                                    <th width="164">卖家</th>
+                                    <th width="84">品牌</th>
+                                    <th width="96">型号</th>
+                                    <th width="80">规格</th>
+                                    <th width="81">交期(天)</th>
+                                    <th width="102">价格梯度</th>
+                                    <th width="100">报价时间</th>
+                                    <!--<th width="195">生产日期</th>-->
+                                    <th width="181">操作</th>
+                                </tr>
                                 </thead>
                             </table>
                             <div class="seek-list">
                                 <table>
                                     <tbody>
-                                    <tr ng-repeat="of in offer track by $index" ng-show="(currentSeek.$status == 3 && of.isReplace == 1) || (currentSeek.$status == 2 && of.isReplace != 1)">
+                                    <tr ng-repeat="of in offer track by $index" ng-if="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">
@@ -1268,6 +1280,52 @@
                                             <a class="seek-btn" ng-if="of.agreed != 0 && of.agreed != 1" ng-click="setActiveRefuse(of)">拒绝</a>
                                         </td>
                                     </tr>
+                                    <tr ng-repeat="of in offer track by $index" ng-if="currentSeek.$status == 3 && of.isReplace == 1">
+                                        <td width="164" ng-bind="of.vendName" title="{{of.vendName}}"></td>
+                                        <td width="84" ng-bind="of.replaceBrand || '-'" title="{{of.replaceBrand}}"></td>
+                                        <td width="96" ng-bind="of.replaceCmpCode || '-'" title="{{of.replaceCmpCode}}"></td>
+                                        <td width="80" ng-bind="of.replaceSpec || '-'" title="{{of.replaceSpec}}"></td>
+                                        <td width="81" class="red-text" ng-bind="of.leadtime">4-6</td>
+                                        <td width="102" class="seek-replies">
+                                            <!--<span>{{of.currency + of.unitPrice | currencyStr}}</span>-->
+                                            <div class="red-text">
+                                                <!--<span>{{of.replies[0].lapQty}}</span>
+                                                <span>{{of.currency + of.replies[0].price | currencyStr}}</span>-->
+                                            </div>
+                                            <ul class="red-text">
+                                                <li ng-repeat="re in of.replies">
+                                                    <span ng-bind="re.lapQty" title="{{re.lapQty}}">1+</span>
+                                                    <span title="{{of.currency + re.price | currencyStr}}">{{of.currency + re.price | currencyStr}}</span>
+                                                </li>
+                                            </ul>
+                                        </td>
+                                        <td width="100" class="red-text" ng-bind="of.offerTime | date:'yyyy-MM-dd'"></td>
+                                        <!--<td width="195" ng-bind="of.produceDate || '-'"></td>-->
+                                        <td width="181" class="operate">
+                                            <div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                                                <a href="javascript:void(0)" ng-click="chat.contactWithOther(null, currentSeek.qutations[$index].enterprise.uu, chat.UserType.ENTERPRISE)">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                                <div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+                                                    <div class="title">
+                                                        <i ng-click="setShowLinkBox(false)"></i>
+                                                    </div>
+                                                    <div class="content">
+                                                        <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+                                                        <p>卖家联系电话:<span ng-bind="phone"></span></p>
+                                                        <div>
+                                                            <a ng-click="setShowLinkBox(false)">我知道了</a>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                            <b class="refused-show" ng-if="of.agreed == 0">拒绝原因 <img src="static/img/seekPurchase/refu.png" alt="">
+                                                <a class="say-price-history" ng-bind="of.refusereason"></a>
+                                            </b>
+                                            <img ng-if="of.agreed == 1" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
+                                            <img ng-if="of.agreed == 0" src="static/img/seekPurchase/refused.png" alt="" class="ng-scope">
+                                            <span class="seek-btn" ng-if="of.agreed != 0 && of.agreed != 1" ng-click="adopt(of)">采纳</span>
+                                            <a class="seek-btn" ng-if="of.agreed != 0 && of.agreed != 1" ng-click="setActiveRefuse(of)">拒绝</a>
+                                        </td>
+                                    </tr>
                                     </tbody>
                                 </table>
                             </div>

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

@@ -738,13 +738,13 @@
                             <div>
                                 <div>
                                     <div class="replace-param" ng-if="seek.isReplace == 1">
-                                        <span>替代物料品牌:</span><span ng-bind="seek.replaceBrand"></span>
+                                        <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>
+                                        <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>
+                                        <span>替代物料规格:</span><span ng-bind="seek.replaceSpec || '-'"></span>
                                     </div>
                                     <span>交期:</span><span class="red-text" ng-bind="seek.leadtime + '天'">6 天</span>
                                 </div>

+ 41 - 8
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -446,7 +446,7 @@
     }
     .seek-purchase .say-price-box .content .content-line .form-left span {
         display: inline-block;
-        width: 110px;
+        width: 115px;
         text-align: right;
     }
     .seek-purchase .say-price-box .content .content-line .form-left input {
@@ -530,6 +530,7 @@
     }
     .seek-purchase .say-price-box  .content .content-line .form-item.form-long {
         width: 100%;
+        position: relative;
     }
     .seek-purchase .say-price-box  .content .content-line .form-item.form-long input {
         width: 292px;
@@ -732,6 +733,32 @@
         color: #fff;
         background: #4290f7;
     }
+    .similar-list {
+        position: absolute;
+        top: 27px;
+        left: 119px;
+        background: #fff;
+        border: 1px solid #b5b5b5;
+        z-index: 1;
+        max-height: 112px;
+        overflow-y: auto;
+        overflow-x: hidden;
+        border-radius: 3px;
+        width: 292px;
+        font-size: 12px;
+    }
+    .similar-list li {
+        height: 22px;
+        line-height: 22px;
+        cursor: pointer;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        padding: 0 5px;
+    }
+    .similar-list li:hover {
+        background: #ddd;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -880,13 +907,13 @@
                                 <p class="price-title">{{seek.quotation.isReplace == 1 ? '替代型号报价' : '当前型号报价'}}</p>
                                 <div>
                                     <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
-                                        <span>替代物料品牌:</span><span ng-bind="seek.quotation.replaceBrand"></span>
+                                        <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>
+                                        <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>
+                                        <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>
@@ -960,19 +987,25 @@
                     <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()">
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceBrand" ng-blur="checkBrand()" ng-change="onBrandChange()" ng-change="onBrandChange()" placeholder="请勿填中文符号">
+                            <ul class="similar-list" ng-show="showSimilarBrandList" ng-mouseenter="isInBrandList = true;" ng-mouseleave="isInBrandList = false;">
+                                <li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(sBrand.nameEn)"></li>
+                            </ul>
                         </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()">
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceCmpCode"  ng-blur="checkCode()" ng-change="onCodeChange()" placeholder="请勿填中文符号">
+                            <ul class="similar-list" ng-show="showSimilarCodeList" ng-mouseenter="isInCodeList = true;" ng-mouseleave="isInCodeList = false;">
+                                <li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(sCode.code)"></li>
+                            </ul>
                         </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()">
+                            <span>规格:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceSpec" ng-blur="checkSpec()" ng-change="onSpecInput()">
                         </div>
                     </div>
                 </div>