From bab490d2da009c1a23b352b3b964e0c2dd06a0b3 Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期四, 12 六月 2025 17:32:42 +0800
Subject: [PATCH] 移动端功能优化

---
 eims-ui-mobile/src/pages/repair/req-list.vue |  270 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 143 insertions(+), 127 deletions(-)

diff --git a/eims-ui-mobile/src/pages/repair/req-list.vue b/eims-ui-mobile/src/pages/repair/req-list.vue
index c93a9ea..ea3ff6f 100644
--- a/eims-ui-mobile/src/pages/repair/req-list.vue
+++ b/eims-ui-mobile/src/pages/repair/req-list.vue
@@ -23,125 +23,134 @@
         custom-style="background: #4D80F0;"
         safeAreaInsetTop
       ></wd-navbar>
-      <wd-drop-menu v-if="!isSelectReq">
-        <wd-drop-menu-item
-          v-model="reqTypeId"
-          label-key="dictLabel"
-          value-key="dictValue"
-          :options="reqTypeList"
-          @change="handleReqType"
-        />
-        <wd-drop-menu-item
-          v-model="filterDate"
-          :options="filterDateList"
-          @change="handleFilterDate"
-        />
-        <wd-drop-menu-item
-          v-model="status"
-          label-key="dictLabel"
-          value-key="dictValue"
-          :options="statusList"
-          @change="handleReqStatu"
-        />
-      </wd-drop-menu>
+<!--      <wd-drop-menu v-if="!isSelectReq">-->
+<!--        <wd-drop-menu-item-->
+<!--          v-model="reqTypeId"-->
+<!--          label-key="dictLabel"-->
+<!--          value-key="dictValue"-->
+<!--          :options="reqTypeList"-->
+<!--          @change="handleReqType"-->
+<!--        />-->
+<!--        <wd-drop-menu-item-->
+<!--          v-model="filterDate"-->
+<!--          :options="filterDateList"-->
+<!--          @change="handleFilterDate"-->
+<!--        />-->
+<!--        <wd-drop-menu-item-->
+<!--          v-model="status"-->
+<!--          label-key="dictLabel"-->
+<!--          value-key="dictValue"-->
+<!--          :options="statusList"-->
+<!--          @change="handleReqStatu"-->
+<!--        />-->
+<!--      </wd-drop-menu>-->
     </template>
 
     <view class="bg-base">
-      <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">
-        <template #title>
-          <view class="flex justify-between items-center">
-            <view class="flex items-center menu-title-box">
-              <view class="menu-indicator"></view>
-              <text class="ml-1 text-sm">{{ item.code }}</text>
-            </view>
+      <ReqCard
+        v-for="item in dataList"
+        :key="item.id"
+        :item="item"
+        @itemClick="itemClick"
+      ></ReqCard>
+<!--      <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">-->
+<!--        <template #title>-->
+<!--          <view class="flex justify-between items-center">-->
+<!--            <view class="flex items-center menu-title-box">-->
+<!--              <view class="menu-indicator"></view>-->
+<!--              <text class="ml-1 text-sm">{{ item.code }}</text>-->
+<!--            </view>-->
 
-            <view>
-              <wd-button size="small" v-if="item.status === '0'" type="info">寰呮帴鍗�</wd-button>
-              <wd-button size="small" v-else-if="item.status === '1'" type="warning">
-                宸叉帴鍗�
-              </wd-button>
-              <wd-button size="small" v-else-if="item.status === '2'" type="primary">
-                缁翠慨涓�
-              </wd-button>
-              <wd-button size="small" v-else-if="item.status === '3'" type="success">
-                宸插畬鎴�
-              </wd-button>
-            </view>
-          </view>
-        </template>
-        <wd-swipe-action>
-          <view class="flex h-[160rpx] items-center" @click.stop="itemClick(item)">
-            <image
-              v-if="item.reqType === '1'"
-              class="slot-img text-center"
-              src="/static/ico/ico-huiyi.png"
-            />
-            <image
-              v-else-if="item.reqType === '2'"
-              class="slot-img text-center"
-              src="/static/ico/ico-setting.png"
-            />
-            <image
-              v-else-if="item.reqType === '3'"
-              class="slot-img text-center"
-              src="/static/ico/ico-faxian.png"
-            />
-            <view class="flex-1 mt-1">
-              <view class="text-color-base">
-                <template v-if="item.reqType === '1'">
-                  <text>璁惧绫诲瀷</text>
-                  <text class="mx-2">|</text>
-                  <text>{{ item.equName }}</text>
-                </template>
+<!--            <view>-->
+<!--              <wd-button size="small" v-if="item.status === '0'" type="info">寰呮帴鍗�</wd-button>-->
+<!--              <wd-button size="small" v-else-if="item.status === '1'" type="warning">-->
+<!--                宸叉帴鍗�-->
+<!--              </wd-button>-->
+<!--              <wd-button size="small" v-else-if="item.status === '2'" type="primary">-->
+<!--                缁翠慨涓�-->
+<!--              </wd-button>-->
+<!--              <wd-button size="small" v-else-if="item.status === '3'" type="success">-->
+<!--                宸插畬鎴�-->
+<!--              </wd-button>-->
+<!--            </view>-->
+<!--          </view>-->
+<!--        </template>-->
+<!--        <wd-swipe-action>-->
+<!--          <view class="flex h-[160rpx] items-center" @click.stop="itemClick(item)">-->
+<!--            <image-->
+<!--              v-if="item.reqType === '1'"-->
+<!--              class="slot-img text-center"-->
+<!--              src="/static/ico/ico-huiyi.png"-->
+<!--            />-->
+<!--            <image-->
+<!--              v-else-if="item.reqType === '2'"-->
+<!--              class="slot-img text-center"-->
+<!--              src="/static/ico/ico-setting.png"-->
+<!--            />-->
+<!--            <image-->
+<!--              v-else-if="item.reqType === '3'"-->
+<!--              class="slot-img text-center"-->
+<!--              src="/static/ico/ico-faxian.png"-->
+<!--            />-->
+<!--            <view class="flex-1 mt-1">-->
+<!--              <view class="text-color-base">-->
+<!--                <template v-if="item.reqType === '1'">-->
+<!--                  <text>璁惧绫诲瀷</text>-->
+<!--                  <text class="mx-2">|</text>-->
+<!--                  <text>{{ item.equName }}</text>-->
+<!--                </template>-->
 
-                <template v-if="item.reqType === '2'">
-                  <text>宸ュ叿绫诲瀷</text>
-                  <text class="mx-2">|</text>
-                  <text>{{ item.fixtureName }}</text>
-                </template>
+<!--                <template v-if="item.reqType === '2'">-->
+<!--                  <text>宸ュ叿绫诲瀷</text>-->
+<!--                  <text class="mx-2">|</text>-->
+<!--                  <text>{{ item.fixtureName }}</text>-->
+<!--                </template>-->
 
-                <template v-if="item.reqType === '3'">
-                  <text>鍏朵粬绫诲瀷</text>
-                </template>
-                <view class="text-color-gray mt-1 text-mini">
-                  <text>鍙戠敓鏃堕棿: {{ item.occTime }}</text>
-                </view>
+<!--                <template v-if="item.reqType === '3'">-->
+<!--                  <text>鍏朵粬绫诲瀷</text>-->
+<!--                </template>-->
+<!--                <view class="text-color-gray mt-1 text-mini">-->
+<!--                  <text>鍙戠敓鏃堕棿: {{ item.occTime }}</text>-->
+<!--                </view>-->
 
