snow 4 months ago
parent
commit
6308d169f2

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


BIN
dist/static/css/app.0d08b088.css.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.cf4cda00.css


BIN
dist/static/css/app.cf4cda00.css.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.23f86050.js


BIN
dist/static/js/app.23f86050.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.b2800320.js


BIN
dist/static/js/app.b2800320.js.gz


+ 17 - 2
src/components/newReporting/columns.js

@@ -30,8 +30,23 @@ export const expressColumns = [
         exportUrl: 'http://rep.report.caixiao365.com//purchease/sale/OutChildListExport',
         baseParameter: { status: '2' } 
       },
-      { label: '无物流信息', prop: 'noSignOrderNoExpressNum', minWidth: '100px'},
-      { label: '物流信息异常', prop: 'noSignOrderFailNum', minWidth: '100px' },
+      { 
+        label: '无物流信息', 
+        prop: 'noSignOrderNoExpressNum', 
+        minWidth: '100px',
+        suffix: '',
+        exportUrl: 'http://rep.report.caixiao365.com//purchease/sale/OutChildErrorExport',
+        baseParameter: { status: '0' }
+      },
+      
+      { 
+        label: '物流信息异常',
+        prop: 'noSignOrderFailNum', 
+        minWidth: '100px',
+        suffix: '',
+        exportUrl: 'http://rep.report.caixiao365.com//purchease/sale/OutChildErrorExport',
+        baseParameter: { status: '7' }
+      },
     ] 
   }
 ]

+ 94 - 13
src/pages/index.vue

@@ -2,39 +2,120 @@
   <div class="container">
     <h3 style="text-align: center;color:#ffffff;margin-bottom: 5px;margin-top:35px">数据导航</h3>
 
-    <div class="wrapper" v-for="route in routes" :key="route.label">
+    <div class="wrapper" v-for="route in permissionRoutes" :key="route.label">
       <el-button type="info" plain @click="goRouter($event,route.link)">{{route.label}}
         <i class="el-icon-right"></i>
       </el-button>
     </div>
   </div>
 </template>
+
 <script>
