Browse Source

feat: 调整一下关联上级的入口

Ritchie 1 year ago
parent
commit
87f3e135da

BIN
src/assets/accountOperation/relationAdmin.png


+ 2 - 5
src/assets/language/en.json

@@ -812,6 +812,7 @@
     "region": "region",
     "accountNumber": "account number",
     "relationAdmin": "Associate superior",
+    "relationAdminPlaceholder": "Please enter the association superior",
     "subscriptionAdministrator": "Subscription administrator",
     "fullNameLabel": "full name",
     "fullNamePlaceholder": "Please enter your name",
@@ -1374,9 +1375,6 @@
       "machinePlace": "Please select the machine list"
     }
   },
-  "relationAdmin": {
-    "title": "关联上级"
-  },
   
   "kSelectPop": {
     "cancel": "cancel",
@@ -1446,8 +1444,7 @@
     "withdrawalAccountNo": "Standby withdrawal account No",
     "standbyWithdrawalAccountNo": "Standby withdrawal account No",
     "merchantManagement": "Merchant management",
-    "labelMan": "Label management",
-    "relationAdmin":  "Associate superior"
+    "labelMan": "Label management"
   },
   "announcement": {
     "header": "Editorial notice",

+ 2 - 5
src/assets/language/zh.json

@@ -816,6 +816,7 @@
     "region": "地区",
     "accountNumber": "账号",
     "relationAdmin": "关联上级",
+    "relationAdminPlaceholder": "请输入关联上级",
     "subscriptionAdministrator": "开通管理员",
     "fullNameLabel": "姓名",
     "fullNamePlaceholder": "请输入姓名",
@@ -1393,9 +1394,6 @@
       "machinePlace": "请选择机器列表"
     }
   },
