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 |  193 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 147 insertions(+), 46 deletions(-)

diff --git a/src/views/kb/cgdd.vue b/src/views/kb/cgdd.vue
index 5a0d588..7982686 100644
--- a/src/views/kb/cgdd.vue
+++ b/src/views/kb/cgdd.vue
@@ -1,6 +1,12 @@
 <template>
   <div>
     <div class="kb_dashboard">
+
+      <!--    鏄熺┖鑳屾櫙-->
+      <!--      <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">
           <div id="topBarLeft" style="width:600px;height:100%" />
@@ -43,7 +49,7 @@
                   <el-table-column
                     prop="PurchaseOrder"
                     label="閲囪喘璁㈠崟"
-                    width="207"
+                    width="225"
                   >
                     <template slot-scope="{row}">
                       <div class="ellipsis">{{ row.PurchaseOrder }}</div>
@@ -52,7 +58,7 @@
                   <el-table-column
                     prop="suppername"
                     label="渚涘簲鍟�"
-                    width="163"
+                    width="183"
                   >
                     <template slot-scope="{row}">
                       <div v-if="row.suppername" class="ellipsis">{{ row.suppername }}</div>
@@ -78,7 +84,7 @@
                   <el-table-column
                     prop="partname"
                     label="浜у搧鍚嶇О"
-                    width="175"
+                    width="215"
                   >
                     <template slot-scope="{row}">
                       <div v-if="row.partname" class="ellipsis">{{ row.partname }}</div>
@@ -98,56 +104,89 @@
                   <el-table-column
                     prop="quantity"
                     label="璁㈠崟鏁伴噺"
-                    width="94"
+                    width="114"
                   >
                     <template slot-scope="{row}">
                       <div v-if="row.quantity">{{ parseFloat(row.quantity) }}</div>
                       <div v-else>0</div>
                     </template>
                   </el-table-column>
-                  <el-table-column
-                    prop="checktype"
-                    label="妫�楠岀姸鎬�"
-                    width="94"
-                  >
-                    <template slot-scope="{row}">
-                      <div v-if="row.checktype===null">鏈楠�</div>
-                      <div v-else>宸叉楠�</div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    prop="checkuser"
-                    label="妫�楠屼汉鍛�"
-                    width="94"
-                  >
-                    <template slot-scope="{row}">
-                      <div v-if="row.checkuser===null">/</div>
-                      <div v-else>{{ row.checkuser }}</div>
-                    </template>
-                  </el-table-column>
+                  <!--                  <el-table-column-->
+                  <!--                    prop="checktype"-->
+                  <!--                    label="妫�楠岀姸鎬�"-->
+                  <!--                    width="104"-->
+                  <!--                  >-->
+                  <!--                    <template slot-scope="{row}">-->
+                  <!--                      <div v-if="row.checktype===null">鏈楠�</div>-->
+                  <!--                      <div v-else>宸叉楠�</div>-->
+                  <!--                    </template>-->
+                  <!--                  </el-table-column>-->
+                  <!--                  <el-table-column-->
+                  <!--                    prop="checkuser"-->
+                  <!--                    label="妫�楠屼汉鍛�"-->
+                  <!--                    width="94"-->
+                  <!--                  >-->
+                  <!--                    <template slot-scope="{row}">-->
+                  <!--                      <div v-if="row.checkuser===null">/</div>-->
+                  <!--                      <div v-else>{{ row.checkuser }}</div>-->
+                  <!--                    </template>-->
+                  <!--                  </el-table-column>-->
                   <el-table-column
                     prop="quantity1"
                     label="宸叉敹鏁伴噺"
-                    width="94"
+                    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
                     label="鏈敹鏁伴噺"
-                    width="94"
+                    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
                     prop="acceptDate"
                     label="棰勮浜ゆ湡"
-                    width="115"
+                    width="135"
                   >
                     <template slot-scope="{row}">
                       <div v-if="row.acceptDate">{{ row.acceptDate.substring(0, 10) }}</div>
