liuam 8 rokov pred
rodič
commit
9cab722926

+ 30 - 2
src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java

@@ -1,19 +1,20 @@
 package com.uas.platform.b2c.common.account.controller;
 
 import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.common.account.model.FormEnterprise;
 import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.common.account.model.UserBaseInfo;
-import com.uas.platform.b2c.common.account.model.FormEnterprise;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
 import com.uas.platform.b2c.common.account.service.UserService;
+import com.uas.platform.b2c.common.search.util.PageParams;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.fa.payment.utils.StringUtils;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.sso.core.Status;
 import com.uas.sso.entity.ApplyUserSpaceView;
 import com.uas.sso.entity.UserSpaceDetail;
 import com.uas.sso.entity.UserSpaceView;
-import com.uas.sso.entity.UserView;
 import com.uas.sso.support.Page;
 import com.uas.sso.util.AccountUtils;
 import org.apache.commons.collections.CollectionUtils;
@@ -306,4 +307,31 @@ public class EnterpriseController {
 		}
 		return ResultMap.success(count);
 	}
+
+    @RequestMapping(value = "/findApplyToMall", method = RequestMethod.GET)
+    public Page<ApplyUserSpaceView> findApplyToMall(Long spaceUU, PageParams params, String keyword, Integer status) {
+        Page<ApplyUserSpaceView> applyAllToMall = null;
+	    try {
+            applyAllToMall = AccountUtils.findApplyAllToMall(spaceUU, params.getPage(), params.getSize(), status, keyword);
+        } catch (Exception e) {
+            throw new IllegalArgumentException("系统异常");
+        }
+        return applyAllToMall;
+    }
+
+    @RequestMapping(value = "/auditApply", method = RequestMethod.GET)
+    public String auditApply(Long userUU, Long id, Integer status) {
+	    String auditApply = null;
+        try {
+            // status == 1 时,申请通过
+            if (status == 1){
+                auditApply = AccountUtils.auditApply(userUU, id, Status.AGREE.getCode());
+            } else {
+                auditApply = AccountUtils.auditApply(userUU, id, Status.DISAGREE.getCode());
+            }
+        } catch (Exception e) {
+            throw new IllegalArgumentException("系统异常");
+        }
+        return auditApply;
+    }
 }

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

