Jelajahi Sumber

BA会员修改

kevin_zhangl 3 tahun lalu
induk
melakukan
4b62c740bf

+ 1 - 1
backendApi/config/menu.php

@@ -55,7 +55,6 @@ return [
             ['name'=>'External mall order list', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-shop-list', 'routePath'=>'shop/order-shop-list', 'show'=>1,], // 外部商城订单列表
             ['name'=>'External mall entry list', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-dec-list', 'routePath'=>'shop/order-dec-list', 'show'=>1,], // 外部商城报单列表
             // ['name'=>'List of qualified orders of external mall', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-standard-list', 'routePath'=>'shop/order-standard-list', 'show'=>1,], // 外部商城达标订单列表
-            ['name'=>'Brand Ambassador List', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'ba-user-list', 'routePath'=>'shop/ba-user-list', 'show'=>1,], // 会员列表
             ['name'=>'Brand Ambassador Order', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'ba-order-list', 'routePath'=>'shop/ba-order-list', 'show'=>1,], // 会员列表
 //            ['name'=>'Brand Ambassador Dec List', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'ba-dec-order-list', 'routePath'=>'shop/ba-dec-order-list', 'show'=>1,], // 会员列表
 
@@ -71,6 +70,7 @@ return [
         'show'=>1,
         'child'=>[
             ['name'=>'Member list', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'index', 'routePath'=>'user/index', 'show'=>1,],//会员列表
+            ['name'=>'Brand Ambassador List', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'ba-user-list', 'routePath'=>'user/ba-user-list', 'show'=>1,], // 会员列表
             ['name'=>'登录到前台', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'login-to-frontend', 'routePath'=>'user/login-to-frontend', 'show'=>0,],
 //            ['name'=>'指定会员管理登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'batch-close-login', 'routePath'=>'user/batch-close-login', 'show'=>0,],
 //            ['name'=>'按条件登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-login', 'routePath'=>'user/close-login', 'show'=>0,],

+ 8 - 2
backendApi/config/urlManagerRules.php

@@ -68,8 +68,6 @@ return [
             'GET dec-order-list-export-pdf/<orderSn>' => 'dec-order-list-export-pdf',
             'GET remain-pv' => 'remain-pv',
             'GET flow-remain-pv' => 'flow-remain-pv',
-            'GET ba-user-list' => 'ba-user-list',
-            'GET ba-user-list-export' => 'ba-user-list-export',
             'GET ba-order-list' => 'ba-order-list',
             'GET ba-order-list-export' => 'ba-order-list-export',
         ],
@@ -173,6 +171,14 @@ return [
             'GET status-audit-export' => 'status-audit-export',
             'GET year-highest-emp-lv-export' => 'year-highest-emp-lv-export',
             'POST recharge-to-user' => 'recharge-to-user',
+
+            'GET ba-user-list' => 'ba-user-list',
+            'GET ba-user-list-export' => 'ba-user-list-export',
+            'POST ba-modify-password' => 'ba-modify-password',
+            'GET ba-profile-get' => 'ba-profile-get',
+            'POST ba-modify-profile' => 'ba-modify-profile',
+            'POST ba-modify-status' => 'ba-modify-status',
+            'POST ba-is-modify-password-status' => 'ba-is-modify-password-status',
         ],
     ],
     [

+ 0 - 114
backendApi/modules/v1/controllers/ShopController.php

@@ -8,29 +8,21 @@
 
 namespace backendApi\modules\v1\controllers;
 
-use backendApi\modules\v1\models\exportForms\OrderExportForm;
 use backendApi\modules\v1\models\exportForms\ShopExportForm;
-use backendApi\modules\v1\models\exportForms\BaUserExportForm;
 use backendApi\modules\v1\models\lists\shop\DecOrderList;
 use backendApi\modules\v1\models\lists\shop\GoodsList;
 use backendApi\modules\v1\models\lists\shop\OrderDecList;
 use backendApi\modules\v1\models\lists\shop\OrderList;
 use backendApi\modules\v1\models\lists\shop\BaOrderList;
-use backendApi\modules\v1\models\lists\shop\BaUserList;
 use backendApi\modules\v1\models\lists\shop\OrderShopList;
 use backendApi\modules\v1\models\lists\shop\OrderStandardList;
 use backendApi\modules\v1\models\lists\shop\PackageList;
 use backendApi\modules\v1\models\lists\shop\RemainPvList;
 use backendApi\modules\v1\models\lists\shop\FlowRemainPvList;
 use common\helpers\Cache;
-use common\helpers\Date;
 use common\helpers\Form;
-use common\helpers\Log;
-use common\helpers\snowflake\SnowFake;
-use common\libs\export\module\ShopExport;
 use common\models\DeclarationPackage;
 use common\models\DecOrder;
-use common\models\ExcelOrderShop;
 use common\models\forms\DecPackageForm;
 use common\models\forms\ExcelOrderDecForm;
 use common\models\forms\ExcelOrderShopForm;
@@ -821,110 +813,4 @@ class ShopController extends BaseController {
         }
         return static::notice('Starting exporting, please go to File Management - Export Files to view.'); // 导出开始,请到文件管理-导出文件查看
     }
-
-    /**
-     * BA会员列表
-     * @return mixed
-     * @throws Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionBaUserList() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'STATUS' => 'U.STATUS',
-            'ALLOW_LOGIN' => 'U.ALLOW_LOGIN',
-            'CREATED_AT' => 'U.CREATED_AT',
-            'PERIOD_AT' => 'U.PERIOD_AT',
-//            'DEC_LV_NAME' => 'U.DEC_LV',
-//            'DEC_LV_UPDATED_AT' => 'U.DEC_LV_UPDATED_AT',
-//            'LAST_DEC_LV_NAME' => 'U.LAST_DEC_LV',
-//            'EMP_LV_NAME' => 'U.EMP_LV',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'CON_USER_NAME' => 'CU.USER_NAME',
-            'ID_CARD' => 'U.ID_CARD',
-            'SPOUSE_NAME' => 'U.SPOUSE_NAME',
-//            'SPOUSE_IDCARD' => 'U.SPOUSE_IDCARD',
-            'SYSTEM_NAME' => 'U.SYSTEM_ID',
-            'MOBILE' => 'U.MOBILE',
-            'TEL' => 'U.TEL',
-            'DEC_USER_NAME' => 'DU.USER_NAME',
-//            'IS_DEC' => 'U.IS_DEC',
-//            'IS_STUDIO' => 'U.IS_STUDIO',
-//            'DEC_ROLE_NAME' => 'U.DEC_ROLE_ID',
-            'OPEN_BANK_NAME' => 'U.OPEN_BANK',
-            'BANK_AREA' => [
-                'FIELD' => ['U.BANK_PROVINCE', 'U.BANK_CITY', 'U.BANK_COUNTY'],
-                'BIND' => ['BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY'],
-            ],
-            'BANK_ADDRESS' => 'U.BANK_ADDRESS',
-            'BANK_NO' => 'U.BANK_NO',
-            'SEX' => 'U.SEX',
-            'NATION_NAME' => 'U.NATION',
-            'AREA' => [
-                'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
-                'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
-            ],
-            'ADDRESS' => 'U.ADDRESS',
-            'VERIFIED' => 'U.VERIFIED',
-            'VERIFIED_AT' => 'U.VERIFIED_AT',
-            'ALLOW_TRANSFER' => 'UI.ALLOW_TRANSFER',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $condition .= ' AND UI.DELETED=0 ';
-        $listObj = new BaUserList();
-        $data = $listObj->getList(['condition' => $condition, 'params' => $params]);
-        return static::notice($data);
-    }
-
-    public function actionBaUserListExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'STATUS' => 'U.STATUS',
-            'ALLOW_LOGIN' => 'U.ALLOW_LOGIN',
-            'CREATED_AT' => 'U.CREATED_AT',
-            'PERIOD_AT' => 'U.PERIOD_AT',
-            'DEC_LV_NAME' => 'U.DEC_LV',
-            'DEC_LV_UPDATED_AT' => 'U.DEC_LV_UPDATED_AT',
-            'LAST_DEC_LV_NAME' => 'U.LAST_DEC_LV',
-            'EMP_LV_NAME' => 'U.EMP_LV',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'CON_USER_NAME' => 'CU.USER_NAME',
-            'ID_CARD' => 'U.ID_CARD',
-            'SPOUSE_NAME' => 'U.SPOUSE_NAME',
-            'SPOUSE_IDCARD' => 'U.SPOUSE_IDCARD',
-            'SYSTEM_NAME' => 'U.SYSTEM_ID',
-            'MOBILE' => 'U.MOBILE',
-            'TEL' => 'U.TEL',
-            'DEC_USER_NAME' => 'DU.USER_NAME',
-            'IS_DEC' => 'U.IS_DEC',
-            'IS_STUDIO' => 'U.IS_STUDIO',
-            'DEC_ROLE_NAME' => 'U.DEC_ROLE_ID',
-            'OPEN_BANK_NAME' => 'U.OPEN_BANK',
-            'BANK_AREA' => [
-                'FIELD' => ['U.BANK_PROVINCE', 'U.BANK_CITY', 'U.BANK_COUNTY'],
-                'BIND' => ['BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY'],
-            ],
-            'BANK_ADDRESS' => 'U.BANK_ADDRESS',
-            'BANK_NO' => 'U.BANK_NO',
-            'SEX' => 'U.SEX',
-            'NATION_NAME' => 'U.NATION',
-            'AREA' => [
-                'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
-                'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
-            ],
-            'ADDRESS' => 'U.ADDRESS',
-            'VERIFIED' => 'U.VERIFIED',
-            'VERIFIED_AT' => 'U.VERIFIED_AT',
-            'ALLOW_TRANSFER' => 'UI.ALLOW_TRANSFER',
-        ]);
-        $form = new BaUserExportForm();
-        $result = $form->run($filter, 'Ba_User_List');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('Starting exporting, please go to File Management - Export Files to view.'); // 导出开始,请到文件管理-导出文件查看
-    }
 }

+ 239 - 91
backendApi/modules/v1/controllers/UserController.php

@@ -10,7 +10,9 @@ namespace backendApi\modules\v1\controllers;
 
 use backendApi\modules\v1\components\UserAuth;
 use backendApi\modules\v1\models\Admin;
+use backendApi\modules\v1\models\exportForms\BaUserExportForm;
 use backendApi\modules\v1\models\exportForms\UserExportForm;
+use backendApi\modules\v1\models\lists\shop\BaUserList;
 use backendApi\modules\v1\models\lists\user\BindList;
 use backendApi\modules\v1\models\lists\user\DecLevelList;
 use backendApi\modules\v1\models\lists\user\GroupList;
@@ -29,9 +31,11 @@ use common\helpers\user\Balance;
 use common\helpers\user\Cash;
 use common\helpers\user\Info;
 use common\helpers\user\Status;
+use common\models\BaUser;
 use common\models\CompanyBank;
 use common\models\FlowBonus;
 use common\models\forms\AdminAddUserForm;
+use common\models\forms\BaUserBasicForm;
 use common\models\forms\ChangeShowEmpLvForm;
 use common\models\forms\CloseDecForm;
 use common\models\forms\CloseLoginForm;
@@ -77,6 +81,7 @@ use common\models\User;
 use common\models\UserInfo;
 use common\models\UserTeamwork;
 use yii\base\Exception;
+use yii\web\HttpException;
 use yii\web\UploadedFile;
 
 class UserController extends BaseController
@@ -94,7 +99,7 @@ class UserController extends BaseController
      * 会员列表
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIndex()
     {
@@ -157,7 +162,7 @@ class UserController extends BaseController
      * 导出会员列表
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIndexExport()
     {
@@ -214,7 +219,7 @@ class UserController extends BaseController
      * 空单会员列表
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionEmptyList()
     {
@@ -276,7 +281,7 @@ class UserController extends BaseController
      * 点位绑定
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBind()
     {
@@ -301,7 +306,7 @@ class UserController extends BaseController
      * 点位绑定导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBindExport()
     {
@@ -326,7 +331,7 @@ class UserController extends BaseController
     /**
      * 添加点位绑定
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBindAdd()
     {
@@ -341,7 +346,7 @@ class UserController extends BaseController
      * 编辑点位绑定
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBindEdit()
     {
@@ -365,7 +370,7 @@ class UserController extends BaseController
      * 删除点位绑定
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBindDelete()
     {
@@ -382,7 +387,7 @@ class UserController extends BaseController
      * 生成点位合作的用户名
      * @return mixed
      * @throws \yii\base\InvalidConfigException
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionGenerateUserName()
     {
@@ -397,7 +402,7 @@ class UserController extends BaseController
      * 点位合作
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionTeamwork()
     {
@@ -425,7 +430,7 @@ class UserController extends BaseController
      * 点位合作导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionTeamworkExport()
     {
@@ -453,7 +458,7 @@ class UserController extends BaseController
     /**
      * 添加点位合作
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionTeamworkAdd()
     {
@@ -473,7 +478,7 @@ class UserController extends BaseController
      * 编辑点位合作
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionTeamworkEdit()
     {
@@ -504,7 +509,7 @@ class UserController extends BaseController
      * 删除方法
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionTeamworkDelete()
     {
@@ -520,7 +525,7 @@ class UserController extends BaseController
      * 会员体系
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystem()
     {
@@ -547,7 +552,7 @@ class UserController extends BaseController
      * 体系管理导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystemExport()
     {
@@ -577,7 +582,7 @@ class UserController extends BaseController
      * @throws \yii\base\InvalidConfigException
      * @throws \yii\db\Exception
      * @throws \yii\httpclient\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystemAdd()
     {
@@ -598,7 +603,7 @@ class UserController extends BaseController
      * @return mixed
      * @throws \yii\base\InvalidConfigException
      * @throws \yii\httpclient\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystemEdit()
     {
@@ -617,7 +622,7 @@ class UserController extends BaseController
     /**
      * 恢复体系
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystemRenew()
     {
@@ -632,7 +637,7 @@ class UserController extends BaseController
      * 删除方法
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionSystemDelete()
     {
@@ -649,7 +654,7 @@ class UserController extends BaseController
      * 团队领导人列表
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionGroup()
     {
@@ -668,7 +673,7 @@ class UserController extends BaseController
      * 团队领导人列表导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionGroupExport()
     {
@@ -688,7 +693,7 @@ class UserController extends BaseController
      * 会员移网记录
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMove()
     {
@@ -723,7 +728,7 @@ class UserController extends BaseController
      * 移网管理导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveExport()
     {
@@ -757,7 +762,7 @@ class UserController extends BaseController
      * @return mixed
      * @throws \yii\base\InvalidConfigException
      * @throws \yii\httpclient\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveAdd()
     {
@@ -772,7 +777,7 @@ class UserController extends BaseController
     /**
      * 获取全部移网类型
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveNetType()
     {
@@ -783,7 +788,7 @@ class UserController extends BaseController
      * 获取移网数据
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveGet()
     {
@@ -801,7 +806,7 @@ class UserController extends BaseController
      * 修改移网数据
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveEdit()
     {
@@ -819,7 +824,7 @@ class UserController extends BaseController
      * 审核通过移网数据(实际的移网动作在这里,异步操作)
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMovePass()
     {
@@ -839,7 +844,7 @@ class UserController extends BaseController
      * @throws \yii\base\InvalidConfigException
      * @throws \yii\db\Exception
      * @throws \yii\httpclient\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveAudit()
     {
@@ -856,7 +861,7 @@ class UserController extends BaseController
      * 删除移网数据
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMoveDelete()
     {
@@ -872,7 +877,7 @@ class UserController extends BaseController
     /**
      * 会员的基础用户信息
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionFullInfo()
     {
@@ -897,7 +902,7 @@ class UserController extends BaseController
     /**
      * 会员的基本信息编号名称
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBaseInfo()
     {
@@ -909,7 +914,7 @@ class UserController extends BaseController
     /**
      * 点位合作主点位分成比例
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionMainDivide()
     {
@@ -924,7 +929,7 @@ class UserController extends BaseController
     /**
      * 获取子公司
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionGetSubCom()
     {
@@ -936,7 +941,7 @@ class UserController extends BaseController
     /**
      * 判断是否在同一推荐网络
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChkRelation()
     {
@@ -956,7 +961,7 @@ class UserController extends BaseController
     /**
      * 获取当前期数
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionGetPeriodNum()
     {
@@ -976,7 +981,7 @@ class UserController extends BaseController
     /**
      * 关停列表
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
 //    public function actionClose()
 //    {
@@ -1009,7 +1014,7 @@ class UserController extends BaseController
     /**
      * 申请关停或停发
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
 //    public function actionCloseAdd()
 //    {
@@ -1040,7 +1045,7 @@ class UserController extends BaseController
      * 审核关停或停发
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
 //    public function actionCloseAudit()
 //    {
@@ -1066,7 +1071,7 @@ class UserController extends BaseController
     /**
      * 添加会员
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionUserAdd()
     {
@@ -1090,7 +1095,7 @@ class UserController extends BaseController
     /**
      * 分页导入excel文件到待导入数据的表中
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionImportUsersToExcelTable()
     {
@@ -1132,7 +1137,7 @@ class UserController extends BaseController
     /**
      * 个人资料获取
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionProfileGet() {
         $id = Yii::$app->request->get('id');
@@ -1181,7 +1186,7 @@ class UserController extends BaseController
     /**
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsModifyPasswordStatus() {
         $form = new UserBasicForm();
@@ -1196,7 +1201,7 @@ class UserController extends BaseController
     /**
      * 分页把待导入表中的数据导入到真正的数据中
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionImportUsersAdd()
     {
@@ -1226,7 +1231,7 @@ class UserController extends BaseController
     /**
      * 判断是否满足删除条件
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChkDelUser()
     {
@@ -1276,7 +1281,7 @@ class UserController extends BaseController
      * 删除空单会员
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionUserDel()
     {
@@ -1294,7 +1299,7 @@ class UserController extends BaseController
     /**
      * 复销列表
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionReConsumeList()
     {
@@ -1329,7 +1334,7 @@ class UserController extends BaseController
      *      'CREATED_AT' => '>=,2018-11-10,date'
      * ]
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionFilterUser()
     {
@@ -1405,7 +1410,7 @@ class UserController extends BaseController
      * 会员级别变动记录
      * @return mixed
      * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionDecLevelList()
     {
@@ -1424,7 +1429,7 @@ class UserController extends BaseController
     /**
      * 调整会员级别报单级别
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChangeUserDecLevel()
     {
@@ -1441,7 +1446,7 @@ class UserController extends BaseController
     /**
      * 调整会员级别报单级别
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChangeUserDecRole()
     {
@@ -1458,7 +1463,7 @@ class UserController extends BaseController
     /**
      * 修改会员前台显示聘级
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChangeShowEmpLevel()
     {
@@ -1476,7 +1481,7 @@ class UserController extends BaseController
      * 注册信息管理
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfo()
     {
@@ -1502,7 +1507,7 @@ class UserController extends BaseController
     /**
      * 注册信息管理中提交修改注册信息
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoEdit()
     {
@@ -1520,7 +1525,7 @@ class UserController extends BaseController
      * 会员注册信息审核
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAudit()
     {
@@ -1552,7 +1557,7 @@ class UserController extends BaseController
     /**
      * 会员注册信息添加
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditAdd()
     {
@@ -1567,7 +1572,7 @@ class UserController extends BaseController
     /**
      * 会员注册信息添加获取
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditAddOpt()
     {
@@ -1579,7 +1584,7 @@ class UserController extends BaseController
      * 会员注册信息获取
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditGet()
     {
@@ -1601,7 +1606,7 @@ class UserController extends BaseController
      * 会员注册信息修改
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditEdit()
     {
@@ -1619,7 +1624,7 @@ class UserController extends BaseController
      * 会员注册信息审核
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditAudit()
     {
@@ -1636,7 +1641,7 @@ class UserController extends BaseController
     /**
      * 分页导入excel文件到待导入数据的表中
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionImportRegInfoToExcelTable()
     {
@@ -1669,7 +1674,7 @@ class UserController extends BaseController
      * 分页把待导入表中的数据导入到真正的数据中
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionImportRegInfo()
     {
@@ -1695,7 +1700,7 @@ class UserController extends BaseController
      * 会员注册信息删除
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRegInfoAuditDelete()
     {
@@ -1709,7 +1714,7 @@ class UserController extends BaseController
     /**
      * 禁止登录
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseLogin()
     {
@@ -1727,7 +1732,7 @@ class UserController extends BaseController
     /**
      * 禁止登陆类型获取
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseLoginGet()
     {
@@ -1737,7 +1742,7 @@ class UserController extends BaseController
     /**
      * 关闭地区登录
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseAreaLogin()
     {
@@ -1758,7 +1763,7 @@ class UserController extends BaseController
     /**
      * 批量登录管理
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBatchCloseLogin()
     {
@@ -1782,7 +1787,7 @@ class UserController extends BaseController
     /**
      * 关闭报单信息获取
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseDecGet()
     {
@@ -1792,7 +1797,7 @@ class UserController extends BaseController
     /**
      * 关闭报单
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseDec()
     {
@@ -1809,7 +1814,7 @@ class UserController extends BaseController
     /**
      * 批量关闭报单
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionBatchCloseDec()
     {
@@ -1832,7 +1837,7 @@ class UserController extends BaseController
     /**
      * 按地区关闭报单
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCloseAreaDec()
     {
@@ -1853,7 +1858,7 @@ class UserController extends BaseController
      * 会员状态管理
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
 //    public function actionStatusAuditList()
 //    {
@@ -1885,7 +1890,7 @@ class UserController extends BaseController
      * 会员状态管理导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAuditExport()
     {
@@ -1917,7 +1922,7 @@ class UserController extends BaseController
     /**
      * 申请修改会员状态
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAuditAdd()
     {
@@ -1933,7 +1938,7 @@ class UserController extends BaseController
     /**
      * 获取全部移网类型
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAuditGetStatuses()
     {
@@ -1945,7 +1950,7 @@ class UserController extends BaseController
      * 获取会员状态数据
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAuditGet()
     {
@@ -1973,7 +1978,7 @@ class UserController extends BaseController
      * @return mixed
      * @throws Exception
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAudit()
     {
@@ -1991,7 +1996,7 @@ class UserController extends BaseController
      * 删除审核修改会员状态
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionStatusAuditDelete()
     {
@@ -2009,7 +2014,7 @@ class UserController extends BaseController
     /**
      * 设置是否运作
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsOperating()
     {
@@ -2030,7 +2035,7 @@ class UserController extends BaseController
     /**
      * 团队领导人
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsGroup()
     {
@@ -2051,7 +2056,7 @@ class UserController extends BaseController
     /**
      * 报单中心
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsDec()
     {
@@ -2063,7 +2068,7 @@ class UserController extends BaseController
     /**
      * 工作室
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsStudio()
     {
@@ -2075,7 +2080,7 @@ class UserController extends BaseController
     /**
      * 网络图谱
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsAtlas()
     {
@@ -2087,7 +2092,7 @@ class UserController extends BaseController
     /**
      * 会员充值管理显隐设置
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionIsRecharge()
     {
@@ -2099,7 +2104,7 @@ class UserController extends BaseController
     /**
      * 获取企业银行信息
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionCompanyBankGet()
     {
@@ -2120,7 +2125,7 @@ class UserController extends BaseController
     /**
      * 调整会员转账/提现比例
      * @return mixed
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionChangeTransferProp()
     {
@@ -2149,7 +2154,7 @@ class UserController extends BaseController
      * @return mixed
      * @throws Exception
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionClearWallet()
     {
@@ -2172,7 +2177,7 @@ class UserController extends BaseController
      * 会员历史年度最高聘级表
      * @return mixed
      * @throws Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionYearHighestEmpLv()
     {
@@ -2193,7 +2198,7 @@ class UserController extends BaseController
      * 会员历史年度最高聘级表导出
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionYearHighestEmpLvExport()
     {
@@ -2215,7 +2220,7 @@ class UserController extends BaseController
      * 会员现金充值
      * @return mixed
      * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
+     * @throws HttpException
      */
     public function actionRechargeToUser()
     {
@@ -2226,4 +2231,147 @@ class UserController extends BaseController
         }
         return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
     }
+
+    /**
+     * 会员修改密码
+     * @return mixed
+     * @throws HttpException
+     */
+    public function actionBaModifyPassword()
+    {
+        $form = new BaUserBasicForm();
+        $form->scenario = 'modifyPassword';
+        if(Yii::$app->request->isPost && $form->load(Yii::$app->request->post(), '') && $result = $form->edit()){
+            return static::notice('Password modified successfully'); // 密码修改成功
+        } else {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+    }
+
+    /**
+     * 个人资料获取
+     * @return mixed
+     * @throws HttpException
+     */
+    public function actionBaProfileGet() {
+        $id = Yii::$app->request->get('id');
+        $userInfo = BaUser::findOneAsArray('ID=:ID', [':ID' => $id]);
+        if (!$userInfo) {
+            return static::notice('Data does not exist', 400);//数据不存在
+        }
+//        $allNation = \Yii::$app->params['nation'];
+//        $allOpenBank = OpenBank::findAllAsArray('STATUS=1');
+//        $data['allNation'] = $allNation;
+//        $data['allOpenBank'] = $allOpenBank;
+        $data['userInfo'] = [
+            'userId' => $userInfo['ID'],
+//            'nation' => \Yii::$app->params['nation'][$userInfo['NATION']]['name']??'',
+            'realName' => $userInfo['REAL_NAME'],
+//            'idCard' => $userInfo['ID_CARD'],
+            'mobile' => $userInfo['MOBILE'],
+//            'openBank' => $userInfo['OPEN_BANK'],
+//            'bankAddress' => $userInfo['BANK_ADDRESS'],
+//            'bankNo' => $userInfo['BANK_NO'],
+        ];
+
+        return static::notice($data);
+    }
+
+    public function actionBaModifyProfile() {
+        $form = new BaUserBasicForm();
+        $form->scenario = 'modifyProfile';
+        if(Yii::$app->request->isPost && $form->load(Yii::$app->request->post(), '') && $result = $form->modifyProfile()){
+            return static::notice('Personal data modified successfully');//个人资料修改成功
+        } else {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+    }
+
+    public function actionBaModifyStatus() {
+        $form = new BaUserBasicForm();
+        $form->scenario = 'modifyStatus';
+        if(Yii::$app->request->isPost && $form->load(Yii::$app->request->post(), '') && $result = $form->modifyStatus()){
+            return static::notice('Member status modified successfully');//会员状态修改成功
+        } else {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+    }
+
+    /**
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws HttpException
+     */
+    public function actionBaIsModifyPasswordStatus() {
+        $form = new BaUserBasicForm();
+        $form->scenario = 'isModifyPasswordStatus';
+        if(Yii::$app->request->isPost && $form->load(Yii::$app->request->post(), '') && $result = $form->isModifyPasswordStatus()){
+            return static::notice('Status modified successfully');//状态修改成功
+        } else {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+    }
+
+    /**
+     * BA会员列表
+     * @return mixed
+     * @throws Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionBaUserList() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'STATUS' => 'U.STATUS',
+            'ALLOW_LOGIN' => 'U.ALLOW_LOGIN',
+            'CREATED_AT' => 'U.CREATED_AT',
+            'PERIOD_AT' => 'U.PERIOD_AT',
+            'SPOUSE_NAME' => 'U.SPOUSE_NAME',
+            'MOBILE' => 'U.MOBILE',
+            'TEL' => 'U.TEL',
+            'SEX' => 'U.SEX',
+            'AREA' => [
+                'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
+                'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
+            ],
+            'ADDRESS' => 'U.ADDRESS',
+            'ALLOW_TRANSFER' => 'UI.ALLOW_TRANSFER',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $condition .= ' AND UI.DELETED=0 ';
+        $listObj = new BaUserList();
+        $data = $listObj->getList(['condition' => $condition, 'params' => $params]);
+        return static::notice($data);
+    }
+
+    public function actionBaUserListExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'STATUS' => 'U.STATUS',
+            'ALLOW_LOGIN' => 'U.ALLOW_LOGIN',
+            'CREATED_AT' => 'U.CREATED_AT',
+            'PERIOD_AT' => 'U.PERIOD_AT',
+            'REC_USER_NAME' => 'RU.USER_NAME',
+            'CON_USER_NAME' => 'CU.USER_NAME',
+            'SPOUSE_NAME' => 'U.SPOUSE_NAME',
+            'SYSTEM_NAME' => 'U.SYSTEM_ID',
+            'MOBILE' => 'U.MOBILE',
+            'TEL' => 'U.TEL',
+            'SEX' => 'U.SEX',
+            'AREA' => [
+                'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
+                'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
+            ],
+            'ADDRESS' => 'U.ADDRESS',
+            'ALLOW_TRANSFER' => 'UI.ALLOW_TRANSFER',
+        ]);
+        $form = new BaUserExportForm();
+        $result = $form->run($filter, 'Ba_User_List');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('Starting exporting, please go to File Management - Export Files to view.'); // 导出开始,请到文件管理-导出文件查看
+    }
 }

+ 27 - 27
backendApi/modules/v1/models/lists/shop/BaUserList.php

@@ -196,7 +196,7 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                     'headerOther' => ['width' => '150'],
                 ],
                 'REC_REAL_NAME' => [
-                    'header' => 'Recommended name',//推荐姓名
+                    'header' => 'Recommended Name',//推荐姓名
                     'headerOther' => ['width' => '100'],
                 ],
 //                'CON_USER_NAME' => [
@@ -221,10 +221,10 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                     },
                     'headerOther' => ['width' => '120'],
                 ],
-                'DEC_USER_NAME' => [
-                    'header' => 'Stockist Code', // 所属报单中心编号
-                    'headerOther' => ['width' => '150'],
-                ],
+//                'DEC_USER_NAME' => [
+//                    'header' => 'Stockist Code', // 所属报单中心编号
+//                    'headerOther' => ['width' => '150'],
+//                ],
 //                'IS_DEC' => [
 //                    'header' => 'Declaration center or not',//是否报单中心
 //                    'value' => function($row) {
@@ -286,20 +286,20 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
 //                        return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
 //                    },
 //                ],
-                'OPEN_BANK_NAME' => [
-                    'header' => 'Bank Name',//开户银行
-                    'headerOther' => ['width' => '110'],
-                    'value' => function($row) use($openBankConfig) {
-                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
-                    },
-                ],
-                'BANK_NO' => [
-                    'header' => 'Bank account number',//银行帐号
-                    'headerOther' => ['width' => '220'],
-                    'value' => function($row) {
-                        return "\t".$row['BANK_NO'];
-                    },
-                ],
+//                'OPEN_BANK_NAME' => [
+//                    'header' => 'Bank Name',//开户银行
+//                    'headerOther' => ['width' => '110'],
+//                    'value' => function($row) use($openBankConfig) {
+//                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
+//                    },
+//                ],
+//                'BANK_NO' => [
+//                    'header' => 'Bank account number',//银行帐号
+//                    'headerOther' => ['width' => '220'],
+//                    'value' => function($row) {
+//                        return "\t".$row['BANK_NO'];
+//                    },
+//                ],
                 'AREA' => [
                     'header' => 'Common address',//常用地址
                     'value' => function($row) use($regionConfig) {
@@ -351,17 +351,17 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                 'REAL_NAME'=> ['name'=> 'Member name'], // 会员姓名
                 'CREATED_AT'=> ['name'=> 'Joining Date', 'other'=> 'date'], // 加入日期
                 'PERIOD_AT'=> ['name'=> 'Joining Period'], // 加入期数
-                'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'], // 实时会员级别
-                'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'], // 实时聘级
-                'CROWN_LV_NAME'=> ['name'=> 'Real time Crown', 'other'=> 'crownLevel'], // 实时聘级
+//                'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'], // 实时会员级别
+//                'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'], // 实时聘级
+//                'CROWN_LV_NAME'=> ['name'=> 'Real time Crown', 'other'=> 'crownLevel'], // 实时聘级
                 'REC_USER_NAME'=> ['name'=> 'Recommendation No'],//推荐编号
                 'CON_USER_NAME'=> ['name'=> 'Placement No'],//安置编号
-                'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
+//                'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
                 'MOBILE'=> ['name'=> 'Phone Number'],//手机号码
-                'DEC_USER_NAME'=> ['name'=> 'Stockist Code'], // 所属报单中心编号
-                'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
-                'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
-                'DEC_ROLE_NAME'=> ['name'=> 'Stockist Level', 'other'=> 'decRole'],//报单中心级别
+//                'DEC_USER_NAME'=> ['name'=> 'Stockist Code'], // 所属报单中心编号
+//                'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
+//                'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
+//                'DEC_ROLE_NAME'=> ['name'=> 'Stockist Level', 'other'=> 'decRole'],//报单中心级别
                 'AREA'=> ['name'=> 'Common address', 'other'=> 'area'],//常用地址
                 'STATUS'=> ['name'=> 'Active status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'locking'],['id'=> 1, 'name'=> 'activation']]],
             ];

+ 12 - 12
backendEle/src/router/index.js

@@ -177,18 +177,6 @@ export const constantRouterMap = [
           ],
         },
       },
-      {
-        path: '/shop/ba-user-list',
-        component: _import('shop/ba-user-list'),
-        name: 'shop_ba-user-list',
-        meta: {
-          title: 'Brand Ambassador List', // 会员列表
-          breadcrumb: [
-            {title: 'Dashboard', path: '/dashboard/index'}, // Dashboard
-            {title: 'Member management', path: '/user/index'} // 会员管理
-          ]
-        }
-      },
       {
         path: '/shop/ba-order-list',
         component: _import('shop/ba-order-list'),
@@ -220,6 +208,18 @@ export const constantRouterMap = [
           ],
         },
       },
+      {
+        path: '/user/ba-user-list',
+        component: _import('user/ba-user-list'),
+        name: 'ba-user-list',
+        meta: {
+          title: 'Brand Ambassador List', // 会员列表
+          breadcrumb: [
+            {title: 'Dashboard', path: '/dashboard/index'}, // Dashboard
+            {title: 'Member management', path: '/user/index'} // 会员管理
+          ]
+        }
+      },
       {
         path: '/user/user-add-opt',
         component: _import('user/user-add-opt'),

+ 0 - 690
backendEle/src/views/shop/ba-user-list.vue

@@ -1,690 +0,0 @@
-<template>
-  <div v-loading="loading">
-    <div class="white-box">
-      <div class="filter-box">
-        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
-      </div>
-      <el-table ref="wrapper" :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange" :height="tool.getTableHeight()">
-        <el-table-column fixed type="selection" width="55" v-if="tableHeaders"></el-table-column>
-        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header"
-            :width="tableHeader.other.width ? tableHeader.other.width : ''" :fixed="tableHeader.index=='USER_NAME' || tableHeader.index=='REAL_NAME' ?true:false">
-          <template slot-scope="scope">
-            <template v-if="scope.row[tableHeader.index].other.tag">
-              <el-tag
-                  :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null"
-                  :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null"
-                  :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null">
-                {{scope.row[tableHeader.index].value}}
-              </el-tag>
-            </template>
-            <template v-else>
-              <template v-if="tableHeader.index === 'USER_NAME'">
-                <el-dropdown v-if="permission.hasPermission(`user/login-to-frontend`)">
-                  <span class="el-dropdown-link">
-                    {{scope.row.USER_NAME.value}} <i class="el-icon-arrow-down el-icon--right"></i>
-                  </span>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item command="login" v-show="scope.row.BTF_URL !== null">
-                      <a :href="`${frontendServer}/#/login-by-backend?${scope.row.BTF_URL}`" target="_blank" style="color:#606266;">
-                        Quick logon<!-- 快速登录 -->
-                      </a>
-                    </el-dropdown-item>
-                  </el-dropdown-menu>
-                </el-dropdown>
-                <el-tag type="primary" size="small" class="no-border" v-if="!permission.hasPermission(`user/login-to-frontend`)">
-                  {{scope.row.USER_NAME.value}}
-                </el-tag>
-              </template>
-              <template v-else>
-                <div v-html="scope.row[tableHeader.index].value"></div>
-              </template>
-            </template>
-          </template>
-        </el-table-column>
-        <el-table-column fixed="right" label="Action" width="180"><!-- 操作 -->
-          <template slot-scope="scope">
-            <el-dropdown size="small" trigger="click">
-              <el-button type="primary" size="small" @click.stop="">
-                Action<!-- 操作该数据 --><i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item @click.native="handleModifyPassword(scope.row)" v-if="permission.hasPermission(`user/modify-password`)">
-                  Change Password<!-- 修改密码 -->
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleModifyProfile(scope.row)" v-if="permission.hasPermission(`user/modify-profile`)">
-                  Modify personal data<!-- 修改个人资料 -->
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleStatusActive(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">
-                  Status activation<!-- 状态激活 -->
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleStatusLock(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">
-                  Status lock<!-- 状态锁定 -->
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 1)" v-if="permission.hasPermission(`user/is-modify-password-status`)">
-                  Open password modification<!-- 开启密码修改 -->
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 0)" v-if="permission.hasPermission(`user/is-modify-password-status`)">
-                  Turn off password modification<!-- 关闭密码修改 -->
-                </el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="white-box-footer">
-        <el-button type="success" size="small" @click="handleExport" v-show="permission.hasPermission(`shop/ba-user-list`)">
-          Export Excel
-        </el-button>
-        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
-      </div>
-    </div>
-    <el-dialog :title="formModifyPassword.typeName" :visible.sync="dialogModifyPasswordVisible" width="50%">
-      <el-form ref="form" :model="formModifyPassword" label-width="120px" class="form-dialog">
-        <el-form-item label="type"><!-- 类型 -->
-          <el-select v-model="formModifyPassword.passwordType" placeholder="Please select a type"><!-- 请选择类型 -->
-            <el-option v-for="(item,key) in passwordType" :label="item.label" :value="item.type" :key="key"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="password"><!-- 密码 -->
-          <el-input placeholder="password" v-model="formModifyPassword.password"><!-- 密码 --></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="submitPasswordButtonStat">Submit<!-- 提交 --></el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-
-    <el-dialog :title="formModifyProfile.typeName" :visible.sync="dialogModifyProfileVisible" width="50%">
-      <el-form ref="form" :model="formModifyProfile" label-width="150px" class="form-dialog">
-        <el-form-item label="Member name"><!-- 会员姓名 -->
-          <el-input v-model="formModifyProfile.realName"></el-input>
-        </el-form-item>
-        <el-form-item label="Identity No."><!-- 身份证号 -->
-          <el-input v-model="formModifyProfile.idCard"></el-input>
-        </el-form-item>
-        <el-form-item label="Phone Number"><!-- 手机号 -->
-          <el-input v-model="formModifyProfile.mobile"></el-input>
-        </el-form-item>
-        <el-form-item label="Bank name"><!-- 银行名称 -->
-          <el-select v-model="formModifyProfile.openBank" placeholder="Please select a bank name"><!-- 请选择银行名称 -->
-            <el-option v-for="(item,index) in allOpenBank" :key="index" :label="item.BANK_NAME" :value="item.BANK_CODE"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="Bank Address"><!-- 开户行地址 -->
-          <el-input v-model="formModifyProfile.bankAddress"></el-input>
-        </el-form-item>
-        <el-form-item label="Bank account number"><!-- 银行帐号 -->
-          <el-input v-model="formModifyProfile.bankNo"></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="handleModifyProfileSubmit" :loading="submitProfileButtonStat">
-            Submit<!-- 提交 -->
-          </el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import network from './../../utils/network'
-import tool from './../../utils/tool'
-import {FRONTEND_SERVER} from '@/utils/config'
-import baseInfo from '@/utils/baseInfo'
-import FilterUser from '../../components/FilterUser'
-import store from './../../utils/vuexStore'
-import permission from '@/utils/permission'
-import Pagination from '@/components/Pagination'
-import filterHelper from '../../utils/filterHelper'
-
-export default {
-  name: 'user_index',
-  components: {FilterUser, Pagination},
-  mounted () {
-    let _this = this
-    _this.getData()
-    store.state.socket.onMessageCallback = this.onMessageCallback
-  },
-  data () {
-    return {
-      tableHeaders: null,
-      tableData: null,
-      loading: true,
-      multipleSelection: [],
-      currentPage: 1,
-      totalPages: 1,
-      totalCount: 1,
-      pageSize: 20,
-      frontendServer: FRONTEND_SERVER,
-      baseDecLevels: baseInfo.decLevels(),
-      baseEmpLevels: baseInfo.empLevels(),
-      tool: tool,
-      permission: permission,
-      filterTypes: null,
-      filterModel: {},
-      dialogVisible: false,
-      formCloseLogin: {
-        userName: null,
-        typeName: 'Login management', // 登录管理
-        type: null,
-        isClose: 0,
-        remark: '',
-        areaSelected: null
-      },
-      regionDataPlus: store.state.regionInfo.regionData,
-      apps: null,
-      closeSwitch: null,
-      submitButtonStat: false,
-      dialogDecVisible: false,
-      dialogModifyPasswordVisible: false,
-      dialogModifyProfileVisible: false,
-      formCloseDec: {
-        userName: null,
-        typeName: 'Manage entry', // 管理报单
-        type: null,
-        isClose: 0,
-        remark: '',
-        areaSelected: null
-      },
-      formModifyPassword: {
-        userId: '',
-        password: '',
-        typeName: 'Change Password', // 修改密码
-        passwordType: 'password'
-        // remark: '',
-      },
-      formModifyProfile: {
-        userId: '',
-        typeName: 'Modify personal data', // 修改个人资料
-        nation: '',
-        realName: '',
-        idCard: '',
-        mobile: '',
-        openBank: '',
-        bankAddress: '',
-        bankNo: ''
-      },
-      passwordType: [
-        {
-          type: 'password',
-          label: 'login password' // 登录密码
-        },
-        {
-          type: 'payPassword',
-          label: 'Payment password' // 支付密码
-        }
-      ],
-      allOpenBank: null,
-      allNation: null,
-      submitDecButtonStat: false,
-      submitPasswordButtonStat: false,
-      submitProfileButtonStat: false,
-      transferPropForm: {
-        userIds: [],
-        allowTransfer: true,
-        transferProp: 100,
-        withdrawProp: 0,
-        remark: ''
-      },
-      closeUserData: null
-    }
-  },
-  methods: {
-    handleSelectionChange (val) {
-      this.multipleSelection = val
-    },
-    handleCurrentChange (page) {
-      this.getData(page, this.pageSize)
-    },
-    handleSizeChange (pageSize) {
-      this.getData(this.currentPage, pageSize)
-    },
-    handleAdd () {
-      this.$router.push('/user/user-add')
-    },
-    handleFilterUser (filterData) {
-      filterHelper.handleFilterUser(this, filterData)
-    },
-    handleFilter () {
-      this.getData()
-    },
-    getData (page, pageSize, isLoading = true) {
-      network.getPageData(this, 'shop/ba-user-list', page, pageSize, this.filterModel, response => {
-        this.filterTypes = response.filterTypes
-      }, isLoading)
-    },
-    handleGroupManage (isGroup) {
-      if (this.multipleSelection.length < 1) {
-        this.$message({
-          message: 'Please check the member to be operated', // 请勾选要操作的会员
-          type: 'warning'
-        })
-        return
-      }
-      let groupTip = isGroup === true ? 'Set as team leader' : 'Cancel team leader' // '设为团队领导人' : '取消团队领导人'
-      this.$confirm(`Are you sure you want to【${groupTip}】?`, 'Hint', { // `确定要对所选会员【${groupTip}】吗?`, '提示'
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        return network.postData(`user/is-group`, {userIds: selectedIds, isGroup: isGroup})
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleIsDecManage (isDec) {
-      if (this.multipleSelection.length < 1) {
-        this.$message({
-          message: 'Please check the member to be operated', // 请勾选要操作的会员
-          type: 'warning'
-        })
-        return
-      }
-      let isDecTip = isDec === true ? 'Set as declaration Center' : 'Cancel Stockist' // '设为报单中心' : '取消报单中心'
-      this.$confirm(`Are you sure you want to【${isDecTip}】?`, 'Hint', { // 确定要对所选会员【${isDecTip}】吗?`, '提示'
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        return network.postData(`user/is-dec`, {userIds: selectedIds, isDec: isDec})
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleIsStudioManage (isStudio) {
-      if (this.multipleSelection.length < 1) {
-        this.$message({
-          message: 'Please check the member to be operated', // 请勾选要操作的会员
-          type: 'warning'
-        })
-        return
-      }
-      let isStudioTip = isStudio === true ? 'Set as studio' : 'Cancel room' // '设为工作室' : '取消工作室'
-      this.$confirm(`Are you sure you want to【${isStudioTip}】?`, 'Hint', {
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        return network.postData(`user/is-studio`, {userIds: selectedIds, isStudio: isStudio})
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleIsAtlasManage (isAtlas) {
-      if (this.multipleSelection.length < 1) {
-        this.$message({
-          message: 'Please check the member to be operated', // 请勾选要操作的会员
-          type: 'warning'
-        })
-        return
-      }
-      let isAtlasTip = isAtlas === true ? 'Display Atlas' : 'Hidden Atlas' // '显示图谱' : '隐藏图谱'
-      this.$confirm(`Are you sure you want to【${isAtlasTip}】?`, 'Hint', { // `确定要对所选会员【${isAtlasTip}】吗?`, '提示'
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        return network.postData(`user/is-atlas`, {userIds: selectedIds, isAtlas: isAtlas})
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleIsRechargeManage (isRecharge) {
-      if (this.multipleSelection.length < 1) {
-        this.$message({
-          message: 'Please check the member to be operated', // 请勾选要操作的会员
-          type: 'warning'
-        })
-        return
-      }
-      let isRechargeTip = isRecharge === true ? 'Display recharge' : 'Hide recharge' // '显示充值' : '隐藏充值'
-      this.$confirm(`Are you sure you want to【${isRechargeTip}】?`, 'Hint', { // `确定要对所选会员【${isRechargeTip}】吗?`, '提示'
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        return network.postData(`user/is-recharge`, {userIds: selectedIds, isRecharge: isRecharge})
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    getTypeName (type) {
-      switch (type) {
-        case 1:
-          return 'By designated member' // 按指定会员
-        case 2:
-          return 'Expand network by' // 按开拓网络
-        case 3:
-          return 'By placement network' // 按安置网络
-        case 4:
-          return 'By membership system' // 按会员体系
-        case 5:
-          return 'By province and region' // 按省份地区
-        default:
-          return ''
-      }
-    },
-    handleLoginManage (type) {
-      if (type === 2 || type === 3 || type === 4) {
-        if (this.multipleSelection.length > 1) {
-          this.$message({
-            message: 'Multiple members are not allowed to be checked in this login management', // 此登录管理不允许勾选多名会员
-            type: 'warning'
-          })
-          return
-        } else if (this.multipleSelection.length < 1) {
-          this.$message({
-            message: 'Please select a member number', // 请选择会员编号
-            type: 'warning'
-          })
-          return
-        }
-      }
-      if (type === 1 && this.multipleSelection.length <= 0) {
-        this.$message({
-          message: 'Please select a member number', // 请选择会员编号
-          type: 'warning'
-        })
-        return
-      }
-      if (type === 5 && this.multipleSelection.length > 0) {
-        this.$message({
-          message: 'Closing login by region without checking member', // 按照地区关闭登录无需勾选会员
-          type: 'warning'
-        })
-        return
-      }
-      this.formCloseLogin = {
-        userName: null,
-        typeName: 'Login management', // 登录管理
-        type: null,
-        isClose: 0,
-        remark: '',
-        areaSelected: null
-      }
-      this.formCloseLogin.typeName = this.getTypeName(type) + 'Manage logins' // 管理登录
-      this.formCloseLogin.type = type
-      this.dialogVisible = true
-    },
-    handleCloseLoginSubmit () {
-      this.submitButtonStat = true
-      // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
-      if (this.formCloseLogin.type === 1) {
-        this.handleCloseLogin(this.formCloseLogin.isClose, this.formCloseLogin.remark)
-      } else {
-        for (let val of this.multipleSelection) {
-          this.formCloseLogin.userName = val.USER_NAME.value
-        }
-        let path = 'user/close-login'
-        if (this.formCloseLogin.type === 5) {
-          path = 'user/close-area-login'
-        }
-        network.postData(path, this.formCloseLogin).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.getData(this.currentPage, this.pageSize)
-          this.submitButtonStat = false
-          this.dialogVisible = false
-        }).catch(response => {
-          this.submitButtonStat = false
-        })
-      }
-    },
-    handleCloseLogin (isClose, remark = '') {
-      let selectedIds = []
-      for (let val of this.multipleSelection) {
-        selectedIds.push(val.USER_ID)
-      }
-      console.log(selectedIds)
-      network.postData(`user/batch-close-login`, {
-        userIds: selectedIds,
-        isClose: isClose,
-        remark: remark,
-        type: 1
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-        this.submitButtonStat = false
-        this.dialogVisible = false
-      }).catch(response => {
-        this.submitButtonStat = false
-      })
-    },
-    handleExport () {
-      this.$confirm(`Are you sure you want to export the current data?`, 'Hint', { // (`确定要导出当前数据吗?`, '提示',
-        confirmButtonText: 'confirm', // 确定
-        cancelButtonText: 'cancel', // 取消
-        type: 'warning'
-      }).then(() => {
-        return network.getData(`shop/ba-user-list-export`, this.filterModel)
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-      }).catch(response => {
-
-      })
-    },
-    onMessageCallback (data) {
-      // this.getData(this.currentPage, this.pageSize, false)
-    },
-    handleDecManage (type) {
-      if (type === 2 || type === 3 || type === 4) {
-        if (this.multipleSelection.length > 1) {
-          this.$message({
-            message: 'Multiple members are not allowed to be checked in this entry management', // 此报单管理不允许勾选多名会员
-            type: 'warning'
-          })
-          return
-        } else if (this.multipleSelection.length < 1) {
-          this.$message({
-            message: 'Please check the member to manage the entry', // 请勾选要管理报单的会员
-            type: 'warning'
-          })
-          return
-        }
-      }
-      if (type === 1 && this.multipleSelection.length <= 0) {
-        this.$message({
-          message: 'Please check the member to manage the entry', // 请勾选要管理报单的会员
-          type: 'warning'
-        })
-        return
-      }
-      if (type === 5 && this.multipleSelection.length > 0) {
-        this.$message({
-          message: 'Closing entry by region without checking member', // 按照地区关闭报单无需勾选会员
-          type: 'warning'
-        })
-        return
-      }
-      this.formCloseDec = {
-        userName: null,
-        typeName: 'Manage entry', // 管理报单
-        type: null,
-        isClose: 0,
-        remark: '',
-        areaSelected: null
-      }
-      this.formCloseDec.typeName = this.getTypeName(type) + 'Manage entry' // 管理报单
-      this.formCloseDec.type = type
-      this.dialogDecVisible = true
-    },
-    handleModifyPassword (row) {
-      this.formModifyPassword.userId = row.USER_ID
-      this.dialogModifyPasswordVisible = true
-    },
-    handleModifyProfile (row) {
-      this.dialogModifyProfileVisible = true
-      let vueObj = this
-      network.getData('user/profile-get', {id: row.USER_ID}).then(response => {
-        vueObj.formModifyProfile = response.userInfo
-        vueObj.allOpenBank = response.allOpenBank
-        vueObj.allNation = response.allNation
-      })
-    },
-    handleCloseDecSubmit () {
-      this.submitDecButtonStat = true
-      // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
-      if (this.formCloseDec.type === 1) {
-        this.handleCloseDec(this.formCloseDec.isClose, this.formCloseDec.remark)
-      } else {
-        for (let val of this.multipleSelection) {
-          this.formCloseDec.userName = val.USER_NAME.value
-        }
-        let path = 'user/close-dec'
-        if (this.formCloseDec.type === 5) {
-          path = 'user/close-area-dec'
-        }
-        network.postData(path, this.formCloseDec).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.getData(this.currentPage, this.pageSize)
-          this.submitDecButtonStat = false
-          this.dialogDecVisible = false
-        }).catch(response => {
-          this.submitDecButtonStat = false
-        })
-      }
-    },
-    handleCloseDec (isClose, remark = '') {
-      let selectedIds = []
-      for (let val of this.multipleSelection) {
-        selectedIds.push(val.USER_ID)
-      }
-      network.postData(`user/batch-close-dec`, {
-        userIds: selectedIds,
-        isClose: isClose,
-        remark: remark,
-        type: 1,
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-        this.submitDecButtonStat = false
-        this.dialogDecVisible = false
-      }).catch(response => {
-        this.submitDecButtonStat = false
-      })
-    },
-    handleStatusActive (row) {
-      network.postData('user/modify-status',{userId: row.USER_ID, status: 1}).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      })
-    },
-    handleStatusLock (row) {
-      network.postData('user/modify-status',{userId: row.USER_ID, status: 0}).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      })
-    },
-    handleIsModifyPassword (row, status) {
-      network.postData('user/is-modify-password-status',{userId: row.USER_ID, status: status}).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      })
-    },
-    handleModifyPasswordSubmit () {
-      this.submitPasswordButtonStat = true
-      let path = 'user/modify-password'
-      network.postData(path, this.formModifyPassword).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-        this.submitPasswordButtonStat = false
-        this.dialogModifyPasswordVisible = false
-      }).catch(response => {
-        this.submitPasswordButtonStat = false
-      })
-    },
-    handleModifyProfileSubmit () {
-      this.submitProfileButtonStat = true
-      let path = 'user/modify-profile'
-      network.postData(path, this.formModifyProfile).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-        this.submitProfileButtonStat = false
-        this.dialogModifyProfileVisible = false
-      }).catch(response => {
-        this.submitProfileButtonStat = false
-      })
-    }
-  }
-}
-
-</script>

+ 345 - 0
backendEle/src/views/user/ba-user-list.vue

@@ -0,0 +1,345 @@
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="filter-box">
+        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
+      </div>
+      <el-table ref="wrapper" :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange" :height="tool.getTableHeight()">
+        <el-table-column fixed type="selection" width="55" v-if="tableHeaders"></el-table-column>
+        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header"
+            :width="tableHeader.other.width ? tableHeader.other.width : ''" :fixed="tableHeader.index=='USER_NAME' || tableHeader.index=='REAL_NAME' ?true:false">
+          <template slot-scope="scope">
+            <template v-if="scope.row[tableHeader.index].other.tag">
+              <el-tag
+                  :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null"
+                  :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null"
+                  :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null">
+                {{scope.row[tableHeader.index].value}}
+              </el-tag>
+            </template>
+            <template v-else>
+              <template v-if="tableHeader.index === 'USER_NAME'">
+                <el-dropdown v-if="permission.hasPermission(`user/login-to-frontend`)">
+                  <span class="el-dropdown-link">
+                    {{scope.row.USER_NAME.value}} <i class="el-icon-arrow-down el-icon--right"></i>
+                  </span>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item command="login" v-show="scope.row.BTF_URL !== null">
+                      <a :href="`${frontendServer}/#/login-by-backend?${scope.row.BTF_URL}`" target="_blank" style="color:#606266;">
+                        Quick logon<!-- 快速登录 -->
+                      </a>
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+                <el-tag type="primary" size="small" class="no-border" v-if="!permission.hasPermission(`user/login-to-frontend`)">
+                  {{scope.row.USER_NAME.value}}
+                </el-tag>
+              </template>
+              <template v-else>
+                <div v-html="scope.row[tableHeader.index].value"></div>
+              </template>
+            </template>
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" label="Action" width="180"><!-- 操作 -->
+          <template slot-scope="scope">
+            <el-dropdown size="small" trigger="click">
+              <el-button type="primary" size="small" @click.stop="">
+                Action<!-- 操作该数据 --><i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item @click.native="handleModifyPassword(scope.row)" v-if="permission.hasPermission(`user/ba-modify-password`)">
+                  Change Password<!-- 修改密码 -->
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleModifyProfile(scope.row)" v-if="permission.hasPermission(`user/ba-modify-profile`)">
+                  Modify personal data<!-- 修改个人资料 -->
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleStatusActive(scope.row)" v-if="permission.hasPermission(`user/ba-modify-status`)">
+                  Status activation<!-- 状态激活 -->
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleStatusLock(scope.row)" v-if="permission.hasPermission(`user/ba-modify-status`)">
+                  Status lock<!-- 状态锁定 -->
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 1)" v-if="permission.hasPermission(`user/ba-is-modify-password-status`)">
+                  Open password modification<!-- 开启密码修改 -->
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 0)" v-if="permission.hasPermission(`user/ba-is-modify-password-status`)">
+                  Turn off password modification<!-- 关闭密码修改 -->
+                </el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="white-box-footer">
+        <el-button type="success" size="small" @click="handleExport" v-show="permission.hasPermission(`user/ba-user-list`)">
+          Export Excel
+        </el-button>
+        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
+      </div>
+    </div>
+    <el-dialog :title="formModifyPassword.typeName" :visible.sync="dialogModifyPasswordVisible" width="50%">
+      <el-form ref="form" :model="formModifyPassword" label-width="120px" class="form-dialog">
+        <el-form-item label="type"><!-- 类型 -->
+          <el-select v-model="formModifyPassword.passwordType" placeholder="Please select a type"><!-- 请选择类型 -->
+            <el-option v-for="(item,key) in passwordType" :label="item.label" :value="item.type" :key="key"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="password"><!-- 密码 -->
+          <el-input placeholder="password" v-model="formModifyPassword.password"><!-- 密码 --></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="submitPasswordButtonStat">Submit<!-- 提交 --></el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <el-dialog :title="formModifyProfile.typeName" :visible.sync="dialogModifyProfileVisible" width="50%">
+      <el-form ref="form" :model="formModifyProfile" label-width="150px" class="form-dialog">
+        <el-form-item label="Member name"><!-- 会员姓名 -->
+          <el-input v-model="formModifyProfile.realName"></el-input>
+        </el-form-item>
+<!--        <el-form-item label="Identity No.">&lt;!&ndash; 身份证号 &ndash;&gt;-->
+<!--          <el-input v-model="formModifyProfile.idCard"></el-input>-->
+<!--        </el-form-item>-->
+        <el-form-item label="Phone Number"><!-- 手机号 -->
+          <el-input v-model="formModifyProfile.mobile"></el-input>
+        </el-form-item>
+<!--        <el-form-item label="Bank name">&lt;!&ndash; 银行名称 &ndash;&gt;-->
+<!--          <el-select v-model="formModifyProfile.openBank" placeholder="Please select a bank name">&lt;!&ndash; 请选择银行名称 &ndash;&gt;-->
+<!--            <el-option v-for="(item,index) in allOpenBank" :key="index" :label="item.BANK_NAME" :value="item.BANK_CODE"></el-option>-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="Bank Address">&lt;!&ndash; 开户行地址 &ndash;&gt;-->
+<!--          <el-input v-model="formModifyProfile.bankAddress"></el-input>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="Bank account number">&lt;!&ndash; 银行帐号 &ndash;&gt;-->
+<!--          <el-input v-model="formModifyProfile.bankNo"></el-input>-->
+<!--        </el-form-item>-->
+        <el-form-item>
+          <el-button type="primary" @click="handleModifyProfileSubmit" :loading="submitProfileButtonStat">
+            Submit<!-- 提交 -->
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import network from '../../utils/network'
+import tool from '../../utils/tool'
+import {FRONTEND_SERVER} from '@/utils/config'
+import baseInfo from '@/utils/baseInfo'
+import FilterUser from '../../components/FilterUser'
+import store from '../../utils/vuexStore'
+import permission from '@/utils/permission'
+import Pagination from '@/components/Pagination'
+import filterHelper from '../../utils/filterHelper'
+
+export default {
+  name: 'ba-user-list',
+  components: {FilterUser, Pagination},
+  mounted () {
+    let _this = this
+    _this.getData()
+    store.state.socket.onMessageCallback = this.onMessageCallback
+  },
+  data () {
+    return {
+      tableHeaders: null,
+      tableData: null,
+      loading: true,
+      multipleSelection: [],
+      currentPage: 1,
+      totalPages: 1,
+      totalCount: 1,
+      pageSize: 20,
+      frontendServer: FRONTEND_SERVER,
+      tool: tool,
+      permission: permission,
+      filterTypes: null,
+      filterModel: {},
+      dialogVisible: false,
+      formCloseLogin: {
+        userName: null,
+        typeName: 'Login management', // 登录管理
+        type: null,
+        isClose: 0,
+        remark: '',
+        areaSelected: null
+      },
+      regionDataPlus: store.state.regionInfo.regionData,
+      apps: null,
+      closeSwitch: null,
+      submitButtonStat: false,
+      dialogDecVisible: false,
+      dialogModifyPasswordVisible: false,
+      dialogModifyProfileVisible: false,
+      formCloseDec: {
+        userName: null,
+        typeName: 'Manage entry', // 管理报单
+        type: null,
+        isClose: 0,
+        remark: '',
+        areaSelected: null
+      },
+      formModifyPassword: {
+        userId: '',
+        password: '',
+        typeName: 'Change Password', // 修改密码
+        passwordType: 'password'
+        // remark: '',
+      },
+      formModifyProfile: {
+        userId: '',
+        typeName: 'Modify personal data', // 修改个人资料
+        // nation: '',
+        realName: '',
+        // idCard: '',
+        mobile: '',
+        // openBank: '',
+        // bankAddress: '',
+        // bankNo: ''
+      },
+      passwordType: [
+        {
+          type: 'password',
+          label: 'login password' // 登录密码
+        },
+        {
+          type: 'payPassword',
+          label: 'Payment password' // 支付密码
+        }
+      ],
+      // allOpenBank: null,
+      // allNation: null,
+      submitDecButtonStat: false,
+      submitPasswordButtonStat: false,
+      submitProfileButtonStat: false,
+      transferPropForm: {
+        userIds: [],
+        allowTransfer: true,
+        transferProp: 100,
+        withdrawProp: 0,
+        remark: ''
+      },
+      closeUserData: null
+    }
+  },
+  methods: {
+    handleSelectionChange (val) {
+      this.multipleSelection = val
+    },
+    handleCurrentChange (page) {
+      this.getData(page, this.pageSize)
+    },
+    handleSizeChange (pageSize) {
+      this.getData(this.currentPage, pageSize)
+    },
+    handleAdd () {
+      this.$router.push('/user/ba-user-add')
+    },
+    handleFilterUser (filterData) {
+      filterHelper.handleFilterUser(this, filterData)
+    },
+    handleFilter () {
+      this.getData()
+    },
+    getData (page, pageSize, isLoading = true) {
+      network.getPageData(this, 'user/ba-user-list', page, pageSize, this.filterModel, response => {
+        this.filterTypes = response.filterTypes
+      }, isLoading)
+    },
+    handleExport () {
+      this.$confirm(`Are you sure you want to export the current data?`, 'Hint', { // (`确定要导出当前数据吗?`, '提示',
+        confirmButtonText: 'confirm', // 确定
+        cancelButtonText: 'cancel', // 取消
+        type: 'warning'
+      }).then(() => {
+        return network.getData(`user/ba-user-list-export`, this.filterModel)
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+      }).catch(response => {
+
+      })
+    },
+    onMessageCallback (data) {
+    },
+    handleModifyPassword (row) {
+      this.formModifyPassword.userId = row.USER_ID
+      this.dialogModifyPasswordVisible = true
+    },
+    handleModifyProfile (row) {
+      this.dialogModifyProfileVisible = true
+      let vueObj = this
+      network.getData('user/ba-profile-get', {id: row.USER_ID}).then(response => {
+        vueObj.formModifyProfile = response.userInfo
+        // vueObj.allOpenBank = response.allOpenBank
+        // vueObj.allNation = response.allNation
+      })
+    },
+    handleStatusActive (row) {
+      network.postData('user/ba-modify-status',{userId: row.USER_ID, status: 1}).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+      })
+    },
+    handleStatusLock (row) {
+      network.postData('user/ba-modify-status',{userId: row.USER_ID, status: 0}).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+      })
+    },
+    handleIsModifyPassword (row, status) {
+      network.postData('user/ba-is-modify-password-status',{userId: row.USER_ID, status: status}).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+      })
+    },
+    handleModifyPasswordSubmit () {
+      this.submitPasswordButtonStat = true
+      let path = 'user/ba-modify-password'
+      network.postData(path, this.formModifyPassword).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+        this.submitPasswordButtonStat = false
+        this.dialogModifyPasswordVisible = false
+      }).catch(response => {
+        this.submitPasswordButtonStat = false
+      })
+    },
+    handleModifyProfileSubmit () {
+      this.submitProfileButtonStat = true
+      let path = 'user/ba-modify-profile'
+      network.postData(path, this.formModifyProfile).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+        this.submitProfileButtonStat = false
+        this.dialogModifyProfileVisible = false
+      }).catch(response => {
+        this.submitProfileButtonStat = false
+      })
+    }
+  }
+}
+
+</script>

+ 224 - 0
common/models/forms/BaUserBasicForm.php

@@ -0,0 +1,224 @@
+<?php
+
+namespace common\models\forms;
+
+use common\components\Model;
+use common\helpers\Date;
+use common\libs\logging\operate\AdminOperate;
+use common\models\BaUser;
+use yii\base\Exception;
+
+/**
+ * Login form
+ */
+class BaUserBasicForm extends Model {
+    public $userId;
+    public $password;
+    public $passwordType;
+
+    //个人资料
+    public $nation;
+    public $realName;
+    public $idCard;
+    public $mobile;
+    public $openBank;
+    public $bankAddress;
+    public $bankNo;
+
+    public $status;
+
+    public function init() {
+        parent::init();
+        $this->adminOperateLogger = new AdminOperate([
+            'fetchClass' => BaUser::class,
+        ]);
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function rules() {
+        return [
+            [['userId', 'password', 'passwordType','realName', 'mobile',/*'openBank','bankAddress','bankNo',*/'status'], 'trim'],
+            [['userId'], 'required'],
+            [[/*'idCard', */'allData'], 'required', 'on'=>['addWithUserName']],
+            [['nation','realName', 'mobile', /*'idCard', 'openBank', 'bankAddress', 'bankNo'*/], 'required', 'on'=>'modifyProfile'],
+            [['mobile'], 'mobile'],
+        ];
+    }
+
+    /**
+     * 指定校验场景
+     * @return array
+     */
+    public function scenarios() {
+        $parentScenarios = parent::scenarios();
+        $customScenarios = [
+            'modifyPassword' => ['userId', 'password', 'passwordType'],
+            'modifyProfile' => ['userId','realName',/*'idCard',*/'mobile',/*'openBank','bankAddress','bankNo'*/],
+            'modifyStatus' => ['userId','status'],
+            'isModifyPasswordStatus' => ['userId','status'],
+        ];
+        return array_merge($parentScenarios, $customScenarios);
+    }
+
+    public function attributeLabels() {
+        return [
+            'ID' => 'ID',
+            'password' => '密码',
+            'passwordType' => '密码类型',
+//            'nation' => '民族',
+            'realName' => '真实姓名',
+//            'idCard' => '身份证号',
+            'mobile' => '手机号',
+//            'openBank' => '银行名称',
+//            'bankAddress' => '开户支行',
+//            'bankNo' => '银行账号',
+            'status' => '状态',
+        ];
+    }
+
+    public function beforeValidate() {
+        return parent::beforeValidate();
+    }
+
+    /**
+     * 编辑用户信息
+     * @return BaUser|null
+     */
+    public function edit()
+    {
+        if (!$this->validate()) {
+            return null;
+        }
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $userModel = BaUser::findOne(['ID'=>$this->userId]);
+            if( $this->passwordType === 'password' ) {
+                $userModel->PASSWORD_HASH = \Yii::$app->security->generatePasswordHash($this->password);
+            }else {
+                $userModel->PAY_PASSWORD = \Yii::$app->security->generatePasswordHash($this->password);
+            }
+
+            if( !$userModel->save(false) ) {
+                throw new Exception($userModel->getErrors());
+            }
+
+            $transaction->commit();
+        } catch (Exception $e) {
+            $transaction->rollBack();
+            return null;
+        }
+
+        return $userModel;
+
+    }
+
+    /**
+     * 修改个人资料
+     * @return BaUser|null
+     */
+    public function modifyProfile(){
+        if(!$this->validate()){
+            return null;
+        }
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $userModel = BaUser::findOne(['ID' => $this->userId]);
+            $this->adminOperateLogger->beforeUpdate($userModel);
+//            $userModel->NATION = $this->nation;
+            $userModel->REAL_NAME = $this->realName;
+            $userModel->MOBILE = $this->mobile;
+//            $userModel->ID_CARD = $this->idCard;
+//            $userModel->OPEN_BANK = $this->openBank;
+//            $userModel->BANK_NO = $this->bankNo;
+//            $userModel->BANK_ADDRESS = $this->bankAddress;
+            if( !$userModel->save(false) ) {
+                throw new Exception($userModel->getErrors());
+            }
+            $transaction->commit();
+            $this->adminOperateLogger->afterUpdate($userModel)->clean()->save([
+                'optType' => 'Modification of Member information', // 修改会员资料
+                'userId' => $this->userId,
+                'userName' => $userModel->USER_NAME,
+//                'nation' => $this->nation,
+                'realName' => $this->realName,
+                'mobile' => $this->mobile,
+//                'idCard' => $this->idCard,
+//                'openBank' => $this->openBank,
+//                'bankNo' => $this->bankNo,
+//                'bankAddress' => $this->bankAddress,
+            ]);
+        }catch (Exception $e) {
+            $transaction->rollBack();
+            return null;
+        }
+        return $userModel;
+    }
+
+
+    /**
+     * 修改会员状态
+     * @return BaUser|null
+     */
+    public function modifyStatus(){
+        if(!$this->validate()){
+            return null;
+        }
+        $this->adminOperateLogger->beforeUpdate($this->userId, 'ID',['select'=>'ID,STATUS']);
+
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $userModel = BaUser::findOne(['ID' => $this->userId]);
+            if($userModel->STATUS==$this->status){
+                $statusName = ($userModel->STATUS == 1) ? 'activation' : 'lock'; // 激活 锁定
+                throw new Exception('The current member status is【' . $statusName . '】,Do not need to set it again!'); // 当前会员状态已  无需重复设置
+            }
+            $userModel->STATUS = $this->status;
+            $userModel->STATUS_AT = Date::nowTime();
+            if( !$userModel->save(false) ) {
+                throw new Exception($userModel->getErrors());
+            }
+            $transaction->commit();
+        }catch (Exception $e) {
+            $transaction->rollBack();
+            $this->addError('modifyStatus', $e->getMessage());
+            return null;
+        }
+        $this->adminOperateLogger->afterUpdate($this->userId,'ID',['select'=>'ID,STATUS'])->clean()->save([
+            'optType' => ($this->status == 1) ? 'Member activation' : 'Member of the lock', // 会员激活 会员锁定
+        ]);
+        return $userModel;
+    }
+
+    /**
+     * @return BaUser|null
+     */
+    public function isModifyPasswordStatus()
+    {
+        if(!$this->validate()){
+            return null;
+        }
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $userModel = BaUser::findOne(['ID' => $this->userId]);
+            if($userModel->IS_MODIFY_PASSWORD==$this->status){
+                throw new Exception('The status has not changed, and do not need to set it again');// 状态没有发生改变,无需重复设置!
+            }
+            $userModel->IS_MODIFY_PASSWORD = $this->status;
+            if( !$userModel->save(false) ) {
+                throw new Exception($userModel->getErrors());
+            }
+            $transaction->commit();
+        }catch (Exception $e) {
+            $transaction->rollBack();
+            $this->addError('isModifyPasswordStatus', $e->getMessage());
+            return null;
+        }
+        return $userModel;
+    }
+}