Browse Source

新增商机管理, 商机关注

shenjj 7 years ago
parent
commit
fe8bf1f800

+ 2 - 0
src/main/java/com/uas/platform/b2c/prod/product/kind/service/impl/KindConcernServiceImpl.java

@@ -237,6 +237,7 @@ public class KindConcernServiceImpl implements KindConcernService {
             map.put("existed", existed);
             map.put("count", count);
             map.put("existedList", existedList);
+            map.put("success", true);
             kindConcernDao.save(kindConcerns);
             return map;
         } catch (Exception e) {
@@ -277,6 +278,7 @@ public class KindConcernServiceImpl implements KindConcernService {
                 }
             }
             map.put("count", kindConcerns.size());
+            map.put("success", true);
             kindConcernDao.delete(kindConcerns);
             return map;
         } catch (Exception e) {

+ 18 - 0
src/main/webapp/resources/js/common/query/attendtion.js

@@ -0,0 +1,18 @@
+define([ 'ngResource' ], function() {
+  angular.module('AttendtionServices', ['ngResource']).factory('Attendtion', ['$resource', function ($resource) {
+    return $resource('produce/kindConcern', {}, {
+       getList: {
+         url: 'produce/kindConcern/list',
+         method: 'GET'
+       },
+       add: {
+         url: 'produce/kindConcern/batch/add',
+         method: 'POST'
+       },
+       del: {
+         url: 'produce/kindConcern/batch/delete',
+         method: 'POST'
+       }
+    });
+  }]);
+});

+ 9 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority', 'common/query/attendtion'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices'])
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices', 'AttendtionServices'])
   app.directive('onFinishRender', function ($timeout) {
     return {
       restrict: 'A',
@@ -67,7 +67,13 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			title: '求购询价',
 			controllerUrl: 'app/controllers/forstore/seek_purchase_ctrl',
 			controller: 'seekPurchaseCtrl'
-		})).state('vendor_query_logistics', angularAMD.route({
+		})).state('purchasAttendtion', angularAMD.route({
+      url: '/purchasAttendtion',
+      templateUrl: 'static/view/vendor/forstore/purchasAttendtion.html',
+      title: '商机关注',
+      controllerUrl: 'app/controllers/forstore/purchasAttendtion_ctrl',
+      controller: 'purchasAttendtionCtrl'
+    })).state('vendor_query_logistics', angularAMD.route({
             url: '/logistics/query/:purchaseid',
             templateUrl: 'static/view/vendor/forstore/query_logistics.html',
             title: '查询物流',

+ 140 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/purchasAttendtion_ctrl.js

@@ -0,0 +1,140 @@
+define(['app/app'], function (app) {
+  app.register.controller('purchasAttendtionCtrl',
+      ['$scope', '$location', '$rootScope', '$stateParams', '$state', 'toaster',
+        '$modal', '$http', 'Attendtion', 'ngTableParams', 'BaseService', 'toaster',
+        function ($scope, $location, $rootScope, $stateParams, $state, toaster,
+           $modal, $http, Attendtion, ngTableParams, BaseService, toaster) {
+          document.title = '商机关注-优软商城';
+          $scope.keyWord = ''
+          $scope.isSearch = false
+          $scope.type = 'yes'
+          $scope.Attend_tab = 'isAttend'
+          $scope.checkBoxAll = false
+          $scope.page = 1
+          $scope.totalElements = 0
+          // 初始化数据表格
+          $scope.seekPurchaseTableParams = new ngTableParams({
+            pageNumber: 1,
+            pageSize: 10
+          }, {
+            total: 0,
+            getData: function ($defer, params) {
+              const param = BaseService.parseParams(params.url());
+              param.keyword = $scope.keyWord;
+              if ($scope.isSearch) {
+                param.page = 1;
+                params.page(1);
+                $scope.isSearch = false;
+              }
+              $scope.page = param.page
+              param.type = $scope.type;
+              param.enUU = $rootScope.userInfo.enterprise.uu;
+              param.enableOffer = 1;
+              Attendtion.getList(param, function(data) {
+                console.log(data.content)
+                params.total(data.totalElements);
+                $scope.totalElements = data.totalElements
+                $scope.endNumber = data.numberOfElements;
+                $defer.resolve(data.content);
+                $scope.AttendListData = data.content;
+                for (var i = 0; i < $scope.AttendListData.length; i++) {
+                  $scope.AttendListData[i].checkBox = false
+                }
+              })
+            }
+          })
+          // 顶部切换
+          $scope.toggleAttend = function(_tp) {
+            $scope.Attend_tab = _tp;
+            $scope.type = _tp === 'isAttend' ? 'yes' : 'no';
+            $scope.checkBoxAll = false;
+            $scope.keyWord = '';
+            $scope.seekPurchaseTableParams.page(1);
+            $scope.seekPurchaseTableParams.reload();
+          }
+          // 全选按钮
+          $scope.onCheckBoxClick = function() {
+            ComputedCheckAll('all')
+          }
+          // 单选按钮
+          $scope.onCheckBoxOnce = function(item, index) {
+            item.checkBox = !item.checkBox
+            ComputedCheckAll()
+          }
+          // 单个关注 || 取消关注
+          $scope.addAttendTionmodify = function(item) {
+            var _arr = []
+            if ($scope.Attend_tab === 'isAttend') {
+              _arr.push(item.id)
+            } else {
+              _arr.push(item.nameCn)
+            }
+            ComputedAttendFn(_arr)
+          };
+          // 搜索
+          $scope.onSearch = function() {
+            $scope.seekPurchaseTableParams.page(1);
+            $scope.seekPurchaseTableParams.reload();
+          }
+          // 批量操作
+          $scope.BatchFn = function() {
+            var _arr = []
+            if ($scope.Attend_tab === 'isAttend') {
+              for (var i = 0; i < $scope.AttendListData.length; i++) {
+                if ($scope.AttendListData[i].checkBox === true) {
+                  _arr.push($scope.AttendListData[i].id)
+                }
+              }
+            } else {
+              for (var i = 0; i < $scope.AttendListData.length; i++) {
+                if ($scope.AttendListData[i].checkBox === true) {
+                  _arr.push($scope.AttendListData[i].nameCn)
+                }
+              }
+            }
+            ComputedAttendFn(_arr)
+          }
+
+          // 批量关注或者 批量取消
+          function ComputedAttendFn(arr) {
+            if ($scope.Attend_tab === 'isAttend') {
+              Attendtion.del({}, arr, function(data) {
+                if (data.success) {
+                  $scope.seekPurchaseTableParams.page($scope.page);
+                  $scope.seekPurchaseTableParams.reload();
+                  toaster.pop('success', '取消关注成功');
+                } else {
+                  toaster.pop('error', data.message);
+                }
+              })
+            } else {
+              Attendtion.add({}, arr, function(data) {
+                if (data.success) {
+                  $scope.seekPurchaseTableParams.page($scope.page);
+                  $scope.seekPurchaseTableParams.reload();
+                  toaster.pop('success', '关注成功');
+                } else {
+                  toaster.pop('error', data.message);
+                }
+              })
+            }
+          }
+          // 判断是否已进行全选
+          function ComputedCheckAll(tp) {
+            var num = 0
+            for (var i = 0; i < $scope.AttendListData.length; i++) {
+              if (tp === 'all') {
+                $scope.AttendListData[i].checkBox = !$scope.checkBoxAll
+              }
+              if ($scope.AttendListData[i].checkBox === true) {
+                num++
+              }
+            }
+            if (num === $scope.AttendListData.length) {
+              $scope.checkBoxAll = true
+            } else {
+              $scope.checkBoxAll = false
+            }
+          }
+  }]);
+});

+ 185 - 0
src/main/webapp/resources/view/vendor/forstore/purchasAttendtion.html

@@ -0,0 +1,185 @@
+<style>
+  .oder01 ul li{
+    margin-left: 0px;
+    position: relative;
+  }
+  .oder01 ul li.active a{
+    border-bottom: #fff;
+    background: #5078cb;
+    color: #fff;
+  }
+  .oder01 ul li::after{
+    background: url('static/img/vendor/images/downicon.png');
+    width: 11px;
+    height: 6px;
+    position: absolute;
+    bottom: 0px;
+    left: 50%;
+    content: ' ';
+    margin-left: -5px;
+    display: none;
+  }
+  .oder01 ul li.active:after{
+    display: block
+  }
+  .seek-purchase-content {
+    background: #fff;
+    padding-bottom: 40px;
+  }
+
+  .seek-purchase-content .checkbox {
+    width: 14px;
+    height: 14px;
+    border: 1px solid #908f8f;
+    display: inline-block;
+    vertical-align: top;
+    margin-top: 13px;
+  }
+  .seek-purchase-content thead tr {
+    line-height: 38px;
+    font-size: 14px;
+    color: #333;
+    text-align: center;
+    border-bottom: 1px solid #e8e8e8;
+  }
+  .seek-purchase .seek-purchase-content >table {
+    margin-bottom: 38px;
+  }
+  .seek-purchase-content thead tr .onCheckBoxClick {
+    cursor: pointer;
+  }
+  .seek-purchase-content tbody tr {
+    line-height: 49px;
+    font-size: 14px;
+    color: #666;
+    text-align: center;
+    border-bottom: 1px solid #e8e8e8;
+  }
+  .seek-purchase-content tbody th {
+    font-weight: 500;
+  }
+  .seek-purchase-content tbody tr:nth-last-of-type(1) {
+    border-bottom: 0;
+  }
+  .seek-purchase-content tbody .Attend_btn a{
+    color: #5078cb;
+  }
+  .seek-purchase-content tbody .Attend_btn a:hover {
+    color: #f15601;
+    cursor: pointer;
+  }
+  .search-check{
+    width: 100%;
+    height: 54px;
+    background: #fff;
+    padding-top: 10px;
+    border-bottom: 1px solid #e8e8e8;
+    margin-bottom: 0px;
+  }
+  .search-check .search{
+    width: 550px;
+    margin-left: 150px;
+  }
+  .search-check .search .form-control{
+    width: 340px;
+    float: left;
+    height: 34px;
+    border-radius: 0;
+    box-shadow: none;
+    border-right: none;
+  }
+  .search-check .search button,.search-check .search a{
+    display: inline-block;
+    width: 94px;
+    height: 34px;
+    line-height: 34px;
+    text-align: center;
+    font-size: 14px;
+  }
+  .search-check .search button{
+    background: #d3e1fc;
+    border-radius: 0;
+    border: #e2dbdb 1px solid;
+    border-left: none;
+  }
+  .search-check .search button:hover,.search-check .search a:hover{
+    color: #fff;
+    background: #3f7ae3;
+  }
+  .search-check .check{
+    font-size: 14px;
+    line-height: 30px;
+    background: #5078cb;
+    text-align: center;
+    margin-right: 100px;
+  }
+  .search-check .check a{
+    margin: 0 10px;
+    color: #f5f5f5;
+  }
+  .search-check .check a:hover{
+    color: #fff;
+  }
+  .record-line{
+    margin-top: -37px;
+    /*height: 30px;*/
+    font-size: 12px;
+    line-height: 35px;
+    /* margin-top: 5px; */
+    padding-right: 22px
+  }
+
+
+</style>
+<div class="user_right fr seek-purchase">
+  <!--求购询价-->
+  <div class="oder">
+    <div class="com_tab oder01">
+      <ul>
+        <li><a href="javascript:void(0)" ui-sref="vendorSeekPurchase">待报价</a></li>
+        <li><a href="javascript:void(0)" ui-sref="vendorPurchaseOffer">已报价</a></li>
+        <li class="active"><a href="javascript:void(0)" ui-sref="purchasAttendtion">商机关注</a></li>
+        <!--<li><a href="javascript:void(0)" ui-sref="vendorPurchaseAccept">已采纳</a></li>-->
+      </ul>
+    </div>
+    <div class="com_tab com_tab2" style="margin-bottom: 0px">
+      <ul class="fl distance" style="width: 100%">
+        <li ng-class="{active : Attend_tab == 'isAttend'}"  ng-click="toggleAttend('isAttend')" title="已关注"><a>已关注</a></li>
+        <li ng-class="{active : Attend_tab =='Attend'}" ng-click="toggleAttend('Attend')" title="未关注"><a>未关注</a></li>
+      </ul>
+    </div>
+  </div>
+  <div class="seek-purchase-content">
+    <div class="search-check">
+      <div class="search fl">
+        <input type="text" class="form-control ng-pristine ng-untouched ng-valid" ng-model="keyWord" placeholder="请输入您要搜索的类目(产品名称)">
+        <button ng-click="onSearch()">搜索</button>
+      </div>
+      <div class="check fr">
+        <a ng-click="BatchFn()"><span>{{Attend_tab === 'isAttend' ? '批量取消' : '批量关注'}}</span></a>
+      </div>
+    </div>
+    <table ng-table="seekPurchaseTableParams">
+      <thead>
+        <tr>
+          <th width="80" class="onCheckBoxClick" ng-click="onCheckBoxClick()">
+            <input ng-checked="checkBoxAll" type="checkbox" class="checkbox">{{checkBoxAll ? '取消全选': '全选'}}</th>
+          <th width="80">序号</th>
+          <th width="556">类目(产品名称)</th>
+          <th width="310">操作</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr ng-repeat="item in AttendListData">
+          <th ng-click="onCheckBoxOnce(item, $index)"><input type="checkbox" class="checkbox" ng-checked="item.checkBox === true"></th>
+          <th>{{$index + 1}}</th>
+          <th>{{item.nameCn}}</th>
+          <th class="Attend_btn"><a ng-click="addAttendTionmodify(item)">{{item.status === 1 ? '取消关注' : '关注'}}</a></th>
+        </tr>
+      </tbody>
+    </table>
+    <div class="record-line text-right ng-binding ng-scope" ng-if="currenctGoods.length != 0">显示 1-
+      <span ng-bind="endNumber" class="ng-binding">10</span>, 共: <span style="color: #5078cb;" class="ng-binding">{{totalElements}}</span> 个
+    </div>
+  </div>
+</div>

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

@@ -602,6 +602,7 @@
             <ul>
                 <li><a href="javascript:void(0)" ui-sref="vendorSeekPurchase">待报价</a></li>
                 <li class="active"><a href="javascript:void(0)" ui-sref="vendorPurchaseOffer">已报价</a></li>
+                <li><a href="javascript:void(0)" ui-sref="purchasAttendtion">商机关注</a></li>
                 <!--<li><a href="javascript:void(0)" ui-sref="vendorPurchaseAccept">已采纳</a></li>-->
             </ul>
         </div>

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

@@ -716,6 +716,7 @@
             <ul>
                 <li class="active"><a href="javascript:void(0)" ui-sref="vendorSeekPurchase">待报价</a></li>
                 <li><a href="javascript:void(0)" ui-sref="vendorPurchaseOffer">已报价</a></li>
+                <li><a href="javascript:void(0)" ui-sref="purchasAttendtion">商机关注</a></li>
                 <!--<li><a href="javascript:void(0)" ui-sref="vendorPurchaseAccept">已采纳</a></li>-->
             </ul>
         </div>