From 1b245806287666bd28a5c87aa2c48f67cd23b840 Mon Sep 17 00:00:00 2001
From: huangchenhao <123673748@qq.com>
Date: Thu, 20 Nov 2025 16:27:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=86=B0=E9=9B=AAApp=20=E4=BA=BA=E5=91=98?=
=?UTF-8?q?=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/mobile/src/router/index.js | 9 +-
.../src/views/Equipment/EquipmentDetails.vue | 4 +-
packages/mobile/src/views/Home.vue | 89 ++--
.../src/views/IceEvent/IceEventDetails.vue | 18 +-
.../src/views/Material/MaterialDetails.vue | 4 +-
.../src/views/Material/MaterialManagement.vue | 2 +-
.../mobile/src/views/Staff/StaffDetail.vue | 239 ++++++++++
.../src/views/Staff/StaffManagement.vue | 419 +++++++++++++-----
8 files changed, 618 insertions(+), 166 deletions(-)
create mode 100644 packages/mobile/src/views/Staff/StaffDetail.vue
diff --git a/packages/mobile/src/router/index.js b/packages/mobile/src/router/index.js
index 839ee21..b0b6a6a 100644
--- a/packages/mobile/src/router/index.js
+++ b/packages/mobile/src/router/index.js
@@ -22,10 +22,15 @@ const routes = [
component: () => import('../views/Material/MaterialManagement.vue')
},
{
- path: '/staffManage',
+ path: '/staffManage/:data',
name: 'StaffManage',
component: () => import('../views/Staff/StaffManagement.vue')
},
+ {
+ path: '/staffDetail/:data',
+ name: 'StaffDetail',
+ component: () => import('../views/Staff/StaffDetail.vue')
+ },
{
path: '/equipDetail/:data',
name: 'EquipDetail',
@@ -37,7 +42,7 @@ const routes = [
component: () => import('../views/Material/MaterialDetails.vue')
},
{
- path: '/iceEventManage/:data',
+ path: '/iceEventManage/:data',
name: 'IceEventManage',
component: () => import('../views/IceEvent/IceEventManagement.vue')
},
diff --git a/packages/mobile/src/views/Equipment/EquipmentDetails.vue b/packages/mobile/src/views/Equipment/EquipmentDetails.vue
index a826555..21c45a2 100644
--- a/packages/mobile/src/views/Equipment/EquipmentDetails.vue
+++ b/packages/mobile/src/views/Equipment/EquipmentDetails.vue
@@ -6,7 +6,7 @@
-
+
{
};
const equipmentInfo = ref({});
const yhzInfo = ref({});
-const equipmentDetailInfo = ref({});
+const equipmentDetailInfo = ref();
const photos = ref([]);
const statusList = ref([]);
diff --git a/packages/mobile/src/views/Home.vue b/packages/mobile/src/views/Home.vue
index 0fa0a70..eb7fce9 100644
--- a/packages/mobile/src/views/Home.vue
+++ b/packages/mobile/src/views/Home.vue
@@ -3,7 +3,7 @@
-
+
@@ -13,7 +13,7 @@
text="设备管理"
:to="{
name: 'EquipManage',
- params: { data: encodeURIComponent(JSON.stringify(detailData)) },
+ params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
}"
/>
+
-
-
-
+
@@ -52,32 +73,11 @@ import { showToast } from "vant";
import { request } from "../../../shared/utils/request";
const router = useRouter();
-const active = ref(0);
-const detailData = ref({});
const yhzinfo = ref({});
-// 获取养护站详情
-const getYHZDetail = async () => {
- try {
- const res = await request({
- url: `/snow-ops-platform/yhz/getById?id=${yhzinfo.value.id}`,
- method: "GET",
- });
- if (res.code && res.code === "00000") {
- detailData.value = res.data;
- } else {
- throw new Error(res.message);
- }
- } catch (error) {
- showToast({
- message: error.message,
- type: "error",
- });
- }
-};
-
const route = useRoute();
const token = route.query.token;
+const YHZConfirmpopup = ref(false);
// 获取当前登录用于就职的养护站信息
const getYHZinfo = async () => {
@@ -99,6 +99,10 @@ const getYHZinfo = async () => {
}
};
+const onYHZConfirmClose = () => {
+ YHZConfirmpopup.value = false;
+};
+
onMounted(async () => {
if (token) {
localStorage.setItem("token", token);
@@ -107,7 +111,12 @@ onMounted(async () => {
});
}
await getYHZinfo();
- await getYHZDetail();
+ if (
+ yhzinfo.value.isManager &&
+ (yhzinfo.value.jd === "" || yhzinfo.value.wd === "")
+ ) {
+ YHZConfirmpopup.value = true;
+ }
});
const goToUser = () => {
@@ -117,7 +126,7 @@ const goToUser = () => {
diff --git a/packages/mobile/src/views/IceEvent/IceEventDetails.vue b/packages/mobile/src/views/IceEvent/IceEventDetails.vue
index 9607db8..d9209ca 100644
--- a/packages/mobile/src/views/IceEvent/IceEventDetails.vue
+++ b/packages/mobile/src/views/IceEvent/IceEventDetails.vue
@@ -6,7 +6,7 @@
-
+
@@ -106,11 +108,7 @@
"
>
-
+
@@ -138,7 +138,7 @@ const route = useRoute();
const yhzDetail = ref({});
const event = ref();
-const eventDetailData = ref({}); // 冰雪事件详情数据
+const eventDetailData = ref(); // 冰雪事件详情数据
// 获取冰雪事件详情数据
const getEventDetailData = async () => {
diff --git a/packages/mobile/src/views/Material/MaterialDetails.vue b/packages/mobile/src/views/Material/MaterialDetails.vue
index e2815b1..27b77e2 100644
--- a/packages/mobile/src/views/Material/MaterialDetails.vue
+++ b/packages/mobile/src/views/Material/MaterialDetails.vue
@@ -6,7 +6,7 @@
-
+
{
diff --git a/packages/mobile/src/views/Material/MaterialManagement.vue b/packages/mobile/src/views/Material/MaterialManagement.vue
index 7caea4b..d777c81 100644
--- a/packages/mobile/src/views/Material/MaterialManagement.vue
+++ b/packages/mobile/src/views/Material/MaterialManagement.vue
@@ -441,7 +441,7 @@ const handleGetLocation = async () => {
loadingToast.close();
} else {
loadingToast.close();
- showToast(result);
+ showToast("定位失败 请检查网络情况后重试");
console.log("result", result);
}
});
diff --git a/packages/mobile/src/views/Staff/StaffDetail.vue b/packages/mobile/src/views/Staff/StaffDetail.vue
new file mode 100644
index 0000000..4ff0e00
--- /dev/null
+++ b/packages/mobile/src/views/Staff/StaffDetail.vue
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+
+
+
+ 重置密码
+
+
+
+
+
+
+ 删除人员
+
+
+
+
+
+
+
+
+ 确认删除?
+
+
+
+
+ 取消
+
+
+ 确认
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/mobile/src/views/Staff/StaffManagement.vue b/packages/mobile/src/views/Staff/StaffManagement.vue
index 543cc94..c2e1110 100644
--- a/packages/mobile/src/views/Staff/StaffManagement.vue
+++ b/packages/mobile/src/views/Staff/StaffManagement.vue
@@ -1,129 +1,318 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+ 添加人员
+
+
+
+
+
-
-
- 添加人员
-
-
-
-
-
-
+
+
+
+
+};
+
+watch(
+ () => addSearchValue.value,
+ (newVal, oldVal) => {
+ if (newVal !== oldVal) {
+ getPersonList(newVal);
+ }
+ }
+);
+
+const onPopupClose = () => {
+ selectedUserId.value = null;
+ selectedUser.value = null;
+ addSearchValue.value = "";
+ personList.value = [];
+ showPopup.value = false;
+};
+
+// 确认添加人员
+const handleConfirmAdd = async () => {
+ try {
+ // console.log('toRaw(selectedUser.value)',toRaw(selectedUser.value));
+
+ const res = await request({
+ url: "/snow-ops-platform/yhzry/add",
+ method: "POST",
+ data: toRaw(selectedUser.value),
+ });
+ if (res.code === "00000") {
+ showToast({
+ type: "success",
+ message: "添加人员成功",
+ });
+ onPopupClose();
+ getStaffList(searchValue.value);
+ } else {
+ throw new Error(res.message);
+ }
+ } catch (error) {
+ showToast({
+ type: "fail",
+ message: error.message || "添加人员失败",
+ });
+ }
+};
+
+.home {
+ padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
+}
+
+.content {
+ padding: 16px;
+}
+
+.content .van-cell-group .van-cell {
+ margin-bottom: 10px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
+}
+
+.add-btn {
+ position: fixed;
+ bottom: 20px;
+ left: 16px;
+ right: 16px;
+ width: calc(100% - 32px);
+ margin: 0 auto;
+ border-radius: 24px;
+ font-size: 16px;
+ height: 44px;
+ z-index: 999;
+}
+
+.grid {
+ margin-top: 16px;
+}
+
+.btn {
+ margin-top: 24px;
+}
+
+.status-tag {
+ display: inline-block;
+ padding: 3px 8px;
+ border-radius: 4px;
+ color: white;
+ font-size: 12px;
+}
+.status-good {
+ background-color: #07c160;
+}
+.status-warning {
+ background-color: #ff976a;
+}
+.status-danger {
+ background-color: #ee0a24;
+}
+.popup-content {
+ padding: 16px 16px 80px 16px;
+}
+.add-cell-group {
+ height: calc(100vh * 0.8 - 200px);
+ overflow-y: auto;
+}
+
\ No newline at end of file