From e23a1db0b60437f17d09d65c65f8fd0c8a5d88c7 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 26 八月 2024 18:11:07 +0800
Subject: [PATCH] 最新版本

---
 h5/pages/staff/task/index.vue |  116 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 78 insertions(+), 38 deletions(-)

diff --git a/h5/pages/staff/task/index.vue b/h5/pages/staff/task/index.vue
index 39d32d6..b0b64bb 100644
--- a/h5/pages/staff/task/index.vue
+++ b/h5/pages/staff/task/index.vue
@@ -1,5 +1,5 @@
 <template>
-  <view class="box">
+  <view class="box" :class="{ popupShow: showFilter }">
     <scroll-view scroll-x class="box_head">
       <view class="box_head_search">
         <view class="box_head_search_ipt">
@@ -21,7 +21,7 @@
           @click="statusClick(0)"
           :class="{ active: search.queryType === 0 }"
           class="box_head_item"
-          >寰呭鐞� {{ headData.noticeWaitNum }}</view
+          >寰呭鐞� {{ headData.noticeWaitNum || "" }}</view
         >
         <view
           @click="statusClick(1)"
@@ -39,7 +39,7 @@
           @click="statusClick(3)"
           :class="{ active: search.queryType === 3 }"
           class="box_head_item"
-          >鎶勯�佹垜鐨� {{ headData.noticeCopyNum }}</view
+          >鎶勯�佹垜鐨� {{ headData.noticeCopyNum || "" }}</view
         >
       </view>
     </scroll-view>
@@ -60,11 +60,12 @@
           />
           <text>浠呯湅鏈</text>
         </view>
-        <view class="right">鍏ㄩ儴鏍囪宸茶</view>
+        <view class="right" @click="handleReady">鍏ㄩ儴鏍囪宸茶</view>
       </view>
       <view
         class="box_list_item"
         v-for="(item, index) in dataList"
+        @click="handleAppr(item)"
         :key="index"
       >
         <view class="box_list_item_head">
@@ -114,9 +115,17 @@
           <view class="box_list_item_nr_x"></view>
           <view class="box_list_item_nr_text">
             <text class="time">{{ item.createDate }}鎻愪氦</text>
-            <text class="btn" @click="handleAppr(item)">鍘诲鐞�</text>
+            <text v-if="item.param2 == '0'" class="btn">鍘诲鐞�</text>
           </view>
         </view>
+      </view>
+      <view v-if="dataList.length === 0" style="text-align: center">
+        <image
+          src="@/static/empty.png"
+          style="width: 320rpx; margin: 120px auto 0"
+          mode="widthFix"
+        />
+        <view class="placeholder9 fs24">鏆傛棤鏁版嵁</view>
       </view>
     </view>
     <!-- 绛涢�� -->
@@ -128,17 +137,17 @@
       @close="showFilter = false"
     >
       <view class="search">
-        <view class="search_head">浠诲姟绛涢��</view>
+        <view class="search_head">绛涢��</view>
         <view class="search_list">
           <view class="search_list_item">
-            <view class="search_list_item_label">鍒涘缓鏃ユ湡</view>
+            <view class="search_list_item_label">鍒涘缓鏃堕棿</view>
             <view class="search_list_item_val">
               <view
                 class="search_list_item_val_row"
                 @click="tiemShow = true"
                 :style="{ color: modelParam.startDate ? '#000' : '' }"
                 >{{
-                  modelParam.startDate ? modelParam.startDate : "寮�濮嬫棩鏈�"
+                  modelParam.startDate ? modelParam.startDate : "寮�濮嬫椂闂�"
                 }}</view
               >
               <view class="search_list_item_val_z">-</view>
@@ -147,13 +156,13 @@
                 @click="tiemShow1 = true"
                 :style="{ color: modelParam.endDate ? '#000' : '' }"
                 >{{
-                  modelParam.endDate ? modelParam.endDate : "缁撴潫鏃ユ湡"
+                  modelParam.endDate ? modelParam.endDate : "缁撴潫鏃堕棿"
                 }}</view
               >
             </view>
           </view>
           <view class="search_list_item">
-            <view class="search_list_item_label">璁㈠崟鏉ユ簮</view>
+            <view class="search_list_item_label">浠诲姟绫诲瀷</view>
             <view class="search_list_item_cates">
               <view
                 :class="
@@ -171,23 +180,24 @@
           </view>
         </view>
         <view class="search_footer">
-          <view class="search_footer_item" @click="showFilter = false"
-            >鍙栨秷</view
-          >
+          <view class="search_footer_item" @click="modalReset">閲嶇疆</view>
           <view class="search_footer_item t" @click="modalSub">鎻愪氦</view>
         </view>
       </view>
     </u-popup>
     <u-datetime-picker
       :show="tiemShow"
-      v-model="modelParam.startDate"
+      v-model="startDate"
       mode="date"
       @confirm="confirmLeft"
       @cancel="tiemShow = false"
     ></u-datetime-picker>
     <u-datetime-picker
       :show="tiemShow1"
