lilei 1 месяц назад
Родитель
Сommit
d11bb3d72b

+ 9 - 8
src/views/reportData/dailyReport/index.vue

@@ -89,7 +89,6 @@
 import { commonMixin } from '@/utils/mixin'
 import XLSX from 'xlsx-js-style'
 // 组件
-import rangeDate from '@/views/common/rangeDate.vue'
 import moment from 'moment'
 import table0 from './table0'
 import table1 from './table1'
@@ -100,7 +99,7 @@ import { salesReportDailyList } from '@/api/reportData.js'
 export default {
   name: 'RegionTypeSalesReportList',
   mixins: [commonMixin],
-  components: { rangeDate, table0, table1, table2, table3 },
+  components: { table0, table1, table2, table3 },
   data () {
     return {
       spinning: false,
@@ -155,8 +154,6 @@ export default {
     //  重置
     resetSearchForm () {
       this.$refs.ruleForm.resetFields()
-      this.queryParam.time = []
-      this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.tableData = []
     },
     exportTable (dom, title) {
@@ -176,11 +173,10 @@ export default {
         }
       })
       // 表格1
-      if (this.activeKey == 1) {
+      if (this.activeKey == 1 || this.activeKey == 2) {
         const cols = zim[this.columns.length - 1]
         Array(this.totalNums).fill().forEach((item, i) => {
           const a = ws[cols + (i + 2)]
-          console.log(cols + (i + 2))
           if (a) {
             a.z = (a.v * 100) + '%' // 设置单元格格式为百分比
           }
@@ -209,14 +205,19 @@ export default {
     // 获取表格数据
     async getTableData () {
       const url = [salesReportDailyList, salesReportDailyList, salesReportDailyList, salesReportDailyList]
-      const reportType = ['DailyPL', 'DailyPL', 'DailyPL', 'DailyPL'][this.activeKey]
+      const reportType = ['DailyPL', 'DailyPL', 'DailyPLJL', 'DailyPL'][this.activeKey]
       const reportDate = this.queryParam.month + '-01 00:00:00'
       this.nowDate = moment().format('DD日HH点mm分')
       this.spinning = true
       const data = await url[this.activeKey]({ reportType, reportDate }).then(res => res.data)
       if (data) {
         this.tableData = data
-        this.columns = this.getColumns()
+        if (this.activeKey == 1) {
+          this.columns = this.getColumns()
+        }
+        if (this.activeKey == 2) {
+          this.columns = [1, 2, 3, 4, 5]
+        }
         this.spinning = false
       }
     },

+ 54 - 43
src/views/reportData/dailyReport/table2.vue

@@ -1,48 +1,28 @@
 <template>
   <div>
-    <!-- 全国销售日报 -->
-    <h2 class="table-title">2025年3月 全国销售日报2(截止22日17点30分)</h2>
-    <table class="table-box">
-      <thead>
-        <tr>
-          <th>项目</th>
-          <th>品类经理</th>
-          <th>2月业绩目标</th>
-          <th>2月销售额截止达成</th>
-          <th>达成率</th>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td width="150">箭牌滤清器</td>
-          <td align="center">141,150,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-        </tr>
-        <tr>
-          <td width="150">箭牌滤清器</td>
-          <td align="center">141,150,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-        </tr>
-        <tr>
-          <td width="150">箭牌滤清器</td>
-          <td align="center">141,150,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-        </tr>
-        <tr>
-          <td width="150">箭牌滤清器</td>
-          <td align="center">141,150,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-          <td align="center">10,850,000.00</td>
-        </tr>
-      </tbody>
-    </table>
+    <div v-if="tableData.length">
+      <!-- 全国销售日报 -->
+      <h2 class="table-title">{{ month.replace('-','年')+'月' }}全国销售日报2(截止{{ nowDate }})</h2>
+      <table class="table-box" id="day-table-2" >
+        <thead>
+          <tr>
+            <th v-for="item in cloumns" :key="item">{{ item }}</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(item,index) in list" :key="index">
+            <td width="150" align="center">{{ item.proName }}</td>
+            <td align="center">{{ item.userName }}</td>
+            <td align="center">{{ item.bymb }}</td>
+            <td align="center">{{ item.amount }}</td>
+            <td align="center" class="red">{{ item.wcl }}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div v-else class="noData">
+      暂无数据,请点击查询
+    </div>
   </div>
 </template>
 
@@ -53,9 +33,29 @@ export default {
     tableData: {
       type: Array,
       default: () => []
+    },
+    month: {
+      type: String,
+      default: () => ''
+    },
+    nowDate: {
+      type: String,
+      default: () => ''
+    }
+  },
+  computed: {
+    list () {
+      return this.tableData
+    },
+    cloumns () {
+      const m = this.month.split('-')
+      return ['项目', '品类经理', m[1] + '月业绩目标', m[1] + '月销售额截止达成', '达成率']
     }
   },
   methods: {
+    getTable () {
+      return document.getElementById('day-table-2')
+    }
   }
 }
 </script>
@@ -69,10 +69,21 @@ export default {
     max-width: 1024px;
     text-align: center;
   }
+  .noData{
+    width: 100%;
+    text-align: center;
+    font-size: 16px;
+    color: #999;
+    min-height: 100px;
+    line-height: 100px;
+  }
   .table-box{
     width: 100%;
     max-width: 1024px;
     font-size: 14px;
+    .red{
+      color: red;
+    }
     tr > th{
       padding: 6px 8px;
       border: 1px solid #eee;

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.103/ocs-admin',
+        target: 'http://192.168.2.132/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {