yumeng 2 дней назад
Родитель
Сommit
480fe340e4

+ 53 - 65
src/utils/request.js

@@ -14,10 +14,10 @@ export let isRelogin = {show: false};
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 const service = axios.create({
-    baseURL: 'http://ruixuan.api.tjyourong.com.cn',
-   // baseURL: 'http://rocket.api.tjyourong.com.cn',
-  //    baseURL: 'http://mgs.api.tjyourong.com.cn',
-   //  baseURL: 'http://127.0.0.1:9003',
+    baseURL: 'http://api.ruixuan.bjhcstszkj.cn',
+
+
+  //  baseURL: 'http://127.0.0.1:9003',
   // 超时
   timeout: 300000
 })
@@ -69,79 +69,67 @@ service.interceptors.request.use(config => {
 
 // 响应拦截器
 service.interceptors.response.use(res => {
-    // 未设置状态码则默认成功状态
-    const code = res.data.code || 200;
-    // 获取错误信息
-    const msg = errorCode[code] || res.data.msg || errorCode['default']
-    // 二进制数据则直接返回
-    if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
-      return res.data
-    }
-    if (code === 401) {
-      if (!isRelogin.show) {
-        isRelogin.show = true;
-        MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
-            confirmButtonText: '重新登录',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(() => {
-          isRelogin.show = false;
-          store.dispatch('LogOut').then(() => {
-            location.href = '/index';
-          })
-        }).catch(() => {
-          isRelogin.show = false;
-        });
-      }
-      return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
-    } else if (code === 500 || code === -1) {
-      Message({
-        message: res.data.message || res.data.msg,
-        type: 'error'
-      })
-      return Promise.reject(new Error(res.data.message || res.data.msg))
-    } else if (code !== 200) {
-      Notification.error({
-        title: res.message
-      })
-      return Promise.reject('error')
-    } else {
-      return res.data
-    }
-  },
-  error => {
-    console.log('err' + error)
-    let {message} = error;
-    if (message == "Network Error") {
-      message = "后端接口连接异常";
-    } else if (message.includes("timeout")) {
-      message = "系统接口请求超时";
-    } else if (message.includes("Request failed with status code")) {
-      message = "系统接口" + message.substr(message.length - 3) + "异常";
+  // 未设置状态码则默认成功状态
+  const code = res.data.code || 200;
+  // 获取错误信息
+  const msg = errorCode[code] || res.data.msg || errorCode['default']
+  // 二进制数据则直接返回
+  if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
+    return res.data
+  }
+  if (code === 401) {
+    if (!isRelogin.show) {
+      isRelogin.show = true;
+      MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
+        confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        isRelogin.show = false;
+        store.dispatch('LogOut').then(() => {
+          location.href = '/index';
+        })
+      }).catch(() => {
+        isRelogin.show = false;
+      });
     }
+    return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
+  } else if (code === 500 || code === -1) {
     Message({
-      message: message,
-      type: 'error',
-      duration: 5 * 1000
+      message: res.data.message || res.data.msg, type: 'error'
+    })
+    return Promise.reject(new Error(res.data.message || res.data.msg))
+  } else if (code !== 200) {
+    Notification.error({
+      title: res.message
     })
-    return Promise.reject(error)
+    return Promise.reject('error')
+  } else {
+    return res.data
+  }
+}, error => {
+  console.log('err' + error)
+  let {message} = error;
+  if (message == "Network Error") {
+    message = "后端接口连接异常";
+  } else if (message.includes("timeout")) {
+    message = "系统接口请求超时";
+  } else if (message.includes("Request failed with status code")) {
+    message = "系统接口" + message.substr(message.length - 3) + "异常";
   }
-)
+  Message({
+    message: message, type: 'error', duration: 5 * 1000
+  })
+  return Promise.reject(error)
+})
 
 // 通用下载方法
 export function download(url, params, filename) {
   downloadLoadingInstance = Loading.service({
-    text: "正在下载数据,请稍候",
-    spinner: "el-icon-loading",
-    background: "rgba(0, 0, 0, 0.7)",
+    text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)",
   })
   return service.post(url, params, {
     transformRequest: [(params) => {
       return tansParams(params)
-    }],
-    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
-    responseType: 'blob'
+    }], headers: {'Content-Type': 'application/x-www-form-urlencoded'}, responseType: 'blob'
   }).then(async (data) => {
     const isLogin = await blobValidate(data);
     if (isLogin) {

+ 8 - 0
src/views/industry/industryItemReport.vue

@@ -197,6 +197,14 @@
         </el-table-column>
 
         <el-table-column
+          label="店铺"
+          align="center"
+          prop="shopName"
+          width="120px"
+        >
+        </el-table-column>
+
+        <el-table-column
           label="单数"
           align="center"
           prop="orderNum"

+ 20 - 12
src/views/jiaoyang/jyItemReport.vue

@@ -111,6 +111,7 @@
               </div>
               <div style="width: 60%" class="item-name-calss">
                 <a
+
                   @click="toIndexDetail(scope.row)"
                   style="
                     text-overflow: ellipsis;
@@ -124,7 +125,8 @@
                 </a>
                 <p>商品Id: {{ scope.row.itemId }}</p>
                 <p>商品单价: {{ scope.row.reservePrice / 100 }}元</p>
-                <p>
+                <p
+                  v-if="roleId != 'jy_out_operation' && roleId != 'jy_out_operation_manager'">
                   佣金率:
                   {{
                     scope.row.itemCommissionRate
@@ -219,6 +221,7 @@ import {
   getItemList,
 } from "@/api/jiaoyang/report";
 import {downFile} from "@/api/bytedance/bytedance";
+
 export default {
   name: "JyItemReport",
   dicts: ["sys_normal_disable"],
@@ -257,6 +260,7 @@ export default {
       saleId: undefined,
       // 获取用户id
       userId: undefined,
+      roleId: undefined,
       // 销售列表
       saleList: [],
       // 分配销售确定loading
@@ -286,6 +290,7 @@ export default {
   },
   created() {
     this.userId = this.$store.getters.userId;
+    this.roleId = this.$store.getters.roles[0];
     let date = new Date();
     let y = date.getFullYear();
     let MM = date.getMonth() + 1;
@@ -313,8 +318,8 @@ export default {
               : this.$store.getters.remark == "管理员"
                 ? null
                 : this.$store.getters.userId,
-            fieId:this.prop,
-            sort:this.sort
+            fieId: this.prop,
+            sort: this.sort
           },
           this.uploadDate,
           "orderStartDate",
@@ -356,15 +361,18 @@ export default {
     },
 
     toIndexDetail(item) {
-      this.$router.replace({
-        path: "/jiaoyang/jyItemDetailsReport",
-        query: {
-          id: item.itemId,
-          name: item.itemTitle,
-          orderStartDate: this.uploadDate[0],
-          orderEndDate: this.uploadDate[1],
-        },
-      });
+      if (this.$store.getters.roles[0] != 'jy_out_operation' && this.$store.getters.roles[0] != 'jy_out_operation_manager') {
+        this.$router.replace({
+          path: "/jiaoyang/jyItemDetailsReport",
+          query: {
+            id: item.itemId,
+            name: item.itemTitle,
+            orderStartDate: this.uploadDate[0],
+            orderEndDate: this.uploadDate[1],
+          },
+        });
+      }
+
     },
     sortChange(col, prop, order) {
       this.prop = col.prop;

+ 1 - 1
src/views/jiaoyang/jyPromoterList.vue

@@ -829,7 +829,7 @@ export default {
   methods: {
 
     toAuth(item) {
-      var url = "https://open.kwaixiaodian.com/oauth/authorize?app_id=ks690458118961229051&redirect_uri=http%3A%2F%2Fruixuan.api.tjyourong.com.cn%2Fjy%2Fcallback%2Foauth&scope=merchant_shop,merchant_funds,merchant_item,merchant_order,merchant_promotion,merchant_user,merchant_refund,user_info,merchant_video,merchant_material,merchant_comment,merchant_logistics&response_type=code&state=" + item;
+      var url = "https://open.kwaixiaodian.com/oauth/authorize?app_id=ks690458118961229051&redirect_uri=http%3A%2F%2Fapi.ruixuan.bjhcstszkj.cn%2Fjy%2Fcallback%2Foauth&scope=merchant_shop,merchant_funds,merchant_item,merchant_order,merchant_promotion,merchant_user,merchant_refund,user_info,merchant_video,merchant_material,merchant_comment,merchant_logistics&response_type=code&state=" + item;
       window.open(url)
     },
 

+ 1 - 1
src/views/staging.vue

@@ -749,7 +749,7 @@ export default {
       a.style.display = "none";
       //   a.href = "http://192.168.1.169:80/dataBigScreen";
       // a.href = " http://192.168.1.82:1024/dataBigScreen";
-      a.href = "http://567.ruixuan.tjyourong.com.cn/dataBigScreen";
+      a.href = "http://567.ruixuan.bjhcstszkj.cn/dataBigScreen";
 
       a.target = "_blank";
       a.click();