-      v-model="modelParam.endDate"
+      :minDate="
+        modelParam.startDate ? new Date(modelParam.startDate).getTime() : null
+      "
+      v-model="startDate"
       mode="date"
       @confirm="confirmRight"
       @cancel="tiemShow1 = false"
@@ -196,7 +206,7 @@
 </template>
 
 <script>
-import { stagingHead, stagingTaskPage } from '@/api'
+import { stagingHead, stagingTaskPage, signReadTask } from '@/api'
 import dayjs from 'dayjs'
 export default {
   data() {
@@ -205,10 +215,7 @@
       search: {
         queryType: 0
       },
-      modelParam: {
-        startDate: dayjs().format('YYYY-MM-DD'),
-        endDate: dayjs().format('YYYY-MM-DD'),
-      },
+      modelParam: {},
       tiemShow: false,
       tiemShow1: false,
 
@@ -224,18 +231,25 @@
         { name: '鐢ㄨ溅鐢宠', id: 2 },
         { name: '闅愭偅闅忔墜鎷�', id: 3 },
         { name: '鐗╂祦杞︾敵璇�', id: 4 },
-      ]
+      ],
+      startDate: dayjs().format('YYYY-MM-DD'),
     }
   },
-  onLoad() {
-    this.getHeadList()
-    this.pagination.page = 0
-    this.getList()
-  },
+  // onLoad() {
+  //   this.getHeadList()
+  //   this.pagination.page = 0
+  //   this.getList()
+  // },
   onReachBottom() {
     // this.pagination.page = 0
     // this.dataList = []
     this.getList()
+  },
+  onBackPress(options) {
+    setTimeout(()=>{
+      this.$eventBus.$emit('taskBack')
+    })
+    return false
   },
   onShow() {
     this.pagination.page = 0
@@ -254,6 +268,13 @@
       this.pagination.page = 0
       this.dataList = []
       this.$set(this.search, 'noRead', val)
+      this.getList()
+    },
+    modalReset() {
+      this.modelParam = {}
+      this.pagination.page = 0
+      this.dataList = []
+      this.showFilter = false
       this.getList()
     },
     modalSub() {
@@ -279,9 +300,10 @@
       }).then(res => {
         this.dataList = [...this.dataList, ...res.data.records]
         this.dataList.forEach(i => {
-          i.param1 = JSON.parse(i.param1)
+          if (i.param1) {
+            i.param1 = JSON.parse(i.param1)
+          }
         })
-        console.log('dataList', this.dataList)
       })
     },
     getHeadList() {
@@ -291,8 +313,23 @@
         this.headData = res.data
       })
     },
+    handleReady() {
+      signReadTask({
+        signType: 1
+      }).then(res => {
+        this.getHeadList()
+      })
+    },
     handleAppr(item) {
       const { objType, objId } = item
+      if (this.search.queryType === 3) {
+        signReadTask({
+          noticesId: item.id,
+          signType: 0
+        }).then(res => {
+          this.getHeadList()
+        })
+      }
       if (objType === 2) {
         uni.navigateTo({
           url: `/pages/staff/vehicle/sendACarDetail?id=${objId}&appr=1`
@@ -312,19 +349,21 @@
       }
     },
     clickItem(index) {
-      this.$set(this.modelParam, 'type', this.cateList[index].id)
+      if (this.cateList[index].id === this.modelParam.type) {
+        this.$set(this.modelParam, 'type', null)
+      } else {
+        this.$set(this.modelParam, 'type', this.cateList[index].id)
+      }
     },
     confirmLeft(e) {
-      console.log(uni.$u.timeFormat(e.value, 'yyyy-mm-dd'))
       setTimeout(() => {
-        this.modelParam.startDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+        this.$set(this.modelParam, 'startDate', uni.$u.timeFormat(e.value, 'yyyy-mm-dd'))
       })
       this.tiemShow = false
     },
     confirmRight(e) {
-      // this.modelParam.endDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss')
       setTimeout(() => {
-        this.modelParam.endDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+        this.$set(this.modelParam, 'endDate', uni.$u.timeFormat(e.value, 'yyyy-mm-dd'))
       })
       this.tiemShow1 = false
     }
@@ -476,7 +515,7 @@
         }
         .tt {
           font-size: 32rpx;
-          font-weight: 500;
+          font-weight: 600;
           color: #222222;
         }
         .info {
@@ -546,7 +585,7 @@
       width: 100%;
       text-align: center;
       font-size: 32rpx;
-      font-weight: 500;
+      font-weight: 600;
       color: #222222;
     }
     .search_list {
@@ -573,8 +612,9 @@
             color: #ffffff !important;
           }
           .search_list_item_cates_row {
-            padding: 0 26rpx;
+            width: 216rpx;
             height: 64rpx;
+            text-align: center;
             line-height: 64rpx;
             background: #f7f7f7;
             border-radius: 36rpx;
@@ -583,8 +623,8 @@
             font-weight: 400;
             color: #333333;
             margin-bottom: 20rpx;
-            &:last-child {
-              margin: 0;
+            &:nth-of-type(3n) {
+              margin-right: 0;
             }
           }
         }

--
Gitblit v1.9.3