@@ -157,18 +196,18 @@
                   <el-table-column
                     prop="warning"
                     label="寤舵湡澶╂暟"
-                    width="114"
+                    width="144"
                   >
                     <template slot-scope="{row}">
                       <div v-if="parseFloat(row.warning)<0" style="color: red">{{
                         Math.abs(parseFloat(row.warning))
                       }}
                       </div>
-                      <div v-else-if="row.warning===null||row.warning===''||row.warning===0">0</div>
-                      <div v-else-if="parseFloat(row.warning)>3">{{ row.warning }}</div>
-                      <div v-else-if="parseFloat(row.warning)>0&&parseFloat(row.warning)<=3" style="color:yellow;">
-                        {{ row.warning }}
-                      </div>
+                      <div v-else-if="row.warning===null||row.warning===''||row.warning>=0">0</div>
+                      <!--                      <div v-else-if="parseFloat(row.warning)>3">{{ row.warning }}</div>-->
+                      <!--                      <div v-else-if="parseFloat(row.warning)>0&&parseFloat(row.warning)<=3" style="color:yellow;">-->
+                      <!--                        {{ row.warning }}-->
+                      <!--                      </div>-->
                     </template>
                   </el-table-column>
                 </el-table>
@@ -259,7 +298,10 @@
       tableDataRank: [],
 
       PurchaseRight: null,
-      PurchaseLeftBottom: null
+      PurchaseLeftBottom: null,
+
+      starsCount: 800, // 鏄熸槦鏁伴噺
+      distance: 900 // 闂磋窛
 
     }
   },
@@ -277,10 +319,32 @@
     this.getEcharts()
     this.getPurchaseLeftBottom()
     this.getPurchaseRight()
+
+    // 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 => {
+        const speed = 0.2 + Math.random() * 1
+        const thisDistance = this.distance + Math.random() * 300
+        item.style.transformOrigin = `0 0 ${thisDistance}px`
+        item.style.transform = `
+        translate3d(0,0,-${thisDistance}px)
+        rotateY(${Math.random() * 360}deg)
+        rotateX(${Math.random() * -50}deg)
+        scale(${speed},${speed})`
+      })
+    },
     // 鑾峰彇topEcharts
     getTopBar() {
       loadEcharts('topBarLeft', kbTop())
@@ -290,19 +354,22 @@
     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 => {
         this.tableData = res.data.filter(i => !parseFloat(i.quantity1))// 杩囨护鎺夊凡鏀舵暟閲忓ぇ浜庨浂鐨勫��
-        this.number1 = this.tableData.length
+
+        // this.number1 = this.tableData.length
 
         const divData = this.$refs.tableData.bodyWrapper
         // 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
@@ -322,7 +389,7 @@
               }
             })
           }
-        }, this.tableData.length <= 13 ? 1000 * 3 : 100)
+        }, this.tableData.length <= 13 ? 1000 * 10 : 100)
       })
     },
     getPurchaseRight() {
@@ -339,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 }) {
@@ -419,3 +486,37 @@
   font-size: 18px;
 }
 </style>
+<!--鏄熺┖-->
+<style lang="css" scoped>
+@keyframes rotate {
+  0% {
+    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(0);
+  }
+  100% {
+    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(-360deg);
+  }
+}
+
+.stars {
+  transform: perspective(500px);
+  transform-style: preserve-3d;
+  position: absolute;
+  perspective-origin: 50% 100%;
+  left: 45%;
+  animation: rotate 90s infinite linear;
+  bottom: 0;
+  z-index: 102;
+}
+
+.star {
+  width: 2px;
+  height: 2px;
+  /*background: #f7f7b6;*/
+  background: #8edffc;
+  position: absolute;
+  left: 0;
+  top: 0;
+  backface-visibility: hidden;
+  z-index: 102;
+}
+</style>

--
Gitblit v1.9.3