Browse Source

新增权限

caojunjie 3 years ago
parent
commit
903e1166da
2 changed files with 15 additions and 9 deletions
  1. 14 8
      src/views/index.vue
  2. 1 1
      vue.config.js

+ 14 - 8
src/views/index.vue

@@ -99,7 +99,7 @@
             <div style="float: right;margin-right: 20px">
             <div style="float: right;margin-right: 20px">
               <el-button type="primary" :plain="choicePlain?false:true" size="mini" style="float: left;margin-left: 0;border-top-right-radius: 0;border-bottom-right-radius: 0" @click="choiceClick(0)">今日</el-button>
               <el-button type="primary" :plain="choicePlain?false:true" size="mini" style="float: left;margin-left: 0;border-top-right-radius: 0;border-bottom-right-radius: 0" @click="choiceClick(0)">今日</el-button>
               <el-button type="primary" :plain="!choicePlain?false:true" size="mini" style="float: left;margin-left: 0;border-top-left-radius: 0;border-bottom-left-radius: 0" @click="choiceClick(1)">本月</el-button>
               <el-button type="primary" :plain="!choicePlain?false:true" size="mini" style="float: left;margin-left: 0;border-top-left-radius: 0;border-bottom-left-radius: 0" @click="choiceClick(1)">本月</el-button>
-              <span style="display: block;float: left;padding-top: 0px;margin-left: 5px">
+              <span style="display: block;float: left;padding-top: 0;margin-left: 5px">
                 <el-date-picker
                 <el-date-picker
                   v-model="choiceValue"
                   v-model="choiceValue"
                   type="daterange"
                   type="daterange"
@@ -131,9 +131,9 @@
               <div style="height: 100%;color:#909399;display: table;margin-left: 10px;">
               <div style="height: 100%;color:#909399;display: table;margin-left: 10px;">
                 <div style="display: table-cell;vertical-align: middle;">
                 <div style="display: table-cell;vertical-align: middle;">
                   <div>数量</div>
                   <div>数量</div>
-                  <div><span style="letter-spacing: 13px">全</span>部:<span style="font-size: 2.4vh;font-weight: bold">{{item.allNum}}</span></div>
-                  <div><span style="letter-spacing: 13px">入</span>账:<span style="font-size: 2.4vh;font-weight: bold">{{item.entryNum}}</span></div>
-                  <div>未入账:<span style="font-size: 2.4vh;font-weight: bold">{{item.notNum}}</span></div>
+                  <div><span style="letter-spacing: 13px">全</span>部:<span style="font-size: 2vh;font-weight: bold">{{item.allNum}}</span></div>
+                  <div><span style="letter-spacing: 13px">入</span>账:<span style="font-size: 2vh;font-weight: bold">{{item.entryNum}}</span></div>
+                  <div>未入账:<span style="font-size: 2vh;font-weight: bold">{{item.notNum}}</span></div>
                 </div>
                 </div>
                 <div style="width: 2px;height: 60%;background-color: #419eff82;margin: 3.2vh 1vh"></div>
                 <div style="width: 2px;height: 60%;background-color: #419eff82;margin: 3.2vh 1vh"></div>
                 <div style="display: table-cell;vertical-align: middle;">
                 <div style="display: table-cell;vertical-align: middle;">
@@ -153,7 +153,7 @@
         <div style="width: 30%">
         <div style="width: 30%">
           <div style="width: 100%">
           <div style="width: 100%">
             <div style="display: flex">
             <div style="display: flex">
-              <div id="box" style="width: 100%; height: 450px"></div>
+              <div id="box" style="width: 100%;" :style="{height: statisList.length > 2?'450px':'300px'}"></div>
               <el-select
               <el-select
                 v-model="select"
                 v-model="select"
                 slot="prepend"
                 slot="prepend"
@@ -324,6 +324,7 @@ import {
   statistics
   statistics
 } from '../../src/api/index'
 } from '../../src/api/index'
 import Cookies from 'js-cookie'
 import Cookies from 'js-cookie'
+import { getUserProfile } from '@/api/system/user'
 
 
 export default {
 export default {
   name: 'index',
   name: 'index',
@@ -382,7 +383,8 @@ export default {
       upperLeftCntrs: {},
       upperLeftCntrs: {},
       sysType: '',
       sysType: '',
       upperRights: [],
       upperRights: [],
-      statisList:[]
+      statisList:[],
+      fMblno:''
     }
     }
   },
   },
   filters: {
   filters: {
@@ -423,7 +425,10 @@ export default {
       }
       }
       this.upperLeftCntrs = response.data.upperLeftCntrs
       this.upperLeftCntrs = response.data.upperLeftCntrs
     })
     })
-    this.choiceClick(3)
+    getUserProfile().then(res=>{
+      this.fMblno = res.roleGroup
+      this.choiceClick(3)
+    })
     this.sysType = Cookies.get('sysType')
     this.sysType = Cookies.get('sysType')
     this.getList()
     this.getList()
     this.warehouses()
     this.warehouses()
@@ -465,10 +470,11 @@ export default {
       }else if (type === 1 || type === 3) {
       }else if (type === 1 || type === 3) {
         this.choicePlain = false
         this.choicePlain = false
         data =[this.timestampToTime(timeStar).slice(0,10)+ ' 00:00:00',this.timestampToTime(timeEnd).slice(0,10)+' 23:59:59']
         data =[this.timestampToTime(timeStar).slice(0,10)+ ' 00:00:00',this.timestampToTime(timeEnd).slice(0,10)+' 23:59:59']
+        if(type === 3) this.choiceValue = [this.timestampToTime(timeStar).slice(0,10)+ ' 00:00:00',this.timestampToTime(timeEnd).slice(0,10)+' 23:59:59']
       }else if(type === 2){
       }else if(type === 2){
         data = this.choiceValue
         data = this.choiceValue
       }
       }
-      statistics({timeInterval:data}).then(res=>{
+      statistics({timeInterval:data,fMblno:this.fMblno}).then(res=>{
         this.statisList = res.data
         this.statisList = res.data
       })
       })
     },
     },

+ 1 - 1
vue.config.js

@@ -34,7 +34,7 @@ module.exports = {
     proxy: {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://192.168.1.177:9020`,
+        // target: `http://192.168.1.12:9020`,
         target: `https://ap.tubaosoft.com/prod-api/`,
         target: `https://ap.tubaosoft.com/prod-api/`,
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {