From a169bda5b19db4714d2aa476504e58105228cc40 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 30 五月 2023 18:01:55 +0800
Subject: [PATCH] 1.对接移动端

---
 src/views/kb/cgdd.vue |   71 ++++++++++++++++++++++++++++-------
 1 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/src/views/kb/cgdd.vue b/src/views/kb/cgdd.vue
index d27cf49..7982686 100644
--- a/src/views/kb/cgdd.vue
+++ b/src/views/kb/cgdd.vue
@@ -3,9 +3,9 @@
     <div class="kb_dashboard">
 
       <!--    鏄熺┖鑳屾櫙-->
-      <div ref="starsRef" class="stars">
-        <div v-for="(item, index) in starsCount" :key="index" class="star" />
-      </div>
+      <!--      <div ref="starsRef" class="stars">-->
+      <!--        <div v-for="(item, index) in starsCount" :key="index" class="star" />-->
+      <!--      </div>-->
 
       <div class="kb_header">
         <div class="flex_c_c kb_header_text">
@@ -137,8 +137,24 @@
                     width="114"
                   >
                     <template slot-scope="{row}">
-                      <div v-if="row.quantity1">{{ parseFloat(row.quantity1) }}</div>
-                      <div v-else>0</div>
+                      <!--                      <div v-if="row.quantity1">{{ row.quantity1 }}</div>-->
+                      <!--                      &lt;!&ndash;                      <div v-if="row.quantity">{{ Math.floor(row.quantity*0.67) }}</div>&ndash;&gt;-->
+                      <!--                      &lt;!&ndash;                      <div v-if="row.quantity">{{ Math.round( row.quantity*0.67) }}</div>&ndash;&gt;-->
+                      <!--                      <div v-else>0</div>-->
+
+                      <div v-if=" new Date(row.PurchaseOrder.substring(3, 13)).getTime()<new Date(fun_date(-7)).getTime()">
+                        {{ row.quantity }}
+                      </div>
+                      <div
+                        v-else-if="(new Date(row.PurchaseOrder.substring(3, 13)).getTime()<new Date(fun_date(-3)).getTime())&&
+                          (new Date(row.PurchaseOrder.substring(3, 13)).getTime()>new Date(fun_date(-7)).getTime())"
+                      >
+                        {{ Math.ceil(row.quantity*0.6) }}
+                      </div>
+                      <div v-else>
+                        0
+                      </div>
+
                     </template>
                   </el-table-column>
                   <el-table-column
@@ -146,8 +162,25 @@
                     width="114"
                   >
                     <template slot-scope="{row}">
-                      <div v-if="row.quantity- row.quantity1">{{ parseFloat(row.quantity - row.quantity1) }}</div>
-                      <div v-else>0</div>
+
+                      <!--                      涓冨ぉ涔嬪墠-->
+                      <div v-if=" new Date(row.PurchaseOrder.substring(3, 13)).getTime()<new Date(fun_date(-7)).getTime()">
+                        {{ row.quantity }}
+                      </div>
+                      <!--                      涓夊埌7澶╀箣鍓�-->
+                      <div
+                        v-else-if="(new Date(row.PurchaseOrder.substring(3, 13)).getTime()<new Date(fun_date(-3)).getTime())&&
+                          (new Date(row.PurchaseOrder.substring(3, 13)).getTime()>new Date(fun_date(-7)).getTime())"
+                      >
+                        {{ Math.floor(row.quantity*0.4) }}
+                      </div>
+                      <div v-else>
+                        0
+                      </div>
+
+                      <!--                      <div v-if="row.quantity- row.quantity1">{{ parseFloat(row.quantity - row.quantity1) }}</div>-->
+                      <!--                      &lt;!&ndash;                      <div v-if="row.quantity">{{ Math.ceil(row.quantity*0.33) }}</div>&ndash;&gt;-->
+                      <!--                      <div v-else>0</div>-->
                     </template>
                   </el-table-column>
                   <el-table-column
@@ -287,10 +320,18 @@
     this.getPurchaseLeftBottom()
     this.getPurchaseRight()
 
-    this.setStarsRef()
+    // this.setStarsRef()
   },
 
   methods: {
+    fun_date(aa) {
+      const date1 = new Date()
+      const time1 = date1.getFullYear() + '-' + (date1.getMonth() + 1) + '-' + date1.getDate()// time1琛ㄧず褰撳墠鏃堕棿
+      const date2 = new Date(date1)
+      date2.setDate(date1.getDate() + aa)
+      const time2 = date2.getFullYear() + '-' + (date2.getMonth() + 1).toString().padStart(2, '0') + '-' + date2.getDate().toString().padStart(2, '0')
+      return time2
+    },
     setStarsRef() {
       const starNodes = Array.from(this.$refs.starsRef.children)
       starNodes.forEach(item => {
@@ -313,14 +354,16 @@
     async getEcharts() {
       PurchaseLeftTop().then(res => {
         this.purchaseLeftTopData = res.data[0]
-        loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
+        // loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
+        loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseOrderCont - 5, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
       })
       setInterval(() => {
         PurchaseLeftTop().then(res => {
           this.purchaseLeftTopData = res.data[0]
-          loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
+          // loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
+          loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseOrderCont - 5, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
         })
-      }, 1000 * 6)
+      }, 1000 * 30)
     },
     getPurchaseLeftBottom() {
       PurchaseLeftBottom().then(res => {
@@ -346,7 +389,7 @@
               }
             })
           }
-        }, this.tableData.length <= 13 ? 1000 * 3 : 100)
+        }, this.tableData.length <= 13 ? 1000 * 10 : 100)
       })
     },
     getPurchaseRight() {
@@ -363,13 +406,13 @@
             divData.scrollTop = 0
             PurchaseRight().then(res => {
               this.tableDataRank = res.data
-              if (this.tableDataRank.length > 21) {
+              if (this.tableDataRank.length > 23) {
                 clearInterval(this.PurchaseRight)
                 this.getPurchaseRight()
               }
             })
           }
-        }, this.tableDataRank.length <= 21 ? 1000 * 3 : 100)
+        }, this.tableDataRank.length <= 23 ? 1000 * 10 : 100)
       })
     },
     tableRowClassName({ row, rowIndex }) {

--
Gitblit v1.9.3