From ba1b15ac2556a322d1cea9bdd108255e0ff32048 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 03 十二月 2024 13:43:44 +0800
Subject: [PATCH] 优化入库出库功能

---
 src/components/view/index-index.vue |  120 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 91 insertions(+), 29 deletions(-)

diff --git a/src/components/view/index-index.vue b/src/components/view/index-index.vue
index b688f28..5f9be9f 100644
--- a/src/components/view/index-index.vue
+++ b/src/components/view/index-index.vue
@@ -212,6 +212,7 @@
     border-radius: 16px;
     overflow: hidden;
     margin-bottom: 8px;
+    cursor: pointer;
   }
   .body-item.color0{
     background: #70A090;
@@ -241,15 +242,33 @@
 		text-align: left;
     margin-bottom: 10px;
 	}
-  >>>.is-selected .el-calendar-day{
-    background: #3A7BFA !important;
-    color: #fff !important;
+  >>>.el-calendar-day span{
+    display: inline-block;
+    width: 30px;
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
     border-radius: 4px;
   }
-  >>>.el-calendar-day:hover{
+  >>>.is-selected{
+    background: transparent !important;
+  }
+  >>>.is-selected .el-calendar-day{
+    background: transparent !important;
+  }
+  >>>.is-selected .el-calendar-day span{
     background: #3A7BFA !important;
     color: #fff !important;
-    border-radius: 4px;
+  }
+  >>>.el-calendar-day:hover{
+    background: transparent;
+  }
+  >>>.el-calendar-day span:hover{
+    background: #3A7BFA !important;
+    color: #fff !important;
+  }
+  >>>.el-tag--dark{
+    border: 0;
   }
 </style>
 
@@ -270,12 +289,22 @@
             <div class="left-item-title">
               <span style="font-size: 18px;">{{ item }}</span>
               <span style="font-size: 14px;color: #999999;">{{ weekdays[index] }}</span>
+              <el-tag style="margin-top: 6px;" size="small">{{workList[index].length}} 鏉�</el-tag>
             </div>
             <div class="left-item-body">
-              <div class="body-item" v-for="(m,i) in workList[index]" :key="i" :class="{color0:m.type==0,color1:m.type==1,color2:m.type==2}">
+              <div class="body-item" v-for="(m,i) in workList[index]" :key="i" :class="{color0:m.type==0,color1:m.type==1,color2:m.type==2}" @click="goAddList(m)">
                 <div>
-                  <span style="font-size: 12px;margin-bottom: 17px;">{{ m.text }}</span>
-                  <span style="display: inline-block;height: 24px;width: 24px;border-radius: 50%;line-height: 24px;text-align: center;background: #C0C4CC;color: #fff;">{{ m.name.charAt(0) }}</span>
+                  <span style="font-size: 12px;margin-bottom: 8px;">{{ m.text }}</span>
+                  <div class="tags" style="display: flex;align-items: end;flex-wrap: wrap;margin-bottom: 8px;">
+                    <el-tag
+                      v-for="(item,index) in m.sample.split(',')"
+                      :key="index"
+                      :color="m.type==0?'#70A090':(m.type==1?'#EBD476':'#FF3838')"
+                      effect="dark" size="mini" style="margin: 2px;">
+                      {{ item }}
+                    </el-tag>
+                  </div>
+                  <span style="display: inline-block;height: 22px;width: 70px;border-radius: 10px;line-height: 22px;text-align: center;background: #C0C4CC;color: #fff;font-size: 14px;">{{ m.name }}</span>
                 </div>
               </div>
             </div>
@@ -289,7 +318,7 @@
               <img src="../../../static/img/index-0.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">0</p>
+              <p style="font-size: 20px;">{{getNumberFourTypes.totalNumberOfMessages}}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">鎴戠殑寰呭姙</p>
             </div>
           </div>
@@ -298,7 +327,7 @@
               <img src="../../../static/img/index-1.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">0</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.totalNumberOfReadMessages }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">宸插姙浜嬪疁</p>
             </div>
           </div>
@@ -307,7 +336,7 @@
               <img src="../../../static/img/index-2.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">0</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.remainingToDo }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">鍓╀綑寰呭姙</p>
             </div>
           </div>
@@ -316,7 +345,7 @@
               <img src="../../../static/img/index-3.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">0</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.totalNumberOfMessagesInThePastSevenDays }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">杩戞湡浜嬪疁</p>
             </div>
           </div>
@@ -353,7 +382,7 @@
                   <p class="ellipsis-multiline" >{{ m.text }}</p>
                 </el-tooltip>
               </div>