@@ -195,7 +195,14 @@ define([ 'angular', 'ui-bootstrap', 'ngResource' ], function(angular) {
 				url: 'basic/user/bindUser',
 				method: 'GET'
 			},
-
+            findApplyToMall: {
+				url: 'basic/enterprise/findApplyToMall',
+				method: 'GET'
+			},
+            auditApply: {
+                url: 'basic/enterprise/auditApply',
+                method: 'GET'
+            },
 			/**
 			 * 根据注册地址返回币别信息
 			 */

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

@@ -10,10 +10,70 @@ define(['app/app'], function(app) {
 		$scope.tab = 'base';
         $scope.userInfo = $rootScope.userInfo;
 		$scope.updateState = false;
+        $scope.searchParams = {
+            keyword: ''
+        };
         // $scope.userInfo.pwdEnable = false;
         // $scope.userInfo.haveUserQuestion = false;
         // $scope.userInfo.userEmail = null;
 
+        //table设置
+        var applyToEnterpriseTableParams = function () {
+            $scope.applyToEnterpriseTableParams = new ngTableParams({
+                page : 1,
+                count : 10
+            }, {
+                total : 0,
+                getData : function ($defer, params) {
+                    var param = BaseService.parseParams(params.url());
+                    param.page = param.page;
+                    param.size = param.count;
+                    param.spaceUU = $scope.userInfo.enterprise.uu;
+                    if (!($scope.searchParams.keyword.trim() == '')) {
+                        param.keyword = $scope.searchParams.keyword.trim();
+                    }
+                    // 状态为申请中
+                    param.status = 311;
+                    Enterprise.findApplyToMall(param, {}, function (page) {
+                        $defer.resolve(page.content || []);
+                        params.total(page.totalElements);
+                        $scope.page = page;
+                        $scope.totalPages = page.totalPages;
+                        $scope.content = page.content;
+                    }, function (error) {
+                        console.log(error);
+                        $defer.resolve([]);
+                        params.total(0);
+                        $scope.totalPages = 0;
+                        toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    });
+                }
+            });
+        };
+        applyToEnterpriseTableParams();
+        // 申请
+        $scope.auditApply = function (status, id, UU) {
+            var param = {
+                userUU: UU,
+                id: id,
+                status: status
+            }
+            Enterprise.auditApply(param, {}, function (data) {
+                console.log(data);
+                applyToEnterpriseTableParams();
+            }, function (error) {
+                console.log(error);
+                $defer.resolve([]);
+                params.total(0);
+                $scope.totalPages = 0;
+                toaster.pop('error', '数据获取失败,请重新刷新页面!');
+            });
+        }
+
+        $scope.searchApply = function () {
+            applyToEnterpriseTableParams();
+        }
+
       //手机号和邮箱号的部分隐藏
       if($scope.userInfo.userTel){
         $scope.userInfo.userTel = $scope.userInfo.userTel.substr(0, 3)
@@ -292,8 +352,14 @@ define(['app/app'], function(app) {
                 });
           };
 
-          // 切换tab
-          $scope.checkTab = function (t) {
+        // 直接跳转到申请绑定
+        if ($rootScope.tab) {
+            $scope.tab = $rootScope.tab;
+            // 删除$rootScope.tab属性
+            delete $rootScope.tab;
+        }
+        // 切换tab
+        $scope.checkTab = function (t) {
             $scope.tab = t;
           };
 

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

@@ -4,11 +4,65 @@
  */
 define(['app/app', 'calendar'], function(app) {
     'use strict';
-    app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', '$modal', 'DistributionRule', '$q', 'User', function($scope, toaster, VendorService, $rootScope, News, $filter, $modal, DistributionRule, $q, User) {
+    app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', '$modal', 'DistributionRule', '$q', 'User', 'ngTableParams', 'BaseService', 'Enterprise', function($scope, toaster, VendorService, $rootScope, News, $filter, $modal, DistributionRule, $q, User, ngTableParams, BaseService, Enterprise) {
         $rootScope.active = 'index';
         $scope.count = 0;
         $scope.userInfo = $rootScope.userInfo;
 
+        // 申请
+        $scope.auditApply = function (status, id, UU) {
+            var param = {
+                userUU: UU,
+                id: id,
+                status: status
+            }
+            Enterprise.auditApply(param, {}, function (data) {
+                applyToEnterpriseTableParams();
+            }, function (error) {
+                console.log(error);
+                $defer.resolve([]);
+                params.total(0);
+                $scope.totalPages = 0;
+                toaster.pop('error', '数据获取失败,请重新刷新页面!');
+            });
+        }
+        //table设置
+        var applyToEnterpriseTableParams = function () {
+            $scope.applyToEnterpriseTableParams = new ngTableParams({
+                page : 1,
+                count : 5
+            }, {
+                total : 0,
+                getData : function ($defer, params) {
+                    var param = BaseService.parseParams(params.url());
+                    param.page = param.page;
+                    param.size = param.count;
+                    param.spaceUU = $scope.userInfo.enterprise.uu;
+                    // 状态为申请中
+                    param.status = 311;
+                    Enterprise.findApplyToMall(param, {}, function (page) {
+                        console.log(page);
+                        $defer.resolve(page.content || []);
+                        params.total(page.totalElements);
+                        $scope.totalPages = page.totalPages;
+                        $scope.content = page.content;
+                    }, function (error) {
+                        console.log(error);
+                        $defer.resolve([]);
+                        params.total(0);
+                        $scope.totalPages = 0;
+                        toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    });
+                }
+            });
+        }
+        applyToEnterpriseTableParams();
+
+        $scope.findMore = function () {
+            window.location.href = '#/account/management/';
+            $rootScope.tab = 'bind';
+        }
+
         $scope.toAccount = function(){
             User.isDevOrProd(null, function(data){
                 $scope.isProd = data.data;

+ 31 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_account_management.html

@@ -369,6 +369,7 @@
       <ul class="fl">
         <li ng-class="{'active': tab=='base'}"><a ng-click="checkTab('base')">基本信息</a></li>
         <li ng-class="{'active': tab=='safe'}"><a ng-click="checkTab('safe')">安全设置</a></li>
+        <li ng-class="{'active': tab=='bind'}"><a ng-click="checkTab('bind')">申请绑定</a></li>
         <!--<li ng-class="{'active': tab=='logistic'}"><a href="#" ng-click="checkTab('logistic')">收货地址</a></li>-->
       </ul>
     </div>
@@ -692,6 +693,36 @@
         </li>-->
       </ul>
     </div>
+      <!--申请绑定-->
+      <div class="count01 clearfix" ng-if="tab=='bind'">
+          <div class="rt_menu">
+              <span class="last-login pull-right"><input type="text" ng-model="searchParams.keyword" placeholder="用户名/UU账号/手机号"/><button ng-click="searchApply()">搜索</button> </span></span>
+          </div>
+        <table ng-table="applyToEnterpriseTableParams">
+          <thead>
+          <tr>
+            <th width="165">用户名</th>
+            <th width="202">UU账号</th>
+            <th width="93">手机号</th>
+            <th width="78">邮箱</th>
+            <th width="70">操作</th>
+          </tr>
+          </thead>
+          <tbody ng-repeat="item in content" ng-class="{'active': seek.$active}">
+          <tr class="default-row">
+            <td class="user-name" ng-bind="item.user.vipName"></td>
+            <td style="text-align: left;" ng-bind="item.user.userUU"></td>
+            <td ng-bind="item.user.mobile"></td>
+            <td ng-bind="item.user.email"></td>
+            <td>
+              <a ng-click="auditApply(1, item.id, item.user.userUU)">同意</a>
+              <a ng-click="auditApply(0, item.id, item.user.userUU)">拒绝</a>
+            </td>
+          </tr>
+          </tbody>
+        </table>
+        <span class="last-login pull-right">显示<span ng-bind="page.size * (page.number - 1) + 1"></span>-<span ng-bind="page.size * (page.number - 1) + page.numberOfElements"></span>条,共<span ng-bind="page.totalElements"></span>条</span>
+      </div>
     <!--权限管理-->
     <div class="count01 clearfix" ng-if="tab=='auth'">
       <div class="power_title">员工账号及权限管理</div>

+ 29 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_index.html

@@ -66,6 +66,35 @@
                 <!--<li><a href="#"><img src="static/img/vendor/images/notice04.png"/><p>缺货预警</p></a></li>-->
             <!--</ul>-->
         <!--</div>-->
+        <div class="data_analyze">
+            <div class="com_menu01">
+                <span>企业绑定申请</span>
+                <span class="last-login pull-right"><a ng-click="findMore()">查看更多</a></span>
+            </div>
+            <table ng-table="applyToEnterpriseTableParams">
+                <thead>
+                <tr>
+                    <th width="165">用户名</th>
+                    <th width="202">UU账号</th>
+                    <th width="93">手机号</th>
+                    <th width="78">邮箱</th>
+                    <th width="70">操作</th>
+                </tr>
+                </thead>
+                <tbody ng-repeat="item in content" ng-class="{'active': seek.$active}">
+                <tr class="default-row">
+                    <td class="user-name" ng-bind="item.user.vipName"></td>
+                    <td style="text-align: left;" ng-bind="item.user.userUU"></td>
+                    <td ng-bind="item.user.mobile"></td>
+                    <td ng-bind="item.user.email"></td>
+                    <td>
+                        <a ng-click="auditApply(1, item.id, item.user.userUU)">同意</a>
+                        <a ng-click="auditApply(0, item.id, item.user.userUU)">拒绝</a>
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
         <div class="data_analyze">
             <div class="com_menu01"><span>数据分析</span></div>
             <ul>