-  "relationAdmin": {
-    "title": "关联上级"
-  },
   "kSelectPop": {
     "cancel": "取消",
     "confirm": "确定",
@@ -1464,8 +1462,7 @@
     "withdrawalAccountNo": "提现账号",
     "standbyWithdrawalAccountNo": "备用提现账号",
     "merchantManagement": "商户管理",
-    "labelMan": "标签管理",
-    "relationAdmin": "关联上级"
+    "labelMan": "标签管理"
   },
   "wechat": {
     "headerName": "绑定微信"

+ 0 - 1
src/common/js/utils.js

@@ -34,7 +34,6 @@ export const $M_Menus = {
   // "M18":t("role.labelMan"),//标签管理
   "M19": t("role.apkMan"),//apk管理
   // "M20":t("role.merchantMan"),//商户管理
-  // "M21": t("role.relationAdmin"),//关联上级
 }
 // 判断值是否是数字 true:数值型的,false:非数值型
 export const $M_IsNaN = (num) => {

+ 1 - 7
src/router/index.js

@@ -311,6 +311,7 @@ const router = createRouter({
       component: () => import("@/views/merchantManage/index"),
       meta: { index: 1 },
     },
+    // 商户信息
     {
       path: "/merchantSet",
       name: "merchantSet",
@@ -434,13 +435,6 @@ const router = createRouter({
       component: () => import("@/views/labelMan/index"),
       meta: { index: 1 },
     },
-    // 关联上级
-    {
-      path: "/relationAdmin",
-      name: "relationAdmin",
-      component: () => import("@/views/relationAdmin/index"),
-      meta: { index: 1 },
-    },
     // 标签管理-新增
     {
       path: "/labelManAdd",

+ 5 - 1
src/service/merchantManage/index.js

@@ -18,10 +18,14 @@ export function getAdminList(params) {
 export function getAdmin(params) {
   return axios.get(`/SZWL-SERVER/tAdmin/getAdmin?${stringToUrl(params)}`);
 }
-// 获取获取上级账号
+// 通过 adminId 获取上级账号信息
 export function getRelation(params) {
   return axios.get(`/SZWL-SERVER/tAdmin/getRelation?${stringToUrl(params)}`);
 }
+// 通过 username 获取账号id
+export function getRelationAdminId(params) {
+  return axios.get(`/SZWL-SERVER/tAdmin/getRelationAdminId?${stringToUrl(params)}`);
+}
 // 获取账户基本详情-提现信息
 export function getAdminMch(params) {
   return axios.get(`/SZWL-SERVER/tJoinpayMch/getMch?${stringToUrl(params)}`);

+ 0 - 10
src/service/relationAdmin/index.js

@@ -1,10 +0,0 @@
-import axios from "@/utils/axios";
-// import { stringToUrl } from '@/common/js/utils';
-
-export function setRelationAdmin(username, managerId, relationUsername) {
-  return axios.post(`/SZWL-SERVER/tAdmin/setRelationAdminId`, {
-    username,
-    managerId,
-    relationUsername,
-  });
-}

+ 3 - 3
src/service/user.js

@@ -13,9 +13,9 @@ export function tAdminGetRelation(params) {
   return axios.get(`/SZWL-SERVER/tAdmin/getRelationAdminUsername?${stringToUrl(params)}`, params);
 }
 // 添加关联上级
-export function tAdminSetRelationAdmin(params) {
-  return axios.get(`/SZWL-SERVER/tAdmin/setRelationAdmin?${stringToUrl(params)}`, params);
-}
+// export function tAdminSetRelationAdmin(params) {
+//   return axios.get(`/SZWL-SERVER/tAdmin/setRelationAdmin?${stringToUrl(params)}`, params);
+// }
 // 三级联动获取地址
 export function Api_getArea(params) {
   return axios.get(`/SZWL-SERVER/tArea/getArea`, {params});

+ 0 - 11
src/styles/accountOperation/index.less

@@ -71,17 +71,6 @@
           top: 0.4rem;
         }
 
-        &.relationAdminIcon::after {
-          content: '';
-          position: absolute;
-          background: #fff url('../../assets/accountOperation/relationAdmin.png') top center no-repeat;
-          background-size: 100%;
-          width: 0.53rem;
-          height: 0.6rem;
-          right: 0.2rem;
-          top: 0.4rem;
-        }
-
       }
 
       .taskRight {

+ 2 - 2
src/utils/config.js

@@ -2,12 +2,12 @@ let baseURL;
 // 开发环境
 if (process.env.NODE_ENV === 'development') {
     // 测试的
-    baseURL = 'http://szwltest.sunzee.com.cn:49002/'
+    // baseURL = 'http://szwltest.sunzee.com.cn:49002/'
     // baseURL = 'https://szwl.sunzee.com.cn/'
     // baseURL = 'http://120.25.151.99:49002/'
 
     // 正式的
-    // baseURL = 'https://sz.sunzee.com.cn/'
+    baseURL = 'https://sz.sunzee.com.cn/'
     
     // 编译环境
     // baseURL = 'http://127.0.0.1:8080/'

+ 0 - 3
src/views/home/index.vue

@@ -566,9 +566,6 @@ export default {
         case "M20":
           router.push({ path: "/merchantManage" });
           break;
-        // case "M21":
-        //   router.push({ path: "/relationAdmin" });
-        //   break;
       }
     };
 

+ 25 - 18
src/views/merchantManage/set.vue

@@ -38,13 +38,15 @@
                   <span> {{ relationObj.username }}</span>
                 </div>
               </div> -->
+              <van-field v-model="relationObj.relationUsername" name="password" :label="$t('merchantManage.relationAdmin')" 
+                :placeholder="$t('merchantManage.relationAdminPlaceholder')" />
               <van-field v-model="adminObj.name" name="password" :label="$t('merchantManage.fullNameLabel')"
                 :placeholder="$t('merchantManage.fullNamePlaceholder')"
                 :rules="[{ required: true, message: $t('merchantManage.fullNamePlaceholder') }]" />
-              <van-field v-model="adminObj.password" name="password" type="password"
+              <van-field v-model="adminObj.password" name="password" type="password" clearable
                 :label="$t('merchantManage.passwordLabel')" :placeholder="$t('merchantManage.passwordPlaceholder')" />
               <span class="txt3">{{ $t('merchantManage.leavBlanToIndiNoModi') }}</span>
-              <van-field v-model="adminObj.checkPassword" name="password" type="password"
+              <van-field v-model="adminObj.checkPassword" name="password" type="password" clearable
                 :label="$t('merchantManage.confirmPasswordLabel')"
                 :placeholder="$t('merchantManage.confirmPasswordPlaceholder')" />
               <van-field v-model="adminObj.email" name="password" :label="$t('merchantManage.mailbox')"
@@ -141,7 +143,7 @@
 <script>
 import { onMounted, ref } from "vue";
 import sHeader from "@/components/SimpleHeader";
-import { getAdmin, getAdminMch, updateAdmin, getHuifuMch } from "@/service/merchantManage";
+import { getAdmin, getRelation, getAdminMch, updateAdmin, getHuifuMch, getRelationAdminId } from "@/service/merchantManage";
 import { showFailToast, showSuccessToast } from "vant";
 import { useRoute } from "vue-router";
 import { getLoginUser, styleUrl } from "@/common/js/utils";
@@ -158,7 +160,7 @@ export default {
     const route = useRoute();
     const merchantId = ref('');
     const adminObj = ref({});
-    // const relationObj = ref({});
+    const relationObj = ref({});
     const adminMchObj = ref({});
     const huifuMchObj = ref({});
     const ifForeign = ref('0');
@@ -169,7 +171,7 @@ export default {
       styleUrl('merchantManage');
       merchantId.value = route.query.merchantId;
       getAdminFun();
-      // getRelationFun();
+      getRelationFun();
       getAdminMchFun();
       getHuifuMchFun();
 
@@ -191,18 +193,15 @@ export default {
       // else { showFailToast(data.message); }
       // console.log('getAdminFun', data);
     };
-    // const getRelationFun = async () => {
-    //   console.log('adminId', merchantId.value);
-    //   const { data } = await getRelation({ adminId: merchantId.value });
-    //   console.log("relationObj.value", relationObj.value);
-    //   console.log("relationObj.value.username", relationObj.value.username);
-    //   if (data.code === "00000") {
-    //     if (data.data != null) {
-    //       relationObj.value = data.data;
-    //       relationObj.value.username = data.data.username;
-    //     }
-    //   }
-    // }
+    const getRelationFun = async () => {
+      const { data } = await getRelation({ adminId: merchantId.value });
+      if (data.code === "00000") {
+        if (data.data != null) {
+          relationObj.value = data.data;
+          relationObj.value.relationUsername = data.data.username;
+        }
+      }
+    }
     const getAdminMchFun = async () => {
       const { data } = await getAdminMch({ id: merchantId.value });
       if (data.code === "00000") {
@@ -246,10 +245,18 @@ export default {
       // console.log('getHuifuMchFun', data);
     }
     const onSubmit = async () => {
+      // console.log("relationUsername:", relationObj.value.relationUsername);
+      const { result } = await getRelationAdminId({ relationUsername: relationObj.value.relationUsername });
+      if (result.code === "00000") { 
+        if (result.data != null) {
+          adminObj.value.relationAdminId = result.data;
+        }
+      }
       const params = {
         id: adminObj.value.id,
         name: adminObj.value.name,
         username: adminObj.value.username,
+        relationAdminId: adminObj.value.relationAdminId,
         ifForeign: adminObj.value.ifForeign,
         phone: adminObj.value.phone,
         email: adminObj.value.email,
@@ -283,7 +290,7 @@ export default {
       tabType,
       adminType,
       adminObj,
-      // relationObj,
+      relationObj,
       adminMchObj,
       huifuMchObj,
       onSubmit,

+ 0 - 65
src/views/relationAdmin/index.vue

@@ -1,65 +0,0 @@
-<template>
-    <div class="relationAdmin" style="background-color:#ebedf0">
-        <s-header :name="'关联上级'" :noback="false"></s-header>
-        <br>
-        <van-form @submit="onSubmit">
-            <van-cell-group inset>
-                <!-- 需要填 username 和 上级 relationUsername,如果上级 relationUsername 为空,就是无上级 -->
-                <van-field v-model="username" name="账号名称" label="账号名称" placeholder="账号名称" required clearable
-                    :rules="[{ required: true, message: '请填写账号名' }]" />
-                <van-field v-model="managerId" name="系统id" label="系统id" placeholder="系统id" required clearable
-                    :rules="[{ required: true, message: '请填写系统id' }]" />
-                <van-field v-model="relationUsername" name="关联账号" label="关联账号" placeholder="关联上级账号名称(选填)" clearable/>
-            </van-cell-group>
-            <br>
-            <div style="margin: 16px; display: flex; justify-content: center; align-items: center;">
-                <van-button round class="custom-button" type="primary" size="small" native-type="submit" block>
-                    提交
-                </van-button>
-            </div>
-        </van-form>
-    </div>
-</template>
-<script>
-import sHeader from "../../components/SimpleHeader";
-import { showFailToast, showToast } from "vant";
-import { setRelationAdmin } from "../../service/relationAdmin/index";
-import { ref } from "vue";
-
-
-export default {
-    components: { sHeader },
-    setup: function () {
-        const usernameCheck = ref({});
-        const username = ref('');
-        const managerId = ref('');
-        const relationUsername = ref('');
-        const onSubmit = async () => {
-            if (!relationUsername.value) {
-                relationUsername.value = '';
-            }
-            // 提交表单
-            const { data } = await setRelationAdmin(username.value, managerId.value, relationUsername.value);
-            
-            if (data.code === "00000") {
-                showToast(data.data);
-            } else {
-                showFailToast(data.message);
-            }
-        }
-
-        return {
-            onSubmit,
-            username,
-            managerId,
-            relationUsername,
-            usernameCheck
-        }
-    }
-}
-</script>
-<style>
-.custom-button {
-    width: 120px;
-}
-</style>

+ 0 - 1
src/views/role/index.vue

@@ -111,7 +111,6 @@ export default {
       { label: t('role.labelMan'), value: 'M18' }, //标签管理
       { label: t('role.apkMan'), value: 'M19' } //apk管理
       // { label: t('role.merchantMan'), value: 'M20' } //商户管理
-      // { label: t('role.relationAdmin'), value: 'M21' } //关联上级
     ];
     let searchParams = reactive({ adminId: user.id });
     // 初始化页面获取列表

+ 19 - 18
src/views/user.vue

@@ -310,7 +310,8 @@ import {
   $M_PhoneTest,
 } from "@/common/js/utils";
 import { useRouter } from "vue-router";
-import { tAdminGetRelation, tAdminSetRelationAdmin, updatePayPlatform } from "@/service/user";
+import { tAdminGetRelation, updatePayPlatform } from "@/service/user";
+// import { tAdminGetRelation, tAdminSetRelationAdmin, updatePayPlatform } from "@/service/user";
 import { showFailToast, showToast, showSuccessToast, showConfirmDialog } from 'vant';
 import { useI18n } from "vue-i18n";
 import { styleUrl } from "../common/js/utils";
@@ -405,23 +406,23 @@ export default {
     // 点击邮箱的确定按钮
     const mailboxChg = async (e, idx) => {
       switch (idx) {
-        case 1:
-          if (!e) {
-            showToast(t("user.associateParentPlace"));
-          } else {
-            const { data } = await tAdminSetRelationAdmin({
-              adminId: user.id,
-              username: e,
-            });
-            relationType.value = true;
-            if (data.code === "00000") {
-              showToast(data.message);
-              setTimeout(() => {
-                gettAdminGetRelation();
-              }, 500);
-            }
-          }
-          break;
+        // case 1:
+        //   if (!e) {
+        //     showToast(t("user.associateParentPlace"));
+        //   } else {
+        //     const { data } = await tAdminSetRelationAdmin({
+        //       adminId: user.id,
+        //       username: e,
+        //     });
+        //     relationType.value = true;
+        //     if (data.code === "00000") {
+        //       showToast(data.message);
+        //       setTimeout(() => {
+        //         gettAdminGetRelation();
+        //       }, 500);
+        //     }
+        //   }
+        //   break;
         case 2:
           if (!e) {
             showToast(t("user.mailboxPlace"));