-                <view class="text-color-gray mt-1 text-mini">
-                  <text>鎶ヤ慨鏃堕棿: {{ item.reqTime }}</text>
-                </view>
-                <view class="text-color-gray mt-1 text-mini">
-                  <text>鎶ヤ慨浜�: {{ item.reqUserName }}</text>
-                </view>
-              </view>
-              <view class="text-color-gray text-sm mt-1">
-                {{ item.location }} {{ item.madeIn }}
-              </view>
-            </view>
-            <view v-if="isSelectReq">
-              <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)">
-                鎺ュ崟
-              </wd-button>
-            </view>
-          </view>
-          <template #right>
-            <view class="h-full px-3 flex items-center">
-              <wd-button size="small" type="error" @click.stop="handleDelete(item)">鍒犻櫎</wd-button>
-            </view>
-          </template>
-        </wd-swipe-action>
-      </wd-card>
+<!--                <view class="text-color-gray mt-1 text-mini">-->
+<!--                  <text>鎶ヤ慨鏃堕棿: {{ item.reqTime }}</text>-->
+<!--                </view>-->
+<!--                <view class="text-color-gray mt-1 text-mini">-->
+<!--                  <text>鎶ヤ慨浜�: {{ item.reqUserName }}</text>-->
+<!--                </view>-->
+<!--              </view>-->
+<!--              <view class="text-color-gray text-sm mt-1">-->
+<!--                {{ item.location }} {{ item.madeIn }}-->
+<!--              </view>-->
+<!--            </view>-->
+<!--            <view v-if="isSelectReq">-->
+<!--              <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)">-->
+<!--                鎺ュ崟-->
+<!--              </wd-button>-->
+<!--            </view>-->
+<!--          </view>-->
+<!--          <template #right>-->
+<!--            <view class="h-full px-3 flex items-center">-->
+<!--              <wd-button size="small" type="error" @click.stop="handleDelete(item)">鍒犻櫎</wd-button>-->
+<!--            </view>-->
+<!--          </template>-->
+<!--        </wd-swipe-action>-->
+<!--      </wd-card>-->
     </view>
   </z-paging>
 </template>
 
 <script setup lang="ts">
-import { onMounted, getCurrentInstance, ref } from 'vue'
 import { useToast, useMessage } from 'wot-design-uni'
 import { getRepairReqList, delRepairReq } from '@/service/repair'
 import { DICT_REPAIR_REQ_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict'
 import dayjs from "dayjs";
+import { isEquAdmin, isRepair } from "@/utils/RoleUtils";
+import { useUserStore } from "@/store";
+import ReqCard from "@/components/repair/req-card.vue";
 
+const userStore = useUserStore()
 const message = useMessage()
 const toast = useToast()
 // 鎶ヤ慨鍗曠被鍨�
@@ -180,31 +189,38 @@
   const queryParams: any = {
     pageNum,
     pageSize,
-    reqType: reqTypeId.value,
-    status: status.value,
+    params: {},
   }
-  if (reqTypeId.value === -1) {
-    delete queryParams.reqType
-  }
-  if (status.value === -1) {
-    delete queryParams.status
-  }
+  // if (reqTypeId.value === -1) {
+  //   delete queryParams.reqType
+  // }
+  // if (status.value === -1) {
+  //   delete queryParams.status
+  // }
+  //
+  // if (filterDate.value === '1') {
+  //   // 鑾峰彇褰撳墠鏃ユ湡
+  //   const now = dayjs()
+  //   queryParams.params = {
+  //     beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'),
+  //     endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'),
+  //   }
+  // } else if (filterDate.value === '2') {
+  //   const now = dayjs()
+  //   queryParams.params = {
+  //     beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'),
+  //     endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
+  //   }
+  // } else {
+  //   delete queryParams.params
+  // }
 
-  if (filterDate.value === '1') {
-    // 鑾峰彇褰撳墠鏃ユ湡
-    const now = dayjs()
-    queryParams.params = {
-      beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'),
-      endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'),
-    }
-  } else if (filterDate.value === '2') {
-    const now = dayjs()
-    queryParams.params = {
-      beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'),
-      endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
-    }
-  } else {
-    delete queryParams.params
+  // 鏌ヨ鏈畬鎴愮殑鎶ヤ慨鍗�
+  queryParams.params.status = '0,1,2'
+  queryParams.reqUser = userStore?.userInfo?.userId
+  if (isRepair() || isEquAdmin()) {
+    queryParams.params.status = '0'
+    queryParams.reqUser = undefined
   }
 
   getRepairReqList(queryParams)
@@ -330,10 +346,10 @@
 
 onLoad(() => {
   initData()
-  uni.$on('req-list-refresh', reloadData)
+  uni.$on('list-refresh', reloadData)
 })
 onUnload(() => {
-  uni.$off('req-list-refresh', reloadData)
+  uni.$off('list-refresh', reloadData)
 })
 </script>
 

--
Gitblit v1.9.3