Explorar o código

提交车间代码

Lijy hai 1 mes
pai
achega
249d460130

+ 30 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/InsertionPlan/InsertionPlan.vue

@@ -2,6 +2,16 @@
   <div class="flexCoum">
     <van-nav-bar title="插单计划" left-text="返回" @click-left="back" fixed left-arrow v-if="!beDeptList" />
     <van-nav-bar title="插单计划" left-text="返回" right-text="新建" @click-left="back" v-if="beDeptList" fixed left-arrow @click-right="add" />
+    <div class="seachPlan">
+      <van-search
+        v-model="searchValue"
+        placeholder="请输入搜索关键词"
+        clearable
+        @input="debouncedPlanSeach"
+        @search="debouncedPlanSeach"
+        @clear="debouncedPlanSeach"
+      />
+    </div>
     <div class="InsertionPlan flexCoum-box">
       <div class="InsertionPlanBox contentRoll">
         <div v-for="item,index in planList" :key="index" class="InsertionPlanBox_item">
@@ -24,6 +34,8 @@ export default {
       beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
       user: JSON.parse(localStorage.getItem('userInfo')),
       planList: [],
+      debouncedPlanSeach: () => {},
+      searchValue: '',
     };
   },
   computed: {},
@@ -31,8 +43,21 @@ export default {
   created() {},
   mounted() {
     this.getPlanList()
+    this.debouncedPlanSeach = this.debounce(this.planSeach, 500); // 300ms 防抖
   },
   methods: {
+    debounce(func, wait) {
+      let timeout;
+      return function (...args) {
+        clearTimeout(timeout);
+        timeout = setTimeout(() => {
+          func.apply(this, args);
+        }, wait);
+      };
+    },
+    planSeach() {
+      this.getPlanList()
+    },
     back() {
       this.$router.go(-1);
     },
@@ -51,6 +76,8 @@ export default {
         pageIndex: 0,
         pageSize: 10000,
         planType: 2,
+        searchType: 5,
+        searchValue: this.searchValue,
       })
       .then(res => {
         if (res.code == "ok") {
@@ -87,10 +114,12 @@ export default {
   * {
     box-sizing: border-box;
   }
+  .seachPlan {
+    padding-top: 46px;
+  }
   .InsertionPlan {
     height: 100%;
     background-color: #F4F4F4;
-    padding-top: 46px;
     display: flex;
     flex-direction: column;
 

+ 32 - 3
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/todayPlan.vue

@@ -1,6 +1,16 @@
 <template>
   <div class="flexCoum">
     <van-nav-bar title="今日计划" left-text="返回" @click-left="back" fixed left-arrow />
+    <div class="seachPlan">
+      <van-search
+        v-model="searchValue"
+        placeholder="请输入搜索关键词"
+        clearable
+        @input="debouncedPlanSeach"
+        @search="debouncedPlanSeach"
+        @clear="debouncedPlanSeach"
+      />
+    </div>
     <div class="todayPlan flexCoum-box">
       <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList"></PlanComponent>
       <van-empty description="暂无数据" v-else />
@@ -18,6 +28,8 @@ export default {
   data() {
     return {
       planList: [], // 今日计划数据
+      searchValue: '',
+      debouncedPlanSeach: () => {},
     };
   },
   computed: {},
@@ -25,11 +37,24 @@ export default {
   created() { },
   mounted() {
     this.getPlanList()
+    this.debouncedPlanSeach = this.debounce(this.planSeach, 500); // 300ms 防抖
   },
   methods: {
     back() {
       this.$router.go(-1);
     },
+    debounce(func, wait) {
+      let timeout;
+      return function (...args) {
+        clearTimeout(timeout);
+        timeout = setTimeout(() => {
+          func.apply(this, args);
+        }, wait);
+      };
+    },
+    planSeach() {
+      this.getPlanList()
+    },
     getPlanList() {
       this.$toast.loading({
         duration: 0, // 持续展示 toast
@@ -40,7 +65,9 @@ export default {
         pageIndex: 0,
         pageSize: 10000,
         planType: 0,
-        isMob:1
+        isMob:1,
+        searchType: 5,
+        searchValue: this.searchValue,
         // date: this.getNowFormatDate()
       })
       .then(res => {
@@ -48,6 +75,7 @@ export default {
           res.data.records.forEach(item => { item.flg = false })
           // this.planList = res.data.records;
           this.planList = []
+          this.planListCopy = []
           // res.data.records.forEach((item => {
           //   const newProgress = item.progress && item.progress.split('%')[0]
           //   const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
@@ -102,10 +130,11 @@ export default {
 * {
   box-sizing: border-box;
 }
-
+.seachPlan {
+  padding-top: 46px;
+}
 .todayPlan {
   height: 100%;
   background-color: #F4F4F4;
-  padding-top: 46px;
 }
 </style>

+ 29 - 2
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/tomorrowPlan/tomorrowPlan.vue

@@ -1,7 +1,17 @@
 <template>
   <div class="flexCoum">
     <van-nav-bar title="明日计划" left-text="返回" @click-left="back" fixed left-arrow/>
-    <div class="todayPlan flexCoum-box">
+    <div class="seachPlan">
+      <van-search
+        v-model="searchValue"
+        placeholder="请输入搜索关键词"
+        clearable
+        @input="debouncedPlanSeach"
+        @search="debouncedPlanSeach"
+        @clear="debouncedPlanSeach"
+      />
+    </div>
+    <div class="flexCoum-box">
       <PlanComponent :titleText="'明日计划'" :planList="planList" v-if="planList.length > 0"></PlanComponent>
       <van-empty description="赞无数据" v-else />
     </div>
@@ -18,6 +28,8 @@ export default {
   data() {
     return {
       planList: [], // 明日计划数据
+      searchValue: '',
+      debouncedPlanSeach: () => {},
     };
   },
   computed: {},
@@ -25,9 +37,22 @@ export default {
   created() {},
   mounted() {
     this.getPlanList()
+    this.debouncedPlanSeach = this.debounce(this.planSeach, 500); // 300ms 防抖
   },
   methods: {
-    back() {
+
+    debounce(func, wait) {
+      let timeout;
+      return function (...args) {
+        clearTimeout(timeout);
+        timeout = setTimeout(() => {
+          func.apply(this, args);
+        }, wait);
+      };
+    },
+    planSeach() {
+      this.getPlanList()
+    },    back() {
       this.$router.go(-1);
     },
     getPlanList() {
@@ -35,6 +60,8 @@ export default {
         pageIndex: 0,
         pageSize: 10000,
         planType: 1,
+        searchType: 5,
+        searchValue: this.searchValue,
         // date: this.getNowFormatDate()
       })
       .then(res => {