From 7fe7b6182c2d407d28c2c9da1c070c3ce964e3e7 Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期二, 20 五月 2025 10:49:14 +0800
Subject: [PATCH] 1.移动端添加自定义navbar导航栏
---
eims-ui-mobile/src/layouts/default.vue | 4
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java | 6
eims-ui-mobile/src/pages/my/index.vue | 8
eims-ui-mobile/src/pages/inspect/insp-st.vue | 34 ++
eims-ui-mobile/src/pages/repair/res-list.vue | 94 +++++--
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java | 2
eims-ui-mobile/src/pages/repair/repair-add.vue | 51 +--
eims-ui-mobile/src/pages/maint/order-detail.vue | 129 +++++-----
eims-ui-mobile/src/pages/maint/maint-order.vue | 45 +-
eims-ui-mobile/src/pages/maint/maint-st.vue | 37 ++
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java | 3
eims-ui-mobile/src/pages.json | 108 --------
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java | 3
eims-ui-mobile/src/pages/equ/equ-list.vue | 17 +
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java | 3
eims-ui-mobile/src/pages/home/index.vue | 1
eims-ui-mobile/src/pages/inspect/insp-record.vue | 42 +-
eims-ui-mobile/src/pages/repair/req-list.vue | 102 +++++--
18 files changed, 364 insertions(+), 325 deletions(-)
diff --git a/eims-ui-mobile/src/layouts/default.vue b/eims-ui-mobile/src/layouts/default.vue
index 768d875..35dc7a5 100644
--- a/eims-ui-mobile/src/layouts/default.vue
+++ b/eims-ui-mobile/src/layouts/default.vue
@@ -13,5 +13,9 @@
// colorTheme: 'red',
// buttonPrimaryBgColor: '#07c160',
// buttonPrimaryColor: '#07c160',
+ navbarColor: '#FFFFFF',
+ navbarDescFontColor: '#FFFFFF',
+ navbarTitleFontSize: '16px',
+ navbarDescFontSize: '14px',
}
</script>
diff --git a/eims-ui-mobile/src/pages.json b/eims-ui-mobile/src/pages.json
index 6bc5e7e..08bf8fa 100644
--- a/eims-ui-mobile/src/pages.json
+++ b/eims-ui-mobile/src/pages.json
@@ -69,7 +69,8 @@
"layout": "default",
"needLogin": true,
"style": {
- "navigationBarTitleText": "璁惧鍒楄〃"
+ "navigationBarTitleText": "璁惧鍒楄〃",
+ "navigationStyle": "custom"
}
},
{
@@ -105,22 +106,7 @@
"needLogin": true,
"style": {
"navigationBarTitleText": "鐐规璁板綍",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鎻愪氦",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationStyle": "custom"
}
},
{
@@ -147,22 +133,7 @@
"needLogin": true,
"style": {
"navigationBarTitleText": "淇濆吇宸ュ崟",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鎻愪氦",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationStyle": "custom"
}
},
{
@@ -181,22 +152,7 @@
"needLogin": true,
"style": {
"navigationBarTitleText": "宸ュ崟鏄庣粏",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鎻愪氦",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationStyle": "custom"
}
},
{
@@ -212,24 +168,10 @@
"path": "pages/repair/repair-add",
"type": "page",
"layout": "default",
+ "needLogin": true,
"style": {
"navigationBarTitleText": "娣诲姞鎶ヤ慨",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鎻愪氦",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationStyle": "custom"
}
},
{
@@ -263,23 +205,8 @@
"layout": "default",
"needLogin": true,
"style": {
- "navigationBarTitleText": "璁惧鎶ヤ慨",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鏂板",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationBarTitleText": "鎶ヤ慨鍒楄〃",
+ "navigationStyle": "custom"
}
},
{
@@ -314,22 +241,7 @@
"needLogin": true,
"style": {
"navigationBarTitleText": "璁惧缁翠慨",
- "app-plus": {
- "titleNView": {
- "buttons": [
- {
- "text": "鎺ュ崟",
- "fontSize": "14px",
- "color": "#FFFFFF"
- },
- {
- "text": "",
- "fontSize": "24px",
- "color": "#FFFFFF"
- }
- ]
- }
- }
+ "navigationStyle": "custom"
}
},
{
diff --git a/eims-ui-mobile/src/pages/equ/equ-list.vue b/eims-ui-mobile/src/pages/equ/equ-list.vue
index ecd0923..e185716 100644
--- a/eims-ui-mobile/src/pages/equ/equ-list.vue
+++ b/eims-ui-mobile/src/pages/equ/equ-list.vue
@@ -2,14 +2,19 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '璁惧鍒楄〃',
- },
+ style: { navigationBarTitleText: '璁惧鍒楄〃', navigationStyle: 'custom' },
}
</route>
<template>
- <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
+ <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
<template #top>
+ <wd-navbar
+ title="璁惧鍒楄〃"
+ left-arrow
+ @click-left="goBack"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ ></wd-navbar>
<wd-drop-menu>
<wd-drop-menu-item
v-model="equTypeId"
@@ -123,6 +128,10 @@
})
}
+const goBack = () => {
+ uni.navigateBack()
+}
+
/**
* 璁惧鏉$洰鐐瑰嚮浜嬩欢
* @param item
diff --git a/eims-ui-mobile/src/pages/home/index.vue b/eims-ui-mobile/src/pages/home/index.vue
index 54b0029..5bac502 100644
--- a/eims-ui-mobile/src/pages/home/index.vue
+++ b/eims-ui-mobile/src/pages/home/index.vue
@@ -95,6 +95,7 @@
v-for="(item, index) in commonMenu"
:key="item.id"
@click.stop="goItemPage(item)"
+ v-show="!(isLeader() && item.custom)"
>
<image class="slot-img text-center" :src="item.icon" />
<text>{{ item.name }}</text>
diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue
index fb20b64..d979f18 100644
--- a/eims-ui-mobile/src/pages/inspect/insp-record.vue
+++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -2,30 +2,25 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '鐐规璁板綍',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鎻愪氦',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ style: { navigationBarTitleText: '鐐规璁板綍', navigationStyle: 'custom' },
}
</route>
<template>
<z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time>
<template #top>
+ <wd-navbar
+ title="鐐规璁板綍"
+ left-arrow
+ @click-left="goBack"
+ right-text="鎻愪氦"
+ @click-right="handleClickRight"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ >
+ <template #right>
+ <text v-if="isOperatorOrRepair()" class="text-white">鎻愪氦</text>
+ </template>
+ </wd-navbar>
<wd-card type="rectangle">
<template #title>
<view class="flex justify-between">
@@ -141,6 +136,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store'
+import { isLeader, isOperatorOrRepair } from "@/utils/RoleUtils";
import {
getInspStRecordList,
getInspSt,
@@ -227,11 +223,13 @@
const goBack = () => {
uni.navigateBack()
}
-onNavigationBarButtonTap((e) => {
- if (e.index === 0) {
+
+function handleClickRight() {
+ if(isOperatorOrRepair()){
handleConfirm()
}
-})
+
+}
const toggleCollapse = () => {
isAllExpanded.value = !isAllExpanded.value
diff --git a/eims-ui-mobile/src/pages/inspect/insp-st.vue b/eims-ui-mobile/src/pages/inspect/insp-st.vue
index ee381b4..9e495be 100644
--- a/eims-ui-mobile/src/pages/inspect/insp-st.vue
+++ b/eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -13,6 +13,11 @@
<template #top>
<wd-drop-menu>
<wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" />
+ <wd-drop-menu-item
+ v-model="filterDate"
+ :options="filterDateList"
+ @change="handleFilterDate"
+ />
<wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
</wd-drop-menu>
</template>
@@ -61,9 +66,7 @@
<text class="ml-1">杩涜涓�</text>
</template>
</view>
- <view class="text-color-gray text-xs mt-2 flex">
- 鍒涘缓鏃堕棿: {{item.createTime}}
- </view>
+ <view class="text-color-gray text-xs mt-2 flex">鍒涘缓鏃堕棿: {{ item.createTime }}</view>
</view>
<wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">鏄庣粏</wd-button>
</view>
@@ -75,15 +78,21 @@
<script setup lang="ts">
import { ref } from 'vue'
import { getInspStList } from '@/service/inspect'
-import { onShow } from '@dcloudio/uni-app'
+import dayjs from 'dayjs'
const viewMode = ref<string>('Day')
const equName = ref<string>('鎵�鏈夎澶�')
+const filterDate = ref<string>('1')
const viewModeList = ref<Record<string, any>[]>([
{ label: '鏃ヨ鍥�', value: 'Day' },
{ label: '鏈堣鍥�', value: 'Month' },
])
+const filterDateList = ref<Record<string, any>[]>([
+ { label: '鎵�鏈夋暟鎹�', value: '0' },
+ { label: '褰撳ぉ(鏈�)鏁版嵁', value: '1' },
+])
+
const equList = ref<Record<string, any>[]>([{ label: '鎵�鏈夎澶�', value: '鎵�鏈夎澶�' }])
function handleViewMode({ value }) {
reloadData()
@@ -91,14 +100,25 @@
function handleEquName({ value }) {
console.log(value)
}
+function handleFilterDate({ value }) {
+ reloadData()
+}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
- // 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲
- // 杩欓噷鐨勮姹傚彧鏄紨绀猴紝璇锋浛鎹㈡垚鑷繁鐨勯」鐩殑缃戠粶璇锋眰锛屽苟鍦ㄧ綉缁滆姹傚洖璋冧腑閫氳繃paging.value.complete(璇锋眰鍥炴潵鐨勬暟缁�)灏嗚姹傜粨鏋滀紶缁檢-paging
- getInspStList({ pageNum, pageSize, viewMode: viewMode.value })
+ const params: any = {
+ pageNum,
+ pageSize,
+ viewMode: viewMode.value,
+ }
+ if (filterDate.value === '1') {
+ params.planTime = dayjs().format('YYYY-MM-DD')
+ } else {
+ delete params.planTime
+ }
+ getInspStList(params)
.then((res: any) => {
// 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡
paging.value.completeByTotal(res.rows, res.total)
diff --git a/eims-ui-mobile/src/pages/maint/maint-order.vue b/eims-ui-mobile/src/pages/maint/maint-order.vue
index e87f216..7f2da57 100644
--- a/eims-ui-mobile/src/pages/maint/maint-order.vue
+++ b/eims-ui-mobile/src/pages/maint/maint-order.vue
@@ -2,25 +2,7 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '淇濆吇宸ュ崟',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鎻愪氦',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ style: { navigationBarTitleText: '淇濆吇宸ュ崟', navigationStyle: 'custom' },
}
</route>
@@ -33,6 +15,19 @@
show-refresher-update-time
>
<template #top>
+ <wd-navbar
+ title="淇濆吇宸ュ崟"
+ left-arrow
+ @click-left="goBack"
+ right-text="鎻愪氦"
+ @click-right="handleClickRight"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ >
+ <template #right>
+ <text v-if="isOperatorOrRepair()" class="text-white">鎻愪氦</text>
+ </template>
+ </wd-navbar>
<wd-cell>
<template #title>
<text class="text-color-gray">璁惧</text>
@@ -434,11 +429,17 @@
function reloadData() {
initMaintSt(maintStId.value)
}
-onNavigationBarButtonTap((e) => {
- if (e.index === 0) {
+
+const goBack = () => {
+ uni.navigateBack()
+}
+
+function handleClickRight() {
+ if(isOperatorOrRepair()){
handleUpdateMaintSt()
}
-})
+
+}
onLoad(() => {
uni.$on('maint-order-refresh', reloadData)
diff --git a/eims-ui-mobile/src/pages/maint/maint-st.vue b/eims-ui-mobile/src/pages/maint/maint-st.vue
index 5abc99f..c535f0b 100644
--- a/eims-ui-mobile/src/pages/maint/maint-st.vue
+++ b/eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -13,6 +13,11 @@
<template #top>
<wd-drop-menu>
<wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
+ <wd-drop-menu-item
+ v-model="filterDate"
+ :options="filterDateList"
+ @change="handleFilterDate"
+ />
<wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" />
</wd-drop-menu>
</template>
@@ -73,6 +78,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { getMaintStList } from '@/service/maint'
+import dayjs from 'dayjs'
/**
* 鍏朵粬椤甸潰浼犺繃鏉ョ殑鏁版嵁
@@ -90,6 +96,7 @@
assetNo?: string
equName?: string
status?: string
+ params?: NonNullable<unknown>
}
// 椤甸潰鍙傛暟锛屼笂涓〉闈紶閫掕繃鏉ョ殑鍙傛暟
@@ -99,6 +106,12 @@
})
const status = ref<string>('-1')
const equName = ref<string>('-1')
+const filterDate = ref<string>('1')
+
+const filterDateList = ref<Record<string, any>[]>([
+ { label: '鎵�鏈夋暟鎹�', value: '0' },
+ { label: '褰撴湀鏁版嵁', value: '1' },
+])
const statusList = ref<Record<string, any>[]>([
{ label: '鎵�鏈夌姸鎬�', value: '-1' },
@@ -112,6 +125,9 @@
function handleEquName({ value }) {
console.log(value)
}
+function handleFilterDate({ value }) {
+ reloadData()
+}
const paging = ref(null)
const dataList = ref([])
@@ -119,24 +135,35 @@
const queryList = (pageNum?: number, pageSize?: number) => {
// 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲
// 杩欓噷鐨勮姹傚彧鏄紨绀猴紝璇锋浛鎹㈡垚鑷繁鐨勯」鐩殑缃戠粶璇锋眰锛屽苟鍦ㄧ綉缁滆姹傚洖璋冧腑閫氳繃paging.value.complete(璇锋眰鍥炴潵鐨勬暟缁�)灏嗚姹傜粨鏋滀紶缁檢-paging
- const params: QueryParams = {
+ const queryParams: QueryParams = {
pageNum,
pageSize,
equName: equName.value,
status: status.value,
}
+ if (filterDate.value === '1') {
+ // 鑾峰彇褰撳墠鏃ユ湡
+ const now = dayjs()
+ queryParams.params = {
+ beginPlanTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'),
+ endPlanTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
+ }
+ } else {
+ delete queryParams.params
+ }
+
if (equName.value === '-1') {
- delete params.equName
+ delete queryParams.equName
}
if (status.value === '-1') {
- delete params.status
+ delete queryParams.status
}
// 濡傛灉鏄粠鎵爜椤甸潰杩囨潵锛屽彧鑳芥煡璇㈠浐瀹氳澶囩殑鏁版嵁
if (option?.from === 'scan') {
- params.assetNo = option.assetNo
+ queryParams.assetNo = option.assetNo
}
- getMaintStList(params)
+ getMaintStList(queryParams)
.then((res: any) => {
// 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡
paging.value.completeByTotal(res.rows, res.total)
diff --git a/eims-ui-mobile/src/pages/maint/order-detail.vue b/eims-ui-mobile/src/pages/maint/order-detail.vue
index 9823cd4..e9571df 100644
--- a/eims-ui-mobile/src/pages/maint/order-detail.vue
+++ b/eims-ui-mobile/src/pages/maint/order-detail.vue
@@ -2,29 +2,25 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '宸ュ崟鏄庣粏',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鎻愪氦',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ style: { navigationBarTitleText: '宸ュ崟鏄庣粏', navigationStyle: 'custom' },
}
</route>
<template>
<view class="bg-base container" safeAreaInsetTopBottom>
+ <wd-navbar
+ title="淇濆吇宸ュ崟"
+ left-arrow
+ @click-left="goBack"
+ right-text="鎻愪氦"
+ @click-right="handleClickRight"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ >
+ <template #right>
+ <text v-if="isOperatorOrRepair()" class="text-white">鎻愪氦</text>
+ <text v-else-if="isLeader()" class="text-white">楠岃瘉</text>
+ </template>
+ </wd-navbar>
<wd-form ref="form" :model="order" :rules="rules">
<wd-cell-group custom-class="group" title="璁惧淇℃伅" border>
<wd-cell title="璁惧鍚嶇О" title-width="200rpx" is-link>
@@ -199,7 +195,7 @@
toast.success('鎿嶄綔鎴愬姛')
}
-function handleClickRight(data: any) {
+function handleSubmit(data: any) {
message
.confirm({
msg: '纭畾鎻愪氦锛�',
@@ -214,55 +210,56 @@
})
}
-onNavigationBarButtonTap((e) => {
- if (e.index === 0) {
- // 绠$悊鍛樿鑹� 涓斿緟楠岃瘉鐘舵��
- if (isLeader()) {
- switch (order.status) {
- case '0':
- case '1':
- toast.warning('褰撳墠宸ュ崟绛夊緟鎿嶄綔宸ヤ繚鍏荤姸鎬侊紝涓嶅彲鎿嶄綔')
- break
- case '2':
- // 鍕鹃�夐獙璇侊紝鍙彁浜�
- if (isVerify.value) {
- // 淇敼宸ュ崟鐘舵�佷负宸插畬鎴�
- const data: any = Object.assign({}, { id: order.id, status: order.status })
- data.status = '3'
- handleClickRight(data)
- } else {
- toast.warning('璇烽�夋嫨鏄惁楠岃瘉閫氳繃')
+const goBack = () => {
+ uni.navigateBack()
+}
+function handleClickRight() {
+ // 绠$悊鍛樿鑹� 涓斿緟楠岃瘉鐘舵��
+ if (isLeader()) {
+ switch (order.status) {
+ case '0':
+ case '1':
+ toast.warning('褰撳墠宸ュ崟绛夊緟鎿嶄綔宸ヤ繚鍏荤姸鎬侊紝涓嶅彲鎿嶄綔')
+ break
+ case '2':
+ // 鍕鹃�夐獙璇侊紝鍙彁浜�
+ if (isVerify.value) {
+ // 淇敼宸ュ崟鐘舵�佷负宸插畬鎴�
+ const data: any = Object.assign({}, { id: order.id, status: order.status })
+ data.status = '3'
+ handleSubmit(data)
+ } else {
+ toast.warning('璇烽�夋嫨鏄惁楠岃瘉閫氳繃')
+ }
+ break
+ case '3':
+ toast.warning('褰撳墠宸ュ崟瀹屾垚鐘舵�侊紝涓嶅彲鎿嶄綔')
+ break
+ }
+ } else if (isOperatorOrRepair()) {
+ switch (order.status) {
+ case '0':
+ break
+ case '1':
+ {
+ const data = Object.assign({}, order)
+ // 鍕鹃�夊伐鍗曞畬鎴愶紝鏀瑰彉鐘舵��
+ if (isFinish.value) {
+ // 淇敼宸ュ崟鐘舵�佷负寰呴獙璇�
+ data.status = '2'
}
- break
- case '3':
- toast.warning('褰撳墠宸ュ崟瀹屾垚鐘舵�侊紝涓嶅彲鎿嶄綔')
- break
- }
- } else if (isOperatorOrRepair()) {
- switch (order.status) {
- case '0':
- break
- case '1':
- {
- const data = Object.assign({}, order)
- // 鍕鹃�夊伐鍗曞畬鎴愶紝鏀瑰彉鐘舵��
- if (isFinish.value) {
- // 淇敼宸ュ崟鐘舵�佷负寰呴獙璇�
- data.status = '2'
- }
- handleClickRight(data)
- }
- break
- case '2':
- toast.warning('褰撳墠宸ュ崟绛夊緟绠$悊楠岃瘉鐘舵�侊紝涓嶅彲鎿嶄綔')
- break
- case '3':
- toast.warning('褰撳墠宸ュ崟瀹屾垚鐘舵�侊紝涓嶅彲鎿嶄綔')
- break
- }
+ handleSubmit(data)
+ }
+ break
+ case '2':
+ toast.warning('褰撳墠宸ュ崟绛夊緟绠$悊楠岃瘉鐘舵�侊紝涓嶅彲鎿嶄綔')
+ break
+ case '3':
+ toast.warning('褰撳墠宸ュ崟瀹屾垚鐘舵�侊紝涓嶅彲鎿嶄綔')
+ break
}
}
-})
+}
onMounted(() => {})
onLoad((options) => {
diff --git a/eims-ui-mobile/src/pages/my/index.vue b/eims-ui-mobile/src/pages/my/index.vue
index 8a5bd92..41c97d5 100644
--- a/eims-ui-mobile/src/pages/my/index.vue
+++ b/eims-ui-mobile/src/pages/my/index.vue
@@ -11,12 +11,12 @@
<template>
<view class="bg-base">
<wd-cell-group border>
- <wd-cell title="鐧诲綍鐢ㄦ埛" :value="realName" icon="user" is-link />
- <wd-cell title="瑙掕壊" :value="loginRoleName()" icon="bags" is-link />
- <wd-cell title="浜哄憳绠$悊" icon="usergroup" is-link @click="handleInfo" />
+ <wd-cell title="鐧诲綍鐢ㄦ埛" :value="realName" icon="user" custom-icon-class="icon-color-base" is-link />
+ <wd-cell title="瑙掕壊" :value="loginRoleName()" icon="bags" custom-icon-class="icon-color-base" is-link />
+ <wd-cell title="浜哄憳绠$悊" icon="usergroup" is-link custom-icon-class="icon-color-base" @click="handleInfo" />
</wd-cell-group>
<wd-cell-group border class="mt-2">
- <wd-cell title="閫�鍑虹櫥褰�" icon="login" is-link @click="handleLogout" />
+ <wd-cell title="閫�鍑虹櫥褰�" icon="login" is-link custom-icon-class="icon-color-base" @click="handleLogout" />
</wd-cell-group>
</view>
</template>
diff --git a/eims-ui-mobile/src/pages/repair/repair-add.vue b/eims-ui-mobile/src/pages/repair/repair-add.vue
index 05718e4..2a2778c 100644
--- a/eims-ui-mobile/src/pages/repair/repair-add.vue
+++ b/eims-ui-mobile/src/pages/repair/repair-add.vue
@@ -1,30 +1,22 @@
<route lang="json5" type="page">
{
layout: 'default',
- style: {
- navigationBarTitleText: '娣诲姞鎶ヤ慨',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鎻愪氦',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ needLogin: true,
+ style: { navigationBarTitleText: '娣诲姞鎶ヤ慨', navigationStyle: 'custom' },
}
</route>
<template>
<view class="bg-base">
+ <wd-navbar
+ title="娣诲姞鎶ヤ慨"
+ left-arrow
+ @click-left="goBack"
+ right-text="鎻愪氦"
+ @click-right="handleSubmit"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ ></wd-navbar>
<wd-form ref="form" :model="model">
<wd-cell-group custom-class="group" title="绫诲瀷淇℃伅" border>
<wd-picker
@@ -243,12 +235,14 @@
fixtureName: '',
fileList: [],
})
-
+const goBack = () => {
+ uni.navigateBack()
+}
/**
* 閫夋嫨璁惧
*/
function handleSelectEqu() {
- if(reqTypeDis.value){
+ if (reqTypeDis.value) {
return false
}
uni.navigateTo({
@@ -387,20 +381,17 @@
/**
* 閫夋嫨鎶ヤ慨绫诲瀷
*/
-function handleConfirmReqType({ value }) {
-}
+function handleConfirmReqType({ value }) {}
/**
* 閫夋嫨鏁呴殰绫诲埆
*/
-function handleConfirmFaultType({ value }) {
-}
+function handleConfirmFaultType({ value }) {}
/**
* 閫夋嫨绱ф�ョ▼搴�
*/
-function handleConfirmUrgencyLevel({ value }) {
-}
+function handleConfirmUrgencyLevel({ value }) {}
async function initData() {
const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE)
@@ -412,12 +403,6 @@
const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL)
urgencyList.value = uList
}
-
-onNavigationBarButtonTap((e) => {
- if (e.index === 0) {
- handleSubmit()
- }
-})
onLoad((options) => {
Object.assign(option, options)
diff --git a/eims-ui-mobile/src/pages/repair/req-list.vue b/eims-ui-mobile/src/pages/repair/req-list.vue
index 54209d6..4db9c85 100644
--- a/eims-ui-mobile/src/pages/repair/req-list.vue
+++ b/eims-ui-mobile/src/pages/repair/req-list.vue
@@ -2,30 +2,27 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '璁惧鎶ヤ慨',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鏂板',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ style: { navigationBarTitleText: '鎶ヤ慨鍒楄〃', navigationStyle: 'custom' },
}
</route>
<template>
- <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time>
+ <z-paging
+ ref="paging"
+ v-model="dataList"
+ :auto="false"
+ @query="queryList"
+ show-refresher-update-time
+ >
<template #top>
+ <wd-navbar
+ title="鎶ヤ慨鍒楄〃"
+ left-arrow
+ @click-left="goBack"
+ right-text="鏂板"
+ @click-right="handleClickRight"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ ></wd-navbar>
<wd-drop-menu v-if="!isSelectReq">
<wd-drop-menu-item
v-model="reqTypeId"
@@ -33,6 +30,11 @@
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"
@@ -138,6 +140,7 @@
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";
const message = useMessage()
const toast = useToast()
@@ -148,6 +151,14 @@
const isSelectReq = ref(false)
+const filterDate = ref<string>('2')
+
+const filterDateList = ref<Record<string, any>[]>([
+ { label: '鎵�鏈夋暟鎹�', value: '0' },
+ { label: '褰撳ぉ鏁版嵁', value: '1' },
+ { label: '褰撴湀鏁版嵁', value: '2' },
+])
+
const reqTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: -1 }])
const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: -1 }])
function handleReqType({ value }) {
@@ -156,25 +167,47 @@
function handleReqStatu({ value }) {
reloadData()
}
+function handleFilterDate({ value }) {
+ reloadData()
+}
+
+
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
- const parmams = {
+ const queryParams: any = {
pageNum,
pageSize,
reqType: reqTypeId.value,
status: status.value,
}
if (reqTypeId.value === -1) {
- delete parmams.reqType
+ delete queryParams.reqType
}
if (status.value === -1) {
- delete parmams.status
+ delete queryParams.status
}
- getRepairReqList(parmams)
+ 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
+ }
+
+ getRepairReqList(queryParams)
.then((res: any) => {
paging.value.completeByTotal(res.rows, res.total)
})
@@ -246,13 +279,20 @@
})
}
-onNavigationBarButtonTap((e) => {
- if (e.index === 0 && !isSelectReq.value) {
- uni.navigateTo({
- url: `/pages/repair/repair-add`,
- })
- }
-})
+const goBack = () => {
+ uni.navigateBack()
+}
+function handleClickRight() {
+ // if (e.index === 0 && !isSelectReq.value) {
+ // uni.navigateTo({
+ // url: `/pages/repair/repair-add`,
+ // })
+ // }
+
+ uni.navigateTo({
+ url: `/pages/repair/repair-add`,
+ })
+}
const eventChannel = ref<any>()
onMounted(() => {
diff --git a/eims-ui-mobile/src/pages/repair/res-list.vue b/eims-ui-mobile/src/pages/repair/res-list.vue
index 02b2570..087fb22 100644
--- a/eims-ui-mobile/src/pages/repair/res-list.vue
+++ b/eims-ui-mobile/src/pages/repair/res-list.vue
@@ -2,30 +2,25 @@
{
layout: 'default',
needLogin: true,
- style: {
- navigationBarTitleText: '璁惧缁翠慨',
- 'app-plus': {
- titleNView: {
- buttons: [
- {
- text: '鎺ュ崟',
- fontSize: '14px',
- color: '#FFFFFF',
- },
- {
- text: '',
- fontSize: '24px',
- color: '#FFFFFF',
- },
- ],
- },
- },
- },
+ style: { navigationBarTitleText: '璁惧缁翠慨', navigationStyle: 'custom' },
}
</route>
<template>
<z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
<template #top>
+ <wd-navbar
+ title="璁惧缁翠慨"
+ left-arrow
+ @click-left="goBack"
+ right-text="鎻愪氦"
+ @click-right="handleClickRight"
+ custom-style="background: #4D80F0;"
+ safeAreaInsetTop
+ >
+ <template #right>
+ <text v-if="isOperatorOrRepair()" class="text-white">鎺ュ崟</text>
+ </template>
+ </wd-navbar>
<wd-drop-menu>
<wd-drop-menu-item
v-model="resTypeId"
@@ -33,6 +28,11 @@
value-key="dictValue"
:options="resTypeList"
@change="handleResType"
+ />
+ <wd-drop-menu-item
+ v-model="filterDate"
+ :options="filterDateList"
+ @change="handleFilterDate"
/>
<wd-drop-menu-item
v-model="status"
@@ -195,6 +195,7 @@
import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils'
import { useUserStore } from '@/store'
import { formatDate } from '@/utils/DateUtils'
+import dayjs from "dayjs";
const userStore = useUserStore()
const message = useMessage()
@@ -222,7 +223,13 @@
const status = ref<number>(-1)
const isSelectRes = ref(false)
+const filterDate = ref<string>('2')
+const filterDateList = ref<Record<string, any>[]>([
+ { label: '鎵�鏈夋暟鎹�', value: '0' },
+ { label: '褰撳ぉ鏁版嵁', value: '1' },
+ { label: '褰撴湀鏁版嵁', value: '2' },
+])
const resTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: -1 }])
const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: -1 }])
function handleResType({ value }) {
@@ -231,28 +238,48 @@
function handleResStatu({ value }) {
reloadData()
}
+function handleFilterDate({ value }) {
+ reloadData()
+}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
- const params: any = {
+ const queryParams: any = {
pageNum,
pageSize,
reqType: resTypeId.value,
status: status.value,
}
if (resTypeId.value === -1) {
- delete params.reqType
+ delete queryParams.reqType
}
if (status.value === -1) {
- delete params.status
+ 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 (option?.from === 'scan') {
- params.assetNo = option.assetNo
+ queryParams.assetNo = option.assetNo
}
- getRepairResList(params)
+ getRepairResList(queryParams)
.then((res: any) => {
paging.value.completeByTotal(res.rows, res.total)
})
@@ -330,16 +357,17 @@
url: `/pages/repair/repair-fb?id=${item.id}`,
})
}
-
-onNavigationBarButtonTap((e) => {
- if (e.index === 0) {
- if (isLeader()) {
- toast.info('璇风櫥褰曠淮淇伐璐﹀彿鎺ュ崟')
- } else if (isOperatorOrRepair()) {
- handleSelectReq()
- }
+const goBack = () => {
+ uni.navigateBack()
+}
+function handleClickRight() {
+ if (isLeader()) {
+ toast.info('璇风櫥褰曠淮淇伐璐﹀彿鎺ュ崟')
+ } else if (isOperatorOrRepair()) {
+ handleSelectReq()
}
-})
+}
+
/**
* 閫夋嫨鎶ヤ慨鍗�
diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java
index aa8a890..a5acf40 100644
--- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java
+++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java
@@ -6,6 +6,7 @@
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
@@ -46,6 +47,8 @@
/**
* 璁″垝鏃堕棿
*/
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd")
private Date planTime;
/**
diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java
index fefd0ef..d509485 100644
--- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java
+++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java
@@ -11,6 +11,7 @@
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
/**
* 鐐规姹囨�讳笟鍔″璞� eims_inspect_st
@@ -48,6 +49,8 @@
/**
* 璁″垝鏃堕棿
*/
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd")
private Date planTime;
/**
diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java
index 66703cd..f9c89c9 100644
--- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java
+++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java
@@ -2,6 +2,7 @@
import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
@@ -58,6 +59,7 @@
* 璁″垝鏃堕棿
*/
@ExcelProperty(value = "璁″垝鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
private Date planTime;
private String planTimeStr;
diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java
index 199219d..0f7a628 100644
--- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java
+++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.dromara.common.core.constant.DictConstants;
+import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -244,6 +245,11 @@
qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle());
qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName());
qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo());
+ if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Day")){
+ qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m-%d')", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,bo.getPlanTime()));
+ }else if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Month")){
+ qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m')", DateUtils.parseDateToStr(DateUtils.YYYY_MM,bo.getPlanTime()));
+ }
qw.eq( "st.type", bo.getType());
qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null,
"st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime"));
diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java
index dd6e024..ffdb5d5 100644
--- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java
+++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java
@@ -303,6 +303,9 @@
qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser());
qw.eq(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo());
+ qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null,
+ "req.req_time", params.get("beginReqTime"), params.get("endReqTime"));
+
List<Long> resDeptIds = getAllDescendantIds(bo.getResDept());
qw.in(bo.getResDept() != null, "res.res_dept", resDeptIds);
--
Gitblit v1.9.3