From c588a47c9c7fbcbe6e0a479cfb081ffa4db2a94c Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 11 五月 2023 17:35:44 +0800
Subject: [PATCH] 1.生产进度报表提交

---
 src/views/kb/cgdd.vue |  140 ++++++++++++++++++++++++++++++----------------
 1 files changed, 92 insertions(+), 48 deletions(-)

diff --git a/src/views/kb/cgdd.vue b/src/views/kb/cgdd.vue
index 69fe599..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">
@@ -49,7 +49,7 @@
                   <el-table-column
                     prop="PurchaseOrder"
                     label="閲囪喘璁㈠崟"
-                    width="207"
+                    width="225"
                   >
                     <template slot-scope="{row}">
                       <div class="ellipsis">{{ row.PurchaseOrder }}</div>
@@ -58,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>
@@ -84,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>
@@ -104,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>
@@ -163,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>
@@ -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,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鍍忕礌)
@@ -345,7 +389,7 @@
               }
             })
           }
-        }, this.tableData.length <= 13 ? 1000 * 3 : 100)
+        }, this.tableData.length <= 13 ? 1000 * 10 : 100)
       })
     },
     getPurchaseRight() {
@@ -362,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