Browse Source

Merge branch 'cpq-dev' of wangfan/adweb3-web into master

chenpeiqing 3 months ago
parent
commit
31c237270b
2 changed files with 24 additions and 13 deletions
  1. 11 1
      src/views/adweb/site/components/Sohoeb2bOrder.vue
  2. 13 12
      src/views/adweb/sohoeb2b/Order.vue

+ 11 - 1
src/views/adweb/site/components/Sohoeb2bOrder.vue

@@ -44,7 +44,7 @@
 
 <script setup lang="ts">
   import { reactive, ref } from 'vue';
-  import { postAction } from '@/api/manage/manage';
+  import { getAction, postAction } from '@/api/manage/manage';
   import { useMessage } from '@/hooks/web/useMessage';
   import pick from 'lodash.pick';
 
@@ -65,6 +65,16 @@
 
   function init(record) {
     Object.assign(formState, pick(record, 'code', 'orderUrl', 'domain', 'orderUrlID'));
+    spinning.value = true;
+    getAction('/adweb/adwebSiteManage/getSiteOrderInfo?siteCode=' + record.code, {}).then(function (res) {
+      if (res.code == 200) {
+        formState.orderUrl = res.result.orderInitUrl;
+        formState.orderUrlID = res.result.orderID;
+      }
+
+      spinning.value = false;
+    });
+
     modalVisible.value = true;
   }
 

+ 13 - 12
src/views/adweb/sohoeb2b/Order.vue

@@ -47,9 +47,16 @@
   const userStore = useUserStore();
   const iframeRef = ref();
 
-  // 租户管理员角色
-  const isTenantAdmin = computed(() => {
-    return userStore.getRoleList.includes(RoleEnum.ADWEB_CHANNEL_ADMIN);
+  // 管理员角色
+  const isAdmin = computed(() => {
+    return (
+      userStore.getRoleList.includes(RoleEnum.ADWEB_CHANNEL_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.SEO_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SITE_MANAGER) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SEO_MANAGER)
+    );
   });
 
   // 是否是苏豪纺织的租户
@@ -74,7 +81,7 @@
       isSohoeb2b.value = res.name.includes('苏豪纺织集团');
 
       // 针对租户管理员,并且是苏豪纺织的租户
-      if (isTenantAdmin.value && isSohoeb2b.value) {
+      if (isAdmin.value && isSohoeb2b.value) {
         isShowSelect.value = true;
       }
     });
@@ -92,15 +99,9 @@
     });
   }
 
-  function setSiteInfo() {
+  function setSiteInfo(selectSiteInfo) {
     confirmLoading.value = true;
-    let url = location.href;
-    let i = url.lastIndexOf('/');
-    let siteId = url.substring(i + 1, url.length);
-    let siteCode = '';
-    if (localStorage.getItem('siteCode') !== null) {
-      siteCode = localStorage.getItem('siteCode');
-    }
+    let siteCode = selectSiteInfo.code;
     getAction('/adweb/adwebSiteManage/getSiteOrderInfo?siteCode=' + siteCode, {}).then(function (res) {
       if (res.code == 200) {
         showiIrame.value = true;