From 453f63fd6cd6466222304df619e62b3a5667ca68 Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期二, 05 八月 2025 13:56:47 +0800
Subject: [PATCH] 修复0730测试问题

---
 eims-ui-mobile/src/pages/maint/maint-st.vue |   63 ++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/eims-ui-mobile/src/pages/maint/maint-st.vue b/eims-ui-mobile/src/pages/maint/maint-st.vue
index 26848fd..85851df 100644
--- a/eims-ui-mobile/src/pages/maint/maint-st.vue
+++ b/eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -53,9 +53,15 @@
             <view class="text-color-gray text-sm mt-1 flex">
               <text class="mr-3">鎬绘暟: {{ item.orderCount }}</text>
               |
-              <text class="mx-3">宸插畬鎴�: {{ item.dyzCount }}</text>
-              |
-              <text class="mx-3">寰呬繚鍏�: {{ item.dbyCount }}</text>
+              <template v-if="activeTab === 0">
+                <text class="mx-3">寰呬繚鍏�: {{ item.dbyCount }}</text>
+                |
+              </template>
+              <template v-else>
+                <text class="mx-3">寰呴獙璇�: {{ item.dyzCount }}</text>
+                |
+              </template>
+              <text class="mx-3">宸插畬鎴�: {{ item.wcCount }}</text>
             </view>
 <!--            <view class="text-color-gray text-sm mt-2 flex">-->
 <!--              <text class="mr-3">寰呬繚鍏�: {{ item.dbyCount }}</text>-->
@@ -85,6 +91,17 @@
         </view>
       </wd-card>
     </view>
+
+    <wd-fab
+      v-if="status === '1' && isLeader()"
+      :draggable="true"
+      type="success"
+      position="left-bottom"
+      :expandable="false"
+      inactiveIcon="check"
+      @click="handleBatchComplete"
+      direction="top"
+    />
   </z-paging>
 </template>
 
@@ -92,6 +109,11 @@
 import { ref, computed } from 'vue'
 import { getMaintStList } from '@/service/maint'
 import dayjs from 'dayjs'
+import { updateMaintSt } from '@/service/maint'
+import { useUserStore } from "@/store";
+import { isLeader } from '@/utils/RoleUtils'
+import { useToast } from 'wot-design-uni'
+
 const searchValue = ref<string>('')
 /**
  * 鍏朵粬椤甸潰浼犺繃鏉ョ殑鏁版嵁
@@ -257,6 +279,41 @@
   paging.value.reload()
 }
 
+const userStore = useUserStore()
+const toast = useToast()
+
+async function handleBatchComplete() {
+  console.log('handleBatchComplete', dataList.value.length)
+  if (!isLeader()) {
+    toast.info('鏃犳潈闄愭搷浣�')
+    return
+  }
+  // 濡傛灉寰呯‘璁ゅ伐鍗曞垪琛ㄤ负绌猴紝鍒欐彁绀虹敤鎴锋棤寰呯‘璁ゅ伐鍗�
+  if (dataList.value.length < 1) {
+    toast.info('鏃犲緟纭宸ュ崟')
+    return
+  }
+  const now = new Date()
+  const verifyTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`
+
+  // 鍋囪 dataList 鏄綋鍓嶅緟纭鐨勫伐鍗曞垪琛�
+  const promises = dataList.value.map(item => {
+    return updateMaintSt({
+      id: item.id,
+      status: '2',
+      verifyUser: userStore?.userInfo?.userId,
+      verifyTime
+    })
+  })
+
+  try {
+    await Promise.all(promises)
+    toast.success('涓�閿‘璁ゅ畬鎴�')
+    reloadData() // 鍒锋柊鍒楄〃
+  } catch (e) {
+    toast.error('閮ㄥ垎宸ュ崟纭澶辫触锛岃閲嶈瘯')
+  }
+}
 
 onLoad((options) => {
   Object.assign(option, options)

--
Gitblit v1.9.3