-              <span style="color:rgb(153, 153, 153);font-size: 12px;text-align: center;margin: 120px 0;display: inline-block;width: 100%;" v-if="listScheduleByMe.length==0">鏆傛棤</span>
+              <span style="color:rgb(144, 147, 153);font-size: 14px;text-align: center;margin: 120px 0;display: inline-block;width: 100%;" v-if="listScheduleByMe.length==0">鏆傛棤鏁版嵁</span>
             </div>
           </div>
         </div>
@@ -363,7 +392,7 @@
             <div class="tab-item" style="cursor: pointer;" :class="{active:currentIndex==5}" @click="currentIndex=5">閫氱煡閫氬憡</div>
           </div>
           <div class="right-3-list" v-loading="listLoading">
-            <scroll-pagination @load="getList" :finishLoding="finishLoding">
+            <scroll-pagination @load="getList" :finishLoding="finishLoding" :list="list" v-if="list.length>0||listLoading">
               <div class="list3-item" v-for="(m,i) in list" :key="i">
               <div class="list3-item-title">
                 <img src="../../../static/img/index-tip.svg" alt="">
@@ -387,7 +416,7 @@
 			<div class="body" style="max-height: 60vh;">
 				<el-row>
 					<el-col class="search_thing" :span="22">
-						<div class="search_label">鏃堕棿锛�</div>
+						<div class="search_label"><span style="color: red;margin-right: 4px;">*</span>鏃堕棿锛�</div>
 						<div class="search_input">
 							<el-date-picker
                 v-model="query.time"
@@ -399,9 +428,10 @@
 						</div>
 					</el-col>
           <el-col class="search_thing" :span="22">
-						<div class="search_label">鍐呭锛�</div>
+						<div class="search_label"><span style="color: red;margin-right: 4px;">*</span>鍐呭锛�</div>
 						<div class="search_input">
-							<el-input v-model="query.text" size="small" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+							<el-input v-model="query.text" type="textarea"
+  :rows="2" size="small" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
 						</div>
 					</el-col>
 				</el-row>
@@ -449,7 +479,9 @@
         total: null,
         listLoading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
         finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
-        timer:null
+        timer:null,
+        keyMap:{},
+        getNumberFourTypes: {},
 			}
 		},
     watch:{
@@ -457,6 +489,7 @@
         this.getScheduleByMe()
       },
       currentIndex(){
+        this.keyMap = {}
         this.currentPage = 1;
         this.list = [];
         this.getList();
@@ -471,6 +504,7 @@
       this.weekdays = this.getWeekdaysForNextWeek()
       this.init();
       this.currentPage = 1;
+      this.keyMap = {}
       this.list = [];
       this.getList();
       this.getScheduleByMe()
@@ -478,13 +512,28 @@
       this.timer = setInterval(() => {
         this.init();
         this.currentPage = 1;
+        this.keyMap = {}
         this.list = [];
         this.getList();
         this.getScheduleByMe()
       },1000*60*10)
+      this.getNumberFourTypesFun()
 		},
 		methods: {
+      getNumberFourTypesFun() {
+        this.$axios.get(this.$api.informationNotification.getNumberFourTypesMessagesHomePage).then(res => {
+          this.getNumberFourTypes = res.data
+        })
+      },
       getList(){
+        const key = `_${this.currentPage}`
+        const value = this.keyMap[key]
+        // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰
+        if(value) {
+          return
+        }
+        // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅
+        this.keyMap[key] = 'temp'
         if(this.currentPage==1){
           this.listLoading = true
         }
@@ -697,18 +746,31 @@
         })
       },
       goNoticeDetail(row){
-      this.$axios.put(this.$api.informationNotification.triggerModificationStatusToRead+'/'+row.id).then(res => {
-        row.num = Math.random(100);
+        this.$axios.put(this.$api.informationNotification.triggerModificationStatusToRead+'/'+row.id).then(res => {
+          row.num = Math.random(100);
+          this.$bus.$emit("change", JSON.stringify(row));
+          this.$parent.addTab({
+            v: "娑堟伅璇︽儏",
+            i: "el-icon-s-tools",
+            u: "notice-detail",
+            k:35,
+            p: "abcd"
+          },29);
+        })
+      },
+      goAddList(row){
         this.$bus.$emit("change", JSON.stringify(row));
-        this.$parent.addTab({
-          v: "娑堟伅璇︽儏",
-          i: "el-icon-s-tools",
-          u: "notice-detail",
-          k:35,
-          p: "abcd"
-        },29);
-      })
-    },
+          this.$parent.addTab({
+            v: "妫�楠屼笅鍗�",
+            i: "font icon-erjidaohang",
+            u: "b1-inspection-order",
+            k:3,
+            p: "selectInsOrderParameter",
+            param:{
+              text:row.text
+            }
+          },1);
+      }
 		},
     deactivated(){
       this.timer&&clearInterval(this.timer)

--
Gitblit v1.9.3