lilei 1 개월 전
부모
커밋
e14af63514

+ 2 - 2
src/config/report/salesReport.js

@@ -99,7 +99,7 @@ export default {
       meta: {
         title: '每日报表',
         icon: 'profile',
-        permission: 'M_dailyReportList'
+        permission: 'M_dailyReport'
       },
       hideChildrenInMenu: true,
       children: [
@@ -111,7 +111,7 @@ export default {
             title: '每日报表',
             icon: 'profile',
             hidden: true,
-            permission: 'M_dailyReportList'
+            permission: 'M_dailyReport'
           }
         }
       ]

+ 14 - 1
src/views/reportData/dailyReport/index.vue

@@ -20,7 +20,7 @@ export default {
     return {
       spinning: false,
       activeKey: 0, // 切换显示页面值 0 各分区品类实售明细 1各区域品类实售明细
-      tabsList: [{ id: 0, name: '全国销售日报' }, { id: 1, name: '项目销售日报1' }, { id: 2, name: '项目销售日报2' }, { id: 3, name: '分区销售日报' }] // tab切换data
+      tabsList: [] // tab切换data
     }
   },
   methods: {
@@ -31,6 +31,19 @@ export default {
     },
     // 初始化
     pageInit () {
+      this.tabsList = []
+      if (this.$hasPermissions('M_National_Sales_Daily_Report')) {
+        this.tabsList.push({ id: 0, name: '全国销售日报' })
+      }
+      if (this.$hasPermissions('M_Project_Sales_Daily_Report')) {
+        this.tabsList.push({ id: 1, name: '项目销售日报1' })
+      }
+      if (this.$hasPermissions('M_Project_Sales_Daily_Report_2')) {
+        this.tabsList.push({ id: 2, name: '项目销售日报2' })
+      }
+      if (this.$hasPermissions('M_Regional_Sales_Daily_Report')) {
+        this.tabsList.push({ id: 3, name: '分区销售日报' })
+      }
       this.activeKey = 0
       this.$refs['table' + this.activeKey][0].pageInit(this.activeKey)
     }

+ 2 - 1
src/views/reportData/dailyReport/table.vue

@@ -20,6 +20,7 @@
                     locale="zh-cn"
                     id="dayReportList-month"
                     v-model="queryParam.month"
+                    :allowClear="false"
                     @change="onChange"
                     :disabled-date="disabledDate"
                     style="width: 100%;"/>
@@ -34,7 +35,7 @@
                   class="button-warning"
                   @click="handleExport"
                   :disabled="tableData.length==0"
-                  v-if="$hasPermissions('B_dailyReportExport')"
+                  v-if="$hasPermissions('B_National_Sales_Daily_Export')||$hasPermissions('B_Project_Sales_Daily_Export')||$hasPermissions('B_Project_Sales_Daily_Export_2')||$hasPermissions('M_Regional_Sales_Daily_Export')"
                   :loading="exportLoading"
                   id="dayReportList-export">导出</a-button>
               </a-col>

+ 23 - 10
src/views/reportData/dailyReport/table0.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 全国销售日报 -->
-    <h2 class="table-title" v-if="tableData.length">{{ month.replace('-','年')+'月' }} 全国销售日报(截止{{ nowDate }})</h2>
+    <h2 class="table-title" v-if="tableData.length">{{ month.replace('-','年')+'月' }} 全国销售日报 <span v-if="showDz">(截止{{ nowDate }})</span></h2>
     <table class="table-box" id="day-table-0" v-if="tableData.length">
       <thead class="ant-table-thead">
         <tr>
@@ -51,11 +51,22 @@ export default {
       default: () => ''
     }
   },
-  computed: {
-    months () {
-      return this.month.split('-')[1]
+  data () {
+    return {
+      months: '',
+      list: [],
+      showDz: false
+    }
+  },
+  methods: {
+    getmonths () {
+      this.months = this.month.split('-')[1]
     },
-    list () {
+    getshowDz () {
+      const nowMonths = new Date().getMonth() + 1
+      this.showDz = this.months == nowMonths
+    },
+    getlist () {
       const rets = []
       const row1 = [
         '年度目标|yearTarget',
@@ -115,12 +126,9 @@ export default {
           }
         })
       })
-      return rets
-    }
-  },
-  methods: {
+      this.list = rets
+    },
     hasRowspan (row) {
-      console.log(row && row.toString().split('rowspan')[1])
       return row && row.toString().split('rowspan')
     },
     hasRate (row) {
@@ -128,6 +136,11 @@ export default {
     },
     getTable () {
       return document.getElementById('day-table-0')
+    },
+    pageInit () {
+      this.getmonths()
+      this.getshowDz()
+      this.getlist()
     }
   }
 }