Procházet zdrojové kódy

fix: 更改查看关联上级账号的方式

Ritchie před 1 rokem
rodič
revize
43241c8dbf

+ 1 - 0
src/assets/language/en.json

@@ -1319,6 +1319,7 @@
     "mailbox": "Email",
     "mailboxPlace": "Please enter your email address",
     "associateParent": "Associate Parent",
+    "superiorAccount": "Superior Account",
     "associateParentPlace": "Please enter the related superior",
     "commonOperations": "Common Operations",
     "taskMessage": "Task Message",

+ 1 - 0
src/assets/language/zh.json

@@ -1338,6 +1338,7 @@
     "mailbox": "邮箱",
     "mailboxPlace": "请输入邮箱",
     "associateParent": "关联上级",
+    "superiorAccount": "上级账号",
     "associateParentPlace": "请输入关联上级",
     "commonOperations": "常用操作",
     "taskMessage": "任务消息",

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

@@ -31,13 +31,13 @@
                   <span> {{ adminObj.username }}</span>
                 </div>
               </div>
-              <div class="van-cell van-field">
+              <!-- <div class="van-cell van-field">
                 <div class="van-cell__title van-field__label"><span>{{ $t('merchantManage.relationAdmin') }}</span>
                 </div>
                 <div class="van-field__value o-pt-8" style="text-align: left;">
                   <span> {{ relationObj.username }}</span>
                 </div>
-              </div>
+              </div> -->
               <van-field v-model="adminObj.name" name="password" :label="$t('merchantManage.fullNameLabel')"
                 :placeholder="$t('merchantManage.fullNamePlaceholder')"
                 :rules="[{ required: true, message: $t('merchantManage.fullNamePlaceholder') }]" />
@@ -141,7 +141,7 @@
 <script>
 import { onMounted, ref } from "vue";
 import sHeader from "@/components/SimpleHeader";
-import { getAdmin, getRelation, getAdminMch, updateAdmin, getHuifuMch } from "@/service/merchantManage";
+import { getAdmin, getAdminMch, updateAdmin, getHuifuMch } from "@/service/merchantManage";
 import { showFailToast, showSuccessToast } from "vant";
 import { useRoute } from "vue-router";
 import { getLoginUser, styleUrl } from "@/common/js/utils";
@@ -158,7 +158,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 +169,7 @@ export default {
       styleUrl('merchantManage');
       merchantId.value = route.query.merchantId;
       getAdminFun();
-      getRelationFun();
+      // getRelationFun();
       getAdminMchFun();
       getHuifuMchFun();
 
@@ -191,18 +191,18 @@ 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 () => {
+    //   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 getAdminMchFun = async () => {
       const { data } = await getAdminMch({ id: merchantId.value });
       if (data.code === "00000") {
@@ -283,7 +283,7 @@ export default {
       tabType,
       adminType,
       adminObj,
-      relationObj,
+      // relationObj,
       adminMchObj,
       huifuMchObj,
       onSubmit,

+ 36 - 18
src/views/user.vue

@@ -24,6 +24,7 @@
           </div>
         </div>
         <div class="userInfoBox">
+          
           <!-- 地区 -->
           <div v-if="isInland && user.type != '0'">
             <div v-if="!areaShow" class="userInfo l-flex-between">
@@ -52,46 +53,54 @@
               <van-icon name="edit" class="editIcon" @click="editClk(4)" />
             </div>
           </div>
-          <!-- 手机号 -->
+          <!-- 邮箱 -->
           <div v-if="user.type != '0'">
-            <div v-if="!phoneNumberShow" class="userInfo l-flex-between">
-              <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
+            <div v-if="!mailboxShow" class="userInfo l-flex-between">
+              <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
               <div>
-                <van-field class="relationClass" v-model="cofficentForm.phone" :placeholder="$t('user.phoneNumberPlace')">
+                <van-field class="relationClass" v-model="cofficentForm.mailBox" :placeholder="$t('user.mailboxPlace')">
                   <template #button>
-                    <van-button type="primary" @click="mailboxChg(cofficentForm.phone, 3)">{{ $t("user.confirmLog") }}
+                    <van-button type="primary" @click="mailboxChg(cofficentForm.mailBox, 2)">{{ $t("user.confirmLog") }}
                     </van-button>
                   </template>
                 </van-field>
               </div>
-              <van-icon name="edit" class="editIcon" @click="editClk(3)" />
+              <van-icon name="edit" class="editIcon" @click="editClk(2)" />
             </div>
             <div v-else class="userInfo l-flex-between">
-              <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
-              <span>{{ accountDetail.phone }}</span>
-              <van-icon name="edit" class="editIcon" @click="editClk(3)" />
+              <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
+              <span>{{ accountDetail.email }}</span>
+              <van-icon name="edit" class="editIcon" @click="editClk(2)" />
             </div>
           </div>
-          <!-- 邮箱 -->
+          <!-- 上级账号 -->
+          <div v-if="isInland && user.type == '2'">
+            <div v-if="haveRelation" class="userInfo l-flex-between">
+              <span class="userInfoLeft">{{ $t("user.superiorAccount") }}: </span>
+              <span>{{ relationAdminName }}</span>
+            </div>
+          </div>
+          <!-- 手机号码 -->
           <div v-if="user.type != '0'">
-            <div v-if="!mailboxShow" class="userInfo l-flex-between">
-              <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
+            <div v-if="!phoneNumberShow" class="userInfo l-flex-between">
+              <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
               <div>
-                <van-field class="relationClass" v-model="cofficentForm.mailBox" :placeholder="$t('user.mailboxPlace')">
+                <van-field class="relationClass" v-model="cofficentForm.phone" :placeholder="$t('user.phoneNumberPlace')">
                   <template #button>
-                    <van-button type="primary" @click="mailboxChg(cofficentForm.mailBox, 2)">{{ $t("user.confirmLog") }}
+                    <van-button type="primary" @click="mailboxChg(cofficentForm.phone, 3)">{{ $t("user.confirmLog") }}
                     </van-button>
                   </template>
                 </van-field>
               </div>
-              <van-icon name="edit" class="editIcon" @click="editClk(2)" />
+              <van-icon name="edit" class="editIcon" @click="editClk(3)" />
             </div>
             <div v-else class="userInfo l-flex-between">
-              <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
-              <span>{{ accountDetail.email }}</span>
-              <van-icon name="edit" class="editIcon" @click="editClk(2)" />
+              <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
+              <span>{{ accountDetail.phone }}</span>
+              <van-icon name="edit" class="editIcon" @click="editClk(3)" />
             </div>
           </div>
+          
           <!-- 关联上级 -->
           <!-- <div v-if="isInland && user.type == '2'">
             <div v-if="!relationType" class="userInfo l-flex-between">
@@ -668,6 +677,13 @@ export default {
     // 是否内陆或海外
     const isInland = ref(true);
     const isAbroad = ref(false);
+    // 是否有上级账号
+    const haveRelation = ref(false);
+    const haveRelationCheck = () => {
+      if (user.relationAdminId !== null) {
+        haveRelation.value = true;
+      }
+    }
     // const checkIsAbroad = async () => {
     //   try {
     //     const { data } = await getIfForeign(user.id);
@@ -700,6 +716,7 @@ export default {
     onMounted(() => {
       checkInWechat();
       checkIsAbroad();
+      haveRelationCheck();
     })
     // 获取回显的值
     const getAreaName = (e) => {
@@ -731,6 +748,7 @@ export default {
       isInWeChat,
       getAreaName,
       isAbroad,
+      haveRelation,
       checkIsAbroad,
       isInland,
       symbolShow,