+import { getOpenid, getParameterByName, removeOpenid, setOpenid } from "../utils/auth";
+import userRequest from "@/api/index";
+
 export default {
   data(){
     return {
+      isShow: [],
+      state: { message: '', error: false, loading: false },
       routes:[
-        { label:'6.业务公司业绩报表', link: '/?path=newResults'},
-        { label:'8.结算订单业绩报表', link: '/?path=newEarningReport'},
-        { label:'2.利润看板', link: '/?path=report'},
-        { label:'3.应收账款', link: '/?path=accountsReceivable'},
-        { label:'4.订单情况', link: '/?path=newReport'},
-        { label:'5.发货情况', link: '/?path=stock'},
-        { label:'7.库存情况', link:'?path=newStock'},
-        { label:'1.业绩报表(2023版)', link: '/?path=results'},
-        // { label: '测试', link: '/?path=newResultInfo'},
-        { label: '业务公司订单统计', link: '/?path=newReporting' }
+        { label:'6.业务公司业绩报表', link: '/?path=newResults', permission: '6'},
+        { label:'8.结算订单业绩报表', link: '/?path=newEarningReport', permission: '8'},
+        { label:'2.利润看板', link: '/?path=report', permission: '2' },
+        { label:'3.应收账款', link: '/?path=accountsReceivable', permission: '3'},
+        { label:'4.订单情况', link: '/?path=newReport', permission: '4'},
+        { label:'5.发货情况', link: '/?path=stock', permission: '5'},
+        { label:'7.库存情况', link:'?path=newStock', permission: '7'},
+        { label:'1.业绩报表(2023版)', link: '/?path=results', permission: '1'},
+        { label: '业务公司订单统计', link: '/?path=newReporting', permission: '9' }
       ]
     }
   },
-  mounted(){
+  computed: {
+    permissionRoutes(){
+      return this.routes.filter(route => this.isShow.includes(route.permission) || this.isShow.includes(Number(route.permission)))
+    }
+  },
+  mounted() {
     document.title = "数据导航"
+
+    if (!getParameterByName('code')) {
+      this.login()
+    } else {
+      this.requestUserinfo()
+    }
   },
   methods:{
     goRouter(e,link){
       e.stopPropagation()
       window.open(link)
-    }
+    },
+    async requestUserinfo() {
+      this.state.loading = true;
+      const openid = getOpenid()
+      const code = getParameterByName('code')
+      const result = await userRequest.userinfo({   ...( openid ? { openid } :  { code })  })
+      //  const result = {
+      //    "code": 0,
+      //    "message": "获取成功",
+      //    "data": {
+      //      "id": "1",
+      //      "openid": "oOpc26KiZFBKIm7SB8knFGvov1qg",
+      //      "mobile": "",
+      //      "gender": "0",
+      //      "nickname": "雪寒",
+      //      "avatar": "",
+      //      "subscribe_time": "2022-12-21 15:52:14",
+      //      "addr": "\/\/",
+      //      "status": "1",
+      //      "is_show": ["1", "2", "7"],
+      //      "companyArr": [{
+      //        "companyNo": "GS2302231125079621",
+      //        "companyName": "北京百辰荣达国际科贸有限公司",
+      //        "info": [1, 2]
+      //      }, {
+      //        "companyNo": "GS2302231323386950",
+      //        "companyName": "北京泓源广诚国际商贸有限公司",
+      //        "info": [1, 2]
+      //      }, {
+      //        "companyNo": "GS2304031312553746",
+      //        "companyName": "北京锦兴弘昌科技有限公司",
+      //        "info": [1, 2]
+      //      }, {
+      //        "companyNo": "GS2302231124114965",
+      //        "companyName": "北京普润心堂商贸有限公司",
+      //        "info": [1, 2]
+      //      }, {
+      //        "companyNo": "GS2203161855277894",
+      //        "companyName": "北京万宇恒通国际科贸有限公司",
+      //        "info": [1, 2]
+      //      }],
+      //      "addtime": "2023-04-10 18:11:07",
+      //      "updatetime": "2023-05-09 16:22:33"
+      //    }
+      //  }
+
+      this.state.loading = false
+      switch (Number(result.code)) {
+        case 0:
+          this.isShow = result.data.is_show
+          setOpenid(result.data.openid)
+          break
+        default:
+          this.state.error = true
+          this.state.message = result.message
+          openid && removeOpenid()
+          break
+      }
+    },    
+    login() {
+      const redirect_url = encodeURIComponent('http://stat.caixiao365.com/accountsReceivable')
+      var state = 'wx_' + Math.random().toString(36).substr(2, 15)
+      const scope = 'snsapi_userinfo'
+      const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.appId}&redirect_uri=${redirect_url}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
+      window.location.href = url
+    },
   }
 }
 </script>

+ 3 - 1
src/pages/newStock.vue

@@ -97,7 +97,7 @@ export default {
   async mounted() {
     document.title = "6.库存情况"
 
-    if (!getParameterByName('coed')) {
+    if (!getParameterByName('code')) {
       this.login()
     } else {
       await this.requestUserinfo()
@@ -226,6 +226,8 @@ export default {
       switch (Number(result.code)) {
         case 0:
           this.isShow = (result.data.is_show || []).includes(7) || (result.data.is_show || []).includes('7')
+          console.log(this.isShow)
+
           setOpenid(result.data.openid)
           break
         default:

+ 1 - 0
src/router/index.js

@@ -28,6 +28,7 @@ const routes = [
   { path:'/newResultInfo', component: NewResultInfo },
   { path:'/newEarningReport', component: NewEarningReport },
   { path:'/newReporting', component: NewReporting },
+  { path:'/newStock', component: NewStock },
 ]
 
 const router = new VueRouter({routes, mode:'hash'})

Some files were not shown because too many files changed in this diff